mesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.
authorRico Schüller <kgbricola@web.de>
Sun, 20 Oct 2013 10:39:55 +0000 (12:39 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Oct 2013 03:12:08 +0000 (20:12 -0700)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rico Schüller <kgbricola@web.de>
src/mesa/main/extensions.c
src/mesa/main/mtypes.h
src/mesa/main/samplerobj.c
src/mesa/main/texparam.c

index 2507fdf34b87416c778cdfe73628634b54e455b8..bf8d7a36b8b42fe0eaafc84cbea6de65513e8330 100644 (file)
@@ -144,6 +144,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_texture_float",                       o(ARB_texture_float),                       GL,             2004 },
    { "GL_ARB_texture_gather",                      o(ARB_texture_gather),                      GL,             2009 },
    { "GL_ARB_texture_mirrored_repeat",             o(dummy_true),                              GLL,            2001 },
+   { "GL_ARB_texture_mirror_clamp_to_edge",        o(ARB_texture_mirror_clamp_to_edge),        GL,             2013 },
    { "GL_ARB_texture_multisample",                 o(ARB_texture_multisample),                 GL,             2009 },
    { "GL_ARB_texture_non_power_of_two",            o(ARB_texture_non_power_of_two),            GL,             2003 },
    { "GL_ARB_texture_query_levels",                o(ARB_texture_query_levels),                GL,             2012 },
index 15893ecac8993202d6832605c5255647dd78741b..6374e8c0d583dc95df8549804dcb48836256ba41 100644 (file)
@@ -3218,6 +3218,7 @@ struct gl_extensions
    GLboolean ARB_texture_env_dot3;
    GLboolean ARB_texture_float;
    GLboolean ARB_texture_gather;
+   GLboolean ARB_texture_mirror_clamp_to_edge;
    GLboolean ARB_texture_multisample;
    GLboolean ARB_texture_non_power_of_two;
    GLboolean ARB_texture_query_levels;
index c3b612c76184af2c405217423f302875e79223e8..7285ef5ed34e9c4bf516e0a44a16b72a14763da4 100644 (file)
@@ -305,7 +305,7 @@ validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
    case GL_MIRROR_CLAMP_EXT:
       return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
    case GL_MIRROR_CLAMP_TO_EDGE_EXT:
-      return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
+      return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp || e->ARB_texture_mirror_clamp_to_edge;
    case GL_MIRROR_CLAMP_TO_BORDER_EXT:
       return e->EXT_texture_mirror_clamp;
    default:
index 31723c377841bdee25216ed3922e58c93fdf11bd..c9d928f6343ce81d3e1d6093c929524bb722efee 100644 (file)
@@ -84,16 +84,22 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
       break;
 
    case GL_MIRROR_CLAMP_EXT:
+      supported = is_desktop_gl
+         && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)
+         && (target != GL_TEXTURE_RECTANGLE_NV)
+         && (target != GL_TEXTURE_EXTERNAL_OES);
+      break;
+
    case GL_MIRROR_CLAMP_TO_EDGE_EXT:
       supported = is_desktop_gl 
-         && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)
-        && (target != GL_TEXTURE_RECTANGLE_NV)
+         && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp || e->ARB_texture_mirror_clamp_to_edge)
+         && (target != GL_TEXTURE_RECTANGLE_NV)
          && (target != GL_TEXTURE_EXTERNAL_OES);
       break;
 
    case GL_MIRROR_CLAMP_TO_BORDER_EXT:
       supported = is_desktop_gl && e->EXT_texture_mirror_clamp
-        && (target != GL_TEXTURE_RECTANGLE_NV)
+         && (target != GL_TEXTURE_RECTANGLE_NV)
          && (target != GL_TEXTURE_EXTERNAL_OES);
       break;