Jump to content
  • Advertisement
Sign in to follow this  
giugio

shader reflection varsize

This topic is 2783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!