r600g: add L8A8 SRGB formats.
authorDave Airlie <airlied@redhat.com>
Wed, 16 Feb 2011 06:09:43 +0000 (16:09 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Feb 2011 06:09:43 +0000 (16:09 +1000)
this fixes the piglit mipmap generation sRGB on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_state_inlines.h
src/gallium/drivers/r600/r600_texture.c

index 3bf0970353f9950e8ea8cc716f41d03b7b4aebf5..f48b8a95d6f1f70c7a60a09aca0f03ee864ec449 100644 (file)
@@ -296,6 +296,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_028C70_SWAP_ALT_REV;
        case PIPE_FORMAT_I8_UNORM:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SRGB:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
                return V_028C70_SWAP_STD;
@@ -316,6 +317,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_028C70_SWAP_STD;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SRGB:
                return V_028C70_SWAP_ALT;
        case PIPE_FORMAT_R8G8_UNORM:
                return V_028C70_SWAP_STD;
@@ -391,6 +393,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_A8_UNORM:
        case PIPE_FORMAT_I8_UNORM:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SRGB:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
                return V_028C70_COLOR_8;
@@ -411,6 +414,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_028C70_COLOR_16;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SRGB:
        case PIPE_FORMAT_R8G8_UNORM:
                return V_028C70_COLOR_8_8;
 
index 8cae4f4dcf61807d206fbc89cdd92bb13e2bc064..f980610f463e3bdb55d6150550bfdc555fdecaff 100644 (file)
@@ -285,6 +285,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_0280A0_SWAP_ALT_REV;
        case PIPE_FORMAT_I8_UNORM:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SRGB:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
                return V_0280A0_SWAP_STD;
@@ -308,6 +309,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_0280A0_SWAP_STD;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SRGB:
                return V_0280A0_SWAP_ALT;
        case PIPE_FORMAT_R8G8_UNORM:
                return V_0280A0_SWAP_STD;
@@ -384,6 +386,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_A8_UNORM:
        case PIPE_FORMAT_I8_UNORM:
        case PIPE_FORMAT_L8_UNORM:
+       case PIPE_FORMAT_L8_SRGB:
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8_SNORM:
                return V_0280A0_COLOR_8;
@@ -404,6 +407,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_0280A0_COLOR_16;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_L8A8_SRGB:
        case PIPE_FORMAT_R8G8_UNORM:
                return V_0280A0_COLOR_8_8;
 
index 86de005031b7ce52b0e18480a2948b1d86dea547..cc36d94cd7ac95ace7dda55839004df5aaef7f35 100644 (file)
@@ -859,8 +859,6 @@ uint32_t r600_translate_texformat(enum pipe_format format,
 
        case UTIL_FORMAT_COLORSPACE_SRGB:
                word4 |= S_038010_FORCE_DEGAMMA(1);
-               if (format == PIPE_FORMAT_L8A8_SRGB || format == PIPE_FORMAT_L8_SRGB)
-                       goto out_unknown; /* fails for some reason - TODO */
                break;
 
        default: