Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3D11ShaderReflection and Constant Buffer slot

Started by judeclarke Jul 26, 2011 at 4:44 AM 2 replies 4.1k views
Original Post
judeclarke
judeclarke
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 ?
Jason Z
Jason Z

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 ?


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).
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 
judeclarke
judeclarke
Oh I see, that was certainly a bit different than what I was expecting. So the BindPoint variable is the register index, right?
Jason Z
Jason Z
Yes, that is correct.
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.