Mesa (master): mesa/main: correct validation for GL_RGB565

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 4 20:15:21 UTC 2018


Module: Mesa
Branch: master
Commit: 5bf38bfb64791e2021c813d069b995ed62ff7d09
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5bf38bfb64791e2021c813d069b995ed62ff7d09

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Dec  3 20:00:34 2018 +0100

mesa/main: correct validation for GL_RGB565

Technically speaking, this validation was incorrect, because GL_RGB565
is only supported in OpenGL ES 1.x if OES_framebuffer_object is
supported. This couldn't lead to any real incorrect behavior, because
all drivers support OES_framebuffer_object. But let's keep the code
self-documenting, by correcting the check as per the spec.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/mesa/main/glformats.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 7506c23823..ea73068d02 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -2312,7 +2312,9 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat)
       }
    }
 
-   if (_mesa_has_ARB_ES2_compatibility(ctx) || _mesa_is_gles(ctx)) {
+   if (_mesa_has_ARB_ES2_compatibility(ctx) ||
+       _mesa_has_OES_framebuffer_object(ctx) ||
+       ctx->API == API_OPENGLES2) {
       switch (internalFormat) {
       case GL_RGB565:
          return GL_RGB;




More information about the mesa-commit mailing list