[Mesa-dev] [PATCH 1/3] mesa: Implement ext_framebuffer_multisample_blit_scaled extension

Brian Paul brianp at vmware.com
Wed May 1 15:40:32 PDT 2013


On 05/01/2013 03:10 PM, Anuj Phogat wrote:
> Signed-off-by: Anuj Phogat<anuj.phogat at gmail.com>
> ---
>   src/mesa/main/extensions.c |  1 +
>   src/mesa/main/fbobject.c   | 17 ++++++++++++++---
>   src/mesa/main/mtypes.h     |  1 +
>   3 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index d8c5f53..15c9026 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -183,6 +183,7 @@ static const struct extension extension_table[] = {
>      { "GL_EXT_fog_coord",                           o(EXT_fog_coord),                           GLL,            1999 },
>      { "GL_EXT_framebuffer_blit",                    o(EXT_framebuffer_blit),                    GL,             2005 },
>      { "GL_EXT_framebuffer_multisample",             o(EXT_framebuffer_multisample),             GL,             2005 },
> +   { "GL_EXT_framebuffer_multisample_blit_scaled", o(EXT_framebuffer_multisample_blit_scaled), GL,             2011 },
>      { "GL_EXT_framebuffer_object",                  o(EXT_framebuffer_object),                  GL,             2000 },
>      { "GL_EXT_framebuffer_sRGB",                    o(EXT_framebuffer_sRGB),                    GL,             1998 },
>      { "GL_EXT_gpu_program_parameters",              o(EXT_gpu_program_parameters),              GLL,            2006 },
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 645a8a3..f5696b1 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2940,8 +2940,18 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
>         return;
>      }
>
> -   if (filter != GL_NEAREST&&  filter != GL_LINEAR) {
> -      _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)");
> +   if (filter != GL_NEAREST&&  filter != GL_LINEAR&&
> +       ((filter != GL_SCALED_RESOLVE_FASTEST_EXT&&
> +         filter != GL_SCALED_RESOLVE_NICEST_EXT) ||
> +        !ctx->Extensions.EXT_framebuffer_multisample_blit_scaled)) {
> +         _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)");

As long as you're there, how about improving the error message to call 
_mesa_lookup_enum_by_nr() to include the offending filter mode?

And below.

> +         return;
> +   }
> +
> +   if ((filter == GL_SCALED_RESOLVE_FASTEST_EXT ||
> +        filter == GL_SCALED_RESOLVE_NICEST_EXT)&&
> +        (readFb->Visual.samples == 0 || drawFb->Visual.samples>  0)) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(filter)");
>         return;
>      }
>
> @@ -3174,7 +3184,8 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
>         }
>
>         /* extra checks for multisample copies... */
> -      if (readFb->Visual.samples>  0 || drawFb->Visual.samples>  0) {
> +      if ((readFb->Visual.samples>  0 || drawFb->Visual.samples>  0)&&
> +          (filter == GL_NEAREST || filter == GL_LINEAR)) {
>            /* src and dest region sizes must be the same */
>            if (abs(srcX1 - srcX0) != abs(dstX1 - dstX0) ||
>                abs(srcY1 - srcY0) != abs(dstY1 - dstY0)) {
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 139c6af..9ec0c7d 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3020,6 +3020,7 @@ struct gl_extensions
>      GLboolean EXT_fog_coord;
>      GLboolean EXT_framebuffer_blit;
>      GLboolean EXT_framebuffer_multisample;
> +   GLboolean EXT_framebuffer_multisample_blit_scaled;
>      GLboolean EXT_framebuffer_object;
>      GLboolean EXT_framebuffer_sRGB;
>      GLboolean EXT_gpu_program_parameters;

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list