[virglrenderer-devel] [PATCH] vrend: Remove bad sRGB warning on GLES

Jakob Bornecrantz jakob at collabora.com
Wed Jul 18 13:26:28 UTC 2018


I had some missunderstanding about what glEnable(sRGB) did when I added this
warning. As in GLES there is no need to do glEnable(sRGB) at all since it is
implied from the framebuffer.

Signed-off-by: Jakob Bornecrantz <jakob at collabora.com>
---
 src/vrend_renderer.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 261b0df..399a4b7 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -515,7 +515,7 @@ static void __report_core_warn(const char *fname, struct vrend_context *ctx, enu
 #define GLES_WARN_DEPTH_RANGE 3
 #define GLES_WARN_POINT_SIZE 4
 #define GLES_WARN_LOD_BIAS 5
-#define GLES_WARN_SRGB_FB 6
+//#define GLES_WARN_ free slot 6
 #define GLES_WARN_TEXTURE_RECT 7
 #define GLES_WARN_OFFSET_LINE 8
 #define GLES_WARN_OFFSET_POINT 9
@@ -529,7 +529,7 @@ static void __report_core_warn(const char *fname, struct vrend_context *ctx, enu
 
 static const char *vrend_gles_warn_strings[] = {
    "None", "Stipple", "Polygon Mode", "Depth Range", "Point Size", "Lod Bias",
-   "SRGB Framebuffer", "Texture Rect", "Offset Line", "Offset Point",
+   "<<WARNING #6>>", "Texture Rect", "Offset Line", "Offset Point",
    "Depth Clip", "Flatshade First", "Line Smooth", "Poly Smooth",
    "Depth Clear", "LogicOp", "GL_TIMESTAMP"
 };
@@ -1690,7 +1690,8 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
       if (!vrend_state.use_gles) {
          glDisable(GL_FRAMEBUFFER_SRGB_EXT);
       }
-   } else {
+   } else if (!vrend_state.use_gles) {
+      /* Do not enter this path on GLES as this is not needed. */
       struct vrend_surface *surf = NULL;
       bool use_srgb = false;
       int i;
@@ -1703,15 +1704,9 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
          }
       }
       if (use_srgb) {
-         if (!vrend_state.use_gles) {
-            glEnable(GL_FRAMEBUFFER_SRGB_EXT);
-         } else {
-            report_gles_warn(ctx, GLES_WARN_SRGB_FB, 0);
-         }
+         glEnable(GL_FRAMEBUFFER_SRGB_EXT);
       } else {
-         if (!vrend_state.use_gles) {
-            glDisable(GL_FRAMEBUFFER_SRGB_EXT);
-         }
+         glDisable(GL_FRAMEBUFFER_SRGB_EXT);
       }
    }
    glDrawBuffers(ctx->sub->nr_cbufs, buffers);
-- 
2.17.1



More information about the virglrenderer-devel mailing list