]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
move extension enables to the top of the shader to comply with spec
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 1 Apr 2013 15:58:00 +0000 (15:58 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 1 Apr 2013 15:58:00 +0000 (15:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11932 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h

index 756118d4f57624a6e61611363ffad88aa1d8359d..63540fc8cb306297ae8075d2763e40230a110ebd 100644 (file)
@@ -2,6 +2,25 @@
 "// written by Forest 'LordHavoc' Hale\n",
 "// shadowmapping enhancements by Lee 'eihrul' Salzman\n",
 "\n",
+"#ifdef USESKELETAL\n",
+"#  ifdef GL_ARB_uniform_buffer_object\n",
+"#    extension GL_ARB_uniform_buffer_object : enable\n",
+"#  endif\n",
+"#endif\n",
+"\n",
+"#ifdef USESHADOWMAP2D\n",
+"# ifdef GL_EXT_gpu_shader4\n",
+"#   extension GL_EXT_gpu_shader4 : enable\n",
+"# endif\n",
+"# ifdef GL_ARB_texture_gather\n",
+"#   extension GL_ARB_texture_gather : enable\n",
+"# else\n",
+"#   ifdef GL_AMD_texture_texture4\n",
+"#     extension GL_AMD_texture_texture4 : enable\n",
+"#   endif\n",
+"# endif\n",
+"#endif\n",
+"\n",
 "#ifdef USECELSHADING\n",
 "# define SHADEDIFFUSE myhalf diffuse = cast_myhalf(min(max(float(dot(surfacenormal, lightnormal)) * 2.0, 0.0), 1.0));\n",
 "# ifdef USEEXACTSPECULARMATH\n",
 "#endif\n",
 "\n",
 "#ifdef VERTEX_SHADER\n",
-"#ifdef USESKELETAL\n",
-"#ifdef GL_ARB_uniform_buffer_object\n",
-"#extension GL_ARB_uniform_buffer_object : enable\n",
-"#endif\n", 
-"#endif\n",
 "dp_attribute vec4 Attrib_Position;  // vertex\n",
 "dp_attribute vec4 Attrib_Color;     // color\n",
 "dp_attribute vec4 Attrib_TexCoord0; // material texcoords\n",
 "# define USEEYEVECTOR\n",
 "#endif\n",
 "\n",
-"#ifdef USESHADOWMAP2D\n",
-"# ifdef GL_EXT_gpu_shader4\n",
-"#   extension GL_EXT_gpu_shader4 : enable\n",
-"# endif\n",
-"# ifdef GL_ARB_texture_gather\n",
-"#   extension GL_ARB_texture_gather : enable\n",
-"# else\n",
-"#   ifdef GL_AMD_texture_texture4\n",
-"#     extension GL_AMD_texture_texture4 : enable\n",
-"#   endif\n",
-"# endif\n",
-"#endif\n",
-"\n",
 "//#ifdef __GLSL_CG_DATA_TYPES\n",
 "//# define myhalf half\n",
 "//# define myhalf2 half2\n",