diff --git a/audio/audio_driver.c b/audio/audio_driver.c index 1a8df5979d..a12827e48a 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -540,10 +540,10 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) return false; performance_counter_init(audio_convert_s16, "audio_convert_s16"); - performance_counter_start(audio_convert_s16); + performance_counter_start_plus(is_perfcnt_enable, audio_convert_s16); convert_s16_to_float(audio_driver_input_data, data, samples, audio_driver_volume_gain); - performance_counter_stop(audio_convert_s16); + performance_counter_stop_plus(is_perfcnt_enable, audio_convert_s16); src_data.data_in = audio_driver_input_data; src_data.input_frames = samples >> 1; @@ -563,9 +563,9 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) dsp_data.input_frames = samples >> 1; performance_counter_init(audio_dsp, "audio_dsp"); - performance_counter_start(audio_dsp); + performance_counter_start_plus(is_perfcnt_enable, audio_dsp); retro_dsp_filter_process(audio_driver_dsp, &dsp_data); - performance_counter_stop(audio_dsp); + performance_counter_stop_plus(is_perfcnt_enable, audio_dsp); if (dsp_data.output) { @@ -610,10 +610,10 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) src_data.ratio *= settings->slowmotion_ratio; performance_counter_init(resampler_proc, "resampler_proc"); - performance_counter_start(resampler_proc); + performance_counter_start_plus(is_perfcnt_enable, resampler_proc); audio_driver_resampler->process(audio_driver_resampler_data, &src_data); - performance_counter_stop(resampler_proc); + performance_counter_stop_plus(is_perfcnt_enable, resampler_proc); output_data = audio_driver_output_samples_buf; output_frames = src_data.output_frames; @@ -623,10 +623,10 @@ static bool audio_driver_flush(const int16_t *data, size_t samples) static struct retro_perf_counter audio_convert_float = {0}; performance_counter_init(audio_convert_float, "audio_convert_float"); - performance_counter_start(audio_convert_float); + performance_counter_start_plus(is_perfcnt_enable, audio_convert_float); convert_float_to_s16(audio_driver_output_samples_conv_buf, (const float*)output_data, output_frames * 2); - performance_counter_stop(audio_convert_float); + performance_counter_stop_plus(is_perfcnt_enable, audio_convert_float); output_data = audio_driver_output_samples_conv_buf; output_size = sizeof(int16_t); diff --git a/performance_counters.h b/performance_counters.h index 47d2906cc3..958c1474f6 100644 --- a/performance_counters.h +++ b/performance_counters.h @@ -82,6 +82,7 @@ void rarch_perf_register(struct retro_perf_counter *perf); * Start performance counter. **/ #define performance_counter_start(perf) performance_counter_start_internal(runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL), perf) +#define performance_counter_start_plus(is_perfcnt_enable, perf) performance_counter_start_internal(is_perfcnt_enable, perf) /** * performance_counter_stop: @@ -90,6 +91,7 @@ void rarch_perf_register(struct retro_perf_counter *perf); * Stop performance counter. **/ #define performance_counter_stop(perf) performance_counter_stop_internal(runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL), perf) +#define performance_counter_stop_plus(is_perfcnt_enable, perf) performance_counter_stop_internal(is_perfcnt_enable, perf) void rarch_timer_tick(rarch_timer_t *timer);