From b95767a57ad499a2ed7431e8b0b52966c6dc0a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 2 Nov 2011 16:39:17 +0100 Subject: [PATCH] r300g: Fix queries on big endian hosts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michel Dänzer Reviewed-by: Corbin Simpson --- src/gallium/drivers/r300/r300_query.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index 782f041e926..6782a09b669 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -138,7 +138,8 @@ static boolean r300_get_query_result(struct pipe_context* pipe, /* Sum up the results. */ temp = 0; for (i = 0; i < q->num_results; i++) { - temp += *map; + /* Convert little endian values written by GPU to CPU byte order */ + temp += util_le32_to_cpu(*map); map++; }