diff options
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_queryobj.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_queryobj.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c b/src/mesa/drivers/dri/i965/gen6_queryobj.c index 8e639cfeef4..357f041d3f5 100644 --- a/src/mesa/drivers/dri/i965/gen6_queryobj.c +++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c @@ -80,9 +80,11 @@ static void write_primitives_generated(struct brw_context *brw, struct brw_bo *query_bo, int stream, int idx) { + const struct gen_device_info *devinfo = &brw->screen->devinfo; + brw_emit_mi_flush(brw); - if (brw->gen >= 7 && stream > 0) { + if (devinfo->gen >= 7 && stream > 0) { brw_store_register_mem64(brw, query_bo, GEN7_SO_PRIM_STORAGE_NEEDED(stream), idx * sizeof(uint64_t)); @@ -96,9 +98,11 @@ static void write_xfb_primitives_written(struct brw_context *brw, struct brw_bo *bo, int stream, int idx) { + const struct gen_device_info *devinfo = &brw->screen->devinfo; + brw_emit_mi_flush(brw); - if (brw->gen >= 7) { + if (devinfo->gen >= 7) { brw_store_register_mem64(brw, bo, GEN7_SO_NUM_PRIMS_WRITTEN(stream), idx * sizeof(uint64_t)); } else { @@ -113,6 +117,7 @@ write_xfb_overflow_streams(struct gl_context *ctx, int idx) { struct brw_context *brw = brw_context(ctx); + const struct gen_device_info *devinfo = &brw->screen->devinfo; brw_emit_mi_flush(brw); @@ -120,7 +125,7 @@ write_xfb_overflow_streams(struct gl_context *ctx, int w_idx = 4 * i + idx; int g_idx = 4 * i + idx + 2; - if (brw->gen >= 7) { + if (devinfo->gen >= 7) { brw_store_register_mem64(brw, bo, GEN7_SO_NUM_PRIMS_WRITTEN(stream + i), g_idx * sizeof(uint64_t)); @@ -168,6 +173,8 @@ static void emit_pipeline_stat(struct brw_context *brw, struct brw_bo *bo, int stream, int target, int idx) { + const struct gen_device_info *devinfo = &brw->screen->devinfo; + /* One source of confusion is the tessellation shader statistics. The * hardware has no statistics specific to the TE unit. Ideally we could have * the HS primitives for TESS_CONTROL_SHADER_PATCHES_ARB, and the DS @@ -196,7 +203,7 @@ emit_pipeline_stat(struct brw_context *brw, struct brw_bo *bo, /* Gen6 GS code counts full primitives, that is, it won't count individual * triangles in a triangle strip. Use CL_INVOCATION_COUNT for that. */ - if (brw->gen == 6 && target == GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB) + if (devinfo->gen == 6 && target == GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB) reg = CL_INVOCATION_COUNT; assert(reg != 0); @@ -217,6 +224,7 @@ gen6_queryobj_get_results(struct gl_context *ctx, struct brw_query_object *query) { struct brw_context *brw = brw_context(ctx); + const struct gen_device_info *devinfo = &brw->screen->devinfo; if (query->bo == NULL) return; @@ -289,7 +297,7 @@ gen6_queryobj_get_results(struct gl_context *ctx, * and correctly emitted the number of pixel shader invocations, but, * whomever forgot to undo the multiply by 4. */ - if (brw->gen == 8 || brw->is_haswell) + if (devinfo->gen == 8 || brw->is_haswell) query->Base.Result /= 4; break; |