diff --git a/src/imagination/vulkan/pvr_csb.c b/src/imagination/vulkan/pvr_csb.c index e831f568e39..d4975e16258 100644 --- a/src/imagination/vulkan/pvr_csb.c +++ b/src/imagination/vulkan/pvr_csb.c @@ -261,9 +261,11 @@ static bool pvr_csb_buffer_extend(struct pvr_csb *csb) /* if this is not the first BO in csb */ if (csb->pvr_bo) { + bool zero_after_move = PVR_IS_DEBUG_SET(DUMP_CONTROL_STREAM); + void *new_buffer = pvr_bo->bo->map; + current_state_update_size = (uint8_t *)csb->next - (uint8_t *)csb->relocation_mark; - void *new_buffer = pvr_bo->bo->map; assert(csb->relocation_mark != NULL); assert(csb->next >= csb->relocation_mark); @@ -273,10 +275,12 @@ static bool pvr_csb_buffer_extend(struct pvr_csb *csb) #if defined(DEBUG) assert(csb->relocation_mark_status == PVR_CSB_RELOCATION_MARK_SET); csb->relocation_mark_status = PVR_CSB_RELOCATION_MARK_SET_AND_CONSUMED; - - memset(csb->relocation_mark, 0, current_state_update_size); + zero_after_move = true; #endif + if (zero_after_move) + memset(csb->relocation_mark, 0, current_state_update_size); + csb->next = csb->relocation_mark; csb->end += stream_link_space;