Sign in to follow this  
judeclarke

D3D11ShaderReflection and Constant Buffer slot

Recommended Posts

I have been building a subsystem that sets my parameters via what is generated from ID3D11ShaderReflection , however, I seem to be over looking where the ConstantBuffer register slot can be found. The most obvious thing to me would be to have it in D3D11_SHADER_BUFFER_DESC , but I don't see it in there. How can I get the ConstantBuffer's register slot so I can then set it with the Set??ConstantBuffers ?

Share this post


Link to post
Share on other sites
[quote name='judeclarke' timestamp='1311655467' post='4840380']
I have been building a subsystem that sets my parameters via what is generated from ID3D11ShaderReflection , however, I seem to be over looking where the ConstantBuffer register slot can be found. The most obvious thing to me would be to have it in D3D11_SHADER_BUFFER_DESC , but I don't see it in there. How can I get the ConstantBuffer's register slot so I can then set it with the Set??ConstantBuffers ?
[/quote]

You are looking for the D3D11_SHADER_INPUT_BIND_DESC, which contains the information about where to bind the constant buffer resource. The reflection API can get a little confusing at times, but if you want to see a reference you can take a look at the RendererDX11::LoadShader() function in my engine (see link below for the project page).

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