Luis C. Busquets Pérez wrote:
This functions gets the Version Token of a binary shader. This Token is the first of the binary stream so it is as easy as picling the pointed DWORD. This is all public information available to the public.
What happens when the shader is NULL? Yours will crash - MSDN says otherwise.
Does this work on Pixel and Vertex shaders ? Does it always return back the first dword as is - what happens if an invalid shader version is passed in.
To implement a test would be far more complicated as it would mean to include a binary shader. Anyway, I have tested the results with Civ4 (by making a derivation on d3dx9_32 with this function and using the original d3dx9_36.D3DXGetShaderVersion function) and the results where the same for all the shaders that where present.
I would suggest an automated test across [ vs: 1.0, 1.1, 2.0, 2.1, 3.0 ] , [ ps: 1.0, 1.1, 1.2, 1.3, 1.4, 2.0, 2.1, 3.0 ] , NULL, and an invalid token. You can see some binary shaders in the d3d9 tests.
Ivan
Am Sonntag, 16. März 2008 15:32:51 schrieb Ivan Gyurdiev:
I would suggest an automated test across [ vs: 1.0, 1.1, 2.0, 2.1, 3.0 ] , [ ps: 1.0, 1.1, 1.2, 1.3, 1.4, 2.0, 2.1, 3.0 ] , NULL, and an invalid token. You can see some binary shaders in the d3d9 tests.
You can't really iterate over the shader versions as various shader versions use different bytecode tokens. Of course you could try to pass an invalid shader with a valid version token, but for a basic functionality test it should be a valid shader IMHO