I am trying to get the filter type set in the sampler stat in the Shader code. I am not getting a way to retrieve that. Can someone suggest me a way to do that??

Texture2D InputTexture;
SamplerState Sampler;

float4 PSMain(float2 pos: TEXCOORD, float4 SVP : SV_POSITION) : SV_TARGET {  
   float4 image = InputTexture.Sample(Sampler, pos);
   //How to get Filter type - Sampler.Filter???
   return image;   
}

Doesn't work the above option for me. Can someone help me out?

Thanks.

有帮助吗?

解决方案

You can't do that, the way to go if you want altering behaviour in your shader is to use either shader constants and branch based on them, or different versions of your shader.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top