Change RARCH_PERFORMANCE_ macro calls to RETRO_PERFORMANCE

This commit is contained in:
twinaphex 2013-12-17 19:14:57 +01:00
parent 38d785984f
commit 69a67b3df2
10 changed files with 61 additions and 61 deletions

View File

@ -63,10 +63,10 @@ typedef struct video4linux
static void process_image(video4linux_t *v4l, const uint8_t *buffer_yuv)
{
RARCH_PERFORMANCE_INIT(yuv_convert_direct);
RARCH_PERFORMANCE_START(yuv_convert_direct);
RETRO_PERFORMANCE_INIT(yuv_convert_direct);
RETRO_PERFORMANCE_START(yuv_convert_direct);
scaler_ctx_scale(&v4l->scaler, v4l->buffer_output, buffer_yuv);
RARCH_PERFORMANCE_STOP(yuv_convert_direct);
RETRO_PERFORMANCE_STOP(yuv_convert_direct);
}
static int xioctl(int fd, int request, void *args)

View File

@ -284,8 +284,8 @@ void D3DVideo::viewport_info(rarch_viewport &vp)
bool D3DVideo::read_viewport(uint8_t *buffer)
{
RARCH_PERFORMANCE_INIT(d3d_read_viewport);
RARCH_PERFORMANCE_START(d3d_read_viewport);
RETRO_PERFORMANCE_INIT(d3d_read_viewport);
RETRO_PERFORMANCE_START(d3d_read_viewport);
bool ret = true;
IDirect3DSurface9 *target = nullptr;
IDirect3DSurface9 *dest = nullptr;
@ -338,7 +338,7 @@ bool D3DVideo::read_viewport(uint8_t *buffer)
}
end:
RARCH_PERFORMANCE_STOP(d3d_read_viewport);
RETRO_PERFORMANCE_STOP(d3d_read_viewport);
if (target)
target->Release();
if (dest)
@ -606,8 +606,8 @@ bool D3DVideo::frame(const void *frame,
if (!frame)
return true;
RARCH_PERFORMANCE_INIT(d3d_frame);
RARCH_PERFORMANCE_START(d3d_frame);
RETRO_PERFORMANCE_INIT(d3d_frame);
RETRO_PERFORMANCE_START(d3d_frame);
// We cannot recover in fullscreen.
if (needs_restore && IsIconic(hWnd))
return true;
@ -670,7 +670,7 @@ bool D3DVideo::frame(const void *frame,
}
#endif
RARCH_PERFORMANCE_STOP(d3d_frame);
RETRO_PERFORMANCE_STOP(d3d_frame);
if (dev->Present(nullptr, nullptr, nullptr, nullptr) != D3D_OK)
{

View File

@ -1315,13 +1315,13 @@ static void gl_pbo_async_readback(void *data)
glPixelStorei(GL_PACK_ALIGNMENT, get_alignment(gl->vp.width * sizeof(uint32_t)));
// Read asynchronously into PBO buffer.
RARCH_PERFORMANCE_INIT(async_readback);
RARCH_PERFORMANCE_START(async_readback);
RETRO_PERFORMANCE_INIT(async_readback);
RETRO_PERFORMANCE_START(async_readback);
glReadBuffer(GL_BACK);
glReadPixels(gl->vp.x, gl->vp.y,
gl->vp.width, gl->vp.height,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
RARCH_PERFORMANCE_STOP(async_readback);
RETRO_PERFORMANCE_STOP(async_readback);
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
}
@ -1372,8 +1372,8 @@ static inline void gl_draw_texture(void *data)
static bool gl_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
{
RARCH_PERFORMANCE_INIT(frame_run);
RARCH_PERFORMANCE_START(frame_run);
RETRO_PERFORMANCE_INIT(frame_run);
RETRO_PERFORMANCE_START(frame_run);
gl_t *gl = (gl_t*)data;
@ -1419,10 +1419,10 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
#endif
{
gl_update_input_size(gl, width, height, pitch, true);
RARCH_PERFORMANCE_INIT(copy_frame);
RARCH_PERFORMANCE_START(copy_frame);
RETRO_PERFORMANCE_INIT(copy_frame);
RETRO_PERFORMANCE_START(copy_frame);
gl_copy_frame(gl, frame, width, height, pitch);
RARCH_PERFORMANCE_STOP(copy_frame);
RETRO_PERFORMANCE_STOP(copy_frame);
}
}
else
@ -1501,7 +1501,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
context_update_window_title_func();
RARCH_PERFORMANCE_STOP(frame_run);
RETRO_PERFORMANCE_STOP(frame_run);
#ifdef HAVE_FBO
// Reset state which could easily mess up libretro core.
@ -1527,8 +1527,8 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
#ifdef HAVE_GL_SYNC
if (g_settings.video.hard_sync && gl->have_sync)
{
RARCH_PERFORMANCE_INIT(gl_fence);
RARCH_PERFORMANCE_START(gl_fence);
RETRO_PERFORMANCE_INIT(gl_fence);
RETRO_PERFORMANCE_START(gl_fence);
glClear(GL_COLOR_BUFFER_BIT);
gl->fences[gl->fence_count++] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
@ -1541,7 +1541,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
memmove(gl->fences, gl->fences + 1, gl->fence_count * sizeof(GLsync));
}
RARCH_PERFORMANCE_STOP(gl_fence);
RETRO_PERFORMANCE_STOP(gl_fence);
}
#endif
@ -2341,8 +2341,8 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
gl_t *gl = (gl_t*)data;
(void)i;
RARCH_PERFORMANCE_INIT(read_viewport);
RARCH_PERFORMANCE_START(read_viewport);
RETRO_PERFORMANCE_INIT(read_viewport);
RETRO_PERFORMANCE_START(read_viewport);
#ifdef HAVE_FBO
// Make sure we're reading from backbuffer incase some state has been overridden.
@ -2398,7 +2398,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
}
#endif
RARCH_PERFORMANCE_STOP(read_viewport);
RETRO_PERFORMANCE_STOP(read_viewport);
return true;
}
#endif

