I'm in the process of abstracting away the D3D9 usage in an application in order to be able to slowly migrate to a newer API in the future.
The first step in this is to create a DX9 rendering back-end that supports the current functionality but without using the legacy D3DX interfaces.
My problem right now comes to the introspection of the shader code in order to map data into constant buffers, i.e. shader variables and texture input.
I'm trying to use the D3DCompile(), CreateVertexShader(), SetVertexShaderConstant() interfaces instead of the D3DX and effect framework and thus need to be able to map variable names to register numbers that can be passed to the SetVertexShaderConstant() function.
If you don't specify any registers manually in your shader, the compiler automatically assigns them, but how do you get that information out from the compiled shader?
Is there a way to do this mapping table automatically instead of manually specifying register usage in the shader and then creating a mapping table outside of the shader?