r600g: implement EXT_packed_float
authorMarek Olšák <maraeo@gmail.com>
Wed, 27 Apr 2011 14:30:28 +0000 (16:30 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 29 Apr 2011 09:31:55 +0000 (11:31 +0200)
src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_state_inlines.h
src/gallium/drivers/r600/r600_texture.c

index 586b7cf2d11d6345ca111e04aeb4c0730b358cdb..b780dba3e33d47dd926a4b965ebd1cb4f6e72aca 100644 (file)
@@ -367,6 +367,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
        case PIPE_FORMAT_B10G10R10A2_UNORM:
                return V_028C70_SWAP_ALT;
 
+       case PIPE_FORMAT_R11G11B10_FLOAT:
        case PIPE_FORMAT_R32_FLOAT:
        case PIPE_FORMAT_R16G16_FLOAT:
        case PIPE_FORMAT_R16G16_UNORM:
@@ -468,6 +469,9 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_R16G16_UNORM:
                return V_028C70_COLOR_16_16;
 
+       case PIPE_FORMAT_R11G11B10_FLOAT:
+               return V_028C70_COLOR_10_11_11_FLOAT;
+
                /* 64-bit buffers. */
        case PIPE_FORMAT_R16G16B16_USCALED:
        case PIPE_FORMAT_R16G16B16A16_USCALED:
index 09d07f784076328d03c5b1c64ef0464fce14aa7d..53a649cf8b286896f19e46cc704e95ce0c78f889 100644 (file)
@@ -361,6 +361,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
        case PIPE_FORMAT_B10G10R10A2_UNORM:
                return V_0280A0_SWAP_ALT;
 
+       case PIPE_FORMAT_R11G11B10_FLOAT:
        case PIPE_FORMAT_R16G16_UNORM:
        case PIPE_FORMAT_R16G16_FLOAT:
        case PIPE_FORMAT_R32_FLOAT:
@@ -462,6 +463,8 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_R16G16_UNORM:
                return V_0280A0_COLOR_16_16;
 
+       case PIPE_FORMAT_R11G11B10_FLOAT:
+               return V_0280A0_COLOR_10_11_11_FLOAT;
 
                /* 64-bit buffers. */
        case PIPE_FORMAT_R16G16B16_USCALED:
index b22eb7bbdeb69c8cd272973135c231fe4d49b369..7ffea6961de9b01516aa3c3abae1c8956f48da13 100644 (file)
@@ -933,6 +933,9 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
        if (format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
                result = FMT_5_9_9_9_SHAREDEXP;
                goto out_word4;
+       } else if (format == PIPE_FORMAT_R11G11B10_FLOAT) {
+               result = FMT_10_11_11_FLOAT;
+               goto out_word4;
        }