Sign in to follow this  

CgFx and unsized arrays.

This topic is 3298 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

The (small) section about CgFx in the Cg users manual says that unsized arrays can be used and set the same way as for Cg programs. But how can this be?! Its impossible to get a CGparameter handle to an effect parameter before calling cgCreateEffectFromFile to actually create the CGeffect handle. And even when I set compile mode to manual, cgCreateEffectFromFile still tries to compile the effect. And fails on any unsized arrays!!! cgSetAutoCompile( _contextHandle, CG_COMPILE_MANUAL ); _handle = cgCreateEffectFromFile(_contextHandle, fileName.c_str(), NULL); _handle is returned as null and when I check for errors I get a CG_COMPILE_ERROR about all unsized effect parameters. Any ideas? I have posted about this on the nVidia Cg forums, but it is the second time I have asked about this problem, and the first time I was just ignored. I am starting to think that maybe it just doesn't work, never has, and they don't care, or want to admit it. Please help, months of investment in using CgFx are about to be wasted :(

Share this post


Link to post
Share on other sites
There's a sample located at

Program Files\NVIDIA Corporation\Cg\examples\OpenGL\advanced\cgfx_interfaces

which might help you out (if you're not already of aware of it that is).

Share this post


Link to post
Share on other sites
Thanks for the pointer. I finally worked out what the difference between their CgFx file and mine is: they are not trying to pass the unsized array as a parameter to a function in a compile statement. Apparently you can't do that, yay for documentation.
Thanks for the help!

Share this post


Link to post
Share on other sites

This topic is 3298 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this