Module: Mesa
Branch: master
Commit: dc92b2d11fb939cf2a0ef330559d49304086c10a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc92b2d11fb939cf2a0ef330559d49304086c10a

Author: Paul Berry <stereotype...@gmail.com>
Date:   Mon Jan 28 11:13:07 2013 -0800

intel/pre-gen6: Disable EXT_framebuffer_multisample.

Previously, the i965 driver enabled EXT_framebuffer_multisample even
on pre-gen6 chipsets.  However, since we don't support multisampling
on these chips, we set GL_MAX_SAMPLES=1 (the minimum allowed by
EXT_framebuffer_multisample), and if the client ever requested a
multisample buffer, we quietly supplied them with a single-sampled
buffer instead.

After some discussion on the mailing list (see thread
"ext_framebuffer_multisample: check for num_samples<=1"), it's clear
that this was the wrong approach.  The correct approach is to only
expose EXT_framebuffer_multisample when we truly support
multisampling; that frees us to set a sensible value of
GL_MAX_SAMPLES=0 on other chipsets, so that we never have to deal with
a client requesting a multisample buffer when multisampling isn't
supported.

This change causes the following piglit tests to be skipped on
chipsets prior to Gen6:

- "ARB_framebuffer_sRGB/blit {renderbuffer,texture}
  {linear,linear_to_srgb,srgb,srgb_to_linear}
  {downsample,msaa,upsample} {disabled,enabled}"
- EXT_framebuffer_multisample/blit-mismatched-formats
- EXT_framebuffer_multisample/blit-mismatched-sizes
- EXT_framebuffer_multisample/dlist
- EXT_framebuffer_multisample/interpolation 0 *
- EXT_framebuffer_multisample/minmax
- EXT_framebuffer_multisample/negative-copypixels
- EXT_framebuffer_multisample/negative-copyteximage
- EXT_framebuffer_multisample/negative-max-samples
- EXT_framebuffer_multisample/negative-mismatched-samples
- EXT_framebuffer_multisample/negative-readpixels
- EXT_framebuffer_multisample/renderbuffer-samples
- EXT_framebuffer_multisample/renderbufferstorage-samples
- EXT_framebuffer_multisample/samples

This is expected, since the above tests exercise MSAA functionality,
and shouldn't be run on systems prior to Gen6.

Reviewed-by: Eric Anholt <e...@anholt.net>

---

 src/mesa/drivers/dri/intel/intel_context.c    |    2 --
 src/mesa/drivers/dri/intel/intel_extensions.c |    2 +-
 src/mesa/drivers/dri/intel/intel_fbo.c        |   10 +---------
 3 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 3946033..9bb7156 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -733,8 +733,6 @@ intelInitContext(struct intel_context *intel,
    ctx->Const.MaxPointSizeAA = 3.0;
    ctx->Const.PointSizeGranularity = 1.0;
 
-   ctx->Const.MaxSamples = 1;
-
    if (intel->gen >= 6)
       ctx->Const.MaxClipPlanes = 8;
 
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c 
b/src/mesa/drivers/dri/intel/intel_extensions.c
index 6b5f678..ee4f0ae 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -67,7 +67,6 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.EXT_blend_minmax = true;
    ctx->Extensions.EXT_framebuffer_blit = true;
    ctx->Extensions.EXT_framebuffer_object = true;
-   ctx->Extensions.EXT_framebuffer_multisample = true;
    ctx->Extensions.EXT_fog_coord = true;
    ctx->Extensions.EXT_gpu_program_parameters = true;
    ctx->Extensions.EXT_packed_depth_stencil = true;
@@ -100,6 +99,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.EXT_transform_feedback = true;
 
    if (intel->gen >= 6) {
+      ctx->Extensions.EXT_framebuffer_multisample = true;
       ctx->Extensions.ARB_blend_func_extended = 
!driQueryOptionb(&intel->optionCache, "disable_blend_func_extended");
       ctx->Extensions.ARB_draw_buffers_blend = true;
       ctx->Extensions.ARB_ES3_compatibility = true;
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index 37ecbd1..9a9bb9f 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -202,15 +202,7 @@ intel_quantize_num_samples(struct intel_screen *intel, 
unsigned num_samples)
          return 0;
       return 0;
    default:
-      /* 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;
+      /* MSAA unsupported. */
       return 0;
    }
 }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to