Mesa (master): r300g: Fix queries on big endian hosts.

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Nov 2 18:01:03 UTC 2011


Module: Mesa
Branch: master
Commit: 0be1f797709528546f17f82e67b86181fa0c61e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0be1f797709528546f17f82e67b86181fa0c61e1

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Nov  2 16:39:17 2011 +0100

r300g: Fix queries on big endian hosts.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude at gmail.com>

---

 src/gallium/drivers/r300/r300_query.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 9e784b5..55ec66d 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++;
     }
 




More information about the mesa-commit mailing list