diff options
author | Kenneth Graunke <[email protected]> | 2016-05-08 22:48:02 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-05-20 19:55:42 -0700 |
commit | 9c0d16adc16e53f8d978eb0e8857071fbd1f07cd (patch) | |
tree | e2530c9607c369fa39869cf63dadaa06ab63f21d /src | |
parent | 915f7c25fac2683f924fded2b47208c7fb850044 (diff) |
i965: Just read the existing tally on EndTransformFeedback if paused.
If the transform feedback object is paused when ending, then there are
no new snapshots to add to the tally. In fact, we haven't written a
starting snapshot, so we'd best not try and compute (end - start).
Just load the existing tally so we can convert it to the number of
vertices written and store it to the final result location.
This is the Haswell+ equivalent of the previous commit.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/hsw_sol.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/i965/hsw_sol.c b/src/mesa/drivers/dri/i965/hsw_sol.c index ef8fcf48346..e299b022706 100644 --- a/src/mesa/drivers/dri/i965/hsw_sol.c +++ b/src/mesa/drivers/dri/i965/hsw_sol.c @@ -95,27 +95,29 @@ tally_prims_written(struct brw_context *brw, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, TALLY_OFFSET + i * sizeof(uint32_t)); - /* GPR1 = Start Snapshot */ - brw_load_register_mem64(brw, HSW_CS_GPR(1), obj->prim_count_bo, - I915_GEM_DOMAIN_INSTRUCTION, - I915_GEM_DOMAIN_INSTRUCTION, - START_OFFSET + i * sizeof(uint64_t)); - /* GPR2 = Ending Snapshot */ - brw_load_register_reg64(brw, GEN7_SO_NUM_PRIMS_WRITTEN(i), HSW_CS_GPR(2)); + if (!obj->base.Paused) { + /* GPR1 = Start Snapshot */ + brw_load_register_mem64(brw, HSW_CS_GPR(1), obj->prim_count_bo, + I915_GEM_DOMAIN_INSTRUCTION, + I915_GEM_DOMAIN_INSTRUCTION, + START_OFFSET + i * sizeof(uint64_t)); + /* GPR2 = Ending Snapshot */ + brw_load_register_reg64(brw, GEN7_SO_NUM_PRIMS_WRITTEN(i), HSW_CS_GPR(2)); - BEGIN_BATCH(9); - OUT_BATCH(HSW_MI_MATH | (9 - 2)); - /* GPR1 = GPR2 (End) - GPR1 (Start) */ - OUT_BATCH(MI_MATH_ALU2(LOAD, SRCA, R2)); - OUT_BATCH(MI_MATH_ALU2(LOAD, SRCB, R1)); - OUT_BATCH(MI_MATH_ALU0(SUB)); - OUT_BATCH(MI_MATH_ALU2(STORE, R1, ACCU)); - /* GPR0 = GPR0 (Tally) + GPR1 (Diff) */ - OUT_BATCH(MI_MATH_ALU2(LOAD, SRCA, R0)); - OUT_BATCH(MI_MATH_ALU2(LOAD, SRCB, R1)); - OUT_BATCH(MI_MATH_ALU0(ADD)); - OUT_BATCH(MI_MATH_ALU2(STORE, R0, ACCU)); - ADVANCE_BATCH(); + BEGIN_BATCH(9); + OUT_BATCH(HSW_MI_MATH | (9 - 2)); + /* GPR1 = GPR2 (End) - GPR1 (Start) */ + OUT_BATCH(MI_MATH_ALU2(LOAD, SRCA, R2)); + OUT_BATCH(MI_MATH_ALU2(LOAD, SRCB, R1)); + OUT_BATCH(MI_MATH_ALU0(SUB)); + OUT_BATCH(MI_MATH_ALU2(STORE, R1, ACCU)); + /* GPR0 = GPR0 (Tally) + GPR1 (Diff) */ + OUT_BATCH(MI_MATH_ALU2(LOAD, SRCA, R0)); + OUT_BATCH(MI_MATH_ALU2(LOAD, SRCB, R1)); + OUT_BATCH(MI_MATH_ALU0(ADD)); + OUT_BATCH(MI_MATH_ALU2(STORE, R0, ACCU)); + ADVANCE_BATCH(); + } if (!finalize) { /* Write back the new tally */ |