mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
mesa: fix glGetFramebufferAttachmentParameteriv w/ on-demand FRONT_BACK alloc
This fixes 66 CTS tests on st/mesa. Cc: 12.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
1c8d4c694b
commit
d58a3906cb
1 changed files with 14 additions and 2 deletions
|
|
@ -303,9 +303,21 @@ _mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
|
|||
|
||||
switch (attachment) {
|
||||
case GL_FRONT_LEFT:
|
||||
return &fb->Attachment[BUFFER_FRONT_LEFT];
|
||||
/* Front buffers can be allocated on the first use, but
|
||||
* glGetFramebufferAttachmentParameteriv must work even if that
|
||||
* allocation hasn't happened yet. In such case, use the back buffer,
|
||||
* which should be the same.
|
||||
*/
|
||||
if (fb->Attachment[BUFFER_FRONT_LEFT].Type == GL_NONE)
|
||||
return &fb->Attachment[BUFFER_BACK_LEFT];
|
||||
else
|
||||
return &fb->Attachment[BUFFER_FRONT_LEFT];
|
||||
case GL_FRONT_RIGHT:
|
||||
return &fb->Attachment[BUFFER_FRONT_RIGHT];
|
||||
/* Same as above. */
|
||||
if (fb->Attachment[BUFFER_FRONT_RIGHT].Type == GL_NONE)
|
||||
return &fb->Attachment[BUFFER_BACK_RIGHT];
|
||||
else
|
||||
return &fb->Attachment[BUFFER_FRONT_RIGHT];
|
||||
case GL_BACK_LEFT:
|
||||
return &fb->Attachment[BUFFER_BACK_LEFT];
|
||||
case GL_BACK_RIGHT:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue