summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-06-19 22:03:37 -0700
committerEric Anholt <[email protected]>2009-09-04 14:40:15 -0700
commit2855ee82c6d74066e8d9e44b17b2ce3b5782110e (patch)
treea4ae873882dcb90dcf9ede50156d2a5b4f303f68 /src/mesa/drivers/dri/intel
parent04081a164ca6160404d87dccbfc641bfd46428e0 (diff)
intel: Update Mesa state before span setup in glReadPixels.
We could have mapped the wrong set of draw buffers. Noticed while looking into a DRI2 glean ReadPixels issue. (cherry picked from commit afc981ee46791838f3cb83e11eb33938aa3efc83)
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_read.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c
index fc0ac0b79c0..defb80f85d9 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel.c
@@ -342,10 +342,8 @@ intelInitPixelFuncs(struct dd_function_table *functions)
functions->Bitmap = intelBitmap;
functions->CopyPixels = intelCopyPixels;
functions->DrawPixels = intelDrawPixels;
-#ifdef I915
- functions->ReadPixels = intelReadPixels;
-#endif
}
+ functions->ReadPixels = intelReadPixels;
}
void
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index 2c57b470f57..538da28c50e 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -291,6 +291,7 @@ intelReadPixels(GLcontext * ctx,
intelFlush(ctx);
+#ifdef I915
if (do_blit_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
@@ -298,9 +299,19 @@ intelReadPixels(GLcontext * ctx,
if (do_texture_readpixels
(ctx, x, y, width, height, format, type, pack, pixels))
return;
+#endif
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+ /* Update Mesa state before calling down into _swrast_ReadPixels, as
+ * the spans code requires the computed buffer states to be up to date,
+ * but _swrast_ReadPixels only updates Mesa state after setting up
+ * the spans code.
+ */
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
_swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
}