i915: Add stub ARB_occlusion_query support under a driconf debug option.
authorEric Anholt <eric@anholt.net>
Wed, 29 Jul 2009 20:07:49 +0000 (13:07 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 1 Oct 2009 21:54:15 +0000 (14:54 -0700)
This is useful for enabling our GLSL testcases using the 2.0 entrypoints
even though we don't have full GL 2.0.

src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/intel/intel_screen.c

index 6831cbbfc856ff64d3f465449c0fc3d657f3d3b3..2eb08a8f057e1918e9f813ec9b00b06c7cb5be2e 100644 (file)
@@ -171,6 +171,7 @@ static const struct dri_extension brw_extensions[] = {
 
 
 static const struct dri_extension arb_oq_extensions[] = {
+   { "GL_ARB_occlusion_query",            GL_ARB_occlusion_query_functions },
    { NULL, NULL }
 };
 
@@ -214,5 +215,9 @@ intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
 
       if (intel == NULL || driQueryOptionb(&intel->optionCache, "fragment_shader"))
         driInitExtensions(ctx, fragment_shader_extensions, GL_FALSE);
+
+      if (intel == NULL || driQueryOptionb(&intel->optionCache,
+                                          "stub_occlusion_query"))
+        driInitExtensions(ctx, arb_oq_extensions, GL_FALSE);
    }
 }
index 2478e6363731c609a5858fbaf2613e95f3a066e1..24f7fbc992237e417ec53a4aecf2c38a1d387748 100644 (file)
@@ -92,10 +92,14 @@ PUBLIC const char __driConfigOptions[] =
      DRI_CONF_NO_RAST(false)
      DRI_CONF_ALWAYS_FLUSH_BATCH(false)
      DRI_CONF_ALWAYS_FLUSH_CACHE(false)
+
+      DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
+        DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
+      DRI_CONF_OPT_END
    DRI_CONF_SECTION_END
 DRI_CONF_END;
 
-const GLuint __driNConfigOptions = 11;
+const GLuint __driNConfigOptions = 12;
 
 #ifdef USE_NEW_INTERFACE
 static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;