From 0d0285ba916d9e25871354441c09b0a8c7c9b844 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Tue, 30 Aug 2011 15:43:03 +0200 Subject: [PATCH] r600g: add support for R4A4 and A4R4 textures. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sampling worked out of the box, but this make them work as surface as well. Signed-off-by: Christian König --- src/gallium/drivers/r600/evergreen_state.c | 4 ++++ src/gallium/drivers/r600/r600_state.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 174446e0198..d29a30ed174 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -277,9 +277,11 @@ static uint32_t r600_translate_colorswap(enum pipe_format format) switch (format) { /* 8-bit buffers. */ case PIPE_FORMAT_L4A4_UNORM: + case PIPE_FORMAT_A4R4_UNORM: return V_028C70_SWAP_ALT; case PIPE_FORMAT_A8_UNORM: + case PIPE_FORMAT_R4A4_UNORM: return V_028C70_SWAP_ALT_REV; case PIPE_FORMAT_I8_UNORM: case PIPE_FORMAT_L8_UNORM: @@ -383,6 +385,8 @@ static uint32_t r600_translate_colorformat(enum pipe_format format) switch (format) { /* 8-bit buffers. */ case PIPE_FORMAT_L4A4_UNORM: + case PIPE_FORMAT_R4A4_UNORM: + case PIPE_FORMAT_A4R4_UNORM: return V_028C70_COLOR_4_4; case PIPE_FORMAT_A8_UNORM: diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 326bbff7fa4..1df85fa12e8 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -277,6 +277,7 @@ static uint32_t r600_translate_colorswap(enum pipe_format format) switch (format) { /* 8-bit buffers. */ case PIPE_FORMAT_A8_UNORM: + case PIPE_FORMAT_R4A4_UNORM: return V_0280A0_SWAP_ALT_REV; case PIPE_FORMAT_I8_UNORM: case PIPE_FORMAT_L8_UNORM: @@ -286,6 +287,7 @@ static uint32_t r600_translate_colorswap(enum pipe_format format) return V_0280A0_SWAP_STD; case PIPE_FORMAT_L4A4_UNORM: + case PIPE_FORMAT_A4R4_UNORM: return V_0280A0_SWAP_ALT; /* 16-bit buffers. */ @@ -383,6 +385,8 @@ static uint32_t r600_translate_colorformat(enum pipe_format format) { switch (format) { case PIPE_FORMAT_L4A4_UNORM: + case PIPE_FORMAT_R4A4_UNORM: + case PIPE_FORMAT_A4R4_UNORM: return V_0280A0_COLOR_4_4; /* 8-bit buffers. */ -- 2.30.2