Problem creating Shader from file!
Hello everyone:
I used the method D3DXAssembleShaderFromFile( "VertexShader1", NULL, NULL, 0, &pCode, &pErrorMsgs ); to assemble a shader from a file named "VertexShader1.vsh" which is placed in the same directory as my project. The content of the file surely is correct but somehow the &pCode is assigned 0x000000. Does anyone have any idea how this could turn out wrong?
thanks for help in advance
Try passing in "VertexShader1.vsh" in as the file name, instead of just "VertexShader1".
xyzzy
xyzzy
Link your project with the debug version of D3DX (d3dx8d.lib, d3dx9d.lib - note the D), also use the debug D3D runtime and set the output level to maximum in the control panel.
Run the code again once you''ve done that and look at the debug output in the output window - D3DX should tell you exactly why the call failed (e.g. unable to load file, bad instructions in the shader file, instructions which aren''t supported, missing declarations etc).
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Run the code again once you''ve done that and look at the debug output in the output window - D3DX should tell you exactly why the call failed (e.g. unable to load file, bad instructions in the shader file, instructions which aren''t supported, missing declarations etc).
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
1) Did you link with the debug version of D3DX though ?
2) If the function failed, then it should have returned an error HRESULT - what was the return value ?
3) If you''ve linked to the debug version of D3DX and the function returns an error, then it DOES display the reason to the Debug (aka Output - not the Build etc) window. That''s assuming you use MSVC, the build of your program is a debug build and you ran the program via the debugger (i.e. F5)
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
2) If the function failed, then it should have returned an error HRESULT - what was the return value ?
3) If you''ve linked to the debug version of D3DX and the function returns an error, then it DOES display the reason to the Debug (aka Output - not the Build etc) window. That''s assuming you use MSVC, the build of your program is a debug build and you ran the program via the debugger (i.e. F5)
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement