[Mesa-dev] [PATCH 5/6] mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()

Kenneth Graunke kenneth at whitecape.org
Tue Dec 18 11:35:08 PST 2012


On 12/12/2012 03:25 PM, Anuj Phogat wrote:
> This allows query on default framebuffer in glGetFramebufferAttachmentParameteriv()
> for gles3. Fixes unexpected GL errors in gles3 conformance test case:
> framebuffer_blit_functionality_multisampled_to_singlesampled_blit
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>   src/mesa/main/fbobject.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 9e32836..d87239e 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -250,6 +250,7 @@ _mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
>         return &fb->Attachment[BUFFER_FRONT_LEFT];
>      case GL_FRONT_RIGHT:
>         return &fb->Attachment[BUFFER_FRONT_RIGHT];
> +   case GL_BACK:
>      case GL_BACK_LEFT:
>         return &fb->Attachment[BUFFER_BACK_LEFT];
>      case GL_BACK_RIGHT:
> @@ -2369,7 +2370,8 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
>          * OES_framebuffer_object spec refers to the EXT_framebuffer_object
>          * spec.
>          */
> -      if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_framebuffer_object) {
> +      if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_framebuffer_object)
> +          && !_mesa_is_gles3(ctx)) {
>   	 _mesa_error(ctx, GL_INVALID_OPERATION,
>   		     "glGetFramebufferAttachmentParameteriv(bound FBO = 0)");
>   	 return;

This makes glGetFramebufferAttachmentParameteriv() accept GL_BACK on 
desktop GL (which is not allowed) and also allows ES 3 to accept the 
GL_*_LEFT/RIGHT targets (which are also not allowed).


More information about the mesa-dev mailing list