Jump to content
  • Advertisement
Sign in to follow this  
bluntman

CgFx and unsized arrays.

This topic is 3511 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!