asahi: fix UB in qbo's

upper bits may be uninitialized. fixes
KHR-GL46.transform_feedback_overflow_query_ARB when built with gcc (passed by
chance with clang).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-01-14 16:17:39 -04:00 committed by Marge Bot
parent a06b51559b
commit 62001e175f

View file

@ -276,11 +276,9 @@ agx_get_query_result_resource(struct pipe_context *pipe, struct pipe_query *q,
switch (query->type) {
case PIPE_QUERY_OCCLUSION_PREDICATE:
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
result.u32 = result.b;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
result.u32 = (bool)(result.u32 > 0);
result.u64 = result.b;
break;
default:
break;