Skip to main content
gamedev.net
🔒 Locked

Debugging

Started by PdG 2 replies 750+ views
Original Post
PdG
PdG
Hi I'm debugging an application written in c++ and using directx 9.0c Setting the debug version of directx, i obtain a LOT of message like these Direct3D9: (WARN) :Ignoring redundant SetRenderState - 20 Direct3D9: (WARN) :Ignoring redundant SetTextureStageState. Stage: 0, State: 24 Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 5 The question is: are they index of something wrong or are only informational message and i can ignore it? Thanks.
sirlemonhead
sirlemonhead
It just means you're trying to set a render state thats already set.

ie if you turn on Alpha blending, then try turn it on again while its already on, you'll get a warning.

I think there's a minorish performance penalty from doing this, so you should keep track of what render states you're currently using in a variable of some sort, (ie a boolean to track whether alpha blending is enabled already or not)



if (alpha_blend != TRUE) {
LastError = d3d.lpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
alpha_blend = TRUE;
}

that sorta thing :)
jollyjeffers
jollyjeffers
As has been said, its better if you can stop these but really they aren't likely to cause you serious problems.

Move the debug-level slider down a couple of notches - somewhere in the middle is usually ok. That way it won't even bother writing out these messages and you'll only see the genuinely important ones [smile]

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
sirlemonhead
sirlemonhead
Actually, if you don't mind me hijacking the thread for a related query..

As I was saying, you can keep track of the true/false states easily with booleans.

But what would you guys recommend for saving D3DBLEND types? would you use the D3DBLEND enum itself?

like:
D3DBLEND blend_save = D3DBLEND_SRCALPHA;

if(blend_save != D3DBLEND_INVSRCCOLOR) {
// change state here
}

?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.