Finding constant buffer data requirements

Started by
2 comments, last by Jason Z 10 years, 2 months ago

Hi,

I'm trying to write a system where the engine can find what data requirements any given constant buffer has and then supply that data in the correct order to the shader. Is there a way to find this information using Direct3D 11 that would be practical for game engine use? Thanks.

Advertisement

You'll want to obtain the ID3D11ShaderReflection interface for a shader, which you can do by calling D3D11Reflect. One you have that interface, you can then use it to obtain an ID3D11ShaderReflectionConstantBuffer interface for a given constant buffer. That interface has members that will give you information about the layout of that constant buffer.

Okay thanks a lot that was the answer I was looking for.

I also have sample code that you can check for how to interrogate all of the various structs and descriptions in the Hieroglyph 3 framework.

This topic is closed to new replies.

Advertisement