r300g: add support for L8A8 colorbuffers
authorMarek Olšák <maraeo@gmail.com>
Sat, 2 Oct 2010 21:13:12 +0000 (23:13 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 2 Oct 2010 21:19:38 +0000 (23:19 +0200)
Blending with DST_ALPHA is undefined. SRC_ALPHA works, though.
I bet some other formats have similar limitations too.

src/gallium/drivers/r300/r300_texture.c

index a084bdff11c342872c3f400002f2ca2e9bb1f1ad..cee56bccdcd24de47230929cfc413e1b264c84e2 100644 (file)
@@ -369,6 +369,7 @@ static uint32_t r300_translate_colorformat(enum pipe_format format)
             return R300_COLOR_FORMAT_I8;
 
         /* 16-bit buffers. */
+        case PIPE_FORMAT_L8A8_UNORM:
         case PIPE_FORMAT_R8G8_UNORM:
         case PIPE_FORMAT_R8G8_SNORM:
             return R300_COLOR_FORMAT_UV88;
@@ -504,6 +505,8 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
 
         /* 16-bit outputs, two channels.
          * COLORFORMAT_UV88 stores C2 and C0. */
+        case PIPE_FORMAT_L8A8_UNORM:
+            return modifier | R300_C0_SEL_A | R300_C2_SEL_R;
         case PIPE_FORMAT_R8G8_UNORM:
         case PIPE_FORMAT_R8G8_SNORM:
             return modifier | R300_C0_SEL_G | R300_C2_SEL_R;