From d69018c195d1bb8e6919e73a1709d03a9ae98f38 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 27 Oct 2022 15:58:34 +0200 Subject: render/gles2: move color uniform from quad.vert to quad.frag We have no use for a v_color varying. We can use the uniform directly from the fragment shader without getting the vertex shader involved. --- render/gles2/shaders/quad.frag | 3 ++- render/gles2/shaders/quad.vert | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/render/gles2/shaders/quad.frag b/render/gles2/shaders/quad.frag index 08291046..f9712797 100644 --- a/render/gles2/shaders/quad.frag +++ b/render/gles2/shaders/quad.frag @@ -1,7 +1,8 @@ precision mediump float; varying vec4 v_color; varying vec2 v_texcoord; +uniform vec4 color; void main() { - gl_FragColor = v_color; + gl_FragColor = color; } diff --git a/render/gles2/shaders/quad.vert b/render/gles2/shaders/quad.vert index abcafd07..9cebb458 100644 --- a/render/gles2/shaders/quad.vert +++ b/render/gles2/shaders/quad.vert @@ -1,12 +1,9 @@ uniform mat3 proj; -uniform vec4 color; attribute vec2 pos; attribute vec2 texcoord; -varying vec4 v_color; varying vec2 v_texcoord; void main() { gl_Position = vec4(proj * vec3(pos, 1.0), 1.0); - v_color = color; v_texcoord = texcoord; } -- cgit v1.2.3