On 06/27/2013 06:20 PM, Ian Romanick wrote:
From: Ian Romanick <ian.d.roman...@intel.com>

In Mesa, this extension is implemented purely in software.  Drivers may
*optionally* provide optimized paths.  If a driver enables,
GL_ARB_texture_multisample, it gets GL_ARB_texture_storage_multisample
for free.

NOTE: This has the side effect of enabling the extension in Gallium
drivers that enable GL_ARB_texture_multisample.

Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
---
  src/mesa/drivers/dri/i965/intel_extensions.c |  1 -
  src/mesa/main/extensions.c                   |  2 +-
  src/mesa/main/mtypes.h                       |  1 -
  src/mesa/main/texparam.c                     | 10 ++--------
  4 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c 
b/src/mesa/drivers/dri/i965/intel_extensions.c
index 5064018..980fd72 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -146,7 +146,6 @@ intelInitExtensions(struct gl_context *ctx)
        ctx->Extensions.OES_depth_texture_cube_map = true;
        ctx->Extensions.ARB_shading_language_packing = true;
        ctx->Extensions.ARB_texture_multisample = true;
-      ctx->Extensions.ARB_texture_storage_multisample = true;

        /* Test if the kernel has the ioctl. */
        if (drm_intel_reg_read(intel->bufmgr, TIMESTAMP, &dummy) == 0)
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index f914981..3fbdf3f 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -150,7 +150,7 @@ static const struct extension extension_table[] = {
     { "GL_ARB_texture_rgb10_a2ui",                  o(ARB_texture_rgb10_a2ui), 
                 GL,             2009 },
     { "GL_ARB_texture_rg",                          o(ARB_texture_rg),         
                 GL,             2008 },
     { "GL_ARB_texture_storage",                     o(dummy_true),             
                 GL,             2011 },
-   { "GL_ARB_texture_storage_multisample",         
o(ARB_texture_storage_multisample),         GL,             2012 },
+   { "GL_ARB_texture_storage_multisample",         o(ARB_texture_multisample), 
                GL,             2012 },
     { "GL_ARB_texture_swizzle",                     o(EXT_texture_swizzle),    
                 GL,             2008 },
     { "GL_ARB_timer_query",                         o(ARB_timer_query),        
                 GL,             2010 },
     { "GL_ARB_transform_feedback2",                 
o(ARB_transform_feedback2),                 GL,             2010 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a19ecd6..d405ac8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3036,7 +3036,6 @@ struct gl_extensions
     GLboolean ARB_texture_query_lod;
     GLboolean ARB_texture_rg;
     GLboolean ARB_texture_rgb10_a2ui;
-   GLboolean ARB_texture_storage_multisample;
     GLboolean ARB_timer_query;
     GLboolean ARB_transform_feedback2;
     GLboolean ARB_transform_feedback3;
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 8ed8fe0..1b76fba 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -176,15 +176,9 @@ get_texobj(struct gl_context *ctx, GLenum target, 
GLboolean get)
        }
        break;
     case GL_TEXTURE_2D_MULTISAMPLE:
-      if (ctx->Extensions.ARB_texture_storage_multisample) {
-         return texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX];
-      }
-      break;
+      return texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_INDEX];
     case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
-      if (ctx->Extensions.ARB_texture_storage_multisample) {
-         return texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX];
-      }
-      break;
+      return texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX];
     default:
        ;
     }


This looks like it'll make TexParameter accept GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY even on drivers that don't support multisampling at all, which seems wrong.

I believe you simply want to change these to:

      if (ctx->Extensions.ARB_texture_multisample)


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

Reply via email to