Reputation: 4078
I am using libshaderc to compile at runtime Shader codes. I do not have any issue when I compile them. If I compile them to Vulkan 1.0 (shaderc_env_version_vulkan_1_0
) I do not have any error with validation, however, when I am using Vulkan 1.1 (shaderc_env_version_vulkan_1_1
) as target environment, I get this validation error SPIR-V module not valid: Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0 (under Vulkan 1.0 semantics)
I am using the SDK 1.1.97
Upvotes: 1
Views: 1393
Reputation: 6787
The validation layers use the API version you're targeting to validate your SPIR-V modules against. So if you use set VkApplicatinInfo::apiVersion
to VK_API_VERSION_1_0
(or don't provide a VkApplicationInfo
, since the default is 1.0), then validation will check that what you're using is valid under 1.0, even if the device supports 1.1. Since Vulkan 1.0 didn't support SPIR-V 1.3 modules, you'll get that error.
Upvotes: 3