mesa: handle GL_FRONT after translating to it

Without this, we end up throwing errors on code along these lines when
rendering using single-buffering:

GLint att;
glGetIntegerv(GL_READ_BUFFER, &att);
glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, att, ...);

This is because we internally translate GL_BACK (which is what
glGetIntegerv returned) to GL_FRONT, which we don't handle in the
Desktop GL case. So let's start handling it.

This fixes the GLTF-GL33.gtf21.GL2FixedTests.buffer_color.blend_color
test for me.

Fixes: e6ca6e587e ("mesa: Handle pbuffers in desktop GL framebuffer attachment queries")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6815>
(cherry picked from commit 9e13a16c97)
This commit is contained in:
Erik Faye-Lund 2020-09-22 12:18:30 +02:00 committed by Eric Engestrom
parent 7590165899
commit 53356f8972
2 changed files with 2 additions and 1 deletions

View file

@ -940,7 +940,7 @@
"description": "mesa: handle GL_FRONT after translating to it",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "e6ca6e587e7f88d6b06c0a5c966438beac6cb18e"
},

View file

@ -343,6 +343,7 @@ get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
}
switch (attachment) {
case GL_FRONT:
case GL_FRONT_LEFT:
/* Front buffers can be allocated on the first use, but
* glGetFramebufferAttachmentParameteriv must work even if that