2
votes

I am trying to port a geometry shader back into an OpenGL 2.1 (GLSL 1.2) vertex shader. After having replaced all code the compiler complained about, it gave me another error:

Too many vertex shader texture samplers

So I queried GL for the allowed maximum and this what I got:

GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: 0

This probably means that there are no textures allowed in the vertex shader.

Is this only a limitation of my hardware/driver or is it required by OpenGL2.1/GLSL1.2?

1

1 Answers

5
votes

Having successfully used vertex texturing on OpenGL 2.1 hardware, I can confirm that this is a mere hardware/driver limitation. Those constants wouldn't make much sense if OpenGL 2.1/GLSL 1.20 would completely disallow the possiblity of vertex textures in the first place.

EDIT: As a more objective proof of the above, the OpenGL Shading Language 1.10 Specification (corresponding to OpenGL 2.0) says in section 8.7 Texture Lookup Functions:

Texture lookup functions are available to both vertex and fragment shaders.

And the OpenGL 2.0 Specification itself says in section 2.15.4 Vertex Shaders - Shader Execution:

Vertex shaders have the ability to do a lookup into a texture map, if supported by the GL implementation. The maximum number of texture image units available to a vertex shader is MAX_VERTEX_TEXTURE_IMAGE_UNITS; a maximum number of zero indicates that the GL implemenation does not support texture accesses in vertex shaders.