mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
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.
This commit is contained in:
parent
dcfe0d66bf
commit
afc981ee46
3 changed files with 13 additions and 3 deletions
1
src/mesa/drivers/dri/i965/intel_pixel_read.c
Symbolic link
1
src/mesa/drivers/dri/i965/intel_pixel_read.c
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../intel/intel_pixel_read.c
|
||||||
|
|
@ -424,10 +424,8 @@ intelInitPixelFuncs(struct dd_function_table *functions)
|
||||||
functions->Bitmap = intelBitmap;
|
functions->Bitmap = intelBitmap;
|
||||||
functions->CopyPixels = intelCopyPixels;
|
functions->CopyPixels = intelCopyPixels;
|
||||||
functions->DrawPixels = intelDrawPixels;
|
functions->DrawPixels = intelDrawPixels;
|
||||||
#ifdef I915
|
|
||||||
functions->ReadPixels = intelReadPixels;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
functions->ReadPixels = intelReadPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,7 @@ intelReadPixels(GLcontext * ctx,
|
||||||
|
|
||||||
intelFlush(ctx);
|
intelFlush(ctx);
|
||||||
|
|
||||||
|
#ifdef I915
|
||||||
if (do_blit_readpixels
|
if (do_blit_readpixels
|
||||||
(ctx, x, y, width, height, format, type, pack, pixels))
|
(ctx, x, y, width, height, format, type, pack, pixels))
|
||||||
return;
|
return;
|
||||||
|
|
@ -298,9 +299,19 @@ intelReadPixels(GLcontext * ctx,
|
||||||
if (do_texture_readpixels
|
if (do_texture_readpixels
|
||||||
(ctx, x, y, width, height, format, type, pack, pixels))
|
(ctx, x, y, width, height, format, type, pack, pixels))
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (INTEL_DEBUG & DEBUG_PIXEL)
|
if (INTEL_DEBUG & DEBUG_PIXEL)
|
||||||
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
|
_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);
|
_swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue