GLSL issue with my x700 and 6800GT

Very odd error which I don’t have off the top of my head due to my desktop has the 6800GT and my laptop has the x700. When I run my shaders on my x700 no problems, but on the 6800GT I get an error in Render Monkey and my engine fails to render also. Here is the code where it fails at…

//VS
varying float temp;
    if(gl_Vertex.y <= .02)
		temp = gl_Vertex.y;

I can’t for the life of me see what would be wrong especially after it works on ATI???

I get an error in Render Monkey and my engine fails to render also
You need to provide more details on the error messages or the look of the failure.
-Does it compile successfully?
-If not, what’s the info log text?
-If yes, does the assembly code look correct? (Search for “nvEmulate” on developer.nvidia.com)
-Did you try newer drivers? Which?

GLSL code snippets will not be enough for anyone to reproduce your problem exactly.

[quote]Originally posted by Relic:
[b]

OpenGL Preview Window: Compiling vertex shader API(OpenGL) /Effect Group 1/Effect1/Pass 0/Vertex Program/ ... success
OpenGL Preview Window: Compiling fragment shader API(OpenGL) /Effect Group 1/Effect1/Pass 0/Fragment Program/ ... success
OpenGL Preview Window: Linking program .. failure
Vertex info
-----------
Internal error: assembly compile error for vertex shader at offset 7296:
-- error message --
line 149, column 29:  error: invalid operand variable
-- internal assembly text --
!!ARBvp1.0
OPTION NV_vertex_program3;
# cgc version 1.5.0000, build date Nov 11 2005 14:12:07
# command line args: 
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp40
#program main
#semantic gl_ModelViewMatrix
#semantic gl_NormalMatrix
#semantic gl_ModelViewProjectionMatrixTranspose
#semantic gl_LightSource
#semantic tileAmount
#var float3 gl_Normal : $vin.NORMAL : NORMAL : -1 : 1
#var float4 gl_Vertex : $vin.POSITION : POSITION : -1 : 1
#var float4 gl_MultiTexCoord0 : $vin.TEXCOORD0 : TEXCOORD0 : -1 : 1
#var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1
#var float4x4 gl_ModelViewMatrix :  : c[0], 4 : -1 : 1
#var float3x3 gl_NormalMatrix :  : c[4], 3 : -1 : 1
#var float4x4 gl_ModelViewProjectionMatrixTranspose :  : c[7], 4 : -1 : 1
#var float4 gl_LightSource[0].ambient :  :  : -1 : 0
#var float4 gl_LightSource[0].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[0].specular :  :  : -1 : 0
#var float4 gl_LightSource[0].position :  : c[12] : -1 : 1
#var float4 gl_LightSource[0].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[0].spotDirection :  :  : -1 : 0
#var float gl_LightSource[0].spotExponent :  :  : -1 : 0
#var float gl_LightSource[0].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[0].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[0].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[0].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[0].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[1].ambient :  :  : -1 : 0
#var float4 gl_LightSource[1].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[1].specular :  :  : -1 : 0
#var float4 gl_LightSource[1].position :  :  : -1 : 0
#var float4 gl_LightSource[1].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[1].spotDirection :  :  : -1 : 0
#var float gl_LightSource[1].spotExponent :  :  : -1 : 0
#var float gl_LightSource[1].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[1].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[1].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[1].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[1].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[2].ambient :  :  : -1 : 0
#var float4 gl_LightSource[2].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[2].specular :  :  : -1 : 0
#var float4 gl_LightSource[2].position :  :  : -1 : 0
#var float4 gl_LightSource[2].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[2].spotDirection :  :  : -1 : 0
#var float gl_LightSource[2].spotExponent :  :  : -1 : 0
#var float gl_LightSource[2].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[2].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[2].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[2].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[2].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[3].ambient :  :  : -1 : 0
#var float4 gl_LightSource[3].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[3].specular :  :  : -1 : 0
#var float4 gl_LightSource[3].position :  :  : -1 : 0
#var float4 gl_LightSource[3].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[3].spotDirection :  :  : -1 : 0
#var float gl_LightSource[3].spotExponent :  :  : -1 : 0
#var float gl_LightSource[3].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[3].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[3].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[3].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[3].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[4].ambient :  :  : -1 : 0
#var float4 gl_LightSource[4].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[4].specular :  :  : -1 : 0
#var float4 gl_LightSource[4].position :  :  : -1 : 0
#var float4 gl_LightSource[4].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[4].spotDirection :  :  : -1 : 0
#var float gl_LightSource[4].spotExponent :  :  : -1 : 0
#var float gl_LightSource[4].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[4].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[4].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[4].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[4].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[5].ambient :  :  : -1 : 0
#var float4 gl_LightSource[5].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[5].specular :  :  : -1 : 0
#var float4 gl_LightSource[5].position :  :  : -1 : 0
#var float4 gl_LightSource[5].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[5].spotDirection :  :  : -1 : 0
#var float gl_LightSource[5].spotExponent :  :  : -1 : 0
#var float gl_LightSource[5].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[5].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[5].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[5].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[5].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[6].ambient :  :  : -1 : 0
#var float4 gl_LightSource[6].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[6].specular :  :  : -1 : 0
#var float4 gl_LightSource[6].position :  :  : -1 : 0
#var float4 gl_LightSource[6].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[6].spotDirection :  :  : -1 : 0
#var float gl_LightSource[6].spotExponent :  :  : -1 : 0
#var float gl_LightSource[6].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[6].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[6].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[6].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[6].quadraticAttenuation :  :  : -1 : 0
#var float4 gl_LightSource[7].ambient :  :  : -1 : 0
#var float4 gl_LightSource[7].diffuse :  :  : -1 : 0
#var float4 gl_LightSource[7].specular :  :  : -1 : 0
#var float4 gl_LightSource[7].position :  :  : -1 : 0
#var float4 gl_LightSource[7].halfVector :  :  : -1 : 0
#var float3 gl_LightSource[7].spotDirection :  :  : -1 : 0
#var float gl_LightSource[7].spotExponent :  :  : -1 : 0
#var float gl_LightSource[7].spotCutoff :  :  : -1 : 0
#var float gl_LightSource[7].spotCosCutoff :  :  : -1 : 0
#var float gl_LightSource[7].constantAttenuation :  :  : -1 : 0
#var float gl_LightSource[7].linearAttenuation :  :  : -1 : 0
#var float gl_LightSource[7].quadraticAttenuation :  :  : -1 : 0
#var float tileAmount :  : c[13] : -1 : 1
#var float3 lightVec : $vout.TEX2 : TEX2 : -1 : 1
#var float waterColorHeight : $vout.TEX3 : TEX3 : -1 : 1
#var float2 blendmap_texCoord : $vout.TEX0 : TEX0 : -1 : 1
#var float3 normal : $vout.TEX1 : TEX1 : -1 : 1
#var float3 viewVec : $vout.TEX4 : TEX4 : -1 : 1
#var float3 tangent :  :  : -1 : 0
#var float2 texture_coord : $vout.TEX5 : TEX5 : -1 : 1
#const c[11] = 0.04
PARAM c[14] = { program.local[0..10],
      { 0.039999999 },
      program.local[12..13] };
