Compute Shader Bind Two Textures

Hello, and I have been working on some compute shader tools and am running into an issue with binding more than one input texture and sampler. The issue arises when I try to setTexture on the instanced shader, and the message states that there are mismatched expected to included bindings.

I have managed to recreate a similar failure in the following PG, although it is likely I am misunderstanding or missing an example (resource)

Thanks for any help,
r

cc @Evgeni_Popov (please be patient as he is on vacations :))

1 Like

Parameters that you declare in the shader (like deux and samplerDeux) but don’t use in the code are automatically removed at compilation time. So, you should not declare them:

You can also use the Phony assignment if you want to keep the declaration:

2 Likes

Thanks, and understood. I had a list of textures which were being conditionally sampled and, without being able to use pre-processor macros, I was wrapping them in ifs. The compiler was pruning them and it was causing the mismatch.

Enjoy your vacation, and thanks again.

r