KhronosGroup / SPIRV-Reflect

SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.
Apache License 2.0
675 stars 147 forks source link

Getting error 20 code (SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_EXECUTION_MODE) when trying to use functions from extension GL_ARB_fragment_shader_interlock #185

Closed TheDonsky closed 1 year ago

TheDonsky commented 1 year ago

Hello,

Added GL_ARB_fragment_shader_interlock extension to code with a regular beginInvocationInterlockARB() - endInvocationInterlockARB()usage.

Code is compiled all right, but spvReflectCreateShaderModule gives me error code 20.

If I remove references to beginInvocationInterlockARB, endInvocationInterlockARB and sample_interlock_ordered, error goes away, but obviously, that's not a solution.

Any idea what can be done about this?

TheDonsky commented 1 year ago

Adding a "special case" for 5336 inside spirv_reflect.c ParseExecutionModes line 3279 removed the error for me: image

I guess, the clean solution would be to add an enumeration value to SpvExecutionMode_ and add case at the end of that switch-case statement; I can make a pull request, but I am not familiar enough with the project internals to be sure that it will not break anything

TheDonsky commented 1 year ago

Small update: I found interlocking enumeration values already in spirv.h; All that's actually needed is inserting those in switch-case statement

TheDonsky commented 1 year ago

Added a pull request: https://github.com/KhronosGroup/SPIRV-Reflect/pull/186

spencer-lunarg commented 1 year ago

@TheDonsky did https://github.com/KhronosGroup/SPIRV-Reflect/pull/186 solve this? Can we close this issue then?

TheDonsky commented 1 year ago

Yes, it seems to be resolved on my side