Sign in to follow this  
giugio

shader reflection varsize

Recommended Posts

hy.
i use this block of code for the shader reflection:

D3D11_SHADER_DESC desc;
pReflector->GetDesc( &desc );
for ( UINT i = 0; i < desc.InputParameters; i )
{
D3D11_SIGNATURE_PARAMETER_DESC in;
pReflector->GetInputParameterDesc( i, &in );
CInputShaderDesc varInputDesc(in);

}



the problem is that i can't find any size of the input var:
float2?
float3?
float4?
where i can find this information?
thanks

Share this post


Link to post
Share on other sites
Hi,

D3D11_SIGNATURE_PARAMETER_DESC contains a member called "Mask". Documentation says that each register can store up to 4 (components) x 32bits. You just check the bits of Mask. For example, 1 = 0x1: 1 component used, 11 = 0x3: 2 components used and so on. "ComponentType" gives you the data type, is it float, is it uint or something else. And when you multiply the number of components used by 4, you can get the size in bytes.

Let me know if there's a more sophisticated style.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this