r600g: add support for R4A4 and A4R4 textures.
authorChristian König <deathsimple@vodafone.de>
Tue, 30 Aug 2011 13:43:03 +0000 (15:43 +0200)
committerChristian König <deathsimple@vodafone.de>
Thu, 1 Sep 2011 17:20:46 +0000 (19:20 +0200)
Sampling worked out of the box, but this make them work as surface as well.

Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 174446e019896c29bd39ce172af29ad45c63f10a..d29a30ed174e874b4c7091cde054258d1cdc329b 100644 (file)
@@ -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:
index 326bbff7fa4f0f781cf74fb8d82f5cd3bde51236..1df85fa12e8b0411c93fa98e7b02081d9c0a6722 100644 (file)
@@ -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. */