Start calling performance_counter_{stop/start}_plus in case we

have is_perfcnt_enable already
This commit is contained in:
twinaphex 2017-01-25 17:02:13 +01:00
parent 727c2448b5
commit 77d5a3941b
2 changed files with 10 additions and 8 deletions

View File

@ -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);

View File

@ -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);