D3D11 Variable Binding

Published May 05, 2009
Advertisement

D3D11 Variable Binding

I've managed to wrap up the resource creation code, the resource view creation code, and the shader loading/reflection code. To be perfectly honest, the majority of the time was spent deciphering the D3D11 documentation and header files - especially with respect to the shader reflection mechanisms. In my previous endeavors, I have mostly relied on the effect framework to take care of making sure my shaders were properly connected together as well as to query what parameters needed to be set.

With D3D11's introduction of the new shader stages, a myriad of new resource types, and the lack of the effect framework in this CTP, I have been forced to dive deep into the low level shader details. So, for each shader I now store the input and output parameter lists, as well as the list of constant buffers and overall shader resource lists. It has been interesting, but I've completed this portion of the renderer and am ready to move on.

The next step is to build the glue functionality that will take those shader parameter descriptions and link them up with the appropriate data. This has been implemented for some time in my D3D9 renderer, so I am hoping that I can use the same basic structures from before. Of course, there will be more types to add, but the basic idea should hold.

Essentially, the system allows for a parameter object to be registered with the renderer. The registration provides type information, a name, and an index for quick references. Those registered parameters are then provided to any shader that has a matching type/name combination when the effect is 'set' in the pipeline. Really, I haven't seen a much easier to use system and it works great for small to mid sized rendering projects. I'm excited to see how the system holds up with the custom 'RenderEffect' class that I'll be putting together. Hopefully tomorrow I can have the rest of the registration system put together...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement