summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_queryobj.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-02-25 18:05:55 -0800
committerKenneth Graunke <kenneth@whitecape.org>2013-03-01 22:09:04 -0800
commitec5d502ec3215c7610bcff0be4418f698b2f36ab (patch)
treeab7d703ef1015bcc5db845eabf39159c38850f18 /src/mesa/drivers/dri/i965/brw_queryobj.c
parentd92c7d8eed4eb0a1c1291a93d84439ba9a9983a2 (diff)
downloadexternal_mesa3d-ec5d502ec3215c7610bcff0be4418f698b2f36ab.zip
external_mesa3d-ec5d502ec3215c7610bcff0be4418f698b2f36ab.tar.gz
external_mesa3d-ec5d502ec3215c7610bcff0be4418f698b2f36ab.tar.bz2
i965: Remove brw_query_object::first_index field as it's always 0.
brw->query.index is initialized to 0 just a few lines before it's copied to first_index. Presumably the idea here was to reuse the query BO for subsequent queries of the same type, but since that doesn't happen, there's no need to have the extra code complexity. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_queryobj.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_queryobj.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index 8def39c..8893dd7 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -208,7 +208,7 @@ brw_queryobj_get_results(struct gl_context *ctx,
* run out of space in the query's BO and allocated a new one. If so,
* this function was already called to accumulate the results so far.
*/
- for (i = query->first_index; i <= query->last_index; i++) {
+ for (i = 0; i <= query->last_index; i++) {
query->Base.Result += results[i * 2 + 1] - results[i * 2];
}
break;
@@ -218,7 +218,7 @@ brw_queryobj_get_results(struct gl_context *ctx,
/* If the starting and ending PS_DEPTH_COUNT from any of the batches
* differ, then some fragments passed the depth test.
*/
- for (i = query->first_index; i <= query->last_index; i++) {
+ for (i = 0; i <= query->last_index; i++) {
if (results[i * 2 + 1] != results[i * 2]) {
query->Base.Result = GL_TRUE;
break;
@@ -330,7 +330,6 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
*/
drm_intel_bo_unreference(query->bo);
query->bo = NULL;
- query->first_index = -1;
query->last_index = -1;
brw->query.obj = query;
@@ -558,7 +557,6 @@ brw_emit_query_begin(struct brw_context *brw)
}
drm_intel_bo_reference(brw->query.bo);
query->bo = brw->query.bo;
- query->first_index = brw->query.index;
}
query->last_index = brw->query.index;
brw->query.begin_emitted = true;