From 49b729dd84b085b7a4b3feccf762ce29e84aba0e Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Fri, 17 Dec 2021 14:51:32 +0900 Subject: [PATCH] vrend: Relax the GLSL ES version requirement Commit a79e837b0d44199776612d2436c3c98a05287412 changed the GLES version requirement of the shaders to support blitting multi-sample textures, which is unavailable on GLES <3.1. However, the change was applied for all shaders, resulting in faults when blitting single-sample textures with GLES <3.1. Require GLES 3.1 only in the shaders for multi-sample textures, which are guarded with the feature detection. Signed-off-by: Akihiko Odaki --- src/vrend_blitter.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/vrend_blitter.h b/src/vrend_blitter.h index 3da5823..f4ccf56 100644 --- a/src/vrend_blitter.h +++ b/src/vrend_blitter.h @@ -35,6 +35,12 @@ "%s" \ #define FS_HEADER_GLES \ + "#version 300 es\n" \ + "// Blitter\n" \ + "%s" \ + "precision mediump float;\n" \ + +#define FS_HEADER_GLES_MS \ "#version 310 es\n" \ "// Blitter\n" \ "%s" \ @@ -52,6 +58,11 @@ "// Blitter\n" \ #define HEADER_GLES \ + "#version 300 es\n" \ + "// Blitter\n" \ + "precision mediump float;\n" \ + +#define HEADER_GLES_MS \ "#version 310 es\n" \ "// Blitter\n" \ "precision mediump float;\n" \ @@ -114,7 +125,7 @@ "}\n" #define FS_TEXFETCH_COL_MSAA_GL FS_HEADER_GL FS_TEXFETCH_COL_MSAA_BODY -#define FS_TEXFETCH_COL_MSAA_GLES FS_HEADER_GLES FS_TEXFETCH_COL_MSAA_BODY +#define FS_TEXFETCH_COL_MSAA_GLES FS_HEADER_GLES_MS FS_TEXFETCH_COL_MSAA_BODY #define FS_TEXFETCH_COL_MSAA_ARRAY_GLES FS_HEADER_GLES_MS_ARRAY FS_TEXFETCH_COL_MSAA_BODY #define FS_TEXFETCH_DS_BODY \ @@ -147,7 +158,7 @@ struct vrend_context; struct vrend_resource; struct vrend_blit_info; #define FS_TEXFETCH_DS_MSAA_GL HEADER_GL FS_TEXFETCH_DS_MSAA_BODY -#define FS_TEXFETCH_DS_MSAA_GLES HEADER_GLES FS_TEXFETCH_DS_MSAA_BODY_GLES +#define FS_TEXFETCH_DS_MSAA_GLES HEADER_GLES_MS FS_TEXFETCH_DS_MSAA_BODY_GLES #define FS_TEXFETCH_DS_MSAA_ARRAY_GLES HEADER_GLES_MS_ARRAY FS_TEXFETCH_DS_MSAA_BODY_GLES /* implement blitting using OpenGL. */