[Mesa-dev] [PATCH 17/51] i965: Replace opencoded brw_store_register_mem32()
Chris Wilson
chris at chris-wilson.co.uk
Tue Jan 10 21:23:40 UTC 2017
The gen7 transform feedback routines store the SOL_OFFSET between
batches into its scratch buffer. Convert these from using opencoded
brw_store_register_mem32()
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
src/mesa/drivers/dri/i965/gen7_sol_state.c | 10 +++-------
src/mesa/drivers/dri/i965/hsw_sol.c | 10 +++-------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index e1b63abeaf..d6c4d1a5c8 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -566,13 +566,9 @@ gen7_pause_transform_feedback(struct gl_context *ctx,
/* Save the SOL buffer offset register values. */
if (brw->gen < 8) {
for (int i = 0; i < 4; i++) {
- BEGIN_BATCH(3);
- OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
- OUT_BATCH(GEN7_SO_WRITE_OFFSET(i));
- OUT_RELOC(brw_obj->offset_bo,
- I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
- i * sizeof(uint32_t));
- ADVANCE_BATCH();
+ brw_store_register_mem32(brw, brw_obj->offset_bo,
+ GEN7_SO_WRITE_OFFSET(i),
+ i * sizeof(uint32_t));
}
}
diff --git a/src/mesa/drivers/dri/i965/hsw_sol.c b/src/mesa/drivers/dri/i965/hsw_sol.c
index 5b2fd6b5c6..0e5c04b4c0 100644
--- a/src/mesa/drivers/dri/i965/hsw_sol.c
+++ b/src/mesa/drivers/dri/i965/hsw_sol.c
@@ -206,13 +206,9 @@ hsw_pause_transform_feedback(struct gl_context *ctx,
/* Save the SOL buffer offset register values. */
for (int i = 0; i < BRW_MAX_XFB_STREAMS; i++) {
- BEGIN_BATCH(3);
- OUT_BATCH(MI_STORE_REGISTER_MEM | (3 - 2));
- OUT_BATCH(GEN7_SO_WRITE_OFFSET(i));
- OUT_RELOC(brw_obj->offset_bo,
- I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
- i * sizeof(uint32_t));
- ADVANCE_BATCH();
+ brw_store_register_mem32(brw, brw_obj->offset_bo,
+ GEN7_SO_WRITE_OFFSET(i),
+ i * sizeof(uint32_t));
}
}
--
2.11.0
More information about the mesa-dev
mailing list