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

Debug option -g produce incorrect SpirV code #6119

Open
mklefrancois opened this issue Jan 17, 2025 · 2 comments
Open

Debug option -g produce incorrect SpirV code #6119

mklefrancois opened this issue Jan 17, 2025 · 2 comments

Comments

@mklefrancois
Copy link

When using the debug -g option, the SpirV code won't pass validation.

The error will look like:

VUID-VkShaderModuleCreateInfo-pCode-08737(ERROR / SPEC): msgNum: -1520283006 - Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08737 ] | MessageID = 0xa5625282 | vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
NonSemantic.Shader.DebugInfo.100 DebugFunctionDefinition: must be in the entry basic block of the function
  %41 = OpExtInst %void %2 DebugFunctionDefinition %37 %main
@csyonghe
Copy link
Collaborator

We will need a shader code to reproduce this issue since this isn't happening for every shader code.

@mklefrancois
Copy link
Author

Here is the shader that is causing an issue:
shader_slang.zip

The compilation arguments are

C:/VulkanSDK/1.4.304.0/Bin/slangc.exe
        -profile sm_6_6+spirv_1_6
        -capability spvInt64Atomics+spvShaderInvocationReorderNV+spvShaderClockKHR+spvRayTracingMotionBlurNV
        -target spirv
        -emit-spirv-directly
        -force-glsl-scalar-layout
        -fvk-use-entrypoint-name
        -g3  # Enable debug information
        -source-embed-style text   
        -source-embed-name shader_comp_slang
        shader.comp.slang

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

2 participants