Is there a way to get the values of the sampler_state object on a sampler as specified in the shader by using the d3d11 shader reflection system?
Ie if I have:
sampler samp = sampler_state
{
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
};
I can loop over the BoundResources of the fragment shader and get a D3D11_SHADER_INPUT_BIND_DESC that has a type of D3D_SIT_SAMPLER with the name "samp", but I don't see any method of extracting the filter/address settings?
sampler_state defaults via reflection?
Native HLSL shaders don't have inline sampler states, that's part of the effects framework. If you want that info you can just ask the effect for the actual ID3D11Sampler and then call GetDesc.
Ah okay, thanks. I'm not using the effects framework, so I will handle these parameters myself in the material system.
If this isn't supported I would have hoped this code would result in a shader compile error (using "ps_5_0" profile), but it doesn't. (using D3DX11CompileFromFile)
If this isn't supported I would have hoped this code would result in a shader compile error (using "ps_5_0" profile), but it doesn't. (using D3DX11CompileFromFile)
Yeah it's kinda weird...there are certain things (like sampler_state) that are built into the language so that the effects framework can use it but have no meaning to native shaders. I don't even know of a way to query that information.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement