From c637002532e366bb7396c342e75b9fc29ab9cd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Aug 2014 21:40:30 +0200 Subject: [PATCH] Shaders: fix MeshVisualizer on ES. The extension line must appear before any other non-preprocessor token. --- src/Magnum/Shaders/MeshVisualizer.frag | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Shaders/MeshVisualizer.frag b/src/Magnum/Shaders/MeshVisualizer.frag index 607348529..5c985ec14 100644 --- a/src/Magnum/Shaders/MeshVisualizer.frag +++ b/src/Magnum/Shaders/MeshVisualizer.frag @@ -36,6 +36,12 @@ #define layout(arg) #endif +/* This is needed also on desktop ES 3.0 emulation on NVidia 330.20 even though + fwidth() is part of GLSL ES 3.0 */ +#if defined(WIREFRAME_RENDERING) && defined(GL_ES) +#extension GL_OES_standard_derivatives : enable +#endif + #ifndef GL_ES layout(location = 2) uniform vec4 color = vec4(1.0, 1.0, 1.0, 1.0); #else @@ -64,12 +70,6 @@ in lowp vec3 barycentric; out lowp vec4 fragmentColor; #endif -/* This is needed also on desktop ES 3.0 emulation on NVidia 330.20 even though - fwidth() is part of GLSL ES 3.0 */ -#if defined(WIREFRAME_RENDERING) && defined(GL_ES) -#extension GL_OES_standard_derivatives : enable -#endif - void main() { #ifdef WIREFRAME_RENDERING #ifndef NO_GEOMETRY_SHADER