[Mesa-dev] [PATCH 2/2] i965/msaa: Allow GL_SAMPLES to be set to 1 prior to Gen6.

Jordan Justen jljusten at gmail.com
Fri Jul 27 16:51:20 PDT 2012


For series:
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On Fri, Jul 27, 2012 at 10:35 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> This patch allows GL_SAMPLES to be set to either 0 or 1 on i965
> platforms that don't support MSAA (those prior to Gen6).  Setting
> GL_SAMPLES=1 has the same effect as setting it to 0 on these platforms
> (because MSAA is unsupported), but is distinguishable via the GL API.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50165
> ---
>  src/mesa/drivers/dri/intel/intel_fbo.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
> index a53985b..613287f 100644
> --- a/src/mesa/drivers/dri/intel/intel_fbo.c
> +++ b/src/mesa/drivers/dri/intel/intel_fbo.c
> @@ -202,7 +202,15 @@ quantize_num_samples(struct intel_context *intel, unsigned num_samples)
>           return 0;
>        return 0;
>     default:
> -      /* MSAA unsupported */
> +      /* MSAA unsupported.  However, a careful reading of
> +       * EXT_framebuffer_multisample reveals that we need to permit
> +       * num_samples to be 1 (since num_samples is permitted to be as high as
> +       * GL_MAX_SAMPLES, and GL_MAX_SAMPLES must be at least 1).  Since
> +       * platforms before Gen6 don't support MSAA, this is safe, because
> +       * multisampling won't happen anyhow.
> +       */
> +      if (num_samples > 0)
> +         return 1;
>        return 0;
>     }
>  }
> --
> 1.7.7.6
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list