mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
Try to use performance counter plus functions in most cases
This commit is contained in:
parent
77d5a3941b
commit
a9164b7124
@ -613,7 +613,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
fflush(stdout);
|
||||
|
||||
performance_counter_init(ctrframe_f, "ctrframe_f");
|
||||
performance_counter_start(ctrframe_f);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, ctrframe_f);
|
||||
|
||||
if (ctr->should_resize)
|
||||
ctr_update_viewport(ctr);
|
||||
@ -842,7 +842,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
ctr->current_buffer_top ^= 1;
|
||||
ctr->p3d_event_pending = true;
|
||||
ctr->ppf_event_pending = true;
|
||||
performance_counter_stop(ctrframe_f);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, ctrframe_f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1388,7 +1388,7 @@ static bool d3d_frame(void *data, const void *frame,
|
||||
return true;
|
||||
|
||||
performance_counter_init(d3d_frame, "d3d_frame");
|
||||
performance_counter_start(d3d_frame);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, d3d_frame);
|
||||
|
||||
/* We cannot recover in fullscreen. */
|
||||
if (d3d->needs_restore)
|
||||
@ -1467,7 +1467,7 @@ static bool d3d_frame(void *data, const void *frame,
|
||||
|
||||
video_context_driver_update_window_title(video_info);
|
||||
|
||||
performance_counter_stop(d3d_frame);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, d3d_frame);
|
||||
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
|
||||
|
@ -690,7 +690,7 @@ static INLINE void gl_copy_frame(gl_t *gl,
|
||||
static struct retro_perf_counter copy_frame = {0};
|
||||
|
||||
performance_counter_init(copy_frame, "copy_frame");
|
||||
performance_counter_start(copy_frame);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, copy_frame);
|
||||
|
||||
#if defined(HAVE_PSGL)
|
||||
{
|
||||
@ -820,7 +820,7 @@ static INLINE void gl_copy_frame(gl_t *gl,
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
#endif
|
||||
performance_counter_stop(copy_frame);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, copy_frame);
|
||||
}
|
||||
|
||||
static INLINE void gl_set_shader_viewport(gl_t *gl, unsigned idx)
|
||||
@ -1102,7 +1102,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
unsigned height = video_info->height;
|
||||
|
||||
performance_counter_init(frame_run, "frame_run");
|
||||
performance_counter_start(frame_run);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, frame_run);
|
||||
|
||||
if (!gl)
|
||||
return false;
|
||||
@ -1293,7 +1293,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
|
||||
video_context_driver_update_window_title(video_info);
|
||||
|
||||
performance_counter_stop(frame_run);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, frame_run);
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
@ -1354,7 +1354,8 @@ static bool gl_frame(void *data, const void *frame,
|
||||
static struct retro_perf_counter gl_fence = {0};
|
||||
|
||||
performance_counter_init(gl_fence, "gl_fence");
|
||||
performance_counter_start(gl_fence);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable,
|
||||
gl_fence);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
gl->fences[gl->fence_count++] =
|
||||
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
@ -1370,7 +1371,8 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl->fence_count * sizeof(GLsync));
|
||||
}
|
||||
|
||||
performance_counter_stop(gl_fence);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable,
|
||||
gl_fence);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1452,7 +1452,7 @@ static bool gx_frame(void *data, const void *frame,
|
||||
fps_text_buf[0] = '\0';
|
||||
|
||||
performance_counter_init(gx_frame, "gx_frame");
|
||||
performance_counter_start(gx_frame);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, gx_frame);
|
||||
|
||||
if(!gx || (!frame && !gx->menu_texture_enable))
|
||||
return true;
|
||||
@ -1488,7 +1488,7 @@ static bool gx_frame(void *data, const void *frame,
|
||||
static struct retro_perf_counter gx_frame_convert = {0};
|
||||
|
||||
performance_counter_init(gx_frame_convert, "gx_frame_convert");
|
||||
performance_counter_start(gx_frame_convert);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, gx_frame_convert);
|
||||
|
||||
if (gx->rgb32)
|
||||
convert_texture32(frame, g_tex.data, width, height, pitch);
|
||||
@ -1498,7 +1498,7 @@ static bool gx_frame(void *data, const void *frame,
|
||||
convert_texture16(frame, g_tex.data, width, height, pitch);
|
||||
DCFlushRange(g_tex.data, height * (width << (gx->rgb32 ? 2 : 1)));
|
||||
|
||||
performance_counter_stop(gx_frame_convert);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, gx_frame_convert);
|
||||
}
|
||||
|
||||
if (gx->menu_texture_enable && gx->menu_data)
|
||||
@ -1580,7 +1580,7 @@ static bool gx_frame(void *data, const void *frame,
|
||||
VIDEO_SetNextFramebuffer(gx->framebuf[g_current_framebuf]);
|
||||
VIDEO_Flush();
|
||||
|
||||
performance_counter_stop(gx_frame);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, gx_frame);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ static bool psp_frame(void *data, const void *frame,
|
||||
psp->draw_buffer = FROM_GU_POINTER(sceGuSwapBuffers());
|
||||
|
||||
performance_counter_init(psp_frame_run, "psp_frame_run");
|
||||
performance_counter_start(psp_frame_run);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, psp_frame_run);
|
||||
|
||||
if (psp->should_resize)
|
||||
psp_update_viewport(psp, video_info);
|
||||
@ -568,7 +568,7 @@ static bool psp_frame(void *data, const void *frame,
|
||||
|
||||
sceGuFinish();
|
||||
|
||||
performance_counter_stop(psp_frame_run);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, psp_frame_run);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
|
@ -514,11 +514,11 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
||||
sdl_refresh_input_size(vid, false, vid->video.rgb32, width, height, pitch);
|
||||
|
||||
performance_counter_init(sdl_copy_frame, "sdl_copy_frame");
|
||||
performance_counter_start(sdl_copy_frame);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, sdl_copy_frame);
|
||||
|
||||
SDL_UpdateTexture(vid->frame.tex, NULL, frame, pitch);
|
||||
|
||||
performance_counter_stop(sdl_copy_frame);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, sdl_copy_frame);
|
||||
}
|
||||
|
||||
SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);
|
||||
|
@ -354,7 +354,7 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
||||
SDL_LockSurface(vid->screen);
|
||||
|
||||
performance_counter_init(sdl_scale, "sdl_scale");
|
||||
performance_counter_start(sdl_scale);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, sdl_scale);
|
||||
|
||||
video_frame_scale(
|
||||
&vid->scaler,
|
||||
@ -367,7 +367,7 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
||||
width,
|
||||
height,
|
||||
pitch);
|
||||
performance_counter_stop(sdl_scale);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, sdl_scale);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
|
@ -391,7 +391,7 @@ static bool vg_frame(void *data, const void *frame,
|
||||
unsigned height = video_info->height;
|
||||
|
||||
performance_counter_init(vg_fr, "vg_fr");
|
||||
performance_counter_start(vg_fr);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, vg_fr);
|
||||
|
||||
if ( frame_width != vg->mRenderWidth
|
||||
|| frame_height != vg->mRenderHeight
|
||||
@ -416,9 +416,9 @@ static bool vg_frame(void *data, const void *frame,
|
||||
vgSeti(VG_SCISSORING, VG_TRUE);
|
||||
|
||||
performance_counter_init(vg_image, "vg_image");
|
||||
performance_counter_start(vg_image);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, vg_image);
|
||||
vg_copy_frame(vg, frame, frame_width, frame_height, pitch);
|
||||
performance_counter_stop(vg_image);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, vg_image);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
@ -433,7 +433,7 @@ static bool vg_frame(void *data, const void *frame,
|
||||
|
||||
video_context_driver_update_window_title(video_info);
|
||||
|
||||
performance_counter_stop(vg_fr);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, vg_fr);
|
||||
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
|
||||
|
@ -1554,7 +1554,8 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
performance_counter_init(begin_cmd, "begin_command");
|
||||
performance_counter_init(build_cmd, "build_command");
|
||||
performance_counter_init(end_cmd, "end_command");
|
||||
performance_counter_start(frame_run);
|
||||
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, frame_run);
|
||||
|
||||
/* Bookkeeping on start of frame. */
|
||||
chain = &vk->swapchain[frame_index];
|
||||
@ -1564,14 +1565,14 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
vulkan_buffer_chain_discard(&chain->vbo);
|
||||
vulkan_buffer_chain_discard(&chain->ubo);
|
||||
|
||||
performance_counter_start(begin_cmd);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, begin_cmd);
|
||||
/* Start recording the command buffer. */
|
||||
vk->cmd = chain->cmd;
|
||||
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||
vkResetCommandBuffer(vk->cmd, 0);
|
||||
|
||||
vkBeginCommandBuffer(vk->cmd, &begin_info);
|
||||
performance_counter_stop(begin_cmd);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, begin_cmd);
|
||||
|
||||
memset(&vk->tracker, 0, sizeof(vk->tracker));
|
||||
|
||||
@ -1596,7 +1597,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
}
|
||||
|
||||
/* Upload texture */
|
||||
performance_counter_start(copy_frame);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, copy_frame);
|
||||
if (frame && !vk->hw.enable)
|
||||
{
|
||||
unsigned y;
|
||||
@ -1647,13 +1648,13 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
|
||||
vk->last_valid_index = frame_index;
|
||||
}
|
||||
performance_counter_stop(copy_frame);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, copy_frame);
|
||||
|
||||
/* Notify filter chain about the new sync index. */
|
||||
vulkan_filter_chain_notify_sync_index((vulkan_filter_chain_t*)vk->filter_chain, frame_index);
|
||||
vulkan_filter_chain_set_frame_count((vulkan_filter_chain_t*)vk->filter_chain, frame_count);
|
||||
|
||||
performance_counter_start(build_cmd);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, build_cmd);
|
||||
/* Render offscreen filter chain passes. */
|
||||
{
|
||||
/* Set the source texture in the filter chain */
|
||||
@ -1781,7 +1782,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
if (vk->overlay.enable)
|
||||
vulkan_render_overlay(vk, video_info);
|
||||
#endif
|
||||
performance_counter_stop(build_cmd);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, build_cmd);
|
||||
|
||||
/* End the render pass. We're done rendering to backbuffer now. */
|
||||
vkCmdEndRenderPass(vk->cmd);
|
||||
@ -1850,9 +1851,9 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
vk->context->graphics_queue_index, vk->hw.src_queue_family);
|
||||
}
|
||||
|
||||
performance_counter_start(end_cmd);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, end_cmd);
|
||||
vkEndCommandBuffer(vk->cmd);
|
||||
performance_counter_stop(end_cmd);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, end_cmd);
|
||||
|
||||
/* Submit command buffers to GPU. */
|
||||
|
||||
@ -1894,9 +1895,9 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
}
|
||||
submit_info.pSignalSemaphores = submit_info.signalSemaphoreCount ? signal_semaphores : NULL;
|
||||
|
||||
performance_counter_stop(frame_run);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, frame_run);
|
||||
|
||||
performance_counter_start(queue_submit);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, queue_submit);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
slock_lock(vk->context->queue_lock);
|
||||
@ -1906,11 +1907,11 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_THREADS
|
||||
slock_unlock(vk->context->queue_lock);
|
||||
#endif
|
||||
performance_counter_stop(queue_submit);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, queue_submit);
|
||||
|
||||
performance_counter_start(swapbuffers);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, swapbuffers);
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
performance_counter_stop(swapbuffers);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, swapbuffers);
|
||||
|
||||
if (!vk->context->swap_interval_emulation_lock)
|
||||
video_context_driver_update_window_title(video_info);
|
||||
|
@ -618,7 +618,7 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
static struct retro_perf_counter gfx_frame_perf = {0};
|
||||
performance_counter_init(gfx_frame_perf, "gfx_frame");
|
||||
performance_counter_start(gfx_frame_perf);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, gfx_frame_perf);
|
||||
|
||||
if (wiiu->should_resize)
|
||||
wiiu_gfx_update_viewport(wiiu);
|
||||
@ -702,7 +702,7 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
GX2SwapScanBuffers();
|
||||
GX2Flush();
|
||||
performance_counter_stop(gfx_frame_perf);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, gfx_frame_perf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1102,11 +1102,11 @@ static bool video_driver_frame_filter(
|
||||
|
||||
*output_pitch = (*output_width) * video_driver_state_out_bpp;
|
||||
|
||||
performance_counter_start(softfilter_process);
|
||||
performance_counter_start_plus(video_info->is_perfcnt_enable, softfilter_process);
|
||||
rarch_softfilter_process(video_driver_state_filter,
|
||||
video_driver_state_buffer, *output_pitch,
|
||||
data, width, height, pitch);
|
||||
performance_counter_stop(softfilter_process);
|
||||
performance_counter_stop_plus(video_info->is_perfcnt_enable, softfilter_process);
|
||||
|
||||
if (video_info->post_filter_record && recording_data)
|
||||
recording_dump_frame(video_driver_state_buffer,
|
||||
|
Loading…
x
Reference in New Issue
Block a user