Advertisement Jump to content


This topic is now archived and is closed to further replies.


Shader bug driving me crazy

This topic is 6074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m about to turn crazy! I have this SIMPLE shader (code will follow), I compile it with D3DXAssembleShaderFromFile then I take the declarator and the compiled code and I store it in a new file the, in my engine, I load this file, extract the declarator, the complied code and pass it to CreateVertexShader. That was working perfecly for all my shaders, but now, I got this stupid shader that is not working for no apparent reason... Here is the code : vs.1.1 // world position mul r0, v0.x, c0 mad r0, v0.y, c1, r0 mad r0, v0.z, c2, r0 mad r0, v0.w, c3, r0 // world normal mul, v2.x, // *** mad, v2.y,, // *** mad, v2.z,, // *** // projected position mul r1, r0.x, c9 mad r1, r0.y, c10, r1 mad r1, r0.z, c11, r1 mad oPos, r0.w, c12, r1 Here are some precisions : - D3DXAssembleShaderFromFile GIVE ME NO ERRORS - CreateVertexShader is crashing telling me that I''m using vertex shader version 48.46 where max is 1.1 (!?! wtf !?!) - You noticed that the line marked with *** are useless but I will need them later, I compiled the shader without thoses lines and CreateVertexShader did not crashed (darn!) - I really am pissed, all my other shaders that are about 100x more complicated are working, and this simple one is not! - A friend of mine already had same kind of weird bug with assemblesahderfromfile (he was never able to fix it and commited suicide) did you? PLEASE HELP! It''s 3:30 in the morning and I wont find sleep until its fixed!

Share this post

Link to post
Share on other sites
Try to use NVASM. It speeds up the development process and gives you extensive error messages.
Check out the second shader tutorial here on on how to configure it.

- Wolf

Share this post

Link to post
Share on other sites
Also, it's always a good idea to strip off the complexity and find the real problem. Hardcode the declaration and the shader in the code. If the shader assembles and works, then you know it's your loader. If not, start stripping complexity off the shader until you find the problem.

What is the shader supposed to be doing? If you are trying to do what I think you're trying to do, there is an easier way.

[edited by - CrazedGenius on May 31, 2002 12:23:52 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!