Sign in to follow this  
RenderCache

how do i debug d3d9 sampling warnings?

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
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

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