summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/radeonsi_pm4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/radeonsi/radeonsi_pm4.c')
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_pm4.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pm4.c b/src/gallium/drivers/radeonsi/radeonsi_pm4.c
index 3c53ce2e172..8268f914808 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pm4.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pm4.c
@@ -109,6 +109,13 @@ void si_pm4_sh_data_add(struct si_pm4_state *state, uint32_t dw)
void si_pm4_sh_data_end(struct si_pm4_state *state, unsigned reg)
{
unsigned offs = state->last_pm4 + 1;
+
+ /* Bail if no data was added */
+ if (state->ndw == offs) {
+ state->ndw--;
+ return;
+ }
+
si_pm4_cmd_end(state, false);
si_pm4_cmd_begin(state, PKT3_SET_SH_REG_OFFSET);