r600g: add some RG texture format support.
authorDave Airlie <airlied@redhat.com>
Thu, 7 Oct 2010 23:35:17 +0000 (09:35 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Oct 2010 23:37:02 +0000 (09:37 +1000)
src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_state_inlines.h

index d7a880f5d3a6e4cdcc780ac8bf60eb0b5cff1877..5a4e00aac38c29908c11a361d902e1877f5b9f04 100644 (file)
@@ -309,6 +309,12 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
 
        case PIPE_FORMAT_Z16_UNORM:
                return V_028C70_SWAP_STD;
+
+       case PIPE_FORMAT_R8G8_UNORM:
+               return V_028C70_SWAP_STD;
+
+       case PIPE_FORMAT_R16_UNORM:
+               return V_028C70_SWAP_STD;
                /* 32-bit buffers. */
 
        case PIPE_FORMAT_A8B8G8R8_SRGB:
@@ -346,6 +352,9 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
        case PIPE_FORMAT_R10SG10SB10SA2U_NORM:
                return V_028C70_SWAP_STD_REV;
 
+       case PIPE_FORMAT_R16G16_UNORM:
+               return V_028C70_SWAP_STD;
+
                /* 64-bit buffers. */
        case PIPE_FORMAT_R16G16B16A16_UNORM:
        case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -390,6 +399,12 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_Z16_UNORM:
                return V_028C70_COLOR_16;
 
+       case PIPE_FORMAT_R8G8_UNORM:
+               return V_028C70_COLOR_8_8;
+
+       case PIPE_FORMAT_R16_UNORM:
+               return V_028C70_COLOR_16;
+
                /* 32-bit buffers. */
        case PIPE_FORMAT_A8B8G8R8_SRGB:
        case PIPE_FORMAT_A8B8G8R8_UNORM:
@@ -427,6 +442,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_028C70_COLOR_16_16_FLOAT;
 
        case PIPE_FORMAT_R16G16_SSCALED:
+       case PIPE_FORMAT_R16G16_UNORM:
                return V_028C70_COLOR_16_16;
 
                /* 64-bit buffers. */
index 81f285027e6a2fbf8c6e3be4b995419bc270ef78..29a29d87cd325c734058d23bcf87ec7511500261 100644 (file)
@@ -303,6 +303,10 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
                return V_0280A0_SWAP_STD;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_R8G8_UNORM:
+               return V_0280A0_SWAP_STD;
+
+       case PIPE_FORMAT_R16_UNORM:
                return V_0280A0_SWAP_STD;
 
                /* 32-bit buffers. */
@@ -342,6 +346,9 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
        case PIPE_FORMAT_R10SG10SB10SA2U_NORM:
                return V_0280A0_SWAP_STD_REV;
 
+       case PIPE_FORMAT_R16G16_UNORM:
+               return V_0280A0_SWAP_STD;
+
                /* 64-bit buffers. */
        case PIPE_FORMAT_R16G16B16A16_UNORM:
        case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -387,8 +394,12 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_0280A0_COLOR_16;
 
        case PIPE_FORMAT_L8A8_UNORM:
+       case PIPE_FORMAT_R8G8_UNORM:
                return V_0280A0_COLOR_8_8;
 
+       case PIPE_FORMAT_R16_UNORM:
+               return V_0280A0_COLOR_16;
+
                /* 32-bit buffers. */
        case PIPE_FORMAT_A8B8G8R8_SRGB:
        case PIPE_FORMAT_A8B8G8R8_UNORM:
@@ -426,6 +437,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
                return V_0280A0_COLOR_16_16_FLOAT;
 
        case PIPE_FORMAT_R16G16_SSCALED:
+       case PIPE_FORMAT_R16G16_UNORM:
                return V_0280A0_COLOR_16_16;