microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.11k stars 697 forks source link

HLSL can't generate vulkan specialization constants. #7005

Closed runner0353 closed 1 week ago

runner0353 commented 1 week ago

test.txt spirv-dis-dump.txt

dxc.exe --version dxcompiler.dll: 1.8 - 1.8.0.4739 (d9a5e97d0)

test.txt is hlsl shader spirv--dis-dump.txt is spirv-dis.exe disassembler info.

when i use glsl compiled a spv , spirv-dis dump info is ok. but use hlsl compiled a spv , spirv--dis can't generated OpSpecConstant

s-perron commented 1 week ago

The two spec constants are unused, so they are not emitted. This is the expected behavior. If I added uses of LIGHTING_MODEL and PARAM_TOON_DESATURATION the spec constants are generated.

Reopen if I missed something.