문제

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