r300g: add L8_SRGB and A8L8_SRGB texture formats
authorMarek Olšák <maraeo@gmail.com>
Fri, 5 Feb 2010 04:01:14 +0000 (05:01 +0100)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 7 Feb 2010 07:25:29 +0000 (23:25 -0800)
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_texture.h

index 18eecf7c135828825894eb4f0186245611f4f3ec..2e04e31376752b27dd98ffe9c52dce7628de9aed 100644 (file)
@@ -236,6 +236,8 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
         case PIPE_FORMAT_DXT3_RGBA:
         case PIPE_FORMAT_DXT5_RGBA:
         case PIPE_FORMAT_YCBCR:
+        case PIPE_FORMAT_L8_SRGB:
+        case PIPE_FORMAT_A8L8_SRGB:
         case PIPE_FORMAT_A8L8_UNORM:
             retval = usage & PIPE_TEXTURE_USAGE_SAMPLER;
             break;
index b37be261337f416eb883a80a32a28829bc7d5b3e..961bdcc5b34c17222c67cf91f6ea1374825bcccf 100644 (file)
@@ -55,6 +55,9 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
             return R300_EASY_TX_FORMAT(X, X, X, X, X8);
         case PIPE_FORMAT_L8_UNORM:
             return R300_EASY_TX_FORMAT(X, X, X, ONE, X8);
+        case PIPE_FORMAT_L8_SRGB:
+            return R300_EASY_TX_FORMAT(X, X, X, ONE, X8) |
+                R300_TX_FORMAT_GAMMA;
         /* X16 */
         case PIPE_FORMAT_R16_UNORM:
         case PIPE_FORMAT_Z16_UNORM:
@@ -65,6 +68,9 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
         /* Y8X8 */
         case PIPE_FORMAT_A8L8_UNORM:
             return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8);
+        case PIPE_FORMAT_A8L8_SRGB:
+            return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8) |
+                R300_TX_FORMAT_GAMMA;
         /* W8Z8Y8X8 */
         case PIPE_FORMAT_A8R8G8B8_UNORM:
             return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);