mirror of
https://github.com/libretro/RetroArch.git
synced 2025-05-13 08:46:10 +00:00
Merge pull request #4370 from loganmc10/threaded
Fix XMB when using threaded video and shared context
This commit is contained in:
commit
3cffd19f2a
@ -163,7 +163,7 @@ static void *gl_raster_font_init_font(void *data,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings->video.threaded)
|
if (video_driver_is_threaded())
|
||||||
video_context_driver_make_current(false);
|
video_context_driver_make_current(false);
|
||||||
|
|
||||||
glGenTextures(1, &font->tex);
|
glGenTextures(1, &font->tex);
|
||||||
@ -203,7 +203,7 @@ static void gl_raster_font_free_font(void *data)
|
|||||||
if (font->font_driver && font->font_data)
|
if (font->font_driver && font->font_data)
|
||||||
font->font_driver->free(font->font_data);
|
font->font_driver->free(font->font_data);
|
||||||
|
|
||||||
if (settings->video.threaded)
|
if (video_driver_is_threaded())
|
||||||
video_context_driver_make_current(true);
|
video_context_driver_make_current(true);
|
||||||
|
|
||||||
glDeleteTextures(1, &font->tex);
|
glDeleteTextures(1, &font->tex);
|
||||||
|
@ -372,7 +372,7 @@ font_data_t *font_driver_init_first(
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (threading_hint
|
if (threading_hint
|
||||||
&& settings->video.threaded
|
&& video_driver_is_threaded()
|
||||||
&& !video_driver_is_hw_context())
|
&& !video_driver_is_hw_context())
|
||||||
ok = video_thread_font_init(&font_driver, &font_handle,
|
ok = video_thread_font_init(&font_driver, &font_handle,
|
||||||
video_data, font_path, font_size, api, font_init_first);
|
video_data, font_path, font_size, api, font_init_first);
|
||||||
|
@ -297,7 +297,7 @@ static bool hw_render_context_is_gl(enum retro_hw_context_type type)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool video_driver_is_threaded(void)
|
bool video_driver_is_threaded(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -497,7 +497,7 @@ static void video_monitor_compute_fps_statistics(void)
|
|||||||
unsigned samples = 0;
|
unsigned samples = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (settings->video.threaded)
|
if (video_driver_is_threaded())
|
||||||
{
|
{
|
||||||
RARCH_LOG("Monitor FPS estimation is disabled for threaded video.\n");
|
RARCH_LOG("Monitor FPS estimation is disabled for threaded video.\n");
|
||||||
return;
|
return;
|
||||||
@ -982,7 +982,7 @@ bool video_monitor_fps_statistics(double *refresh_rate,
|
|||||||
unsigned samples = MIN(MEASURE_FRAME_TIME_SAMPLES_COUNT,
|
unsigned samples = MIN(MEASURE_FRAME_TIME_SAMPLES_COUNT,
|
||||||
video_driver_frame_time_count);
|
video_driver_frame_time_count);
|
||||||
|
|
||||||
if (settings->video.threaded || (samples < 2))
|
if (video_driver_is_threaded() || (samples < 2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Measure statistics on frame time (microsecs), *not* FPS. */
|
/* Measure statistics on frame time (microsecs), *not* FPS. */
|
||||||
|
@ -285,6 +285,7 @@ bool video_driver_get_hw_render_interface(const struct
|
|||||||
bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
||||||
void video_driver_set_title_buf(void);
|
void video_driver_set_title_buf(void);
|
||||||
void video_driver_monitor_adjust_system_rates(void);
|
void video_driver_monitor_adjust_system_rates(void);
|
||||||
|
bool video_driver_is_threaded(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* video_driver_find_handle:
|
* video_driver_find_handle:
|
||||||
|
@ -102,7 +102,7 @@ static const char *menu_video_get_ident(void)
|
|||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (settings->video.threaded)
|
if (video_driver_is_threaded())
|
||||||
return video_thread_get_ident();
|
return video_thread_get_ident();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user