parent
04baed2aff
commit
9ad2cc2bc6
|
@ -1211,7 +1211,7 @@ uintptr_t d3d9_load_texture(void *video_data, void *data,
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
return video_thread_texture_load(&info,
|
return video_thread_texture_handle(&info,
|
||||||
d3d9_video_texture_load_wrap_d3d);
|
d3d9_video_texture_load_wrap_d3d);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2121,7 +2121,7 @@ static uintptr_t d3d8_load_texture(void *video_data, void *data,
|
||||||
info.type = filter_type;
|
info.type = filter_type;
|
||||||
|
|
||||||
if (threaded)
|
if (threaded)
|
||||||
return video_thread_texture_load(&info,
|
return video_thread_texture_handle(&info,
|
||||||
d3d8_video_texture_load_wrap_d3d);
|
d3d8_video_texture_load_wrap_d3d);
|
||||||
|
|
||||||
d3d8_video_texture_load_d3d(&info, &id);
|
d3d8_video_texture_load_d3d(&info, &id);
|
||||||
|
|
|
@ -2130,12 +2130,30 @@ static void video_texture_load_gl1(
|
||||||
static int video_texture_load_wrap_gl1(void *data)
|
static int video_texture_load_wrap_gl1(void *data)
|
||||||
{
|
{
|
||||||
uintptr_t id = 0;
|
uintptr_t id = 0;
|
||||||
if (!data)
|
gl1_t *gl1 = (gl1_t*)video_driver_get_ptr();
|
||||||
return 0;
|
|
||||||
video_texture_load_gl1((struct texture_image*)data,
|
if (gl1->ctx_driver->make_current)
|
||||||
TEXTURE_FILTER_NEAREST, &id);
|
gl1->ctx_driver->make_current(false);
|
||||||
|
|
||||||
|
if (data)
|
||||||
|
video_texture_load_gl1((struct texture_image*)data,
|
||||||
|
TEXTURE_FILTER_NEAREST, &id);
|
||||||
return (int)id;
|
return (int)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int video_texture_unload_wrap_gl1(void *data)
|
||||||
|
{
|
||||||
|
GLuint glid;
|
||||||
|
uintptr_t id = (uintptr_t)data;
|
||||||
|
gl1_t *gl1 = (gl1_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
|
if (gl1 && gl1->ctx_driver->make_current)
|
||||||
|
gl1->ctx_driver->make_current(false);
|
||||||
|
|
||||||
|
glid = (GLuint)id;
|
||||||
|
glDeleteTextures(1, &glid);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uintptr_t gl1_load_texture(void *video_data, void *data,
|
static uintptr_t gl1_load_texture(void *video_data, void *data,
|
||||||
|
@ -2149,10 +2167,7 @@ static uintptr_t gl1_load_texture(void *video_data, void *data,
|
||||||
gl1_t *gl1 = (gl1_t*)video_data;
|
gl1_t *gl1 = (gl1_t*)video_data;
|
||||||
custom_command_method_t func = video_texture_load_wrap_gl1;
|
custom_command_method_t func = video_texture_load_wrap_gl1;
|
||||||
|
|
||||||
if (gl1->ctx_driver->make_current)
|
return video_thread_texture_handle(data, func);
|
||||||
gl1->ctx_driver->make_current(false);
|
|
||||||
|
|
||||||
return video_thread_texture_load(data, func);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2171,15 +2186,15 @@ static void gl1_unload_texture(void *data,
|
||||||
bool threaded, uintptr_t id)
|
bool threaded, uintptr_t id)
|
||||||
{
|
{
|
||||||
GLuint glid;
|
GLuint glid;
|
||||||
gl1_t *gl1 = (gl1_t*)data;
|
|
||||||
if (!id)
|
if (!id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
{
|
{
|
||||||
if (gl1->ctx_driver->make_current)
|
custom_command_method_t func = video_texture_unload_wrap_gl1;
|
||||||
gl1->ctx_driver->make_current(false);
|
video_thread_texture_handle((void *)id, func);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -5156,24 +5156,44 @@ static void video_texture_load_gl2(
|
||||||
static int video_texture_load_wrap_gl2_mipmap(void *data)
|
static int video_texture_load_wrap_gl2_mipmap(void *data)
|
||||||
{
|
{
|
||||||
uintptr_t id = 0;
|
uintptr_t id = 0;
|
||||||
|
gl2_t *gl = (gl2_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
if (!data)
|
if (gl && gl->ctx_driver->make_current)
|
||||||
return 0;
|
gl->ctx_driver->make_current(false);
|
||||||
video_texture_load_gl2((struct texture_image*)data,
|
|
||||||
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
|
if (data)
|
||||||
|
video_texture_load_gl2((struct texture_image*)data,
|
||||||
|
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
|
||||||
return (int)id;
|
return (int)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int video_texture_load_wrap_gl2(void *data)
|
static int video_texture_load_wrap_gl2(void *data)
|
||||||
{
|
{
|
||||||
uintptr_t id = 0;
|
uintptr_t id = 0;
|
||||||
|
gl2_t *gl = (gl2_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
if (!data)
|
if (gl && gl->ctx_driver->make_current)
|
||||||
return 0;
|
gl->ctx_driver->make_current(false);
|
||||||
video_texture_load_gl2((struct texture_image*)data,
|
|
||||||
TEXTURE_FILTER_LINEAR, &id);
|
if (data)
|
||||||
|
video_texture_load_gl2((struct texture_image*)data,
|
||||||
|
TEXTURE_FILTER_LINEAR, &id);
|
||||||
return (int)id;
|
return (int)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int video_texture_unload_wrap_gl2(void *data)
|
||||||
|
{
|
||||||
|
GLuint glid;
|
||||||
|
uintptr_t id = (uintptr_t)data;
|
||||||
|
gl2_t *gl = (gl2_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
|
if (gl && gl->ctx_driver->make_current)
|
||||||
|
gl->ctx_driver->make_current(false);
|
||||||
|
|
||||||
|
glid = (GLuint)id;
|
||||||
|
glDeleteTextures(1, &glid);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uintptr_t gl2_load_texture(void *video_data, void *data,
|
static uintptr_t gl2_load_texture(void *video_data, void *data,
|
||||||
|
@ -5184,12 +5204,7 @@ static uintptr_t gl2_load_texture(void *video_data, void *data,
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
{
|
{
|
||||||
gl2_t *gl = (gl2_t*)video_data;
|
|
||||||
custom_command_method_t func = video_texture_load_wrap_gl2;
|
custom_command_method_t func = video_texture_load_wrap_gl2;
|
||||||
|
|
||||||
if (gl->ctx_driver->make_current)
|
|
||||||
gl->ctx_driver->make_current(false);
|
|
||||||
|
|
||||||
switch (filter_type)
|
switch (filter_type)
|
||||||
{
|
{
|
||||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||||
|
@ -5199,7 +5214,7 @@ static uintptr_t gl2_load_texture(void *video_data, void *data,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return video_thread_texture_load(data, func);
|
return video_thread_texture_handle(data, func);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -5217,10 +5232,9 @@ static void gl2_unload_texture(void *data,
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
{
|
{
|
||||||
gl2_t *gl = (gl2_t*)data;
|
custom_command_method_t func = video_texture_unload_wrap_gl2;
|
||||||
if (gl && gl->ctx_driver)
|
video_thread_texture_handle((void *)id, func);
|
||||||
if (gl->ctx_driver->make_current)
|
return;
|
||||||
gl->ctx_driver->make_current(false);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2585,7 +2585,7 @@ static bool gl3_frame(void *data, const void *frame,
|
||||||
#endif
|
#endif
|
||||||
gl3_filter_chain_set_rotation(gl->filter_chain, retroarch_get_rotation());
|
gl3_filter_chain_set_rotation(gl->filter_chain, retroarch_get_rotation());
|
||||||
|
|
||||||
/* Sub-frame info for multiframe shaders (per real content frame).
|
/* Sub-frame info for multiframe shaders (per real content frame).
|
||||||
Should always be 1 for non-use of subframes*/
|
Should always be 1 for non-use of subframes*/
|
||||||
if (!(gl->flags & GL3_FLAG_FRAME_DUPE_LOCK))
|
if (!(gl->flags & GL3_FLAG_FRAME_DUPE_LOCK))
|
||||||
{
|
{
|
||||||
|
@ -2604,7 +2604,7 @@ static bool gl3_frame(void *data, const void *frame,
|
||||||
gl->filter_chain, 1);
|
gl->filter_chain, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GL3_ROLLING_SCANLINE_SIMULATION
|
#ifdef GL3_ROLLING_SCANLINE_SIMULATION
|
||||||
if ( (video_info->shader_subframes > 1)
|
if ( (video_info->shader_subframes > 1)
|
||||||
&& (video_info->scan_subframes)
|
&& (video_info->scan_subframes)
|
||||||
&& !video_info->black_frame_insertion
|
&& !video_info->black_frame_insertion
|
||||||
|
@ -2620,8 +2620,8 @@ static bool gl3_frame(void *data, const void *frame,
|
||||||
{
|
{
|
||||||
gl3_filter_chain_set_simulate_scanline(
|
gl3_filter_chain_set_simulate_scanline(
|
||||||
gl->filter_chain, false);
|
gl->filter_chain, false);
|
||||||
}
|
}
|
||||||
#endif // GL3_ROLLING_SCANLINE_SIMULATION
|
#endif // GL3_ROLLING_SCANLINE_SIMULATION
|
||||||
|
|
||||||
gl3_filter_chain_set_input_texture(gl->filter_chain, &texture);
|
gl3_filter_chain_set_input_texture(gl->filter_chain, &texture);
|
||||||
gl3_filter_chain_build_offscreen_passes(gl->filter_chain,
|
gl3_filter_chain_build_offscreen_passes(gl->filter_chain,
|
||||||
|
@ -2845,24 +2845,44 @@ static struct video_shader *gl3_get_current_shader(void *data)
|
||||||
static int video_texture_load_wrap_gl3_mipmap(void *data)
|
static int video_texture_load_wrap_gl3_mipmap(void *data)
|
||||||
{
|
{
|
||||||
GLuint id = 0;
|
GLuint id = 0;
|
||||||
|
gl3_t *gl = (gl3_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
if (!data)
|
if (gl && gl->ctx_driver->make_current)
|
||||||
return 0;
|
gl->ctx_driver->make_current(false);
|
||||||
video_texture_load_gl3((struct texture_image*)data,
|
|
||||||
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
|
if (data)
|
||||||
|
video_texture_load_gl3((struct texture_image*)data,
|
||||||
|
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
|
||||||
return (int)id;
|
return (int)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int video_texture_load_wrap_gl3(void *data)
|
static int video_texture_load_wrap_gl3(void *data)
|
||||||
{
|
{
|
||||||
GLuint id = 0;
|
GLuint id = 0;
|
||||||
|
gl3_t *gl = (gl3_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
if (!data)
|
if (gl && gl->ctx_driver->make_current)
|
||||||
return 0;
|
gl->ctx_driver->make_current(false);
|
||||||
video_texture_load_gl3((struct texture_image*)data,
|
|
||||||
TEXTURE_FILTER_LINEAR, &id);
|
if (data)
|
||||||
|
video_texture_load_gl3((struct texture_image*)data,
|
||||||
|
TEXTURE_FILTER_LINEAR, &id);
|
||||||
return (int)id;
|
return (int)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int video_texture_unload_wrap_gl3(void *data)
|
||||||
|
{
|
||||||
|
GLuint glid;
|
||||||
|
uintptr_t id = (uintptr_t)data;
|
||||||
|
gl3_t *gl = (gl3_t*)video_driver_get_ptr();
|
||||||
|
|
||||||
|
if (gl && gl->ctx_driver->make_current)
|
||||||
|
gl->ctx_driver->make_current(false);
|
||||||
|
|
||||||
|
glid = (GLuint)id;
|
||||||
|
glDeleteTextures(1, &glid);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uintptr_t gl3_load_texture(void *video_data, void *data,
|
static uintptr_t gl3_load_texture(void *video_data, void *data,
|
||||||
|
@ -2873,12 +2893,7 @@ static uintptr_t gl3_load_texture(void *video_data, void *data,
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
{
|
{
|
||||||
gl3_t *gl = (gl3_t*)video_data;
|
|
||||||
custom_command_method_t func = video_texture_load_wrap_gl3;
|
custom_command_method_t func = video_texture_load_wrap_gl3;
|
||||||
|
|
||||||
if (gl->ctx_driver->make_current)
|
|
||||||
gl->ctx_driver->make_current(false);
|
|
||||||
|
|
||||||
switch (filter_type)
|
switch (filter_type)
|
||||||
{
|
{
|
||||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||||
|
@ -2888,7 +2903,7 @@ static uintptr_t gl3_load_texture(void *video_data, void *data,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return video_thread_texture_load(data, func);
|
return video_thread_texture_handle(data, func);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2900,15 +2915,15 @@ static void gl3_unload_texture(void *data, bool threaded,
|
||||||
uintptr_t id)
|
uintptr_t id)
|
||||||
{
|
{
|
||||||
GLuint glid;
|
GLuint glid;
|
||||||
gl3_t *gl = (gl3_t*)data;
|
|
||||||
if (!id)
|
if (!id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (threaded)
|
if (threaded)
|
||||||
{
|
{
|
||||||
if (gl->ctx_driver->make_current)
|
custom_command_method_t func = video_texture_unload_wrap_gl3;
|
||||||
gl->ctx_driver->make_current(false);
|
video_thread_texture_handle((void *)id, func);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1423,7 +1423,7 @@ bool video_thread_font_init(const void **font_driver, void **font_handle,
|
||||||
return pkt.data.font_init.return_value;
|
return pkt.data.font_init.return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned video_thread_texture_load(void *data, custom_command_method_t func)
|
unsigned video_thread_texture_handle(void *data, custom_command_method_t func)
|
||||||
{
|
{
|
||||||
thread_packet_t pkt;
|
thread_packet_t pkt;
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
|
|
|
@ -61,7 +61,7 @@ enum thread_cmd
|
||||||
CMD_POKE_SET_HDR_MAX_NITS,
|
CMD_POKE_SET_HDR_MAX_NITS,
|
||||||
CMD_POKE_SET_HDR_PAPER_WHITE_NITS,
|
CMD_POKE_SET_HDR_PAPER_WHITE_NITS,
|
||||||
CMD_POKE_SET_HDR_CONTRAST,
|
CMD_POKE_SET_HDR_CONTRAST,
|
||||||
CMD_POKE_SET_HDR_EXPAND_GAMUT,
|
CMD_POKE_SET_HDR_EXPAND_GAMUT,
|
||||||
|
|
||||||
CMD_DUMMY = INT_MAX
|
CMD_DUMMY = INT_MAX
|
||||||
};
|
};
|
||||||
|
@ -270,7 +270,7 @@ bool video_thread_font_init(
|
||||||
custom_font_command_method_t func,
|
custom_font_command_method_t func,
|
||||||
bool is_threaded);
|
bool is_threaded);
|
||||||
|
|
||||||
unsigned video_thread_texture_load(void *data,
|
unsigned video_thread_texture_handle(void *data,
|
||||||
custom_command_method_t func);
|
custom_command_method_t func);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
Loading…
Reference in New Issue