r300-gallium: Allow surface_fill to clear depth/stencil buffers too.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 30 Mar 2009 23:51:01 +0000 (16:51 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 30 Mar 2009 23:51:01 +0000 (16:51 -0700)
src/gallium/drivers/r300/r300_state_inlines.h
src/gallium/drivers/r300/r300_surface.c

index b80ff1c1abab5cd8039cfb11d60211b9202e7195..91b93fc367eda2089431a89a9b964fe3e552b75b 100644 (file)
@@ -292,6 +292,7 @@ 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_Z24S8_UNORM:
             return R300_COLOR_FORMAT_ARGB8888;
         /* XXX Not in pipe_format
         case PIPE_FORMAT_A32R32G32B32:
@@ -337,6 +338,7 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
 {
     switch (format) {
         case PIPE_FORMAT_A8R8G8B8_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;
index 6ecc708e000dfe381c98d837a8008af4e751fe62..7e6036868a93c91ee19c60b3bd5f81c8297fb3fa 100644 (file)
@@ -97,7 +97,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
         dest, x, y, w, h, pixpitch, color);
 
     /* Fallback? */
-    if (tex->tex.format != PIPE_FORMAT_A8R8G8B8_UNORM) {
+    if (FALSE) {
         debug_printf("r300: Falling back on surface clear...");
         util_surface_fill(pipe, dest, x, y, w, h, color);
         return;