[CG] setting semantic of connected parameters doesn't work

I’m using CG 1.4 with OpenGL and found some strange behaviour. I have both a vertex shader and a fragment shader loaded to the same context. I connect both uniforms to one “source” parameter and would like to set the semantic of the the source parameter to that of the original parameters.
I do it like the following:

cgPCGparameter vs_parameter = cgGetNamedParameter(vs,"my_uniform");
cgParameter fs_parameter = cgGetNamedParameter(fs,"my_uniform");

CGparameter connect_parameter = cgCreateParameter(context,cgGetParameterType(vs_parameter));

cgConnectParameter(connect_parameter,vs_parameter);
cgConnectParameter(connect_parameter,fs_parameter);


// getting the semantic from the raw shader parameters works, but not the following :(
cgSetParameterSemantic(connect_parameter,"the_semantic");

printf("<%s>
",cgGetParameterSemantic(connect_parameter)); // will print "<>" instead of "<the_semantic>"

Is that a bug or a feature? :confused:

:mad: That forum software stinks, was complaining about a 30 char word in my subject and suggested using my back button to fix it; I had to retype all, this time in notepad :wink:

LOL. But this isn’t a forum about cG but for GLSL. And I can’t help you: try to find a forum about cG.

Yeah, but my gfx card uses CG to implement GLSL :wink: and NVIDIA guys are hanging around here.

At first I checked the shadertech.com forums, but there are down for a while, so I posted here.

And to give it some relation to GLSL, are there plans to add support for semantic and annotations to GLSL. It would ease handling shaders a lot, like giving semantic like TANGENT or BINORMAL to vertex shader varyings and then automagically connect them to the proper vertex buffers…

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