From 0be1f797709528546f17f82e67b86181fa0c61e1 Mon Sep 17 00:00:00 2001 From: =?utf8?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=utf8 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 9e784b5fecf..55ec66deb72 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -132,7 +132,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++; } -- 2.30.2