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

Marek Olšák mareko at kemper.freedesktop.org
Wed Nov 2 21:30:24 UTC 2011


Module: Mesa
Branch: 7.11
Commit: b95767a57ad499a2ed7431e8b0b52966c6dc0a45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b95767a57ad499a2ed7431e8b0b52966c6dc0a45

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 782f041..6782a09 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++;
     }
 




More information about the mesa-commit mailing list