intel: Expose GL_EXT_texture_integer when GL 3.0 override is set.
authorEric Anholt <eric@anholt.net>
Wed, 5 Oct 2011 20:25:36 +0000 (13:25 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 9 Nov 2011 20:38:58 +0000 (12:38 -0800)
This will let the feature be incrementally developed, hidden behind
the flag we're all using as we work on GL 3.0 support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_extensions.c

index 7a5ef3e5f05bd8e538d110f7a98649e44564e68d..89f092073238431492ad24a5c2396347d8fdf84c 100644 (file)
@@ -41,6 +41,14 @@ void
 intelInitExtensions(struct gl_context *ctx)
 {
    struct intel_context *intel = intel_context(ctx);
+   char *override = getenv("MESA_GL_VERSION_OVERRIDE");
+   int override_major, override_minor;
+   int override_version = 0;
+
+   if (override &&
+       sscanf(override, "%u.%u", &override_major, &override_minor) == 2) {
+      override_version = override_major * 10 + override_minor;
+   }
 
    ctx->Extensions.ARB_draw_elements_base_vertex = true;
    ctx->Extensions.ARB_explicit_attrib_location = true;
@@ -117,6 +125,8 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.EXT_draw_buffers2 = true;
       ctx->Extensions.EXT_framebuffer_sRGB = true;
       ctx->Extensions.EXT_texture_array = true;
+      if (override_version >= 30)
+        ctx->Extensions.EXT_texture_integer = true;
       ctx->Extensions.EXT_texture_snorm = true;
       ctx->Extensions.EXT_texture_sRGB = true;
       ctx->Extensions.EXT_texture_sRGB_decode = true;