Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute shaders compiling to spir-v version 1.6 generates Vulkan validation error due to OpExecutionMode #1414

Open
Wlammm opened this issue May 1, 2024 · 0 comments

Comments

@Wlammm
Copy link

Wlammm commented May 1, 2024

Compiling this shader (TestShader.comp):

#version 450

layout (local_size_x = 256) in;

void main() {
// Compute shader code
}

using this code:

shaderc::Compiler compiler;
shaderc::CompileOptions options;
options.SetTargetEnvironment(shaderc_target_env_vulkan, shaderc_env_version_vulkan_1_3);
options.SetWarningsAsErrors();
options.SetGenerateDebugInfo();
options.SetTargetSpirv(shaderc_spirv_version_1_6);
options.SetOptimizationLevel(shaderc_optimization_level_performance);
shaderc::SpvCompilationResult result = compiler.CompileGlslToSpv(shaderSource, shaderc_compute_shader, inputFileName, options);

generates this validation error when running vkCreateShaderModule:

{ Validation } Validation Error: [ VUID-RuntimeSpirv-LocalSizeId-06434 ] | MessageID = 0xf95e08b7 | vkCreateShaderModule(): SPIR-V OpExecutionMode LocalSizeId is used but maintenance4 feature was not enabled. The Vulkan spec states: If Execution Mode LocalSizeId is used, maintenance4 must be enabled

This does not happen if I change the target spir-v version to shaderc_spirv_version_1_5.
This does not happen if I compile it directly with glslc.exe -c TestShader.comp.

Tested on Vulkan version 1.3 with Vulkan SDK version 1.3.280.0 and whatever shaderc version is included there.

@Wlammm Wlammm changed the title Compute shaders compiling to version spir-v version 1.6 generates Vulkan validation error due to OpExecutionMode Compute shaders compiling to spir-v version 1.6 generates Vulkan validation error due to OpExecutionMode May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant