View Full Version : [CG] setting semantic of connected parameters doesn't work

01-05-2006, 08:51 PM
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_pa rameter));

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

// getting the semantic from the raw shader parameters works, but not the following :(

printf("<%s>\n",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 ;)

01-07-2006, 12:34 PM
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.

01-07-2006, 01:56 PM
Yeah, but my gfx card uses CG to implement GLSL ;) 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...