aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-10-26 11:44:09 -0700
committerKenneth Graunke <[email protected]>2017-10-27 10:19:07 -0700
commit4f538c3f99b25dc96cd20314ce7785fd4d333be1 (patch)
treef5c9dff59cca0002f77b8f353c4827d64852c00f
parent7a718667f354935dc8470380f37ccea1477632d0 (diff)
mesa: Accept GL_BACK in get_fb0_attachment with ARB_ES3_1_compatibility.
According to the ARB_ES3_1_compatibility specification, glGetFramebufferAttachmentParameteriv is supposed to accept BACK, and it behaves exactly like BACK_LEFT. Fixes a GL error in GFXBench 5 Aztec Ruins. Cc: "17.3 17.2" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
-rw-r--r--src/mesa/main/fbobject.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 71e91f9301f..9a2c7ebbcf7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -330,6 +330,15 @@ get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
return &fb->Attachment[BUFFER_BACK_LEFT];
case GL_BACK_RIGHT:
return &fb->Attachment[BUFFER_BACK_RIGHT];
+ case GL_BACK:
+ /* The ARB_ES3_1_compatibility spec says:
+ *
+ * "Since this command can only query a single framebuffer
+ * attachment, BACK is equivalent to BACK_LEFT."
+ */
+ if (ctx->Extensions.ARB_ES3_1_compatibility)
+ return &fb->Attachment[BUFFER_BACK_LEFT];
+ return NULL;
case GL_AUX0:
if (fb->Visual.numAuxBuffers == 1) {
return &fb->Attachment[BUFFER_AUX0];