Skip to content

Proper usage of combined ImageSamplers with Vulkan #5654

Closed Answered by jkwak-work
wpsimon09 asked this question in Q&A
Discussion options

You must be logged in to vote

The provided shader code looks fine to me. I think the validation error is coming from the other part of the shader where the sampler is used in an unexpected stage. The struct might be meant for vertex shader only but it might be used in a fragment shader incorrectly.

If you think it is a bug on Slang, we can work on it, but we need a repro case that reproduces the validation error mentioned.

The texture-combined samplers such as sampler2D in GLSL are legalized by Slang in a way described above. If you use sampler2D, Slang will create a Texture2D and SamplerState automatically. Please give a try and let us know if it doesn't work.

*EDIT: I forgot to mention that you have to use -allow-glsl

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by wpsimon09
Comment options

You must be logged in to vote
2 replies
@jkwak-work
Comment options

@wpsimon09
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants