Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


VP works in Nvidia but not in ATI?

This topic is 5275 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

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 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;

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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!

Share this post

Link to post
Share on other sites
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

Share this post

Link to post
Share on other sites
Original post by Madster
=D neat

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

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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!