anv: emit 3DSTATE_HS in cmd_buffer_flush_gfx_state

Patch packs 3DSTATE_HS state during pipeline creation but it
gets emitted only before 3DPRIMITIVE. We will later need this
to implement a workaround.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21308>
This commit is contained in:
Tapani Pälli 2023-02-09 16:34:54 +02:00 committed by Marge Bot
parent a043ae8e24
commit 2028f1caa3
3 changed files with 47 additions and 35 deletions

View file

@ -3145,6 +3145,7 @@ struct anv_graphics_pipeline {
uint32_t wm[2];
uint32_t blend_state[1 + MAX_RTS * 2];
uint32_t streamout_state[5];
uint32_t hs[9];
} gfx8;
};

View file

@ -3522,6 +3522,13 @@ genX(cmd_buffer_flush_gfx_state)(struct anv_cmd_buffer *cmd_buffer)
}
}
if (cmd_buffer->state.gfx.dirty & ANV_CMD_DIRTY_PIPELINE) {
uint32_t *dw =
anv_batch_emitn(&cmd_buffer->batch, GENX(3DSTATE_HS_length),
GENX(3DSTATE_HS));
memcpy(dw, &pipeline->gfx8.hs, sizeof(pipeline->gfx8.hs));
}
if (any_dynamic_state_dirty || cmd_buffer->state.gfx.dirty)
genX(cmd_buffer_flush_dynamic_state)(cmd_buffer);
}

View file

@ -1311,7 +1311,10 @@ emit_3dstate_hs_ds(struct anv_graphics_pipeline *pipeline,
const struct brw_tcs_prog_data *tcs_prog_data = get_tcs_prog_data(pipeline);
const struct brw_tes_prog_data *tes_prog_data = get_tes_prog_data(pipeline);
anv_batch_emit(&pipeline->base.batch, GENX(3DSTATE_HS), hs) {
struct GENX(3DSTATE_HS) hs = {
GENX(3DSTATE_HS_header),
};
hs.Enable = true;
hs.StatisticsEnable = true;
hs.KernelStartPointer = tcs_bin->kernel.offset;
@ -1360,7 +1363,8 @@ emit_3dstate_hs_ds(struct anv_graphics_pipeline *pipeline,
hs.DispatchMode = tcs_prog_data->base.dispatch_mode;
hs.IncludePrimitiveID = tcs_prog_data->include_primitive_id;
}
GENX(3DSTATE_HS_pack)(NULL, pipeline->gfx8.hs, &hs);
anv_batch_emit(&pipeline->base.batch, GENX(3DSTATE_DS), ds) {
ds.Enable = true;