Revert "Fix issue #6747 black bug"

This commit is contained in:
Twinaphex 2019-01-10 22:52:13 +01:00 committed by GitHub
parent 3ac631c7a3
commit 01397f008a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 25 additions and 56 deletions

View File

@ -1580,7 +1580,7 @@ static uintptr_t d3d10_gfx_load_texture(
return (uintptr_t)texture; return (uintptr_t)texture;
} }
static void d3d10_gfx_unload_texture(void* data, uintptr_t handle, bool threaded) static void d3d10_gfx_unload_texture(void* data, uintptr_t handle)
{ {
d3d10_texture_t* texture = (d3d10_texture_t*)handle; d3d10_texture_t* texture = (d3d10_texture_t*)handle;

View File

@ -1640,7 +1640,7 @@ static uintptr_t d3d11_gfx_load_texture(
return (uintptr_t)texture; return (uintptr_t)texture;
} }
static void d3d11_gfx_unload_texture(void* data, uintptr_t handle, bool threaded) static void d3d11_gfx_unload_texture(void* data, uintptr_t handle)
{ {
d3d11_texture_t* texture = (d3d11_texture_t*)handle; d3d11_texture_t* texture = (d3d11_texture_t*)handle;

View File

@ -1759,7 +1759,7 @@ static uintptr_t d3d12_gfx_load_texture(
return (uintptr_t)texture; return (uintptr_t)texture;
} }
static void d3d12_gfx_unload_texture(void* data, uintptr_t handle, bool threaded) static void d3d12_gfx_unload_texture(void* data, uintptr_t handle)
{ {
d3d12_texture_t* texture = (d3d12_texture_t*)handle; d3d12_texture_t* texture = (d3d12_texture_t*)handle;

View File

@ -1811,14 +1811,14 @@ 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_custom_cmd(&info, return video_thread_texture_load(&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);
return id; return id;
} }
static void d3d8_unload_texture(void *data, uintptr_t id, bool threaded) static void d3d8_unload_texture(void *data, uintptr_t id)
{ {
LPDIRECT3DTEXTURE8 texid; LPDIRECT3DTEXTURE8 texid;
if (!id) if (!id)

View File

@ -1980,14 +1980,14 @@ static uintptr_t d3d9_load_texture(void *video_data, void *data,
info.type = filter_type; info.type = filter_type;
if (threaded) if (threaded)
return video_thread_custom_cmd(&info, return video_thread_texture_load(&info,
d3d9_video_texture_load_wrap_d3d); d3d9_video_texture_load_wrap_d3d);
d3d9_video_texture_load_d3d(&info, &id); d3d9_video_texture_load_d3d(&info, &id);
return id; return id;
} }
static void d3d9_unload_texture(void *data, uintptr_t id, bool threaded) static void d3d9_unload_texture(void *data, uintptr_t id)
{ {
LPDIRECT3DTEXTURE9 texid; LPDIRECT3DTEXTURE9 texid;
if (!id) if (!id)

View File

@ -610,7 +610,7 @@ static uintptr_t gdi_load_texture(void *video_data, void *data,
return (uintptr_t)texture; return (uintptr_t)texture;
} }
static void gdi_unload_texture(void *data, uintptr_t handle, bool threaded) static void gdi_unload_texture(void *data, uintptr_t handle)
{ {
struct gdi_texture *texture = (struct gdi_texture*)handle; struct gdi_texture *texture = (struct gdi_texture*)handle;

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License along with RetroArch. * You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment(lib, "opengl32") #pragma comment(lib, "opengl32")
#endif #endif
@ -128,7 +128,6 @@ void context_bind_hw_render(void *data, bool enable)
gl_context_bind_hw_render(gl, enable); gl_context_bind_hw_render(gl, enable);
} }
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
static void gl_free_overlay(gl_t *gl) static void gl_free_overlay(gl_t *gl)
{ {
@ -247,7 +246,6 @@ static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
} }
#endif #endif
static void gl_set_projection(gl_t *gl, static void gl_set_projection(gl_t *gl,
struct video_ortho *ortho, bool allow_rotate) struct video_ortho *ortho, bool allow_rotate)
{ {
@ -688,7 +686,6 @@ static void gl_set_texture_frame(void *data,
if (!gl->menu_texture) if (!gl->menu_texture)
glGenTextures(1, &gl->menu_texture); glGenTextures(1, &gl->menu_texture);
gl_load_texture_data(gl->menu_texture, gl_load_texture_data(gl->menu_texture,
RARCH_WRAP_EDGE, menu_filter, RARCH_WRAP_EDGE, menu_filter,
video_pixel_get_alignment(width * base_size), video_pixel_get_alignment(width * base_size),
@ -940,7 +937,6 @@ static void gl_pbo_async_readback(gl_t *gl)
gl->renderchain_driver->unbind_pbo(gl, gl->renderchain_data); gl->renderchain_driver->unbind_pbo(gl, gl->renderchain_data);
} }
static bool gl_frame(void *data, const void *frame, static bool gl_frame(void *data, const void *frame,
unsigned frame_width, unsigned frame_height, unsigned frame_width, unsigned frame_height,
uint64_t frame_count, uint64_t frame_count,
@ -1234,7 +1230,6 @@ static bool gl_frame(void *data, const void *frame,
return true; return true;
} }
static void gl_destroy_resources(gl_t *gl) static void gl_destroy_resources(gl_t *gl)
{ {
if (gl) if (gl)
@ -2357,8 +2352,6 @@ static bool gl_overlay_load(void *data,
return true; return true;
} }
static void gl_overlay_enable(void *data, bool state) static void gl_overlay_enable(void *data, bool state)
{ {
gl_t *gl = (gl_t*)data; gl_t *gl = (gl_t*)data;
@ -2395,7 +2388,6 @@ static void gl_overlay_set_alpha(void *data, unsigned image, float mod)
color[12 + 3] = mod; color[12 + 3] = mod;
} }
static const video_overlay_interface_t gl_overlay_interface = { static const video_overlay_interface_t gl_overlay_interface = {
gl_overlay_enable, gl_overlay_enable,
gl_overlay_load, gl_overlay_load,
@ -2413,7 +2405,6 @@ static void gl_get_overlay_interface(void *data,
} }
#endif #endif
static retro_proc_address_t gl_get_proc_address(void *data, const char *sym) static retro_proc_address_t gl_get_proc_address(void *data, const char *sym)
{ {
gfx_ctx_proc_address_t proc_address; gfx_ctx_proc_address_t proc_address;
@ -2458,7 +2449,6 @@ static void gl_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
gl->should_resize = true; gl->should_resize = true;
} }
static void gl_apply_state_changes(void *data) static void gl_apply_state_changes(void *data)
{ {
gl_t *gl = (gl_t*)data; gl_t *gl = (gl_t*)data;
@ -2467,7 +2457,6 @@ static void gl_apply_state_changes(void *data)
gl->should_resize = true; gl->should_resize = true;
} }
static void gl_get_video_output_size(void *data, static void gl_get_video_output_size(void *data,
unsigned *width, unsigned *height) unsigned *width, unsigned *height)
{ {
@ -2502,12 +2491,6 @@ static void video_texture_load_gl(
); );
} }
static void video_texture_unload_gl(
uintptr_t *id)
{
glDeleteTextures(1, (GLuint*)id);
}
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
static int video_texture_load_wrap_gl_mipmap(void *data) static int video_texture_load_wrap_gl_mipmap(void *data)
{ {
@ -2530,20 +2513,13 @@ static int video_texture_load_wrap_gl(void *data)
TEXTURE_FILTER_LINEAR, &id); TEXTURE_FILTER_LINEAR, &id);
return (int)id; return (int)id;
} }
static int video_texture_unload_wrap_gl(void *data)
{
if (!data)
return 0;
video_texture_unload_gl((uintptr_t*)data);
return 0;
}
#endif #endif
static uintptr_t gl_load_texture(void *video_data, void *data, static uintptr_t gl_load_texture(void *video_data, void *data,
bool threaded, enum texture_filter_type filter_type) bool threaded, enum texture_filter_type filter_type)
{ {
uintptr_t id = 0; uintptr_t id = 0;
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
if (threaded) if (threaded)
{ {
@ -2558,8 +2534,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data,
default: default:
break; break;
} }
id=video_thread_custom_cmd(data, func); return video_thread_texture_load(data, func);
return id;
} }
#endif #endif
@ -2567,22 +2542,14 @@ static uintptr_t gl_load_texture(void *video_data, void *data,
return id; return id;
} }
static void gl_unload_texture(void *video_data, uintptr_t data, bool threaded) static void gl_unload_texture(void *data, uintptr_t id)
{ {
if (!data) GLuint glid;
if (!id)
return; return;
GLuint* glid = (GLuint*)data;
#ifdef HAVE_THREADS glid = (GLuint)id;
if (threaded) glDeleteTextures(1, &glid);
{
custom_command_method_t func = video_texture_unload_wrap_gl;
video_thread_custom_cmd((void *)&data, func);
return;
}
#endif
video_texture_unload_gl(&data);
} }
static void gl_set_coords(void *handle_data, void *shader_data, static void gl_set_coords(void *handle_data, void *shader_data,

View File

@ -2334,7 +2334,7 @@ static uintptr_t vulkan_load_texture(void *video_data, void *data,
return (uintptr_t)texture; return (uintptr_t)texture;
} }
static void vulkan_unload_texture(void *data, uintptr_t handle, bool threaded) static void vulkan_unload_texture(void *data, uintptr_t handle)
{ {
vk_t *vk = (vk_t*)data; vk_t *vk = (vk_t*)data;
struct vk_texture *texture = (struct vk_texture*)handle; struct vk_texture *texture = (struct vk_texture*)handle;

View File

@ -2715,7 +2715,7 @@ bool video_driver_texture_unload(uintptr_t *id)
if (!video_driver_poke || !video_driver_poke->unload_texture) if (!video_driver_poke || !video_driver_poke->unload_texture)
return false; return false;
video_driver_poke->unload_texture(video_driver_data, *id, video_driver_is_threaded_internal()); video_driver_poke->unload_texture(video_driver_data, *id);
*id = 0; *id = 0;
return true; return true;
} }

View File

@ -710,7 +710,7 @@ typedef struct video_poke_interface
const void *mat_data); const void *mat_data);
uintptr_t (*load_texture)(void *video_data, void *data, uintptr_t (*load_texture)(void *video_data, void *data,
bool threaded, enum texture_filter_type filter_type); bool threaded, enum texture_filter_type filter_type);
void (*unload_texture)(void *data, uintptr_t id, bool threaded); void (*unload_texture)(void *data, uintptr_t id);
void (*set_video_mode)(void *data, unsigned width, void (*set_video_mode)(void *data, unsigned width,
unsigned height, bool fullscreen); unsigned height, bool fullscreen);
float (*get_refresh_rate)(void *data); float (*get_refresh_rate)(void *data);

View File

@ -1198,13 +1198,15 @@ static uintptr_t thread_load_texture(void *video_data, void *data,
return thr->poke->load_texture(thr->driver_data, data, threaded, filter_type); return thr->poke->load_texture(thr->driver_data, data, threaded, filter_type);
} }
static void thread_unload_texture(void *video_data, uintptr_t id, bool threaded) static void thread_unload_texture(void *video_data, uintptr_t id)
{ {
thread_video_t *thr = (thread_video_t*)video_data; thread_video_t *thr = (thread_video_t*)video_data;
if (!thr) if (!thr)
return; return;
if (thr->poke && thr->poke->unload_texture) if (thr->poke && thr->poke->unload_texture)
thr->poke->unload_texture(thr->driver_data, id, threaded); thr->poke->unload_texture(thr->driver_data, id);
} }
static void thread_apply_state_changes(void *data) static void thread_apply_state_changes(void *data)
@ -1426,7 +1428,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_custom_cmd(void *data, unsigned video_thread_texture_load(void *data,
custom_command_method_t func) custom_command_method_t func)
{ {
thread_video_t *thr = (thread_video_t*)video_driver_get_ptr(true); thread_video_t *thr = (thread_video_t*)video_driver_get_ptr(true);

View File

@ -83,7 +83,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_custom_cmd(void *data, unsigned video_thread_texture_load(void *data,
custom_command_method_t func); custom_command_method_t func);
RETRO_END_DECLS RETRO_END_DECLS