2018-11-24 00:37:07 +01:00
|
|
|
#undef GLSL_DERIV_PREAMBLE
|
|
|
|
#undef GLSL_PREAMBLE
|
|
|
|
#undef GLSL
|
|
|
|
#undef GLSL_300
|
|
|
|
#undef GLSL_330
|
2016-05-28 18:18:23 +02:00
|
|
|
|
2018-11-23 23:57:22 +01:00
|
|
|
#define GLSL_DERIV_PREAMBLE() "#extension GL_OES_standard_derivatives : enable\n"
|
|
|
|
#define GLSL_PREAMBLE() \
|
|
|
|
"#ifdef GL_ES\n" \
|
|
|
|
" #ifdef GL_FRAGMENT_PRECISION_HIGH\n" \
|
|
|
|
" precision highp float;\n" \
|
|
|
|
" #else\n" \
|
|
|
|
" precision mediump float;\n" \
|
|
|
|
" #endif\n" \
|
|
|
|
"#else\n" \
|
|
|
|
" precision mediump float;\n" \
|
|
|
|
"#endif\n"
|
|
|
|
|
2016-05-28 20:56:02 +02:00
|
|
|
#if defined(HAVE_OPENGLES)
|
2018-11-23 23:57:22 +01:00
|
|
|
#define GLSL(src) GLSL_DERIV_PREAMBLE() GLSL_PREAMBLE() #src
|
|
|
|
#define GLSL_330(src) "#version 330 es\n" GLSL_PREAMBLE() #src
|
2016-05-28 20:56:02 +02:00
|
|
|
#else
|
2018-11-23 23:57:22 +01:00
|
|
|
#define GLSL(src) "" GLSL_PREAMBLE() #src
|
|
|
|
#define GLSL_300(src) "#version 300 es\n" GLSL_PREAMBLE() #src
|
|
|
|
#define GLSL_330(src) "#version 330 core\n" GLSL_PREAMBLE() #src
|
2016-05-28 18:18:23 +02:00
|
|
|
#endif
|