r600g: add support for missing colorbuffer formats
authorMarek Olšák <maraeo@gmail.com>
Wed, 29 Feb 2012 12:09:51 +0000 (13:09 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 5 Mar 2012 13:22:25 +0000 (14:22 +0100)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 114689fad379b86809e2adc314a541d98c4e1250..53fe81dfa9a2d525425f3d2f7c5c3fb1840f9a98 100644 (file)
@@ -215,17 +215,44 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_028C70_SWAP_ALT;
 
        case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_A8_SNORM:
        case PIPE_FORMAT_A8_UINT:
        case PIPE_FORMAT_A8_SINT:
+       case PIPE_FORMAT_A16_UNORM:
+       case PIPE_FORMAT_A16_SNORM:
+       case PIPE_FORMAT_A16_UINT:
+       case PIPE_FORMAT_A16_SINT:
+       case PIPE_FORMAT_A16_FLOAT:
+       case PIPE_FORMAT_A32_UINT:
+       case PIPE_FORMAT_A32_SINT:
+       case PIPE_FORMAT_A32_FLOAT:
        case PIPE_FORMAT_R4A4_UNORM:
                return V_028C70_SWAP_ALT_REV;
        case PIPE_FORMAT_I8_UNORM:
-       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_I8_SNORM:
        case PIPE_FORMAT_I8_UINT:
        case PIPE_FORMAT_I8_SINT:
+       case PIPE_FORMAT_I16_UNORM:
+       case PIPE_FORMAT_I16_SNORM:
+       case PIPE_FORMAT_I16_UINT:
+       case PIPE_FORMAT_I16_SINT:
+       case PIPE_FORMAT_I16_FLOAT:
+       case PIPE_FORMAT_I32_UINT:
+       case PIPE_FORMAT_I32_SINT:
+       case PIPE_FORMAT_I32_FLOAT:
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SNORM:
        case PIPE_FORMAT_L8_UINT:
        case PIPE_FORMAT_L8_SINT:
        case PIPE_FORMAT_L8_SRGB:
+       case PIPE_FORMAT_L16_UNORM:
+       case PIPE_FORMAT_L16_SNORM:
+       case PIPE_FORMAT_L16_UINT:
+       case PIPE_FORMAT_L16_SINT:
+       case PIPE_FORMAT_L16_FLOAT:
+       case PIPE_FORMAT_L32_UINT:
+       case PIPE_FORMAT_L32_SINT:
+       case PIPE_FORMAT_L32_FLOAT:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
        case PIPE_FORMAT_R8_UINT:
@@ -248,16 +275,27 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_028C70_SWAP_STD;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SNORM:
        case PIPE_FORMAT_L8A8_UINT:
        case PIPE_FORMAT_L8A8_SINT:
        case PIPE_FORMAT_L8A8_SRGB:
+       case PIPE_FORMAT_L16A16_UNORM:
+       case PIPE_FORMAT_L16A16_SNORM:
+       case PIPE_FORMAT_L16A16_UINT:
+       case PIPE_FORMAT_L16A16_SINT:
+       case PIPE_FORMAT_L16A16_FLOAT:
+       case PIPE_FORMAT_L32A32_UINT:
+       case PIPE_FORMAT_L32A32_SINT:
+       case PIPE_FORMAT_L32A32_FLOAT:
                return V_028C70_SWAP_ALT;
        case PIPE_FORMAT_R8G8_UNORM:
+       case PIPE_FORMAT_R8G8_SNORM:
        case PIPE_FORMAT_R8G8_UINT:
        case PIPE_FORMAT_R8G8_SINT:
                return V_028C70_SWAP_STD;
 
        case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_R16_SNORM:
        case PIPE_FORMAT_R16_UINT:
        case PIPE_FORMAT_R16_SINT:
        case PIPE_FORMAT_R16_FLOAT:
@@ -312,6 +350,7 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
        case PIPE_FORMAT_Z32_FLOAT:
        case PIPE_FORMAT_R16G16_FLOAT:
        case PIPE_FORMAT_R16G16_UNORM:
+       case PIPE_FORMAT_R16G16_SNORM:
        case PIPE_FORMAT_R16G16_UINT:
        case PIPE_FORMAT_R16G16_SINT:
                return V_028C70_SWAP_STD;
@@ -346,12 +385,15 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
        switch (format) {
        /* 8-bit buffers. */
        case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_A8_SNORM:
        case PIPE_FORMAT_A8_UINT:
        case PIPE_FORMAT_A8_SINT:
        case PIPE_FORMAT_I8_UNORM:
+       case PIPE_FORMAT_I8_SNORM:
        case PIPE_FORMAT_I8_UINT:
        case PIPE_FORMAT_I8_SINT:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SNORM:
        case PIPE_FORMAT_L8_UINT:
        case PIPE_FORMAT_L8_SINT:
        case PIPE_FORMAT_L8_SRGB:
@@ -377,20 +419,38 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_028C70_COLOR_16;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SNORM:
        case PIPE_FORMAT_L8A8_UINT:
        case PIPE_FORMAT_L8A8_SINT:
        case PIPE_FORMAT_L8A8_SRGB:
        case PIPE_FORMAT_R8G8_UNORM:
+       case PIPE_FORMAT_R8G8_SNORM:
        case PIPE_FORMAT_R8G8_UINT:
        case PIPE_FORMAT_R8G8_SINT:
                return V_028C70_COLOR_8_8;
 
        case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_R16_SNORM:
        case PIPE_FORMAT_R16_UINT:
        case PIPE_FORMAT_R16_SINT:
+       case PIPE_FORMAT_A16_UNORM:
+       case PIPE_FORMAT_A16_SNORM:
+       case PIPE_FORMAT_A16_UINT:
+       case PIPE_FORMAT_A16_SINT:
+       case PIPE_FORMAT_L16_UNORM:
+       case PIPE_FORMAT_L16_SNORM:
+       case PIPE_FORMAT_L16_UINT:
+       case PIPE_FORMAT_L16_SINT:
+       case PIPE_FORMAT_I16_UNORM:
+       case PIPE_FORMAT_I16_SNORM:
+       case PIPE_FORMAT_I16_UINT:
+       case PIPE_FORMAT_I16_SINT:
                return V_028C70_COLOR_16;
 
        case PIPE_FORMAT_R16_FLOAT:
+       case PIPE_FORMAT_A16_FLOAT:
+       case PIPE_FORMAT_L16_FLOAT:
+       case PIPE_FORMAT_I16_FLOAT:
                return V_028C70_COLOR_16_FLOAT;
 
        /* 32-bit buffers. */
@@ -431,18 +491,33 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
 
        case PIPE_FORMAT_R32_UINT:
        case PIPE_FORMAT_R32_SINT:
+       case PIPE_FORMAT_A32_UINT:
+       case PIPE_FORMAT_A32_SINT:
+       case PIPE_FORMAT_L32_UINT:
+       case PIPE_FORMAT_L32_SINT:
+       case PIPE_FORMAT_I32_UINT:
+       case PIPE_FORMAT_I32_SINT:
                return V_028C70_COLOR_32;
 
        case PIPE_FORMAT_R32_FLOAT:
+       case PIPE_FORMAT_A32_FLOAT:
+       case PIPE_FORMAT_L32_FLOAT:
+       case PIPE_FORMAT_I32_FLOAT:
        case PIPE_FORMAT_Z32_FLOAT:
                return V_028C70_COLOR_32_FLOAT;
 
        case PIPE_FORMAT_R16G16_FLOAT:
+       case PIPE_FORMAT_L16A16_FLOAT:
                return V_028C70_COLOR_16_16_FLOAT;
 
        case PIPE_FORMAT_R16G16_UNORM:
+       case PIPE_FORMAT_R16G16_SNORM:
        case PIPE_FORMAT_R16G16_UINT:
        case PIPE_FORMAT_R16G16_SINT:
+       case PIPE_FORMAT_L16A16_UNORM:
+       case PIPE_FORMAT_L16A16_SNORM:
+       case PIPE_FORMAT_L16A16_UINT:
+       case PIPE_FORMAT_L16A16_SINT:
                return V_028C70_COLOR_16_16;
 
        case PIPE_FORMAT_R11G11B10_FLOAT:
@@ -460,10 +535,13 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_028C70_COLOR_16_16_16_16_FLOAT;
 
        case PIPE_FORMAT_R32G32_FLOAT:
+       case PIPE_FORMAT_L32A32_FLOAT:
                return V_028C70_COLOR_32_32_FLOAT;
 
        case PIPE_FORMAT_R32G32_SINT:
        case PIPE_FORMAT_R32G32_UINT:
+       case PIPE_FORMAT_L32A32_UINT:
+       case PIPE_FORMAT_L32A32_SINT:
                return V_028C70_COLOR_32_32;
 
        /* 96-bit buffers. */
index c859f09a2ac176242baaf37ef2b85f05464fd607..38a9830c35ecd2b74f9c389a10962927c442a0d6 100644 (file)
@@ -156,17 +156,44 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
        switch (format) {
        /* 8-bit buffers. */
        case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_A8_SNORM:
        case PIPE_FORMAT_A8_UINT:
        case PIPE_FORMAT_A8_SINT:
+       case PIPE_FORMAT_A16_UNORM:
+       case PIPE_FORMAT_A16_SNORM:
+       case PIPE_FORMAT_A16_UINT:
+       case PIPE_FORMAT_A16_SINT:
+       case PIPE_FORMAT_A16_FLOAT:
+       case PIPE_FORMAT_A32_UINT:
+       case PIPE_FORMAT_A32_SINT:
+       case PIPE_FORMAT_A32_FLOAT:
        case PIPE_FORMAT_R4A4_UNORM:
                return V_0280A0_SWAP_ALT_REV;
        case PIPE_FORMAT_I8_UNORM:
-       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_I8_SNORM:
        case PIPE_FORMAT_I8_UINT:
        case PIPE_FORMAT_I8_SINT:
+       case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SNORM:
        case PIPE_FORMAT_L8_UINT:
        case PIPE_FORMAT_L8_SINT:
        case PIPE_FORMAT_L8_SRGB:
+       case PIPE_FORMAT_L16_UNORM:
+       case PIPE_FORMAT_L16_SNORM:
+       case PIPE_FORMAT_L16_UINT:
+       case PIPE_FORMAT_L16_SINT:
+       case PIPE_FORMAT_L16_FLOAT:
+       case PIPE_FORMAT_L32_UINT:
+       case PIPE_FORMAT_L32_SINT:
+       case PIPE_FORMAT_L32_FLOAT:
+       case PIPE_FORMAT_I16_UNORM:
+       case PIPE_FORMAT_I16_SNORM:
+       case PIPE_FORMAT_I16_UINT:
+       case PIPE_FORMAT_I16_SINT:
+       case PIPE_FORMAT_I16_FLOAT:
+       case PIPE_FORMAT_I32_UINT:
+       case PIPE_FORMAT_I32_SINT:
+       case PIPE_FORMAT_I32_FLOAT:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
        case PIPE_FORMAT_R8_UINT:
@@ -193,16 +220,27 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_0280A0_SWAP_STD;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SNORM:
        case PIPE_FORMAT_L8A8_UINT:
        case PIPE_FORMAT_L8A8_SINT:
        case PIPE_FORMAT_L8A8_SRGB:
+       case PIPE_FORMAT_L16A16_UNORM:
+       case PIPE_FORMAT_L16A16_SNORM:
+       case PIPE_FORMAT_L16A16_UINT:
+       case PIPE_FORMAT_L16A16_SINT:
+       case PIPE_FORMAT_L16A16_FLOAT:
+       case PIPE_FORMAT_L32A32_UINT:
+       case PIPE_FORMAT_L32A32_SINT:
+       case PIPE_FORMAT_L32A32_FLOAT:
                return V_0280A0_SWAP_ALT;
        case PIPE_FORMAT_R8G8_UNORM:
+       case PIPE_FORMAT_R8G8_SNORM:
        case PIPE_FORMAT_R8G8_UINT:
        case PIPE_FORMAT_R8G8_SINT:
                return V_0280A0_SWAP_STD;
 
        case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_R16_SNORM:
        case PIPE_FORMAT_R16_UINT:
        case PIPE_FORMAT_R16_SINT:
        case PIPE_FORMAT_R16_FLOAT:
@@ -253,6 +291,7 @@ static uint32_t r600_translate_colorswap(enum pipe_format format)
 
        case PIPE_FORMAT_R11G11B10_FLOAT:
        case PIPE_FORMAT_R16G16_UNORM:
+       case PIPE_FORMAT_R16G16_SNORM:
        case PIPE_FORMAT_R16G16_FLOAT:
        case PIPE_FORMAT_R16G16_UINT:
        case PIPE_FORMAT_R16G16_SINT:
@@ -297,12 +336,15 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
 
        /* 8-bit buffers. */
        case PIPE_FORMAT_A8_UNORM:
+       case PIPE_FORMAT_A8_SNORM:
        case PIPE_FORMAT_A8_UINT:
        case PIPE_FORMAT_A8_SINT:
        case PIPE_FORMAT_I8_UNORM:
+       case PIPE_FORMAT_I8_SNORM:
        case PIPE_FORMAT_I8_UINT:
        case PIPE_FORMAT_I8_SINT:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SNORM:
        case PIPE_FORMAT_L8_UINT:
        case PIPE_FORMAT_L8_SINT:
        case PIPE_FORMAT_L8_SRGB:
@@ -328,20 +370,38 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_0280A0_COLOR_16;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SNORM:
        case PIPE_FORMAT_L8A8_UINT:
        case PIPE_FORMAT_L8A8_SINT:
        case PIPE_FORMAT_L8A8_SRGB:
        case PIPE_FORMAT_R8G8_UNORM:
+       case PIPE_FORMAT_R8G8_SNORM:
        case PIPE_FORMAT_R8G8_UINT:
        case PIPE_FORMAT_R8G8_SINT:
                return V_0280A0_COLOR_8_8;
 
        case PIPE_FORMAT_R16_UNORM:
+       case PIPE_FORMAT_R16_SNORM:
        case PIPE_FORMAT_R16_UINT:
        case PIPE_FORMAT_R16_SINT:
+       case PIPE_FORMAT_A16_UNORM:
+       case PIPE_FORMAT_A16_SNORM:
+       case PIPE_FORMAT_A16_UINT:
+       case PIPE_FORMAT_A16_SINT:
+       case PIPE_FORMAT_L16_UNORM:
+       case PIPE_FORMAT_L16_SNORM:
+       case PIPE_FORMAT_L16_UINT:
+       case PIPE_FORMAT_L16_SINT:
+       case PIPE_FORMAT_I16_UNORM:
+       case PIPE_FORMAT_I16_SNORM:
+       case PIPE_FORMAT_I16_UINT:
+       case PIPE_FORMAT_I16_SINT:
                return V_0280A0_COLOR_16;
 
        case PIPE_FORMAT_R16_FLOAT:
+       case PIPE_FORMAT_A16_FLOAT:
+       case PIPE_FORMAT_L16_FLOAT:
+       case PIPE_FORMAT_I16_FLOAT:
                return V_0280A0_COLOR_16_FLOAT;
 
        /* 32-bit buffers. */
@@ -382,18 +442,33 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
 
        case PIPE_FORMAT_R32_UINT:
        case PIPE_FORMAT_R32_SINT:
+       case PIPE_FORMAT_A32_UINT:
+       case PIPE_FORMAT_A32_SINT:
+       case PIPE_FORMAT_L32_UINT:
+       case PIPE_FORMAT_L32_SINT:
+       case PIPE_FORMAT_I32_UINT:
+       case PIPE_FORMAT_I32_SINT:
                return V_0280A0_COLOR_32;
 
        case PIPE_FORMAT_R32_FLOAT:
+       case PIPE_FORMAT_A32_FLOAT:
+       case PIPE_FORMAT_L32_FLOAT:
+       case PIPE_FORMAT_I32_FLOAT:
        case PIPE_FORMAT_Z32_FLOAT:
                return V_0280A0_COLOR_32_FLOAT;
 
        case PIPE_FORMAT_R16G16_FLOAT:
+       case PIPE_FORMAT_L16A16_FLOAT:
                return V_0280A0_COLOR_16_16_FLOAT;
 
        case PIPE_FORMAT_R16G16_UNORM:
+       case PIPE_FORMAT_R16G16_SNORM:
        case PIPE_FORMAT_R16G16_UINT:
        case PIPE_FORMAT_R16G16_SINT:
+       case PIPE_FORMAT_L16A16_UNORM:
+       case PIPE_FORMAT_L16A16_SNORM:
+       case PIPE_FORMAT_L16A16_UINT:
+       case PIPE_FORMAT_L16A16_SINT:
                return V_0280A0_COLOR_16_16;
 
        case PIPE_FORMAT_R11G11B10_FLOAT:
@@ -411,10 +486,13 @@ static uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_0280A0_COLOR_16_16_16_16_FLOAT;
 
        case PIPE_FORMAT_R32G32_FLOAT:
+       case PIPE_FORMAT_L32A32_FLOAT:
                return V_0280A0_COLOR_32_32_FLOAT;
 
        case PIPE_FORMAT_R32G32_SINT:
        case PIPE_FORMAT_R32G32_UINT:
+       case PIPE_FORMAT_L32A32_UINT:
+       case PIPE_FORMAT_L32A32_SINT:
                return V_0280A0_COLOR_32_32;
 
        /* 96-bit buffers. */