Skip to main content
GameDev.net gamedev.net
🔒 Locked

CG, problem binding parameter to register

Started by codehunter13 Oct 18, 2005 at 4:08 PM 0 replies 550+ views
Original Post
codehunter13
codehunter13
hi, i'm new to cg and when i use the function cgGetParameterResourceIndex it always returns 0. here's some code

CGparameter worldViewProjMatrix = cgGetNamedParameter(*getVertexShaderProg(), "WorldViewProjMatrix");
CGparameter texMat1 = cgGetNamedParameter(*getVertexShaderProg(), "TexMatrix1");
DWORD wvpMatrixReg = cgGetParameterResourceIndex(worldViewProjMatrix);
DWORD texMatrix1 = cgGetParameterResourceIndex(texMat1);


i've set the callback error handler functions and this doesn't give an error. Can someone help me? thx in advance [Edited by - codehunter13 on October 18, 2005 5:06:10 PM]
Jimfing
Jimfing
Is the parameter actually been used in the shader (towards calculating the output). The compiler is very good at removing code that doesn't get used in the end. So if a parameter isn't used, it won't appear in the compiled object code.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.