5 Replies Latest reply on Aug 4, 2011 11:54 PM by kenwang

    vertex texture fetch

    aerkis
      works on ATI cards?

      Hello,

      I have a strange crash with a simple GLSL code when I try to use it on an ATI card (It works perfectly on NVidia cards).
      There is my GLSL code:

      Vertex shader:

      uniform sampler2D tex;  
      varying vec4 texColor
      ;          
      void main()
      {  
              gl_Position
      = ftransform();
              gl_TexCoord
      [0] = gl_MultiTexCoord0;
              texColor
      = texture2DLod(tex, gl_TexCoord[0].st, 0.0);
       
      }

      Fragment shader:

      varying vec4 texColor;  
      void main()
      {  
          gl_FragColor
      = texColor;
      }



      With this code, crash seems to be occured in ATI drivers (atioglxx.dll) however I have the last drivers.
      Is vertex texture fetch worked correctly on ATI cards?
      Thanks you by advance.
        • vertex texture fetch
          gsellers

          Hi,

          Vertex texture fetch should work just fine. Where does the crash occur? Is it during shader compilation, when you try to use the shader or at some other time?

          The only thing I can suggest off the top of my head is that gl_TexCoord[0] is actually an output variable and is essentially 'write-only'. Try changing your texture lookup to

          texColor = texture2DLod(tex, gl_MultiTexCoord0.st, 0.0);

          That may resolve the issue. Regardless, we shouldn't crash, so we'll investigate.

          Graham

            • vertex texture fetch
              aerkis

              Thank you for your repply.

              I have try to implement your suggestion, however it doesn't change anything. The shaders are linked correctly but it seems to have a problem during the buid. I have run my application in an OpenGL debugger to find the problem, and I have the following message when I build my shaders:

              "Validation warning! - Sampler value tex has not been set."

              I have also run the application in gdb, and I have obtained the following stack:

              Program received signal SIGSEGV, Segmentation fault.
              0x0597f23c in atioglxx!DrvValidateVersion () from C:\Windows\SysWOW64\atioglxx.dll
              #0 0x0597f23c in atioglxx!DrvValidateVersion () from C:\Windows\SysWOW64\atioglxx.dll
              #1 0x0d65cbe0 in ?? ()

              #2 0x059b0987 in atioglxx!DrvValidateVersion () from C:\Windows\SysWOW64\atioglxx.dll
              #3 0x0d5d53f4 in ?? ()

              So it seems that the vertex shader can not access to the texture passed.
              Any idea why?

              Thanks by advance.