ScottManDeath
01-05-2006, 07: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 :(
cgSetParameterSemantic(connect_parameter,"the_semantic");
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 ;)
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 :(
cgSetParameterSemantic(connect_parameter,"the_semantic");
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 ;)