intel: Pack colors for blit at blit time, rather than at ClearColor.
authorEric Anholt <eric@anholt.net>
Wed, 18 Nov 2009 11:32:35 +0000 (03:32 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 19 Nov 2009 10:47:21 +0000 (11:47 +0100)
src/mesa/drivers/dri/intel/intel_blit.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_state.c

index 817223da41d63af1acada031caba8f25d1d8ef40..f14854602b677b0b2bb3abab2aada0370a7b1637 100644 (file)
@@ -499,10 +499,11 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
                  switch (irb->texformat) {
                  case MESA_FORMAT_ARGB8888:
                  case MESA_FORMAT_XRGB8888:
-                    clearVal = intel->ClearColor8888;
+                    clearVal = PACK_COLOR_8888(clear[3], clear[0],
+                                               clear[1], clear[2]);
                     break;
                  case MESA_FORMAT_RGB565:
-                    clearVal = intel->ClearColor565;
+                    clearVal = PACK_COLOR_565(clear[0], clear[1], clear[2]);
                     break;
                  case MESA_FORMAT_ARGB4444:
                     clearVal = PACK_COLOR_4444(clear[3], clear[0],
index 81beff4819d6b54277945b586de70ce3e2aa96fa..2d352090a5a06f229ba5471e7e76b26e3f208480 100644 (file)
@@ -209,10 +209,6 @@ struct intel_context
    char *prevLockFile;
    int prevLockLine;
 
-   GLuint ClearColor565;
-   GLuint ClearColor8888;
-
-
    /* Offsets of fields within the current vertex:
     */
    GLuint coloroffset;
index 4ee742377d696e563756afcb3c3ebd2f746123b4..aefae53eb20750fe965b6ceed8db290189726347 100644 (file)
@@ -196,25 +196,6 @@ intel_translate_logic_op(GLenum opcode)
    }
 }
 
-
-static void
-intelClearColor(GLcontext *ctx, const GLfloat color[4])
-{
-   struct intel_context *intel = intel_context(ctx);
-   GLubyte clear[4];
-
-   CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]);
-   CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]);
-   CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]);
-   CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]);
-
-   /* compute both 32 and 16-bit clear values */
-   intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1],
-                                               clear[2], clear[3]);
-   intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]);
-}
-
-
 /* Fallback to swrast for select and feedback.
  */
 static void
@@ -229,5 +210,4 @@ void
 intelInitStateFuncs(struct dd_function_table *functions)
 {
    functions->RenderMode = intelRenderMode;
-   functions->ClearColor = intelClearColor;
 }