gl-renderer: Use highest precision for vertex shaders
Whilst GLSL requires highp for the vertex shader stage, highp is optional for the fragment shader. Make sure that we work in highp by default during the vertex shader stage, using either highp or mediump for the texcoord varying according to what the fragment shader supports. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
e471edb33d
commit
e07be58dc4
|
@ -119,7 +119,7 @@ uniform samplerExternalOES tex;
|
||||||
uniform sampler2D tex;
|
uniform sampler2D tex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
varying vec2 v_texcoord;
|
varying HIGHPRECISION vec2 v_texcoord;
|
||||||
uniform sampler2D tex1;
|
uniform sampler2D tex1;
|
||||||
uniform sampler2D tex2;
|
uniform sampler2D tex2;
|
||||||
uniform float view_alpha;
|
uniform float view_alpha;
|
||||||
|
|
|
@ -25,10 +25,21 @@
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Always use high-precision for vertex calculations */
|
||||||
|
precision highp float;
|
||||||
|
|
||||||
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||||
|
#define FRAG_PRECISION highp
|
||||||
|
#else
|
||||||
|
#define FRAG_PRECISION mediump
|
||||||
|
#endif
|
||||||
|
|
||||||
uniform mat4 proj;
|
uniform mat4 proj;
|
||||||
attribute vec2 position;
|
attribute vec2 position;
|
||||||
attribute vec2 texcoord;
|
attribute vec2 texcoord;
|
||||||
varying vec2 v_texcoord;
|
|
||||||
|
/* Match the varying precision to the fragment shader */
|
||||||
|
varying FRAG_PRECISION vec2 v_texcoord;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue