Hi,
I've a question concerning d3dcompiler, d3d10 and d3dx10 dlls in combination with the shader reflection interfaces.
It seems there are 4 different known interfaces: IID_ID3D10ShaderReflection -> d3d10.dll (D3D10ReflectShader()) IID_ID3D10ShaderReflection1 -> d3dx10_xx.dll (D3DX10ReflectShader()) IID_ID3D11ShaderReflection_42 -> d3dcompiler_(40-42).dll (D3DReflect()) IID_ID3D11ShaderReflection -> d3dcompiler_(43).dll (D3DReflect())
The IID_ID3D11ShaderReflection_42 is just a new name for a IID_ID3D11ShaderReflection interface for version 40-42. In d3dcompiler 43 the interface changed and now has a new IID.
What's the preferred way to implement the different interfaces?
1. Implement a parser which parses the shader (RDEF, STAT), and implement 4 independent interfaces (each in its own dll). Only reuse the parser. 2. Like 1, but all 4 implementations have there own parser, which leads to a lot of duplicated code. But it is the most flexible way. It could easily parse all possible shader blobs (theoretically they could differ from version to version, I have no test for that, yet). 3. Forward all interfaces to d3dcompiler_43.dll and this will contain all interfaces and the parser. This way the codebase is the smallest possible one, but it will offer all interfaces, which isn't what native does. Also all further interfaces would go to d3dcompiler_43.dll. This could get tricky.
Attached is a test program and the output. The programm is compiled with "i686-pc-mingw32-gcc -I./wine/build/include -I./wine/git/include compilertest.c".
The test for D3DReflectCode() doesn't work, so please ignore that part.
Cheers Rico