Sign in to follow this  
laeuchli

OpenGL Cg and DirectX debug info

Recommended Posts

Dear All, I've just started working on someone elses code, which is basicly a wrapper for DirectX and OpenGL. I've been trying to get familar with the code base, and have been running the DirectX section of the code though the debugger. I notice lots of redundant SetSampler warnings in the debug information. However when I look at the code, I dont see anyplace that could be calling it that often(in fact I've placed break points on the SetSampler calls, and they are only getting called once at startup, whereas I'm getting lots of SetSampelr warnings). I've noticed several of the Cg DirectX demos also have this problem. Is this an issue with Cg(and if so should I be concerned about this), or is it more likely that theres some problem I havent detected in the code? If the latter is the case, does anyone have a suggestion on how to go about debugging this? Regards Jesse

Share this post


Link to post
Share on other sites
If memory serves me right, that warning only shows when you have the DX warning level set to highest.

Also, in my experience, ID3DXEFFECT tends to generate similar warnings when used, so it's probably safe to say they're coming from the CG handling.

I wouldn't worry about it too much. I mean, it is setting redundant states, but that's not a big deal. Not a big deal at all. I just keep my warning level at a notch under the highest.

Hope this helps.

Share this post


Link to post
Share on other sites
I found the problem by stepping though every line for several frames. It had to do with how the guy who'd written it had set it up to handle multiple windows, so he was releasing and resetting the fragement shader each time frame. So in the end it was possible to get rid of most of them. I'm aware its not a super serious error, but my understanding is its better to get rid of them. Then again maybe not. Can anyone pronounce for certain?

Share this post


Link to post
Share on other sites

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