r300g: xRGB and RGBx formats.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 1 Oct 2009 02:44:38 +0000 (19:44 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 4 Oct 2009 16:30:30 +0000 (09:30 -0700)
We now have 48 GLX visuals. Pretty soon, we'll have 90+ visuals,
only five of which ever get tested. :3

src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state_inlines.h
src/gallium/drivers/r300/r300_texture.h

index f2659ca61f718e1a1d959c767d0eb430d7875af8..81d01b1320ca6ec6323f01d7b7532e7989c04b6d 100644 (file)
@@ -205,7 +205,9 @@ static boolean check_tex_2d_format(enum pipe_format format, uint32_t usage,
 
         /* Colorbuffer or texture */
         case PIPE_FORMAT_A8R8G8B8_UNORM:
+        case PIPE_FORMAT_X8R8G8B8_UNORM:
         case PIPE_FORMAT_R8G8B8A8_UNORM:
+        case PIPE_FORMAT_R8G8B8X8_UNORM:
         case PIPE_FORMAT_I8_UNORM:
             return usage &
                 (PIPE_TEXTURE_USAGE_RENDER_TARGET |
index 91b93fc367eda2089431a89a9b964fe3e552b75b..88eb66b79e768c314e903bc1aabda3f7411f86e7 100644 (file)
@@ -292,6 +292,9 @@ static INLINE uint32_t r300_translate_colorformat(enum pipe_format format)
             return R300_COLOR_FORMAT_ARGB4444;
         /* 32-bit buffers */
         case PIPE_FORMAT_A8R8G8B8_UNORM:
+        case PIPE_FORMAT_X8R8G8B8_UNORM:
+        case PIPE_FORMAT_R8G8B8A8_UNORM:
+        case PIPE_FORMAT_R8G8B8X8_UNORM:
         case PIPE_FORMAT_Z24S8_UNORM:
             return R300_COLOR_FORMAT_ARGB8888;
         /* XXX Not in pipe_format
@@ -338,10 +341,16 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
 {
     switch (format) {
         case PIPE_FORMAT_A8R8G8B8_UNORM:
+        case PIPE_FORMAT_X8R8G8B8_UNORM:
         case PIPE_FORMAT_Z24S8_UNORM:
             return R300_US_OUT_FMT_C4_8 |
                 R300_C0_SEL_B | R300_C1_SEL_G |
                 R300_C2_SEL_R | R300_C3_SEL_A;
+        case PIPE_FORMAT_R8G8B8A8_UNORM:
+        case PIPE_FORMAT_R8G8B8X8_UNORM:
+            return R300_US_OUT_FMT_C4_8 |
+                R300_C0_SEL_A | R300_C1_SEL_B |
+                R300_C2_SEL_G | R300_C3_SEL_R;
         default:
             debug_printf("r300: Implementation error: "
                 "Got unsupported output format %s in %s\n",
index 78ee0f1611af0e5e0fdf9a2055e67e4663a10690..bd87790bc34f76238fe5ba7b4eb934ee89a55e1a 100644 (file)
@@ -48,6 +48,10 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
             return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
         case PIPE_FORMAT_R8G8B8A8_UNORM:
             return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8);
+        case PIPE_FORMAT_X8R8G8B8_UNORM:
+            return R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8);
+        case PIPE_FORMAT_R8G8B8X8_UNORM:
+            return R300_EASY_TX_FORMAT(Y, Z, ONE, X, W8Z8Y8X8);
         case PIPE_FORMAT_A8R8G8B8_SRGB:
             return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8) |
                 R300_TX_FORMAT_GAMMA;