From 62001e175f41bc544cbabaf4c139d01bfb6bbfee Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 14 Jan 2024 16:17:39 -0400 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/asahi/agx_query.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_query.c b/src/gallium/drivers/asahi/agx_query.c index 2582043ca81..32ac8591e98 100644 --- a/src/gallium/drivers/asahi/agx_query.c +++ b/src/gallium/drivers/asahi/agx_query.c @@ -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;