cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

aerkis
Journeyman III

vertex texture fetch

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.
0 Likes
5 Replies
gsellers
Staff

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

0 Likes

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.

 

0 Likes

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

0 Likes

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.

0 Likes

can you send me a vc project which can duplicate the issue on AMD card?

0 Likes