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 <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28671>
This commit is contained in:
Mike Blumenkrantz 2024-04-10 11:44:03 -04:00 committed by Marge Bot
parent 6067426549
commit 129bebd519

View file

@ -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: {