mesa: initial EXT_texture_snorm support
authorMarek Olšák <maraeo@gmail.com>
Fri, 18 Mar 2011 12:44:51 +0000 (13:44 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 29 Mar 2011 10:04:55 +0000 (12:04 +0200)
The component ordering of some formats has been been reversed to match
Gallium types.

src/mesa/main/extensions.c
src/mesa/main/fbobject.c
src/mesa/main/formats.c
src/mesa/main/formats.h
src/mesa/main/image.c
src/mesa/main/macros.h
src/mesa/main/mtypes.h
src/mesa/main/texformat.c
src/mesa/main/teximage.c
src/mesa/main/version.c

index 7844b5060a1c72a2d5d5d74e33fa1e0f1b9b69f2..285e08d7596ca79f45a060981716c4c4c8f20846 100644 (file)
@@ -203,6 +203,7 @@ static const struct extension extension_table[] = {
    { "GL_EXT_texture",                             o(EXT_texture),                             GL,             1996 },
    { "GL_EXT_texture_rectangle",                   o(NV_texture_rectangle),                    GL,             2004 },
    { "GL_EXT_texture_shared_exponent",             o(EXT_texture_shared_exponent),             GL,             2004 },
+   { "GL_EXT_texture_snorm",                       o(EXT_texture_snorm),                       GL,             2009 },
    { "GL_EXT_texture_sRGB",                        o(EXT_texture_sRGB),                        GL,             2004 },
    { "GL_EXT_texture_sRGB_decode",                 o(EXT_texture_sRGB_decode),                        GL,      2006 },
    { "GL_EXT_texture_swizzle",                     o(EXT_texture_swizzle),                     GL,             2008 },
@@ -274,7 +275,7 @@ static const struct extension extension_table[] = {
    { "GL_MESA_pack_invert",                        o(MESA_pack_invert),                        GL,             2002 },
    { "GL_MESA_resize_buffers",                     o(MESA_resize_buffers),                     GL,             1999 },
    { "GL_MESA_texture_array",                      o(MESA_texture_array),                      GL,             2007 },
-   { "GL_MESA_texture_signed_rgba",                o(MESA_texture_signed_rgba),                GL,             2009 },
+   { "GL_MESA_texture_signed_rgba",                o(EXT_texture_snorm),                       GL,             2009 },
    { "GL_MESA_window_pos",                         o(ARB_window_pos),                          GL,             2000 },
    { "GL_MESAX_texture_float",                     o(ARB_texture_float),                       GL,             2009 },
    { "GL_MESA_ycbcr_texture",                      o(MESA_ycbcr_texture),                      GL,             2002 },
index cc13103de407bcfea67f5cc1447a7cc3d0273958..4eab3e11911a495c30d66ca19b1fdd3a7fc7269e 100644 (file)
@@ -1081,7 +1081,6 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
    case GL_RGB10_A2:
    case GL_RGBA12:
    case GL_RGBA16:
-   case GL_RGBA16_SNORM:
    case GL_SRGB8_ALPHA8_EXT:
       return GL_RGBA;
    case GL_STENCIL_INDEX:
@@ -1109,6 +1108,43 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
    case GL_RG8:
    case GL_RG16:
       return ctx->Extensions.ARB_texture_rg ? GL_RG : 0;
+   /* signed normalized texture formats */
+   case GL_RED_SNORM:
+   case GL_R8_SNORM:
+   case GL_R16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm ? GL_RED : 0;
+   case GL_RG_SNORM:
+   case GL_RG8_SNORM:
+   case GL_RG16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm ? GL_RG : 0;
+   case GL_RGB_SNORM:
+   case GL_RGB8_SNORM:
+   case GL_RGB16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm ? GL_RGB : 0;
+   case GL_RGBA_SNORM:
+   case GL_RGBA8_SNORM:
+   case GL_RGBA16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm ? GL_RGBA : 0;
+   case GL_ALPHA_SNORM:
+   case GL_ALPHA8_SNORM:
+   case GL_ALPHA16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm &&
+             ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+   case GL_LUMINANCE_SNORM:
+   case GL_LUMINANCE8_SNORM:
+   case GL_LUMINANCE16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm &&
+             ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+   case GL_LUMINANCE_ALPHA_SNORM:
+   case GL_LUMINANCE8_ALPHA8_SNORM:
+   case GL_LUMINANCE16_ALPHA16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm &&
+             ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+   case GL_INTENSITY_SNORM:
+   case GL_INTENSITY8_SNORM:
+   case GL_INTENSITY16_SNORM:
+      return ctx->Extensions.EXT_texture_snorm &&
+             ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
    /* XXX add floating point and integer formats eventually */
    default:
       return 0;
index db10c9b4c2e2550d98ddb27a0b8a1c96f5e26860..e62170b71c18e9ff988ecb5bc07712a4ac0983fb 100644 (file)
@@ -809,8 +809,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       1, 1, 1                       /* BlockWidth/Height,Bytes */
    },
    {
-      MESA_FORMAT_SIGNED_RG88,
-      "MESA_FORMAT_SIGNED_RG88",
+      MESA_FORMAT_SIGNED_RG88_REV,
+      "MESA_FORMAT_SIGNED_RG88_REV",
       GL_RG,
       GL_SIGNED_NORMALIZED,
       8, 8, 0, 0,
@@ -847,8 +847,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
 
    /* Signed 16 bits / channel */
    {
-      MESA_FORMAT_SIGNED_R_16,
-      "MESA_FORMAT_SIGNED_R_16",
+      MESA_FORMAT_SIGNED_R16,
+      "MESA_FORMAT_SIGNED_R16",
       GL_RED,
       GL_SIGNED_NORMALIZED,
       16, 0, 0, 0,
@@ -856,8 +856,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       1, 1, 2
    },
    {
-      MESA_FORMAT_SIGNED_RG_16,
-      "MESA_FORMAT_SIGNED_RG_16",
+      MESA_FORMAT_SIGNED_GR1616,
+      "MESA_FORMAT_SIGNED_GR1616",
       GL_RG,
       GL_SIGNED_NORMALIZED,
       16, 16, 0, 0,
@@ -963,6 +963,80 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
      4, 0, 0, 0, 0,
      4, 4, 16                     /* 16 bytes per 4x4 block */
    },
+
+   /* Signed formats from EXT_texture_snorm that are not in GL3.1 */
+   {
+      MESA_FORMAT_SIGNED_A8,
+      "MESA_FORMAT_SIGNED_A8",
+      GL_ALPHA,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 8,
+      0, 0, 0, 0, 0,
+      1, 1, 1
+   },
+   {
+      MESA_FORMAT_SIGNED_L8,
+      "MESA_FORMAT_SIGNED_L8",
+      GL_LUMINANCE,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 0,
+      8, 0, 0, 0, 0,
+      1, 1, 1
+   },
+   {
+      MESA_FORMAT_SIGNED_AL88,
+      "MESA_FORMAT_SIGNED_AL88",
+      GL_LUMINANCE_ALPHA,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 8,
+      8, 0, 0, 0, 0,
+      1, 1, 2
+   },
+   {
+      MESA_FORMAT_SIGNED_I8,
+      "MESA_FORMAT_SIGNED_I8",
+      GL_INTENSITY,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 0,
+      0, 8, 0, 0, 0,
+      1, 1, 1
+   },
+   {
+      MESA_FORMAT_SIGNED_A16,
+      "MESA_FORMAT_SIGNED_A16",
+      GL_ALPHA,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 16,
+      0, 0, 0, 0, 0,
+      1, 1, 2
+   },
+   {
+      MESA_FORMAT_SIGNED_L16,
+      "MESA_FORMAT_SIGNED_L16",
+      GL_LUMINANCE,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 0,
+      16, 0, 0, 0, 0,
+      1, 1, 2
+   },
+   {
+      MESA_FORMAT_SIGNED_AL1616,
+      "MESA_FORMAT_SIGNED_AL1616",
+      GL_LUMINANCE_ALPHA,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 16,
+      16, 0, 0, 0, 0,
+      1, 1, 4
+   },
+   {
+      MESA_FORMAT_SIGNED_I16,
+      "MESA_FORMAT_SIGNED_I16",
+      GL_INTENSITY,
+      GL_SIGNED_NORMALIZED,
+      0, 0, 0, 0,
+      0, 16, 0, 0, 0,
+      1, 1, 2
+   }
 };
 
 
@@ -1530,10 +1604,14 @@ _mesa_format_to_type_and_comps(gl_format format,
       return;
 
    case MESA_FORMAT_SIGNED_R8:
+   case MESA_FORMAT_SIGNED_A8:
+   case MESA_FORMAT_SIGNED_L8:
+   case MESA_FORMAT_SIGNED_I8:
       *datatype = GL_BYTE;
       *comps = 1;
       return;
-   case MESA_FORMAT_SIGNED_RG88:
+   case MESA_FORMAT_SIGNED_RG88_REV:
+   case MESA_FORMAT_SIGNED_AL88:
       *datatype = GL_BYTE;
       *comps = 2;
       return;
@@ -1549,11 +1627,15 @@ _mesa_format_to_type_and_comps(gl_format format,
       *comps = 4;
       return;
 
-   case MESA_FORMAT_SIGNED_R_16:
+   case MESA_FORMAT_SIGNED_R16:
+   case MESA_FORMAT_SIGNED_A16:
+   case MESA_FORMAT_SIGNED_L16:
+   case MESA_FORMAT_SIGNED_I16:
       *datatype = GL_SHORT;
       *comps = 1;
       return;
-   case MESA_FORMAT_SIGNED_RG_16:
+   case MESA_FORMAT_SIGNED_GR1616:
+   case MESA_FORMAT_SIGNED_AL1616:
       *datatype = GL_SHORT;
       *comps = 2;
       return;
index 04a18930b4e1b53cd5a9710a8d446bb0f885b037..e0c2acbb9e9c679ea1930c868832c679afae02b6 100644 (file)
@@ -168,12 +168,12 @@ typedef enum
    /*@{*/
    MESA_FORMAT_DUDV8,             /*                     DUDU DUDU DVDV DVDV */
    MESA_FORMAT_SIGNED_R8,         /*                               RRRR RRRR */
-   MESA_FORMAT_SIGNED_RG88,       /*                     RRRR RRRR GGGG GGGG */
+   MESA_FORMAT_SIGNED_RG88_REV,   /*                     GGGG GGGG RRRR RRRR */
    MESA_FORMAT_SIGNED_RGBX8888,   /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
    MESA_FORMAT_SIGNED_RGBA8888,   /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
    MESA_FORMAT_SIGNED_RGBA8888_REV,/*AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
-   MESA_FORMAT_SIGNED_R_16,       /* ushort[0]=R */
-   MESA_FORMAT_SIGNED_RG_16,      /* ushort[0]=R, ushort[1]=G */
+   MESA_FORMAT_SIGNED_R16,        /*                     RRRR RRRR RRRR RRRR */
+   MESA_FORMAT_SIGNED_GR1616,     /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
    MESA_FORMAT_SIGNED_RGB_16,     /* ushort[0]=R, ushort[1]=G, ushort[2]=B */
    MESA_FORMAT_SIGNED_RGBA_16,    /* ... */
    MESA_FORMAT_RGBA_16,           /* ... */
@@ -193,6 +193,15 @@ typedef enum
    MESA_FORMAT_SIGNED_LA_LATC2,
    /*@}*/
 
+   MESA_FORMAT_SIGNED_A8,         /*                               AAAA AAAA */
+   MESA_FORMAT_SIGNED_L8,         /*                               LLLL LLLL */
+   MESA_FORMAT_SIGNED_AL88,       /*                     AAAA AAAA LLLL LLLL */
+   MESA_FORMAT_SIGNED_I8,         /*                               IIII IIII */
+   MESA_FORMAT_SIGNED_A16,        /*                     AAAA AAAA AAAA AAAA */
+   MESA_FORMAT_SIGNED_L16,        /*                     LLLL LLLL LLLL LLLL */
+   MESA_FORMAT_SIGNED_AL1616,     /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
+   MESA_FORMAT_SIGNED_I16,        /*                     IIII IIII IIII IIII */
+
    MESA_FORMAT_COUNT
 } gl_format;
 
index bbde3800e8c9b5df4d8590508251db3dc503c3b0..28841c251020e28a30965d9446474c823466cee4 100644 (file)
@@ -748,9 +748,6 @@ _mesa_is_color_format(GLenum format)
       case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
       case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
       case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
-      /* signed, normalized texture formats */
-      case GL_RGBA_SNORM:
-      case GL_RGBA8_SNORM:
       /* generic integer formats */
       case GL_RED_INTEGER_EXT:
       case GL_GREEN_INTEGER_EXT:
@@ -799,6 +796,31 @@ _mesa_is_color_format(GLenum format)
       case GL_INTENSITY8I_EXT:
       case GL_LUMINANCE8I_EXT:
       case GL_LUMINANCE_ALPHA8I_EXT:
+      /* signed, normalized texture formats */
+      case GL_RED_SNORM:
+      case GL_R8_SNORM:
+      case GL_R16_SNORM:
+      case GL_RG_SNORM:
+      case GL_RG8_SNORM:
+      case GL_RG16_SNORM:
+      case GL_RGB_SNORM:
+      case GL_RGB8_SNORM:
+      case GL_RGB16_SNORM:
+      case GL_RGBA_SNORM:
+      case GL_RGBA8_SNORM:
+      case GL_RGBA16_SNORM:
+      case GL_ALPHA_SNORM:
+      case GL_ALPHA8_SNORM:
+      case GL_ALPHA16_SNORM:
+      case GL_LUMINANCE_SNORM:
+      case GL_LUMINANCE8_SNORM:
+      case GL_LUMINANCE16_SNORM:
+      case GL_LUMINANCE_ALPHA_SNORM:
+      case GL_LUMINANCE8_ALPHA8_SNORM:
+      case GL_LUMINANCE16_ALPHA16_SNORM:
+      case GL_INTENSITY_SNORM:
+      case GL_INTENSITY8_SNORM:
+      case GL_INTENSITY16_SNORM:
          return GL_TRUE;
       case GL_YCBCR_MESA:  /* not considered to be RGB */
          /* fall-through */
index b2ec0ba9b73fbf91c4ade70ec558eac29f0ffbf7..86a58cc6b4303fb29b33e716a5cb37c66dafa83c 100644 (file)
@@ -58,8 +58,7 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256];
 #define BYTE_TO_FLOAT_TEX(B)    ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F))
 
 /** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127], texture/fb data */
-#define FLOAT_TO_BYTE_TEX(X)    ( (GLint) (127.0F * (X)) )
-
+#define FLOAT_TO_BYTE_TEX(X)    CLAMP( (GLint) (127.0F * (X)), -128, 127 )
 
 /** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
 #define USHORT_TO_FLOAT(S)  ((GLfloat) (S) * (1.0F / 65535.0F))
index 2e3ea5c0c1c69059e24a2fc848b07c46fb936f7f..02676006a9f003835c8907c602bc7c256236ad78 100644 (file)
@@ -2828,6 +2828,7 @@ struct gl_extensions
    GLboolean EXT_texture_lod_bias;
    GLboolean EXT_texture_mirror_clamp;
    GLboolean EXT_texture_shared_exponent;
+   GLboolean EXT_texture_snorm;
    GLboolean EXT_texture_sRGB;
    GLboolean EXT_texture_sRGB_decode;
    GLboolean EXT_texture_swizzle;
@@ -2855,7 +2856,6 @@ struct gl_extensions
    GLboolean MESA_resize_buffers;
    GLboolean MESA_ycbcr_texture;
    GLboolean MESA_texture_array;
-   GLboolean MESA_texture_signed_rgba;
    GLboolean NV_blend_square;
    GLboolean NV_conditional_render;
    GLboolean NV_fragment_program;
index 5eabf2aa527325ea5cb48c01e0f1cbd7f686a830..8b7b4ff475d70bb50a247b784f9299d864ad242c 100644 (file)
@@ -389,19 +389,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
       }
    }
 
-   if (ctx->Extensions.MESA_texture_signed_rgba) {
-      switch (internalFormat) {
-         case GL_RGBA_SNORM:
-         case GL_RGBA8_SNORM:
-           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
-           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
-           break;
-         default:
-            ; /* fallthrough */
-      }
-   }
-
-   if (ctx->VersionMajor * 10 + ctx->VersionMinor >= 31) {
+   if (ctx->Extensions.EXT_texture_snorm) {
       switch (internalFormat) {
          case GL_RED_SNORM:
          case GL_R8_SNORM:
@@ -409,7 +397,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
            break;
          case GL_RG_SNORM:
          case GL_RG8_SNORM:
-           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88_REV);
            break;
          case GL_RGB_SNORM:
          case GL_RGB8_SNORM:
@@ -418,12 +406,29 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_RGBA_SNORM:
          case GL_RGBA8_SNORM:
            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
            break;
+         case GL_ALPHA_SNORM:
+         case GL_ALPHA8_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8);
+            break;
+         case GL_LUMINANCE_SNORM:
+         case GL_LUMINANCE8_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L8);
+            break;
+         case GL_LUMINANCE_ALPHA_SNORM:
+         case GL_LUMINANCE8_ALPHA8_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL88);
+            break;
+         case GL_INTENSITY_SNORM:
+         case GL_INTENSITY8_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I8);
+            break;
          case GL_R16_SNORM:
