OSDN Git Service

i915: Correctly set the OQ counter bits.
authorEric Anholt <eric@anholt.net>
Wed, 17 Apr 2013 20:58:00 +0000 (13:58 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Apr 2013 18:41:33 +0000 (11:41 -0700)
While we may provide the extension, we need to tell applications that they
can't actually use it:

            An implementation can either set QUERY_COUNTER_BITS_ARB to the
            value 0, or to some number greater than or equal to n.  If an
            implementation returns 0 for QUERY_COUNTER_BITS_ARB, then the
            occlusion queries will always return that zero samples passed the
            occlusion test, and so an application should not use occlusion
            queries on that implementation.

src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c

index 524e7cb..f4b3517 100644 (file)
@@ -113,6 +113,7 @@ i830CreateContext(int api,
    ctx->Const.MaxTextureMaxAnisotropy = 2.0;
 
    ctx->Const.MaxDrawBuffers = 1;
+   ctx->Const.QueryCounterBits.SamplesPassed = 0;
 
    _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12,
                       18 * sizeof(GLfloat));
index 133f339..46fc966 100644 (file)
@@ -262,6 +262,7 @@ i915CreateContext(int api,
    fs_options->EmitNoIndirectTemp = true;
 
    ctx->Const.MaxDrawBuffers = 1;
+   ctx->Const.QueryCounterBits.SamplesPassed = 0;
 
    _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12,
                       36 * sizeof(GLfloat));