TEMP R0;
TEMP R1;
TEMP R2;
TEMP CC;
BB1:
MUL   R0, vertex.position.y, c[1];
MAD   R0, vertex.position.x, c[0], R0;
MAD   R0, vertex.position.z, c[2], R0;
MAD   R0, vertex.position.w, c[3], R0;
ADD   R1, -R0, c[12];
DP4   R1.w, R1, R1;
RSQ   R1.w, R1.w;
MUL   result.texcoord[2].xyz, R1.w, R1;
DP4   R1.w, -R0, -R0;
MUL   R2.xyz, vertex.normal.y, c[5];
MAD   R2.xyz, vertex.normal.x, c[4], R2;
MAD   R1.xyz, vertex.normal.z, c[6], R2;
DP3   R0.w, R1, R1;
RSQ   R1.w, R1.w;
RSQ   R0.w, R0.w;
MOV   result.texcoord[3].x, result.texcoord[3];
SLEC  CC.x, vertex.position.y, c[11];
MOV   result.texcoord[3].x(GT), vertex.position.y;
MUL   result.texcoord[4].xyz, R1.w, -R0;
MUL   result.texcoord[1].xyz, R0.w, R1;
MOV   result.texcoord[0].xy, vertex.texcoord[0];
MUL   result.texcoord[5].xy, vertex.texcoord[0], c[13].x;
DP4   result.position.w, vertex.position, c[10];
DP4   result.position.z, vertex.position, c[9];
DP4   result.position.y, vertex.position, c[8];
DP4   result.position.x, vertex.position, c[7];
END
# 26 instructions, 3 R-regs

bump…

Not sure if this is right but looks like to me that the output from RM shows that it store the const for the if as a const variable and the local parameters is .0399999 which looks like a rounding error???

Error found it is due to I wasn’t writing to a variable in all paths. ATI cards overlook this or do something different cause my x700 runs fine without writing to it. I assumed the variable would be set to Zero. Hope this helps someone…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.