Set the default endianess of a staging texture to match the original
texture's endianess.

Signed-off-by: Oded Gabbay <[email protected]>
---
 src/gallium/drivers/radeon/r600_texture.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_texture.c 
b/src/gallium/drivers/radeon/r600_texture.c
index e5a1c65..24354d3 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1285,6 +1285,16 @@ static void *r600_texture_transfer_map(struct 
pipe_context *ctx,
        }
 
        if (trans->staging) {
+               /* staging endian format should match original texture format, 
except for
+                * certain formats, which due to their definitions in mesa, 
should always
+                * be set to native endianess */
+               switch (trans->staging->b.b.format)
+               {
+               default:
+                       trans->staging->b.b.endian_format = 
texture->endian_format;
+                       break;
+               }
+
                buf = trans->staging;
                if (!rtex->is_depth && !(usage & PIPE_TRANSFER_READ))
                        usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
-- 
2.5.5

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to