pvr: Reserve space for vdm state for deferred secondary buffer.

For secondary buffer we need to emit additional vdm state along
with additional ppp state words to provide depthbias and scissor
indexes. These are indexes into depthbias and scissor tables.

In vkCmdExecuteCommands we append secondary buffer tables to primary
buffer tables, so the depthbias and scissor indexes change and
need fixing. This is why we need to emit these separatly.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18871>
This commit is contained in:
Rajnesh Kanwal 2022-09-21 16:56:49 +01:00
parent 100456a516
commit ea2f4cbecb
2 changed files with 19 additions and 5 deletions

View file

@ -4542,21 +4542,31 @@ static VkResult pvr_emit_ppp_state(struct pvr_cmd_buffer *const cmd_buffer,
struct pvr_deferred_cs_command cmd;
if (deferred_secondary) {
const uint32_t num_dwords = pvr_cmd_length(VDMCTRL_PPP_STATE0) +
pvr_cmd_length(VDMCTRL_PPP_STATE1);
uint32_t *vdm_state = pvr_csb_alloc_dwords(control_stream, num_dwords);
if (!vdm_state) {
cmd_buffer->state.status = pvr_csb_get_status(control_stream);
return cmd_buffer->state.status;
}
cmd = (struct pvr_deferred_cs_command){
.type = PVR_DEFERRED_CS_COMMAND_TYPE_DBSC,
.dbsc = ppp_state->depthbias_scissor_indices,
.dbsc = {
.state = ppp_state->depthbias_scissor_indices,
.vdm_state = vdm_state,
},
};
} else {
/* clang-format off */
cmd = (struct pvr_deferred_cs_command){
.type = PVR_DEFERRED_CS_COMMAND_TYPE_DBSC2,
.dbsc2 = {
.state = ppp_state->depthbias_scissor_indices,
.ppp_cs_bo = pvr_bo,
.patch_offset = dbsc_patching_offset,
}
},
};
/* clang-format on */
}
util_dynarray_append(&cmd_buffer->deferred_csb_commands,

View file

@ -867,7 +867,11 @@ struct pvr_ppp_state {
struct pvr_deferred_cs_command {
enum pvr_deferred_cs_command_type type;
union {
struct pvr_ppp_dbsc dbsc;
struct {
struct pvr_ppp_dbsc state;
uint32_t *vdm_state;
} dbsc;
struct {
struct pvr_ppp_dbsc state;