diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2016-06-30 15:20:34 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2016-07-07 11:02:35 -0700 |
commit | 2e6d35809bf4ef60af62f9c84d394e97d5bbe2a7 (patch) | |
tree | 87b7d5e0f658370aa9466ed7323b1c77e46885b8 /src/mesa/main/clear.c | |
parent | f35f8464ecf35de769629d316db620472a92f995 (diff) | |
download | external_mesa3d-2e6d35809bf4ef60af62f9c84d394e97d5bbe2a7.zip external_mesa3d-2e6d35809bf4ef60af62f9c84d394e97d5bbe2a7.tar.gz external_mesa3d-2e6d35809bf4ef60af62f9c84d394e97d5bbe2a7.tar.bz2 |
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 <marcheu@chromium.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r-- | src/mesa/main/clear.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index 35b912c..a1bb36e 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -267,6 +267,14 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer) mask |= BUFFER_BIT_FRONT_RIGHT; break; case GL_BACK: + /* For GLES contexts with a single buffered configuration, we actually + * only have a front renderbuffer, so any clear calls to GL_BACK should + * affect that buffer. See draw_buffer_enum_to_bitmask for details. + */ + if (_mesa_is_gles(ctx)) + if (!ctx->DrawBuffer->Visual.doubleBufferMode) + if (att[BUFFER_FRONT_LEFT].Renderbuffer) + mask |= BUFFER_BIT_FRONT_LEFT; if (att[BUFFER_BACK_LEFT].Renderbuffer) mask |= BUFFER_BIT_BACK_LEFT; if (att[BUFFER_BACK_RIGHT].Renderbuffer) |