Trying to get shader reflection working, so I can load a shader then assign variables easily using the name (like with the old ID3DXConstantTable)
However, reflection only seems to work for new shader models, which is useless to me at the moment because my graphics card only supports shader model 3. Why wont it work for shader model 4?
The following shader will compile correctly for both vs_3_0 and vs_4_0, without any changes to the shader code. However, reflection fails for vs_3_0, but succeeds for vs_4_0
I don't personally have any experience with this personally, but some of the other DX MVPs have suggested that you need to use the downlevel shader targets since vs_3_0 is not directly supported. So for instance you need to use this: vs_4_0_level_9_3 for an equivalent to shader model 3 (although you have to note that this is not directly the same as vs_3_0!!).
Oh, I'd never even heard of vs_4_0_level_9_3 before, and I read the documentation and tutorial sections quite carefully...
Thanks for the heads up, I'll try that immediately!
It kind of worked (D3D_FEATURE_LEVEL_9_3 + hardware device), but I can't use SV_INSTANCEID
Other than that, constant buffers and reflection worked flawlessly! Also, ps_4_0_level_9_3 compiles ok but the shader doesn't want to be created (it was fine with a D3D_FEATURE_LEVEL_10_1 + WARP device)... I assume that's down to my graphics card and not the shader. (ps_4_0_level_9_2 worked though).
Thanks Jason!