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>
This commit is contained in:
Erik Faye-Lund
2020-09-22 12:18:30 +02:00
committed by Marge Bot
parent 005d9d2219
commit 9e13a16c97
+1
View File
@@ -344,6 +344,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