summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-03-03 10:13:46 -0800
committerEric Anholt <[email protected]>2014-03-11 12:46:59 -0700
commit66073ef438623f27dbbd01ba25189e5d4f0d9ae0 (patch)
tree6fc624c9a6dbf425c7382d1da176943997c92d29 /src
parente1a9a54464c31f7b3b69d686d82f425dffb65f40 (diff)
intel: When checking for updating front buffer reading, use the right fb.
It's the ctx->ReadBuffer that gets read from, not the ctx->DrawBuffer. So, if you happened to have a ctx->ReadBuffer that was the winsys buffer, and it had previously been intel_prepare_render()ed but not invalidated since then, and you called glReadBuffer() to switch to front buffer instead of back buffer reading on the winsys fbo while your drawbuffer was a user FBO, you'd never get the front buffer's miptree fetched, and segfault. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/intel_buffers.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_buffers.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_buffers.c b/src/mesa/drivers/dri/i915/intel_buffers.c
index cf4ba4b0bc5..51eaea43a50 100644
--- a/src/mesa/drivers/dri/i915/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915/intel_buffers.c
@@ -78,7 +78,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
static void
intelReadBuffer(struct gl_context * ctx, GLenum mode)
{
- if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ if (ctx->ReadBuffer && _mesa_is_winsys_fbo(ctx->ReadBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_reading =
intel->is_front_buffer_reading;
diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c
index 9e3b585e903..1ece875d54c 100644
--- a/src/mesa/drivers/dri/i965/intel_buffers.c
+++ b/src/mesa/drivers/dri/i965/intel_buffers.c
@@ -76,7 +76,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
static void
intelReadBuffer(struct gl_context * ctx, GLenum mode)
{
- if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ if (ctx->ReadBuffer && _mesa_is_winsys_fbo(ctx->ReadBuffer)) {
struct brw_context *const brw = brw_context(ctx);
const bool was_front_buffer_reading = brw->is_front_buffer_reading;