intel: Merge check_blit_fragment_ops between i915/i965.
authorEric Anholt <eric@anholt.net>
Tue, 24 Jun 2008 18:34:42 +0000 (11:34 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 24 Jun 2008 18:34:42 +0000 (11:34 -0700)
Both had some useful bits for the other.

src/mesa/drivers/dri/i965/Makefile
src/mesa/drivers/dri/i965/intel_pixel.c [new symlink]
src/mesa/drivers/dri/i965/intel_pixel_copy.c
src/mesa/drivers/dri/intel/intel_pixel.c

index d46b3428f595d4c2ea2a5cbc34ba9e275aca11f0..c561b744d1b2b897f11e0e187fec0890d50ef8c3 100644 (file)
@@ -19,6 +19,7 @@ DRIVER_SOURCES = \
        intel_regions.c \
        intel_screen.c \
        intel_span.c \
+       intel_pixel.c \
        intel_pixel_copy.c \
        intel_pixel_bitmap.c \
        intel_state.c \
diff --git a/src/mesa/drivers/dri/i965/intel_pixel.c b/src/mesa/drivers/dri/i965/intel_pixel.c
new file mode 120000 (symlink)
index 0000000..d733c5e
--- /dev/null
@@ -0,0 +1 @@
+../intel/intel_pixel.c
\ No newline at end of file
index 2f9c621dae72e3eb1e4013d5861c6a4b89ef57f0..5725dff3ef49179dd6125082d50e5bc8fd04a3b0 100644 (file)
@@ -70,34 +70,6 @@ copypix_src_region(struct intel_context *intel, GLenum type)
    return NULL;
 }
 
-
-
-
-/**
- * Check if any fragment operations are in effect which might effect
- * glDraw/CopyPixels.
- */
-GLboolean
-intel_check_blit_fragment_ops(GLcontext * ctx)
-{
-   if (ctx->NewState)
-      _mesa_update_state(ctx);
-
-   return !(ctx->_ImageTransferState ||
-           ctx->RenderMode != GL_RENDER ||
-            ctx->Color.AlphaEnabled ||
-            ctx->Depth.Test ||
-            ctx->Fog.Enabled ||
-            ctx->Stencil.Enabled ||
-            !ctx->Color.ColorMask[0] ||
-            !ctx->Color.ColorMask[1] ||
-            !ctx->Color.ColorMask[2] ||
-            !ctx->Color.ColorMask[3] ||        /* can do this! */
-            ctx->Texture._EnabledUnits ||
-           ctx->FragmentProgram._Enabled ||
-           ctx->Color.BlendEnabled);
-}
-
 /* Doesn't work for overlapping regions.  Could do a double copy or
  * just fallback.
  */
index c0333969d0cde525ade25db19dbe09027bfffc9e..72eb823bc47010385a4a547578ba658433578d65 100644 (file)
@@ -99,6 +99,11 @@ intel_check_blit_fragment_ops(GLcontext * ctx)
       return GL_FALSE;
    }
 
+   if (ctx->RenderMode != GL_RENDER) {
+      DBG("fallback due to render mode\n");
+      return GL_FALSE;
+   }
+
    return GL_TRUE;
 }
 
@@ -157,7 +162,9 @@ intelInitPixelFuncs(struct dd_function_table *functions)
    if (!getenv("INTEL_NO_BLIT")) {
       functions->Bitmap = intelBitmap;
       functions->CopyPixels = intelCopyPixels;
+#ifdef I915
       functions->ReadPixels = intelReadPixels;
       functions->DrawPixels = intelDrawPixels;
+#endif
    }
 }