[Mesa-dev] [PATCH 07/10] r600g: set staging texture endianess

Oded Gabbay oded.gabbay at gmail.com
Mon Apr 11 14:34:10 UTC 2016


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

Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
---
 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



More information about the mesa-dev mailing list