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 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.
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.
Can you show me the code piece about how did you set the "tex"?
the warning indicate that you haven't set the value before drawing the primitive
The code which set "tex" value is technically correct because it works on NVidia cards and it works also on ATI cards if I get the sampler2D in the fragment shader. So, I don't think the problem is here.
can you send me a vc project which can duplicate the issue on AMD card?