Sign in to follow this  

shader reflection varsize

Recommended Posts

giugio    246
i use this block of code for the shader reflection:

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


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

Share this post

Link to post
Share on other sites
j3p    1363

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