-           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R_16);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R16);
            break;
          case GL_RG16_SNORM:
-           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG_16);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_GR1616);
            break;
          case GL_RGB16_SNORM:
            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16);
@@ -431,6 +436,18 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_RGBA16_SNORM:
            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
            break;
+         case GL_ALPHA16_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A16);
+            break;
+         case GL_LUMINANCE16_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L16);
+            break;
+         case GL_LUMINANCE16_ALPHA16_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL1616);
+            break;
+         case GL_INTENSITY16_SNORM:
+            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I16);
+            break;
          default:
             ; /* fall-through */
       }
index c6b8c05b100eced31cf6d01d1ceddba2d290664a..86927d3b661f28a0a38092533314c182f8c0ba93 100644 (file)
@@ -311,11 +311,40 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
-   if (ctx->Extensions.MESA_texture_signed_rgba) {
+   if (ctx->Extensions.EXT_texture_snorm) {
       switch (internalFormat) {
+         case GL_RED_SNORM:
+         case GL_R8_SNORM:
+         case GL_R16_SNORM:
+            return GL_RED;
+         case GL_RG_SNORM:
+         case GL_RG8_SNORM:
+         case GL_RG16_SNORM:
+            return GL_RG;
+         case GL_RGB_SNORM:
+         case GL_RGB8_SNORM:
+         case GL_RGB16_SNORM:
+            return GL_RGB;
          case GL_RGBA_SNORM:
          case GL_RGBA8_SNORM:
+         case GL_RGBA16_SNORM:
             return GL_RGBA;
+         case GL_ALPHA_SNORM:
+         case GL_ALPHA8_SNORM:
+         case GL_ALPHA16_SNORM:
+            return GL_ALPHA;
+         case GL_LUMINANCE_SNORM:
+         case GL_LUMINANCE8_SNORM:
+         case GL_LUMINANCE16_SNORM:
+            return GL_LUMINANCE;
+         case GL_LUMINANCE_ALPHA_SNORM:
+         case GL_LUMINANCE8_ALPHA8_SNORM:
+         case GL_LUMINANCE16_ALPHA16_SNORM:
+            return GL_LUMINANCE_ALPHA;
+         case GL_INTENSITY_SNORM:
+         case GL_INTENSITY8_SNORM:
+         case GL_INTENSITY16_SNORM:
+            return GL_INTENSITY;
          default:
             ; /* fallthrough */
       }
index 956c7b90a370584b4d1f774a8c5de8e73d5249e0..c7a0d69a4f0522caaf200c150085a164ab61d092 100644 (file)
@@ -114,6 +114,7 @@ compute_version(struct gl_context *ctx)
                               ctx->Extensions.ARB_draw_instanced &&
                               ctx->Extensions.ARB_texture_buffer_object &&
                               ctx->Extensions.ARB_uniform_buffer_object &&
+                              ctx->Extensions.EXT_texture_snorm &&
                               ctx->Extensions.NV_primitive_restart &&
                               ctx->Extensions.NV_texture_rectangle &&
                               ctx->Const.MaxVertexTextureImageUnits >= 16);