From 0e6dfd11f220fd1c55b4dc2f371263414874f1fd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 30 Jun 2020 05:04:19 +1000 Subject: [PATCH] mesa/get: fix enum16 big-endian getting. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/mesa/main/get.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6bd583473ec..a1199e5ad53 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -228,6 +228,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; @@ -744,7 +745,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: @@ -843,11 +844,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: @@ -863,20 +864,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); -- 2.30.2