PDA

View Full Version : specifying samplers in shader



peterfilm
10-30-2012, 10:10 AM
could someone remind me again why we can't set the integer value of a sampler directly in the shader, in the same way we can specify the generic vertex attribute slot of an input, and the uniform buffer binding index?

Alfonse Reinheart
10-30-2012, 10:53 AM
Because you didn't read far enough in the ARB_shading_language_420pack (http://www.opengl.org/registry/specs/ARB/shading_language_420pack.txt) extension? You know, the part where it says that this is legal:



layout(binding = 0) uniform sampler2D myTextureUsesUnit0;


I don't know how you missed that, since it is literally right after the part where it says you can do this same thing with uniform blocks...

Either that, or you're running into a driver bug.