From 4d04144b9254335c74f54c6e282904ec0c54c9dd Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 27 Oct 2022 16:05:50 +0200 Subject: render/gles2: de-duplicate vertex shaders The vertex shaders for quads and textures are identical. --- render/gles2/shaders/common.vert | 9 +++++++++ render/gles2/shaders/meson.build | 3 +-- render/gles2/shaders/quad.vert | 9 --------- render/gles2/shaders/tex.vert | 9 --------- 4 files changed, 10 insertions(+), 20 deletions(-) create mode 100644 render/gles2/shaders/common.vert delete mode 100644 render/gles2/shaders/quad.vert delete mode 100644 render/gles2/shaders/tex.vert (limited to 'render/gles2/shaders') diff --git a/render/gles2/shaders/common.vert b/render/gles2/shaders/common.vert new file mode 100644 index 00000000..9cebb458 --- /dev/null +++ b/render/gles2/shaders/common.vert @@ -0,0 +1,9 @@ +uniform mat3 proj; +attribute vec2 pos; +attribute vec2 texcoord; +varying vec2 v_texcoord; + +void main() { + gl_Position = vec4(proj * vec3(pos, 1.0), 1.0); + v_texcoord = texcoord; +} diff --git a/render/gles2/shaders/meson.build b/render/gles2/shaders/meson.build index 626c2b14..79454d9a 100644 --- a/render/gles2/shaders/meson.build +++ b/render/gles2/shaders/meson.build @@ -1,9 +1,8 @@ embed = find_program('./embed.sh', native: true) shaders = [ - 'quad.vert', + 'common.vert', 'quad.frag', - 'tex.vert', 'tex_rgba.frag', 'tex_rgbx.frag', 'tex_external.frag', diff --git a/render/gles2/shaders/quad.vert b/render/gles2/shaders/quad.vert deleted file mode 100644 index 9cebb458..00000000 --- a/render/gles2/shaders/quad.vert +++ /dev/null @@ -1,9 +0,0 @@ -uniform mat3 proj; -attribute vec2 pos; -attribute vec2 texcoord; -varying vec2 v_texcoord; - -void main() { - gl_Position = vec4(proj * vec3(pos, 1.0), 1.0); - v_texcoord = texcoord; -} diff --git a/render/gles2/shaders/tex.vert b/render/gles2/shaders/tex.vert deleted file mode 100644 index 9cebb458..00000000 --- a/render/gles2/shaders/tex.vert +++ /dev/null @@ -1,9 +0,0 @@ -uniform mat3 proj; -attribute vec2 pos; -attribute vec2 texcoord; -varying vec2 v_texcoord; - -void main() { - gl_Position = vec4(proj * vec3(pos, 1.0), 1.0); - v_texcoord = texcoord; -} -- cgit v1.2.3