[Mesa-dev] [PATCH v2 08/11] r600g: set staging texture endianess

Oded Gabbay oded.gabbay at gmail.com
Thu Apr 14 12:18:51 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 390b711..537f893 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1289,6 +1289,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