i915g: Add option to lie about caps
authorJakob Bornecrantz <wallbraker@gmail.com>
Sun, 20 Feb 2011 12:41:18 +0000 (13:41 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Mon, 21 Feb 2011 23:42:53 +0000 (23:42 +0000)
src/gallium/drivers/i915/i915_debug.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_screen.h

index d11da83eb29d60e8cad3c3851897f6255931293c..e0ea025d0ecf5a5b9b6824675c204c4882cf34a3 100644 (file)
@@ -50,11 +50,13 @@ boolean i915_tiling = TRUE;
 
 DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", debug_options, 0);
 DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE);
+DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, "I915_LIE", FALSE);
 
 void i915_debug_init(struct i915_screen *is)
 {
    i915_debug = debug_get_option_i915_debug();
    is->debug.tiling = !debug_get_option_i915_no_tiling();
+   is->debug.lie = debug_get_option_i915_lie();
 }
 
 
index 2260bcecf6e19a006ef23ab0f802e2a6181dac99..d929eb25bdcbaeec13466a75c443749a9ccd4b8d 100644 (file)
@@ -100,6 +100,8 @@ i915_get_name(struct pipe_screen *screen)
 static int
 i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
 {
+   struct i915_screen *is = i915_screen(screen);
+
    switch (cap) {
    /* Supported features (boolean caps). */
    case PIPE_CAP_ANISOTROPIC_FILTER:
@@ -123,7 +125,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_INDEP_BLEND_ENABLE:
    case PIPE_CAP_INDEP_BLEND_FUNC:
    case PIPE_CAP_INSTANCED_DRAWING: /* draw module? */
-   case PIPE_CAP_OCCLUSION_QUERY:
    case PIPE_CAP_POINT_SPRITE:
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
@@ -131,6 +132,10 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_TIMER_QUERY:
       return 0;
 
+   /* Features we can lie about (boolean caps). */
+   case PIPE_CAP_OCCLUSION_QUERY:
+      return is->debug.lie ? 1 : 0;
+
    /* Texturing. */
    case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
    case PIPE_CAP_MAX_COMBINED_SAMPLERS:
index e76e33ad42ed9693582664e510b9b46f582a0c9b..60f0e2971e0cb17a06cc50cc47ae315564be9843 100644 (file)
@@ -48,6 +48,7 @@ struct i915_screen
 
    struct {
       boolean tiling;
+      boolean lie;
    } debug;
 };