View File

@ -305,10 +305,10 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width, unsigne
if (SDL_MUSTLOCK(vid->screen))
SDL_LockSurface(vid->screen);
RARCH_PERFORMANCE_INIT(sdl_scale);
RARCH_PERFORMANCE_START(sdl_scale);
RETRO_PERFORMANCE_INIT(sdl_scale);
RETRO_PERFORMANCE_START(sdl_scale);
scaler_ctx_scale(&vid->scaler, vid->screen->pixels, frame);
RARCH_PERFORMANCE_STOP(sdl_scale);
RETRO_PERFORMANCE_STOP(sdl_scale);
if (msg)
sdl_render_msg(vid, vid->screen, msg, vid->screen->w, vid->screen->h, vid->screen->format);

View File

@ -394,8 +394,8 @@ static bool thread_focus(void *data)
static bool thread_frame(void *data, const void *frame_,
unsigned width, unsigned height, unsigned pitch, const char *msg)
{
RARCH_PERFORMANCE_INIT(thread_frame);
RARCH_PERFORMANCE_START(thread_frame);
RETRO_PERFORMANCE_INIT(thread_frame);
RETRO_PERFORMANCE_START(thread_frame);
thread_video_t *thr = (thread_video_t*)data;
unsigned copy_stride = width * (thr->info.rgb32 ? sizeof(uint32_t) : sizeof(uint16_t));
@ -461,7 +461,7 @@ static bool thread_frame(void *data, const void *frame_,
slock_unlock(thr->lock);
RARCH_PERFORMANCE_STOP(thread_frame);
RETRO_PERFORMANCE_STOP(thread_frame);
thr->last_time = rarch_get_time_usec();
return true;

View File

@ -354,8 +354,8 @@ static void vg_copy_frame(void *data, const void *frame, unsigned width, unsigne
static bool vg_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
{
RARCH_PERFORMANCE_INIT(vg_fr);
RARCH_PERFORMANCE_START(vg_fr);
RETRO_PERFORMANCE_INIT(vg_fr);
RETRO_PERFORMANCE_START(vg_fr);
vg_t *vg = (vg_t*)data;
if (width != vg->mRenderWidth || height != vg->mRenderHeight || vg->should_resize)
@ -377,10 +377,10 @@ static bool vg_frame(void *data, const void *frame, unsigned width, unsigned hei
vgClear(0, 0, vg->mScreenWidth, vg->mScreenHeight);
vgSeti(VG_SCISSORING, VG_TRUE);
RARCH_PERFORMANCE_INIT(vg_image);
RARCH_PERFORMANCE_START(vg_image);
RETRO_PERFORMANCE_INIT(vg_image);
RETRO_PERFORMANCE_START(vg_image);
vg_copy_frame(vg, frame, width, height, pitch);
RARCH_PERFORMANCE_STOP(vg_image);
RETRO_PERFORMANCE_STOP(vg_image);
vgDrawImage(vg->mImage);
@ -389,7 +389,7 @@ static bool vg_frame(void *data, const void *frame, unsigned width, unsigned hei
vg->driver->update_window_title();
RARCH_PERFORMANCE_STOP(vg_fr);
RETRO_PERFORMANCE_STOP(vg_fr);
vg->driver->swap_buffers();
return true;

View File

@ -626,42 +626,42 @@ struct retro_perf_callback
#if defined(PERF_TEST)
#define RARCH_PERFORMANCE_INIT(X) \
#define RETRO_PERFORMANCE_INIT(X) \
static retro_perf_counter_t X = {#X}; \
do { \
if (!(X).registered) \
rarch_perf_register(&(X)); \
} while(0)
#define RARCH_PERFORMANCE_START(X) do { \
#define RETRO_PERFORMANCE_START(X) do { \
(X).call_cnt++; \
(X).start = rarch_get_perf_counter(); \
} while(0)
#define RARCH_PERFORMANCE_STOP(X) do { \
#define RETRO_PERFORMANCE_STOP(X) do { \
(X).total += rarch_get_perf_counter() - (X).start; \
} while(0)
#elif !defined(RARCH_INTERNAL)
#define RARCH_PERFORMANCE_INIT(X, perf_register_cb) static retro_perf_counter_t X = {#X}; \
#define RETRO_PERFORMANCE_INIT(X, perf_register_cb) static retro_perf_counter_t X = {#X}; \
do { \
if (!(X).registered) \
perf_register_cb(&(X)); \
} while(0)
#define RARCH_PERFORMANCE_START(X, get_perf_counter_cb) do { \
#define RETRO_PERFORMANCE_START(X, get_perf_counter_cb) do { \
(X).call_cnt++; \
(X).start = get_perf_counter_cb(); \
} while(0)
#define RARCH_PERFORMANCE_STOP(X, get_perf_counter_cb) do { \
#define RETRO_PERFORMANCE_STOP(X, get_perf_counter_cb) do { \
(X).total += get_perf_counter_cb() - (X).start; \
} while(0)
#else
#define RARCH_PERFORMANCE_INIT(X)
#define RARCH_PERFORMANCE_START(X)
#define RARCH_PERFORMANCE_STOP(X)
#define RETRO_PERFORMANCE_INIT(X)
#define RETRO_PERFORMANCE_START(X)
#define RETRO_PERFORMANCE_STOP(X)
#endif
// FIXME: Document the sensor API and work out behavior.

View File

@ -88,7 +88,7 @@ void rarch_perf_log(void)
unsigned i;
RARCH_LOG("[PERF]: Performance counters:\n");
for (i = 0; i < perf_ptr; i++)
RARCH_PERFORMANCE_LOG(perf_counters[i]->ident, *perf_counters[i]);
RETRO_PERFORMANCE_LOG(perf_counters[i]->ident, *perf_counters[i]);
}
retro_perf_tick_t rarch_get_perf_counter(void)

View File

@ -37,18 +37,18 @@ void rarch_get_cpu_features(unsigned *cpu);
#if defined(PERF_TEST) || !defined(RARCH_INTERNAL)
#ifdef _WIN32
#define RARCH_PERFORMANCE_LOG(functionname, X) RARCH_LOG("[PERF]: Avg (%s): %I64u ticks, %I64u runs.\n", \
#define RETRO_PERFORMANCE_LOG(functionname, X) RARCH_LOG("[PERF]: Avg (%s): %I64u ticks, %I64u runs.\n", \
functionname, \
(X).total / (X).call_cnt, \
(X).call_cnt)
#else
#define RARCH_PERFORMANCE_LOG(functionname, X) RARCH_LOG("[PERF]: Avg (%s): %llu ticks, %llu runs.\n", \
#define RETRO_PERFORMANCE_LOG(functionname, X) RARCH_LOG("[PERF]: Avg (%s): %llu ticks, %llu runs.\n", \
functionname, \
(X).total / (X).call_cnt, \
(X).call_cnt)
#endif
#else
#define RARCH_PERFORMANCE_LOG(functionname, X)
#define RETRO_PERFORMANCE_LOG(functionname, X)
#endif
#ifdef __cplusplus

