summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-02-16 21:17:44 -0800
committerKenneth Graunke <[email protected]>2017-02-21 12:38:13 -0800
commit8513090cd751b35d03462b6ee8bef46c1f49f608 (patch)
tree0473d76e054c6f4da156945d3974227b8dc6a644 /src
parent42a4f918208b483e98e06fb92e3029f3cc171e7e (diff)
i965: Update brw_save_primitives_written_counters for pre-Gen7.
Sandybridge and earlier only have a single counter. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sol.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index 41158bd580c..8adac92d07d 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -297,11 +297,17 @@ brw_save_primitives_written_counters(struct brw_context *brw,
brw_emit_mi_flush(brw);
/* Emit MI_STORE_REGISTER_MEM commands to write the values. */
- for (int i = 0; i < streams; i++) {
- int offset = (obj->prim_count_buffer_index + i) * sizeof(uint64_t);
+ if (brw->gen >= 7) {
+ for (int i = 0; i < streams; i++) {
+ int offset = (obj->prim_count_buffer_index + i) * sizeof(uint64_t);
+ brw_store_register_mem64(brw, obj->prim_count_bo,
+ GEN7_SO_NUM_PRIMS_WRITTEN(i),
+ offset);
+ }
+ } else {
brw_store_register_mem64(brw, obj->prim_count_bo,
- GEN7_SO_NUM_PRIMS_WRITTEN(i),
- offset);
+ GEN6_SO_NUM_PRIMS_WRITTEN,
+ obj->prim_count_buffer_index * sizeof(uint64_t));
}
/* Update where to write data to. */