Jump to content

  • Log In with Google      Sign In   
  • Create Account


preprocssor defines not allowed in compile shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 smasherprog   Members   -  Reputation: 432

Like
0Likes
Like

Posted 08 June 2012 - 07:18 AM

While working on my graphics engine, I have some shaders that never change and I want to keep them inside my compiled code so I have less files floating around, but compiling a shader from a string with pre processor macros causes an error to be thrown.

Error CompileShaderFromMemory, Shader@0x03D5F140(1,76): error X3000: syntax error: unexpected token '#'

E_FAIL
An undetermined error occurred

Are any pre procesor defines not allowed when compiling a shader from memory? I did a search and found nothing, so I am curious.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.

Sponsor:

#2 MJP   Moderators   -  Reputation: 10913

Like
1Likes
Like

Posted 08 June 2012 - 03:03 PM

No, you can always use preprocessor macros. The error is probably on the line before that, either a missing semicolon or something similar.

#3 smasherprog   Members   -  Reputation: 432

Like
0Likes
Like

Posted 09 June 2012 - 12:08 PM

MJP,
thanks for the reply, i had a buffer overrun in a part of my program that spilled over into the shader which was causing the error. I could'nt understand what was going on because I knew pre processor macros could be used.....

Thanks for the response +1
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS