Mesa (staging/20.1): mesa/get: fix enum16 big-endian getting.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 1 11:19:39 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: cbcd35ac667a2948a1af9621c3677053fb4e5dfa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbcd35ac667a2948a1af9621c3677053fb4e5dfa

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jun 30 05:04:19 2020 +1000

mesa/get: fix enum16 big-endian getting.

These values were getting casted up to 32-bit, but then extracted
via 16-bit pointer later. Just store via 16-bit.

Fixes a lot of piglit on s390

Fixes: f96a69f916ae ("mesa: replace GLenum with GLenum16 in common structures (v4)");

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
(cherry picked from commit 0e6dfd11f220fd1c55b4dc2f371263414874f1fd)

---

 .pick_status.json   |  2 +-
 src/mesa/main/get.c | 19 ++++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index dbe61ddfb71..33ce3343c38 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -94,7 +94,7 @@
         "description": "mesa/get: fix enum16 big-endian getting.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "f96a69f916aed40519e755d0460a83940a58780e"
     },
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index f03685f33ac..81bb18d2bd2 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -229,6 +229,7 @@ union value {
    GLint value_int_4[4];
    GLint64 value_int64;
    GLenum value_enum;
+   GLenum16 value_enum16;
    GLubyte value_ubyte;
    GLshort value_short;
    GLuint value_uint;
@@ -750,7 +751,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
       break;
 
    case GL_READ_BUFFER:
-      v->value_enum = ctx->ReadBuffer->ColorReadBuffer;
+      v->value_enum16 = ctx->ReadBuffer->ColorReadBuffer;
       break;
 
    case GL_MAP2_GRID_DOMAIN:
@@ -849,11 +850,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
       break;
    case GL_LIST_MODE:
       if (!ctx->CompileFlag)
-         v->value_enum = 0;
+         v->value_enum16 = 0;
       else if (ctx->ExecuteFlag)
-         v->value_enum = GL_COMPILE_AND_EXECUTE;
+         v->value_enum16 = GL_COMPILE_AND_EXECUTE;
       else
-         v->value_enum = GL_COMPILE;
+         v->value_enum16 = GL_COMPILE;
       break;
 
    case GL_VIEWPORT:
@@ -869,20 +870,20 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
       break;
 
    case GL_ACTIVE_STENCIL_FACE_EXT:
-      v->value_enum = ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT;
+      v->value_enum16 = ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT;
       break;
 
    case GL_STENCIL_FAIL:
-      v->value_enum = ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
+      v->value_enum16 = ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
       break;
    case GL_STENCIL_FUNC:
-      v->value_enum = ctx->Stencil.Function[ctx->Stencil.ActiveFace];
+      v->value_enum16 = ctx->Stencil.Function[ctx->Stencil.ActiveFace];
       break;
    case GL_STENCIL_PASS_DEPTH_FAIL:
-      v->value_enum = ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
+      v->value_enum16 = ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
       break;
    case GL_STENCIL_PASS_DEPTH_PASS:
-      v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
+      v->value_enum16 = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
       break;
    case GL_STENCIL_REF:
       v->value_int = _mesa_get_stencil_ref(ctx, ctx->Stencil.ActiveFace);



More information about the mesa-commit mailing list