i915g: Support more texture and render target formats.
[mesa.git] / src / gallium / drivers / i915 / i915_state_static.c
index 44449bec0444f6917fa7daa25bb0536f7e6d3e3d..7116c0a5ca13c583668cf1252aa1f82895a8301b 100644 (file)
@@ -42,6 +42,12 @@ static unsigned translate_format(enum pipe_format format)
       return COLOR_BUF_ARGB8888;
    case PIPE_FORMAT_B5G6R5_UNORM:
       return COLOR_BUF_RGB565;
+   case PIPE_FORMAT_R8G8B8A8_UNORM:
+      return COLOR_BUF_ARGB8888;
+   case PIPE_FORMAT_L8_UNORM:
+   case PIPE_FORMAT_A8_UNORM:
+   case PIPE_FORMAT_I8_UNORM:
+      return COLOR_BUF_8BIT;
    default:
       assert(0);
       return 0;
@@ -131,12 +137,14 @@ static void update_framebuffer(struct i915_context *i915)
       i915->current.draw_offset = draw_offset;
       i915_set_flush_dirty(i915, I915_PIPELINE_FLUSH);
       i915->static_dirty |= I915_DST_RECT;
-   } else if (i915->current.draw_size != draw_size) {
+   }
+   if (i915->current.draw_size != draw_size) {
       i915->current.draw_size = draw_size;
       i915->static_dirty |= I915_DST_RECT;
    }
 
-   i915->hardware_dirty |= I915_HW_STATIC;
+   /* we also send a new program to make sure the fixup for RGBA surfaces happens */
+   i915->hardware_dirty |= I915_HW_STATIC | I915_HW_PROGRAM;
 
    /* flush the cache in case we sample from the old renderbuffers */
    i915_set_flush_dirty(i915, I915_FLUSH_CACHE);