vulkan/rmv: Only trace on the n-th frame

This makes it stop dumping on every n-th frame. It also uses a simple
increment, since the function is locked.

Fixes: defed48 ("vulkan: Add common RMV tracing infrastructure")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20635>
This commit is contained in:
Konstantin Seurer 2023-01-11 09:39:00 +01:00 committed by Marge Bot
parent 0b081731cb
commit 329e017300

View file

@ -92,9 +92,9 @@ vk_rmv_handle_present_locked(struct vk_device *device)
}
#endif
int32_t new_frame_index = p_atomic_add_return(&trace_data->cur_frame_idx, 1);
frame_trigger =
(new_frame_index % trace_data->trace_frame_idx == 0) && trace_data->trace_frame_idx != -1;
frame_trigger = trace_data->cur_frame_idx == trace_data->trace_frame_idx;
if (trace_data->cur_frame_idx <= trace_data->trace_frame_idx)
trace_data->cur_frame_idx++;
if (file_trigger || frame_trigger)
vk_dump_rmv_capture(trace_data);