From 62cba397d1a60b7c64a1921b415c257d0898130a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 10 Apr 2024 11:44:03 -0400 Subject: [PATCH] llvmpipe: clamp 32bit query results to low 32 bits rather than MIN this should be more consistent with hardware driver behavior cc: mesa-stable Reviewed-by: Roland Scheidegger Part-of: (cherry picked from commit 129bebd519928296aa98b42b9d46292973821ec1) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_query.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8c4dacb31f1..248b47759ce 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3684,7 +3684,7 @@ "description": "llvmpipe: clamp 32bit query results to low 32 bits rather than MIN", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index d63c6aae0a3..4de16e9b657 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -372,12 +372,12 @@ llvmpipe_get_query_result_resource(struct pipe_context *pipe, switch (result_type) { case PIPE_QUERY_TYPE_I32: { int32_t *iptr = (int32_t *)dst; - *iptr = (int32_t) MIN2(value, INT32_MAX); + *iptr = (int32_t) (value & INT32_MAX); break; } case PIPE_QUERY_TYPE_U32: { uint32_t *uptr = (uint32_t *)dst; - *uptr = (uint32_t) MIN2(value, UINT32_MAX); + *uptr = (uint32_t) (value & UINT32_MAX); break; } case PIPE_QUERY_TYPE_I64: {