aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2016-06-30 15:20:34 -0700
committerChad Versace <[email protected]>2016-07-07 11:02:35 -0700
commit2e6d35809bf4ef60af62f9c84d394e97d5bbe2a7 (patch)
tree87b7d5e0f658370aa9466ed7323b1c77e46885b8 /src/mesa/main/context.c
parentf35f8464ecf35de769629d316db620472a92f995 (diff)
mesa: Make single-buffered GLES representation internally consistent
There are a few places in the code where clearing and reading are done on incorrect buffers for GLES contexts. See comments for details. This fixes 75 GLES3 dEQP tests on the surfaceless platform with no regressions. v2: Corrected unclear comment v3: Make the change in context.c instead of get.c v4: Removed whitespace Reviewed-by: Stéphane Marchesin <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index c30031eced9..574c0fb7cec 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1667,6 +1667,16 @@ _mesa_make_current( struct gl_context *newCtx,
}
if (!newCtx->ReadBuffer || _mesa_is_winsys_fbo(newCtx->ReadBuffer)) {
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
+ /* In _mesa_initialize_window_framebuffer, for single-buffered
+ * visuals, the ColorReadBuffer is set to be GL_FRONT, even with
+ * GLES contexts. When calling read_buffer, we verify we are reading
+ * from GL_BACK in is_legal_es3_readbuffer_enum. But the default is
+ * incorrect, and certain dEQP tests check this. So fix it here.
+ */
+ if (_mesa_is_gles(newCtx) &&
+ !newCtx->ReadBuffer->Visual.doubleBufferMode)
+ if (newCtx->ReadBuffer->ColorReadBuffer == GL_FRONT)
+ newCtx->ReadBuffer->ColorReadBuffer = GL_BACK;
}
/* XXX only set this flag if we're really changing the draw/read