enum amd_ip_type ip_type = cs->hw_ip;
uint32_t ib_pad_dw_mask = MAX2(3, cs->ws->info.ib_pad_dw_mask[ip_type]);
uint32_t nop_packet = get_nop_packet(cs);
- while (!cs->base.cdw || (cs->base.cdw & ib_pad_dw_mask) != ib_pad_dw_mask - 3)
- radeon_emit_unchecked(&cs->base, nop_packet);
- if (cs->use_ib)
+ if (cs->use_ib) {
+ while (!cs->base.cdw || (cs->base.cdw & ib_pad_dw_mask) != ib_pad_dw_mask - 3)
+ radeon_emit_unchecked(&cs->base, nop_packet);
+
*cs->ib_size_ptr |= cs->base.cdw + 4;
+ } else {
+ /* Pad the CS with NOP packets. */
+ while (!cs->base.cdw || (cs->base.cdw & ib_pad_dw_mask))
+ radeon_emit_unchecked(&cs->base, nop_packet);
+ }
radv_amdgpu_cs_add_old_ib_buffer(cs);
if (cs->status != VK_SUCCESS)
radeon_emit_unchecked(&cs->base, S_3F2_CHAIN(1) | S_3F2_VALID(1));
cs->ib_size_ptr = cs->base.buf + cs->base.cdw - 1;
- } else {
- /* Pad the CS with NOP packets. */
- while (!cs->base.cdw || (cs->base.cdw & ib_pad_dw_mask))
- radeon_emit_unchecked(&cs->base, nop_packet);
}
cs->base.buf = (uint32_t *)cs->ib_mapped;