mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Remove video_driver_set_video_cache_context_ack - replace with single line
This commit is contained in:
parent
f062b74e26
commit
e108fefc41
@ -1756,7 +1756,7 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
|||||||
vk->context.device = cached_device_vk;
|
vk->context.device = cached_device_vk;
|
||||||
cached_device_vk = NULL;
|
cached_device_vk = NULL;
|
||||||
|
|
||||||
video_driver_set_video_cache_context_ack();
|
video_state_get_ptr()->flags |= VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
||||||
RARCH_LOG("[Vulkan]: Using cached Vulkan context.\n");
|
RARCH_LOG("[Vulkan]: Using cached Vulkan context.\n");
|
||||||
}
|
}
|
||||||
else if (vkCreateDevice(vk->context.gpu, &device_info,
|
else if (vkCreateDevice(vk->context.gpu, &device_info,
|
||||||
|
@ -241,12 +241,13 @@ static bool sdl_ctx_set_video_mode(void *data,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sdl->ctx)
|
if (sdl->ctx)
|
||||||
video_driver_set_video_cache_context_ack();
|
{
|
||||||
|
video_state_get_ptr()->flags |= VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
||||||
|
RARCH_LOG("[SDL_GL]: Using cached GL context.\n");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sdl->ctx = SDL_GL_CreateContext(sdl->win);
|
if (!(sdl->ctx = SDL_GL_CreateContext(sdl->win)))
|
||||||
|
|
||||||
if (!sdl->ctx)
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -186,8 +186,8 @@ static void create_gl_context(HWND hwnd, bool *quit)
|
|||||||
|
|
||||||
if (win32_hrc)
|
if (win32_hrc)
|
||||||
{
|
{
|
||||||
|
video_state_get_ptr()->flags |= VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
||||||
RARCH_LOG("[WGL]: Using cached GL context.\n");
|
RARCH_LOG("[WGL]: Using cached GL context.\n");
|
||||||
video_driver_set_video_cache_context_ack();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -846,7 +846,7 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
video_driver_set_video_cache_context_ack();
|
video_state_get_ptr()->flags |= VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
||||||
RARCH_LOG("[GLX]: Using cached GL context.\n");
|
RARCH_LOG("[GLX]: Using cached GL context.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2457,12 +2457,6 @@ const struct retro_hw_render_context_negotiation_interface *
|
|||||||
return video_st->hw_render_context_negotiation;
|
return video_st->hw_render_context_negotiation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_set_video_cache_context_ack(void)
|
|
||||||
{
|
|
||||||
video_driver_state_t *video_st = &video_driver_st;
|
|
||||||
video_st->flags |= VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool video_driver_get_viewport_info(struct video_viewport *viewport)
|
bool video_driver_get_viewport_info(struct video_viewport *viewport)
|
||||||
{
|
{
|
||||||
video_driver_state_t *video_st = &video_driver_st;
|
video_driver_state_t *video_st = &video_driver_st;
|
||||||
@ -3135,16 +3129,17 @@ bool video_context_driver_set_flags(gfx_ctx_flags_t *flags)
|
|||||||
if (!flags)
|
if (!flags)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (video_st->current_video_context.set_flags)
|
if (!video_st->current_video_context.set_flags)
|
||||||
{
|
{
|
||||||
video_st->current_video_context.set_flags(
|
video_st->deferred_flag_data.flags = flags->flags;
|
||||||
video_st->context_data, flags->flags);
|
video_st->flags |= VIDEO_FLAG_DEFERRED_VIDEO_CTX_DRIVER_SET_FLAGS;
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
video_st->deferred_flag_data.flags = flags->flags;
|
video_st->current_video_context.set_flags(
|
||||||
video_st->flags |= VIDEO_FLAG_DEFERRED_VIDEO_CTX_DRIVER_SET_FLAGS;
|
video_st->context_data, flags->flags);
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum gfx_ctx_api video_context_driver_get_api(void)
|
enum gfx_ctx_api video_context_driver_get_api(void)
|
||||||
@ -4181,12 +4176,12 @@ void video_driver_reinit(int flags)
|
|||||||
struct retro_hw_render_callback *hwr =
|
struct retro_hw_render_callback *hwr =
|
||||||
VIDEO_DRIVER_GET_HW_CONTEXT_INTERNAL(video_st);
|
VIDEO_DRIVER_GET_HW_CONTEXT_INTERNAL(video_st);
|
||||||
if (hwr->cache_context != false)
|
if (hwr->cache_context != false)
|
||||||
video_st->flags |= VIDEO_FLAG_CACHE_CONTEXT;
|
video_st->flags |= VIDEO_FLAG_CACHE_CONTEXT;
|
||||||
else
|
else
|
||||||
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT;
|
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT;
|
||||||
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT_ACK;
|
||||||
video_driver_reinit_context(settings, flags);
|
video_driver_reinit_context(settings, flags);
|
||||||
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT;
|
video_st->flags &= ~VIDEO_FLAG_CACHE_CONTEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FRAME_DELAY_AUTO_DEBUG 0
|
#define FRAME_DELAY_AUTO_DEBUG 0
|
||||||
@ -4285,17 +4280,17 @@ void video_frame_delay_auto(video_driver_state_t *video_st, video_frame_delay_au
|
|||||||
mode = 3;
|
mode = 3;
|
||||||
/* Boost med/max spikes */
|
/* Boost med/max spikes */
|
||||||
else if (
|
else if (
|
||||||
frame_time_count_pos >= frame_time_frames_half
|
( frame_time_count_pos >= frame_time_frames_half)
|
||||||
&& ( frame_time_count_max > 0
|
&& ( frame_time_count_max > 0
|
||||||
|| frame_time_count_med > 1)
|
|| frame_time_count_med > 1)
|
||||||
&& frame_time_count_max == frame_time_count_med
|
&& ( frame_time_count_max == frame_time_count_med)
|
||||||
&& frame_time_delta < frame_time_target
|
&& ( frame_time_delta < frame_time_target)
|
||||||
)
|
)
|
||||||
mode = 4;
|
mode = 4;
|
||||||
/* Ignore */
|
/* Ignore */
|
||||||
else if (
|
else if (
|
||||||
frame_time_delta > frame_time_target
|
(frame_time_delta > frame_time_target)
|
||||||
&& frame_time_count_med == 0
|
&& (frame_time_count_med == 0)
|
||||||
)
|
)
|
||||||
mode = -1;
|
mode = -1;
|
||||||
|
|
||||||
|
@ -1028,8 +1028,6 @@ struct retro_hw_render_callback *video_driver_get_hw_context(void);
|
|||||||
const struct retro_hw_render_context_negotiation_interface
|
const struct retro_hw_render_context_negotiation_interface
|
||||||
*video_driver_get_context_negotiation_interface(void);
|
*video_driver_get_context_negotiation_interface(void);
|
||||||
|
|
||||||
void video_driver_set_video_cache_context_ack(void);
|
|
||||||
|
|
||||||
bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user