Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top