Jump to content


Ignoring redundant SetSamplerState Sampler


  • You cannot reply to this topic
4 replies to this topic

#1 Phlex

    Member

  • Members
  • PipPip
  • 53 posts

Posted 12 February 2009 - 03:25 AM

In my debug output information for my DirectX9 application, it giving me this kind of thing:


Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 15

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 17

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

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 6

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 1

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 2

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 6

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 5

Direct3D9: (WARN) :Ignoring redundant SetSamplerState. Sampler: 0, State: 7



I had a look and found that I could get rid of this by one of two methods.

1. Move the debug output slider to less rather than more

or

2. Make sure you don't redundantely set the sampler state in an effects class.


Option 1 seems like ignoring a problem and isn't the reason why I put debug information to more! So that leaves me with option 2, I don't see how I would change this, in my effect I create my sampler like this:


sampler2D DownSampler = sampler_state
{
Texture = <g_tDownSample>;
AddressU = Clamp;
AddressV = Clamp;
MinFilter = Point;
MagFilter = Linear;
MipFilter = Linear;
};



and create the sample in my technique like this:



Sampler[0] = (DownSampler);



I don't know how I'm reduntantly setting the samplers state, any help would be great, I don't like having warnings floating around in my debug info! Thanks heaps.

#2 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 12 February 2009 - 01:31 PM

Slide the Debug Output Level back just one notch and these warnings will dissapear.

Note that the rightmost setting will also tell you when your parking ticket expires and when the baby needs a change, stuff that is really not related to writing a correct Direct3D application. :huh: So don't worry too much about missing crucial things. In fact even at the leftmost slider position it will inform you every time a function returns an error code.

The only time the rightmost setting is useful is when designing your own state management system and you want to verify that it sorts render state changes and eliminates duplicates correctly.

#3 Phlex

    Member

  • Members
  • PipPip
  • 53 posts

Posted 13 February 2009 - 03:02 AM

I really would prefer to not just ignore the problem to be totally honest, what is actually causing this warning?

#4 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 13 February 2009 - 05:29 AM

Setting an effect's technique will cause all the corresponding states to be set. For samplers, this means the SetSamperState function will be called. But frequently a technique will have some states which are identical to the previous ones. The D3D debug runtime informs you of this, but it's really not an error. It might have been a minor performance issue with CPUs and drivers from years ago, but nowadays I'm pretty sure it's handled very efficiently.

I'm not aware of any other way to get rid of these warnings, so I assume that anyone who uses effect files is seeing these warnings when the debug output is set to the highest level. It's just very very verbose and I don't think sliding the setting back one notch has any downside worth paying attention to.

#5 Phlex

    Member

  • Members
  • PipPip
  • 53 posts

Posted 13 February 2009 - 05:32 AM

I see, thank you for the information, much appreciated!!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users