author Ryan C. Gordon <>
Wed, 17 Apr 2013 23:30:10 -0400
changeset 1128 a66416e507d1
parent 471 61f87c72e447
child 1189 9aaae21251bc
permissions -rw-r--r--
Optimizations to preprocessor's find_define(). - don't check for __FILE__ and __LINE__ until after we've checked our hash, since this is the less likely case. - Check against the hard-coded hash value of the strings "__FILE__" and "__LINE__" to avoid unnecessary strcmp() calls. This dropped the profile of this function from 20% of our total CPU time to 10%. Of that 10%, 70% is now the hashing function.

To use this in your project:

- Add mojoshader*.c and mojoshader*.h to your project.
- Compile mojoshader*.c
- If you don't have a C99-compliant compiler, like Microsoft Visual Studio,
  you'll need to compile the .c files as C++ to get them to build.
- If you don't have cmake to generate mojoshader_version.h, you can either
  add a blank file with that name, or add MOJOSHADER_NO_VERSION_INCLUDE to
  your preprocessor definitions.

// end of README.txt ...