From 129bebd519928296aa98b42b9d46292973821ec1 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: --- src/gallium/drivers/llvmpipe/lp_query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: {