diff options
author | Eric Anholt <[email protected]> | 2012-10-17 13:07:33 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-10-22 17:35:59 -0700 |
commit | e755c1a36b27d6e45f0ae81729908342b8775c74 (patch) | |
tree | da0e338eb3755f8145814a973c877153d74f7530 /src/mesa/drivers/dri/i965/brw_queryobj.c | |
parent | 11070105f0b5ad20f12bb40a8dd0b357924bcfdd (diff) |
i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.
v2: Fix mangled sentence in the comment, and make the loop exit early.
Reviewed-by: Ian Romanick <[email protected]> (v1)
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_queryobj.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_queryobj.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 1aa497439d7..84da9e0e30a 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -194,6 +194,16 @@ brw_queryobj_get_results(struct gl_context *ctx, } break; + case GL_ANY_SAMPLES_PASSED: + /* Set true if any of the sub-queries passed. */ + for (i = query->first_index; i <= query->last_index; i++) { + if (results[i * 2 + 1] != results[i * 2]) { + query->Base.Result = GL_TRUE; + break; + } + } + break; + case GL_PRIMITIVES_GENERATED: case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: /* We don't actually query the hardware for this value, so query->bo @@ -250,6 +260,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q) write_timestamp(intel, query->bo, 0); break; + case GL_ANY_SAMPLES_PASSED: case GL_SAMPLES_PASSED_ARB: /* Reset our driver's tracking of query state. */ drm_intel_bo_unreference(query->bo); @@ -304,6 +315,7 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q) write_timestamp(intel, query->bo, 1); break; + case GL_ANY_SAMPLES_PASSED: case GL_SAMPLES_PASSED_ARB: if (query->bo) { brw_emit_query_end(brw); |