diff options
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_urb.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_urb.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c b/src/mesa/drivers/dri/i965/gen7_urb.c index e53fcb7..e6cf1eb 100644 --- a/src/mesa/drivers/dri/i965/gen7_urb.c +++ b/src/mesa/drivers/dri/i965/gen7_urb.c @@ -51,6 +51,30 @@ * See "Volume 2a: 3D Pipeline," section 1.8. */ static void +gen7_allocate_push_constants(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + BEGIN_BATCH(2); + OUT_BATCH(_3DSTATE_PUSH_CONSTANT_ALLOC_VS << 16 | (2 - 2)); + OUT_BATCH(8); + ADVANCE_BATCH(); + + BEGIN_BATCH(2); + OUT_BATCH(_3DSTATE_PUSH_CONSTANT_ALLOC_PS << 16 | (2 - 2)); + OUT_BATCH(8 | 8 << GEN7_PUSH_CONSTANT_BUFFER_OFFSET_SHIFT); + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen7_push_constant_alloc = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_CONTEXT, + .cache = 0, + }, + .emit = gen7_allocate_push_constants, +}; + +static void gen7_upload_urb(struct brw_context *brw) { struct intel_context *intel = &brw->intel; @@ -76,16 +100,6 @@ gen7_upload_urb(struct brw_context *brw) assert(!brw->gs.prog_active); BEGIN_BATCH(2); - OUT_BATCH(_3DSTATE_PUSH_CONSTANT_ALLOC_VS << 16 | (2 - 2)); - OUT_BATCH(8); - ADVANCE_BATCH(); - - BEGIN_BATCH(2); - OUT_BATCH(_3DSTATE_PUSH_CONSTANT_ALLOC_PS << 16 | (2 - 2)); - OUT_BATCH(8 | 8 << GEN7_PUSH_CONSTANT_BUFFER_OFFSET_SHIFT); - ADVANCE_BATCH(); - - BEGIN_BATCH(2); OUT_BATCH(_3DSTATE_URB_VS << 16 | (2 - 2)); OUT_BATCH(brw->urb.nr_vs_entries | ((brw->urb.vs_size - 1) << GEN7_URB_ENTRY_SIZE_SHIFT) | |