+ /* The remainder of this function initializes the gfx CS and must be last. */
+ assert(sctx->gfx_cs->current.cdw == 0);
+
+ if (sctx->has_graphics) {
+ si_init_cp_reg_shadowing(sctx);
+ }
+
+ si_begin_new_gfx_cs(sctx, true);
+ assert(sctx->gfx_cs->current.cdw == sctx->initial_gfx_cs_size);
+
+ /* Initialize per-context buffers. */
+ if (sctx->wait_mem_scratch) {
+ si_cp_write_data(sctx, sctx->wait_mem_scratch, 0, 4, V_370_MEM, V_370_ME,
+ &sctx->wait_mem_number);
+ }