diff --git a/gfx/drivers_renderchain/xdk_renderchain.cpp b/gfx/drivers_renderchain/xdk_renderchain.cpp index 7a9f1c3c21..e767800099 100644 --- a/gfx/drivers_renderchain/xdk_renderchain.cpp +++ b/gfx/drivers_renderchain/xdk_renderchain.cpp @@ -42,6 +42,7 @@ typedef struct xdk_renderchain #endif unsigned tex_w; unsigned tex_h; + uint64_t frame_count; } xdk_renderchain_t; static void renderchain_set_mvp(void *data, unsigned vp_width, @@ -401,18 +402,17 @@ static bool xdk_renderchain_render(void *data, const void *frame, { unsigned i; unsigned width, height; - uint64_t *frame_count = NULL; d3d_video_t *d3d = (d3d_video_t*)data; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev; settings_t *settings = config_get_ptr(); xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data; - frame_count = video_driver_get_frame_count_ptr(); + chain->frame_count++; video_driver_get_size(&width, &height); renderchain_blit_to_texture(chain, frame, frame_width, frame_height, pitch); - renderchain_set_vertices(d3d, 1, frame_width, frame_height, *frame_count); + renderchain_set_vertices(d3d, 1, frame_width, frame_height, chain->frame_count); d3d_set_texture(d3dr, 0, chain->tex); d3d_set_viewports(chain->dev, &d3d->final_viewport); diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 93b175985f..550c12c5e1 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1647,14 +1647,6 @@ bool video_driver_read_viewport(uint8_t *buffer, bool is_idle) return false; } -uint64_t video_driver_get_frame_count(void) -{ - uint64_t frame_count; - video_driver_threaded_lock(); - frame_count = video_driver_frame_count; - video_driver_threaded_unlock(); - return frame_count; -} bool video_driver_frame_filter_alive(void) { @@ -2379,7 +2371,7 @@ void video_driver_get_window_title(char *buf, unsigned len) void video_driver_get_status(uint64_t *frame_count, bool * is_alive, bool *is_focused) { - *frame_count = video_driver_get_frame_count(); + *frame_count = video_driver_frame_count; *is_alive = video_driver_is_alive(); *is_focused = video_driver_is_focused(); } diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 34adede943..bb86cab17f 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -347,7 +347,6 @@ bool video_driver_find_driver(void); void video_driver_apply_state_changes(void); bool video_driver_read_viewport(uint8_t *buffer, bool is_idle); bool video_driver_cached_frame(void); -uint64_t video_driver_get_frame_count(void); bool video_driver_frame_filter_alive(void); bool video_driver_frame_filter_is_32bit(void); void video_driver_default_settings(void); diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index 3344667b19..6fac9572d5 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -67,6 +67,7 @@ HXUIOBJ m_back; HXUIOBJ root_menu; HXUIOBJ current_menu; static msg_queue_t *xui_msg_queue = NULL; +static uint64_t xui_frame_count = 0; class CRetroArch : public CXuiModule { @@ -362,6 +363,8 @@ static void xui_free(void *data) (void)data; app.Uninit(); + xui_frame_count = 0; + if (xui_msg_queue) msg_queue_free(xui_msg_queue); } @@ -422,6 +425,8 @@ static void xui_frame(void *data, video_frame_info_t *video_info) if (!d3dr) return; + xui_frame_count++; + menu_display_set_viewport(video_info->width, video_info->height); app.RunFrame(); @@ -536,7 +541,7 @@ static void xui_render(void *data) const char *dir = NULL; const char *label = NULL; unsigned menu_type = 0; - uint64_t *frame_count = video_driver_get_frame_count_ptr(); + uint64_t frame_count = xui_frame_count; bool msg_force = menu_display_get_msg_force(); menu_display_get_fb_size(&fb_width, &fb_height, @@ -560,7 +565,7 @@ static void xui_render(void *data) mbstowcs(strw_buffer, title, sizeof(strw_buffer) / sizeof(wchar_t)); XuiTextElementSetText(m_menutitle, strw_buffer); menu_animation_ticker_str(title, RXUI_TERM_WIDTH(fb_width) - 3, - (unsigned int)*frame_count / 15, title, true); + (unsigned int)frame_count / 15, title, true); } if (XuiHandleIsValid(m_menutitle))