Ignoring redundant SetSamplerState

Started by
4 comments, last by circlesoft 17 years, 8 months ago
Hi, When I turn on dx debug and output level max I found some messages in output window. "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 ..." I understand "ignoring redundant setsamplerstate". But what I don't know is next this sentence. "State:13, 14, 25, 15,16, 17, 18, 19, 20,..." "D3DSAMPLERSTATETYPE" is defined and "D3DSAMP_DMAPOFFSET = 13" is the end as I know. is there more enum value in samplerstate? thanks.
Advertisement
This is the exact thing that I have been wondering. In this utility I have been playing with, I tried to map those state numbers to the real enum, but those numbers...don't exist in the enumeration :P
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
They reason for this is the way RefRast is implemented. As a Software device is use a similar interface as a real driver. As D3D drivers on XP need to be compatible to older runtimes the sampler states are a problem because they are not serrated from the texture stage states in earlier versions. To ease the driver development the D3D9 runtime maps the new Sampler states to the old texture stage stages before they are passed to the driver. Unfortunately the RefRast don't convert them back. But there is a list in the DDK

#define     D3DTSS_ADDRESSU         ((D3DTEXTURESTAGESTATETYPE)13)#define     D3DTSS_ADDRESSV         ((D3DTEXTURESTAGESTATETYPE)14)#define     D3DTSS_BORDERCOLOR      ((D3DTEXTURESTAGESTATETYPE)15)#define     D3DTSS_MAGFILTER        ((D3DTEXTURESTAGESTATETYPE)16)#define     D3DTSS_MINFILTER        ((D3DTEXTURESTAGESTATETYPE)17)#define     D3DTSS_MIPFILTER        ((D3DTEXTURESTAGESTATETYPE)18)#define     D3DTSS_MIPMAPLODBIAS    ((D3DTEXTURESTAGESTATETYPE)19)#define     D3DTSS_MAXMIPLEVEL      ((D3DTEXTURESTAGESTATETYPE)20)#define     D3DTSS_MAXANISOTROPY    ((D3DTEXTURESTAGESTATETYPE)21)#define     D3DTSS_ADDRESSW         ((D3DTEXTURESTAGESTATETYPE)25)#define     D3DTSS_SRGBTEXTURE      ((D3DTEXTURESTAGESTATETYPE)29)#define     D3DTSS_ELEMENTINDEX     ((D3DTEXTURESTAGESTATETYPE)30)#define     D3DTSS_DMAPOFFSET       ((D3DTEXTURESTAGESTATETYPE)31)

Thanks..
But i'm still wondering why samplerstate warning appear.
I didn't use SetSamplerState() at all.
I just use Pixel shader and so simple as you see.

===========================================
sampler TextureSampler0 =
sampler_state
{
Texture = <tex0>;
};

float4 PS( float2 Tex: TEXCOORD0 ) : COLOR
{
return tex2D(TextureSampler0, Tex);
}
===========================================
if I don't use texture in ps() there is no redundant sampler warning.
I don't know why and I don't know how to fix it.


Is this shader part of an effect?
Quote:Original post by Demirug
They reason for this is the way RefRast is implemented. As a Software device is use a similar interface as a real driver. As D3D drivers on XP need to be compatible to older runtimes the sampler states are a problem because they are not serrated from the texture stage states in earlier versions. To ease the driver development the D3D9 runtime maps the new Sampler states to the old texture stage stages before they are passed to the driver. Unfortunately the RefRast don't convert them back. But there is a list in the DDK

Aha - that would explain it! Thanks [smile]
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement