Skip to main content
gamedev.net
🔒 Locked

Warning error for DX

Started by MARS_999 2 replies 1k views
Original Post
MARS_999
MARS_999
I am using .fx files for HLSL and I get his error when I run my app and is sampler 0-4. Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13 Not sure where to look for I am not doing any sampler states in the app side only the .fx file.

sampler Tex1 = sampler_state
{
	Texture = <terrain>;
	MinFilter = POINT;
	MagFilter = LINEAR;
	MipFilter = LINEAR;
	AddressU  = WRAP;
        AddressV  = WRAP;
};

but I have 4 of these but one for each texture? Do I need to have one for each texture? Thanks
circlesoft
circlesoft
You get these warnings because ID3DXEffect parses your FX file, notices you want those particular sampler states set, and makes the call for you. It probably goes through the same interface that you do, so that's why you get that warning.

If at some point if you rendering using a different effect that has different sampler states, you shouldn't get this warning (because it actually has a different state then). In generally, you only should specify the state when you actually need it (ie when you want something other than the default).
MARS_999
MARS_999
Would these errors go away if I was to set the rendering state in the C++ code side with calls for each texture unit?
BaSSraf
BaSSraf
if you keep track of its current state and make sure you dont set it when it already has the same value, yes it will go away.
huraay!

Topic Locked

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

Sign in to reply to this topic.