Jump to content
  • Advertisement
Sign in to follow this  
RenderCache

how do i debug d3d9 sampling warnings?

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

hihi! juz wondering how could i find out what these warnings come from? i tried looking at the docs for the stateID, but they dun correspond well...
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 14
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 25
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 15
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 16
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 17
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 18
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 19
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 20
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 21
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 29
Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 30

thx! RC

Share this post


Link to post
Share on other sites
Advertisement
The warnings come from the application setting a render state to what it already is, e.g.



lpD3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);

// some code, do rendering etc. (but no change of sampler state)

// warning would be triggered here!
lpD3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);




It's basically telling you that it's had to filter out an unnecessary state change. They only really impact performance, your app will not crash etc. from them.

-Mezz

Share this post


Link to post
Share on other sites
As Mezz said, they aren't going to cause you many problems (reducing the debug output level often helps reduce the number that appear).

Quote:
i tried looking at the docs for the stateID
You won't find the values in here. As much because they're not too relevant, but MS will want to reserve the ability to change the values (but not the symbol names) without having to update all of the docs.

To solve the problem, here's what I do... (I assume VStudio2002 here, but it might work for other IDE's)

Find the lines in your project with SetSamplerState() calls. For the constants you use here, right click and "find declaration" (might be "Find definition"). It should pop up one of the D3D header files where they're usually just a long list of #define's.

Look at this listing and it should have the numerical values for you.

I then copy-n-paste the debug spew to a text file, and do a find-replace on "State: 13" to "State: D3DSAMP_???". You can then at least read your debug trace using the same symbols your code uses.

But again, to go full circle, as Mezz said - they're not that important and only worth all this effort tracing them down if you want some seriously hard-core fine tuning and optimization...

hth
Jack

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!