I’m using the Slang compiler with RTX Neural Shaders (rtxns) to generate SPIR-V compute shaders. The SPIR-V runs correctly in Vulkan, but reflection via SPIRV-Reflect fails with: SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE
The error is returned inside SPIRV-Reflect from ParseTypes(), which is invoked internally by spvReflectCreateShaderModule:
if (result == SPV_REFLECT_RESULT_SUCCESS) {
result = ParseTypes(&parser, p_module);
SPV_REFLECT_ASSERT(result == SPV_REFLECT_RESULT_SUCCESS);
}
Here is the SPIR-V file (renamed as a .txt) for testing:
Training.txt
The source code for the shader can be found here: RTXNS ShaderTraining sample