-
Notifications
You must be signed in to change notification settings - Fork 558
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
HLSL/MSL: Passing samplers and textures to functions results in global sampler and unused parameters #2358
Comments
I cannot reproduce this. GLSL:
SPIR-V:
HLSL with --shader-model 50
MSL:
|
Apologies for the late response. Here is my full shader and the intermediate SPIR-V that glslang generated. Does this reproduce for you? I updated to the latest glslang ToT and it's still happening. On my older glslang version the issue does not occur (same spirv-cross version). full_shader.frag.txt I am using the glslang and spirv-cross C++ APIs to perform the conversions. I used spvBinaryToText to get the textual SPIR-V representation. |
The following GLSL function:
Becomes this when compiled to SPIRV via glslang 14.3.0 and converted to HLSL:
The parameters
shadowSampler_1
andt_depthshadow
are unused in the HLSL function body and instead the globalst_depthshadowshadowSampler
and_t_depthshadowshadowSampler_sampler
are created. They are not initialized anywhere in the generated HLSL.The desired behavior is for the generated function to use the sampler and texture arguments passed in.
The text was updated successfully, but these errors were encountered: