VP works in Nvidia but not in ATI?

Started by
6 comments, last by Madster 19 years, 10 months ago
This code was developed and tested on an Nvidia card (GeForce.. works without a hitch in there) and when tested in an ATI 9600XT it gives a parser error: Error on line 11: malformed declaration (hint: ''program'') here''s the Vertex Program source:

!!ARBvp1.0

ATTRIB iPos = vertex.position;
ATTRIB iTex = vertex.texcoord[0];
ATTRIB iColor = vertex.color;

OUTPUT oPos = result.position;
OUTPUT oTex = result.texcoord[0];
OUTPUT oColor = result.color;

PARAM mvp[4] = { state.matrix.mvp };
PARAM lightpos[1] = { program.local[0] };
PARAM lightintensity[1] = { program.local[1] };
PARAM lightcolor[1] = { program.local[2] };

TEMP tColor;
TEMP rRSQ;
TEMP xmx,fm,suma;

DP4 oPos.x, mvp[0], iPos;
DP4 oPos.y, mvp[1], iPos;
DP4 oPos.z, mvp[2], iPos;
DP4 oPos.w, mvp[3], iPos;

SUB xmx, iPos, lightpos[0];
MUL fm, xmx, xmx;
ADD suma.x, suma.x, fm.x;
ADD suma.x, suma.x, fm.y;
ADD suma.x, suma.x, fm.z;
RSQ rRSQ, suma.x;
MUL rRSQ, rRSQ, lightintensity[0];
SUB tColor, rRSQ, lightcolor[0];
#SUB tColor, -lightcolor[0], -rRSQ;

MIN tColor, tColor, lightcolor[0];

MOV oColor.xyz, tColor;
MOV oColor.w,iColor.w;
MOV oTex, iTex;

END
line 11 is:

PARAM lightpos[1] = { program.local[0] };
i tried playing with spaces, to no avail any ideas? and any suggestion for developing shaders across brands? this is kind of annoying -Madster
Working on a fully self-funded project
Advertisement
ever tried it without the braces? as far as i understand them they are only meant for stuff thats more than a single vector, which would make them pointless and/or plain wrong for everything but the mvp matrix.
f@dzhttp://festini.device-zero.de
Trienco is right. I tried the shader on my Radeon 8500 LE and it worked without the braces. With the braces I got the same error like you.
That did it... thanks!
Working on a fully self-funded project
Eeep... posted too fast. Works on an ATI, but then tried it in a GeForce and i get

Position:262, Error:line 12, column 22: error: expected ''{''

the removed braces look like this:

PARAM mvp[4] = { state.matrix.mvp };PARAM lightpos[1] = program.local[0];PARAM lightintensity[1] = program.local[1];PARAM lightcolor[1] = program.local[2];


thanks for the help!
Working on a fully self-funded project
I have got a paper from the nvidia developer site and there is the program.local parameter without the braces, so I think it is a driver-bug, because I don''t believe they want to show you, how to program an ATI-card
=D neat

guess i''ll just wait and see if they fix it
thanks!
Working on a fully self-funded project
quote:Original post by Madster
=D neat

guess i''ll just wait and see if they fix it
thanks!

There will be a new ARB VP parser in a future ATI OpenGL driver with numerous fixes. I''m not certain of when it will be released to the public however.

This topic is closed to new replies.

Advertisement