Author Topic: MadShaders 0.2.0 problem with shader from: demo_6254_0_gl2.xml  (Read 354 times)

0 Members and 1 Guest are viewing this topic.

rafal.jasinski

  • Newbie

  • Offline
  • *

  • 1
    • View Profile
Hi,
I've found little gaffe in fragment shader of demo_6254_0_gl2.xml, which cause shader compilation failure on Intel OpenGL driver.
There is preprocessor directive constructed incorrectly, with contradition to GLSL spec:
#ifdef ENABLE_POINT_LIGHT
               vec3 vLightPos = GetLightPos();
(…)
               vSpecularReflection += GetBlinnPhongIntensity( ray, material, vLightDir, vNormal ) * vIncidentLight;
#endif ENABLE_POINT_LIGHT

Token ENABLE_POINT_LIGHT, after #endif is incorrect, according to specification:
GLSLangSpec.4.30.6.pdf,
Quote
3.3 Preprocessor:
#if, #ifdef, #ifndef, #else, #elif, and #endif are defined to operate as is standard for C++ preprocessors.

Following  ISO C++ official site:
http://isocpp.org/std/the-standard
and working draft
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
Quote
16 Preprocessing directives
endif-line:
# endif  new-line

Only acceptable token after #endif directive is new line token.

Can you look closer into this issue ?

JeGX

  • Global Moderator
  • Hero Member

  • Offline
  • *****

  • 543
    • View Profile
    • Geeks3D.com
Re: MadShaders 0.2.0 problem with shader from: demo_6254_0_gl2.xml
« Reply #1 on: April 11, 2014, 08:40:36 AM »
Thanks for the bug report. I fixed the shader and it will be available in the next update.