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

SPIR-V/Vulkan specialization constants are not generated in SPIRV when -allow-glsl is set #5463

Closed
andreasschultes opened this issue Oct 30, 2024 · 2 comments · Fixed by #5568
Assignees
Labels
goal:client support Feature or fix needed for a current slang user. kind:bug something doesn't work like it should

Comments

@andreasschultes
Copy link

SPIR-V/Vulkan specialization constants are not generated in SPIRV when -allow-glsl is set.

${SLANGC} ${SHADER_FILE} -target spirv -I${SOURCE_ROOT} ${SHADER_INCLUDE_DIRS} -DdebugPrintfEXT -depfile ${SPIRV}.d -o ${SPIRV}

generates the SpecId "OpDecorate %a SpecId 5"

${SLANGC} ${SHADER_FILE} -target spirv -allow-glsl -I${SOURCE_ROOT} ${SHADER_INCLUDE_DIRS} -DdebugPrintfEXT -depfile ${SPIRV}.d -o ${SPIRV}

uses the default values and the constants are optimised out

@csyonghe
Copy link
Collaborator

Can you share with us the shader code that canbe used to reproduce this issue?

@andreasschultes
Copy link
Author

The test case for specialization constants reproduce this with the parameter -target spirv -allow-glsl -o test.spv
https://github.com/shader-slang/slang/blob/master/tests/spirv/specialization-constant.slang

@bmillsNV bmillsNV added this to the Q4 2024 (Fall) milestone Oct 31, 2024
@bmillsNV bmillsNV added kind:bug something doesn't work like it should goal:client support Feature or fix needed for a current slang user. labels Oct 31, 2024
@csyonghe csyonghe self-assigned this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Feature or fix needed for a current slang user. kind:bug something doesn't work like it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants