KhronosGroup / OpenGL-API

OpenGL and OpenGL ES API Issue Tracker
34 stars 5 forks source link

OpenGL 4.6: SPIR-V and shader object type. #16

Closed NicolBolas closed 6 years ago

NicolBolas commented 7 years ago

When you create a shader object, it is passed the shader stage that it works with. But SPIR-V entry points serve the same function: each entry point specifies which shader stage it works with.

So, what happens if there is a mismatch when specializing a shader? That's not explicitly a failure mode of glSpecializeShader; it only says that the entry point must be "valid".

dgkoch commented 6 years ago

I propose replacing the current error:

 INVALID_VALUE is generated if <pEntryPoint> does not name a valid
 entry point for <shader>.

with the following:

 INVALID_VALUE is generated if <pEntryPoint> does not match the
 <Name> of any OpEntryPoint declaration in the SPIR-V module
 associated with <shader>.

 INVALID_OPERATION is generated if the <Execution Mode> of the
 OpEntryPoint indicated by <pEntryPoint> does not match the type
 of <shader>.
pdaniell-nv commented 6 years ago

OpenGL|ES meeting approved. @dgkoch to create ARB extension PR and @oddhack to incorporate that change into core spec.

dgkoch commented 6 years ago

PR for extension doc: https://github.com/KhronosGroup/OpenGL-Registry/pull/129

Also filed CTS issue to make sure test for new error is added: https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/852

dgkoch commented 6 years ago

Extension PR was merged. Assigning to @oddhack to incorporate the same change into the next GL 4.6 spec update.

oddhack commented 6 years ago

This will be fixed in the next GL 4.6 spec update, coming soon.