5 Replies Latest reply on Feb 10, 2011 3:25 AM by frali

    OpenGL 4.0: shader validation fails when using sampler2D and sampler2DArray in tess eval and frag shaders

    ricardog
      Error message: Different sampler types for same sample texture unit in tessellation evaluation shader.

      Hello,

       

      I have an OpenGL 4 program using tesselation shaders. In the tesselation evalution shader I use a 2D texture sampler:


      uniform sampler2D heightMap;
      ...
      height = texture(heightMap, texCoord).x;

       

      In the fragment shader I use a 2D texture array sampler:

       

      uniform sampler2DArray texLayers;
      ...
      gl_FragColor = texture(texLayers, texCoord); 

       

      The samplers are assigned to different texture units as below:

       

      glActiveTexture(GL_TEXTURE0);
      glBindTexture(GL_TEXTURE_2DtexHeightmap);
      glActiveTexture(GL_TEXTURE1);
      glBindTexture(GL_TEXTURE_2D_ARRAYtexLayers);
      glUniform1i(heightMapLoc, 0);
      glUniform1i(texLayersLoc, 1);

       

      However my program validation is failing with the message "Validation failed! - Different sampler types for same sample texture unit in tessellation evaluation shader.". It happens whenever I use the sampler2DArray in the fragment shader and the sampler2D in the tesselation evalution shader, or vice-versa. Using both samplers in one shader and none in the other works without problems.

       

      System: Radeon 5850 + Catalyst Hotfix 10.10c on Windows 7 x64.

       

      Any help is appreciated. Thanks.