Browse Source

Declare VaryingTexCoords and love_ScreenSize as highp when supported.

--HG--
branch : minor
Alex Szpakowski 8 years ago
parent
commit
856a4e60ae
1 changed files with 13 additions and 13 deletions
  1. 13 13
      src/modules/graphics/wrap_Graphics.lua

+ 13 - 13
src/modules/graphics/wrap_Graphics.lua

@@ -40,6 +40,11 @@ GLSL.SYNTAX = [[
 	#define mediump
 	#define mediump
 	#define highp
 	#define highp
 #endif
 #endif
+#if defined(VERTEX) || __VERSION__ > 100 || defined(GL_FRAGMENT_PRECISION_HIGH)
+	#define LOVE_HIGHP_OR_MEDIUMP highp
+#else
+	#define LOVE_HIGHP_OR_MEDIUMP mediump
+#endif
 #define number float
 #define number float
 #define Image sampler2D
 #define Image sampler2D
 #define ArrayImage sampler2DArray
 #define ArrayImage sampler2DArray
@@ -59,16 +64,11 @@ GLSL.UNIFORMS = [[
 // According to the GLSL ES 1.0 spec, uniform precision must match between stages,
 // According to the GLSL ES 1.0 spec, uniform precision must match between stages,
 // but we can't guarantee that highp is always supported in fragment shaders...
 // but we can't guarantee that highp is always supported in fragment shaders...
 // We *really* don't want to use mediump for these in vertex shaders though.
 // We *really* don't want to use mediump for these in vertex shaders though.
-#if defined(VERTEX) || __VERSION__ > 100 || defined(GL_FRAGMENT_PRECISION_HIGH)
-	#define LOVE_UNIFORM_PRECISION highp
-#else
-	#define LOVE_UNIFORM_PRECISION mediump
-#endif
-uniform LOVE_UNIFORM_PRECISION mat4 TransformMatrix;
-uniform LOVE_UNIFORM_PRECISION mat4 ProjectionMatrix;
-uniform LOVE_UNIFORM_PRECISION mat4 TransformProjectionMatrix;
-uniform LOVE_UNIFORM_PRECISION mat3 NormalMatrix;
-uniform mediump vec4 love_ScreenSize;]]
+uniform LOVE_HIGHP_OR_MEDIUMP mat4 TransformMatrix;
+uniform LOVE_HIGHP_OR_MEDIUMP mat4 ProjectionMatrix;
+uniform LOVE_HIGHP_OR_MEDIUMP mat4 TransformProjectionMatrix;
+uniform LOVE_HIGHP_OR_MEDIUMP mat3 NormalMatrix;
+uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_ScreenSize;]]
 
 
 GLSL.FUNCTIONS = [[
 GLSL.FUNCTIONS = [[
 #if __VERSION__ >= 130 && !defined(LOVE_GLSL1_ON_GLSL3)
 #if __VERSION__ >= 130 && !defined(LOVE_GLSL1_ON_GLSL3)
@@ -253,7 +253,7 @@ vec4 VideoTexel(vec2 texcoords) {
 
 
 	MAIN = [[
 	MAIN = [[
 uniform sampler2D MainTex;
 uniform sampler2D MainTex;
-varying mediump vec4 VaryingTexCoord;
+varying LOVE_HIGHP_OR_MEDIUMP vec4 VaryingTexCoord;
 varying mediump vec4 VaryingColor;
 varying mediump vec4 VaryingColor;
 
 
 vec4 effect(vec4 vcolor, Image tex, vec2 texcoord, vec2 pixcoord);
 vec4 effect(vec4 vcolor, Image tex, vec2 texcoord, vec2 pixcoord);
@@ -263,8 +263,8 @@ void main() {
 }]],
 }]],
 
 
 	MAIN_CUSTOM = [[
 	MAIN_CUSTOM = [[
-varying vec4 VaryingColor;
-varying vec4 VaryingTexCoord;
+varying LOVE_HIGHP_OR_MEDIUMP vec4 VaryingTexCoord;
+varying mediump vec4 VaryingColor;
 
 
 void effect();
 void effect();