Get rid of unused video_driver_get_frame_count - locking/unlocking

around this variable should no longer be necessary
This commit is contained in:
twinaphex 2017-04-23 21:39:49 +02:00
parent c38f86e14a
commit 087002d9c5
4 changed files with 11 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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