r300g: Clean up texture formats.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 6 Oct 2009 22:30:39 +0000 (15:30 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 13 Oct 2009 04:48:07 +0000 (21:48 -0700)
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state_inlines.h
src/gallium/drivers/r300/r300_texture.h

index 81d01b1320ca6ec6323f01d7b7532e7989c04b6d..e8d991586fb8d323b222fafec1514c87b7d67fd4 100644 (file)
@@ -215,10 +215,8 @@ static boolean check_tex_2d_format(enum pipe_format format, uint32_t usage,
                  PIPE_TEXTURE_USAGE_PRIMARY |
                  PIPE_TEXTURE_USAGE_SAMPLER);
 
-        /* Z buffer */
+        /* Z buffer or texture */
         case PIPE_FORMAT_Z16_UNORM:
-            return usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
-
         /* Z buffer with stencil or texture */
         case PIPE_FORMAT_Z24S8_UNORM:
             return usage &
index 88eb66b79e768c314e903bc1aabda3f7411f86e7..d7b57e1b22709893a71e9a787dcbe43cd2c58cd8 100644 (file)
@@ -295,7 +295,6 @@ static INLINE uint32_t r300_translate_colorformat(enum pipe_format format)
         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
         case PIPE_FORMAT_A32R32G32B32:
index e5182d31b42c0ef13725dc331c11891834f836ad..992dad77ab43c7b1bade57e0cdb0041b33104e1d 100644 (file)
@@ -43,6 +43,14 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
         /* X8 */
         case PIPE_FORMAT_I8_UNORM:
             return R300_EASY_TX_FORMAT(X, X, X, X, X8);
+        /* X16 */
+        case PIPE_FORMAT_R16_UNORM:
+            return R300_EASY_TX_FORMAT(X, X, X, X, X16);
+        case PIPE_FORMAT_R16_SNORM:
+            return R300_EASY_TX_FORMAT(X, X, X, X, X16) |
+                R300_TX_FORMAT_SIGNED;
+        case PIPE_FORMAT_Z16_UNORM:
+            return R300_EASY_TX_FORMAT(X, X, X, X, X16);
         /* W8Z8Y8X8 */
         case PIPE_FORMAT_A8R8G8B8_UNORM:
             return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
@@ -76,11 +84,6 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
         /* W24_FP */
         case PIPE_FORMAT_Z24S8_UNORM:
             return R300_EASY_TX_FORMAT(X, X, X, X, W24_FP);
-       /* Z5_Y6_X5 */
-        case PIPE_FORMAT_R16_SNORM:
-            return R300_EASY_TX_FORMAT(X, X, X, X, Z5Y6X5);
-        case PIPE_FORMAT_Z16_UNORM:
-           return R300_EASY_TX_FORMAT(X, X, X, X, X16);
         default:
             debug_printf("r300: Implementation error: "
                 "Got unsupported texture format %s in %s\n",