View File

@ -276,8 +276,8 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
if (g_extern.system.pix_fmt == RETRO_PIXEL_FORMAT_0RGB1555 && data && data != RETRO_HW_FRAME_BUFFER_VALID)
{
RARCH_PERFORMANCE_INIT(video_frame_conv);
RARCH_PERFORMANCE_START(video_frame_conv);
RETRO_PERFORMANCE_INIT(video_frame_conv);
RETRO_PERFORMANCE_START(video_frame_conv);
driver.scaler.in_width = width;
driver.scaler.in_height = height;
driver.scaler.out_width = width;
@ -288,7 +288,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
scaler_ctx_scale(&driver.scaler, driver.scaler_out, data);
data = driver.scaler_out;
pitch = driver.scaler.out_stride;
RARCH_PERFORMANCE_STOP(video_frame_conv);
RETRO_PERFORMANCE_STOP(video_frame_conv);
}
// Slightly messy code,
@ -381,11 +381,11 @@ static bool audio_flush(const int16_t *data, size_t samples)
unsigned output_frames = 0;
struct resampler_data src_data = {0};
RARCH_PERFORMANCE_INIT(audio_convert_s16);
RARCH_PERFORMANCE_START(audio_convert_s16);
RETRO_PERFORMANCE_INIT(audio_convert_s16);
RETRO_PERFORMANCE_START(audio_convert_s16);
audio_convert_s16_to_float(g_extern.audio_data.data, data, samples,
g_extern.audio_data.volume_gain);
RARCH_PERFORMANCE_STOP(audio_convert_s16);
RETRO_PERFORMANCE_STOP(audio_convert_s16);
#if defined(HAVE_DYLIB)
rarch_dsp_output_t dsp_output = {0};
@ -412,11 +412,11 @@ static bool audio_flush(const int16_t *data, size_t samples)
if (g_extern.is_slowmotion)
src_data.ratio *= g_settings.slowmotion_ratio;
RARCH_PERFORMANCE_INIT(resampler_proc);
RARCH_PERFORMANCE_START(resampler_proc);
RETRO_PERFORMANCE_INIT(resampler_proc);
RETRO_PERFORMANCE_START(resampler_proc);
rarch_resampler_process(g_extern.audio_data.resampler,
g_extern.audio_data.resampler_data, &src_data);
RARCH_PERFORMANCE_STOP(resampler_proc);
RETRO_PERFORMANCE_STOP(resampler_proc);
output_data = g_extern.audio_data.outsamples;
output_frames = src_data.output_frames;
@ -431,11 +431,11 @@ static bool audio_flush(const int16_t *data, size_t samples)
}
else
{
RARCH_PERFORMANCE_INIT(audio_convert_float);
RARCH_PERFORMANCE_START(audio_convert_float);
RETRO_PERFORMANCE_INIT(audio_convert_float);
RETRO_PERFORMANCE_START(audio_convert_float);
audio_convert_float_to_s16(g_extern.audio_data.conv_outsamples,
output_data, output_frames * 2);
RARCH_PERFORMANCE_STOP(audio_convert_float);
RETRO_PERFORMANCE_STOP(audio_convert_float);
if (audio_write_func(g_extern.audio_data.conv_outsamples, output_frames * sizeof(int16_t) * 2) < 0)
{