[Mesa-dev] [PATCH 6/9] r600g: add support for subsampled rgb formats

Christian König deathsimple at vodafone.de
Wed Mar 7 06:49:30 PST 2012


v2: r600 formats are msb first!

Signed-off-by: Christian König <deathsimple at vodafone.de>
---
 src/gallium/drivers/r600/r600_texture.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 923efce..ce66117 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -1135,6 +1135,21 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
 		}
 	}
 
+	if (desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
+		switch (format) {
+		case PIPE_FORMAT_R8G8_B8G8_UNORM:
+		case PIPE_FORMAT_G8R8_B8R8_UNORM:
+			result = FMT_GB_GR;
+			goto out_word4;
+		case PIPE_FORMAT_G8R8_G8B8_UNORM:
+		case PIPE_FORMAT_R8G8_R8B8_UNORM:
+			result = FMT_BG_RG;
+			goto out_word4;
+		default:
+			goto out_unknown;
+		}
+	}
+
 	if (format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
 		result = FMT_5_9_9_9_SHAREDEXP;
 		goto out_word4;
-- 
1.7.5.4



More information about the mesa-dev mailing list