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;
}
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;

View File

@ -1640,7 +1640,7 @@ static uintptr_t d3d11_gfx_load_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;

View File

@ -1759,7 +1759,7 @@ static uintptr_t d3d12_gfx_load_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;

View File

@ -1811,14 +1811,14 @@ static uintptr_t d3d8_load_texture(void *video_data, void *data,
info.type = filter_type;
if (threaded)
return video_thread_custom_cmd(&info,
return video_thread_texture_load(&info,
d3d8_video_texture_load_wrap_d3d);
d3d8_video_texture_load_d3d(&info, &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;
if (!id)

View File

@ -1980,14 +1980,14 @@ static uintptr_t d3d9_load_texture(void *video_data, void *data,
info.type = filter_type;
if (threaded)
return video_thread_custom_cmd(&info,
return video_thread_texture_load(&info,
d3d9_video_texture_load_wrap_d3d);
d3d9_video_texture_load_d3d(&info, &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;
if (!id)

View File

@ -610,7 +610,7 @@ static uintptr_t gdi_load_texture(void *video_data, void *data,
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;

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _MSC_VER
#pragma comment(lib, "opengl32")
#endif
@ -128,7 +128,6 @@ void context_bind_hw_render(void *data, bool enable)
gl_context_bind_hw_render(gl, enable);
}
#ifdef HAVE_OVERLAY
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
static void gl_set_projection(gl_t *gl,
struct video_ortho *ortho, bool allow_rotate)
{
@ -688,7 +686,6 @@ static void gl_set_texture_frame(void *data,
if (!gl->menu_texture)
glGenTextures(1, &gl->menu_texture);
gl_load_texture_data(gl->menu_texture,
RARCH_WRAP_EDGE, menu_filter,
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);
}
static bool gl_frame(void *data, const void *frame,
unsigned frame_width, unsigned frame_height,
uint64_t frame_count,
@ -1234,7 +1230,6 @@ static bool gl_frame(void *data, const void *frame,
return true;
}
static void gl_destroy_resources(gl_t *gl)
{
if (gl)
@ -2357,8 +2352,6 @@ static bool gl_overlay_load(void *data,
return true;
}
static void gl_overlay_enable(void *data, bool state)
{
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;
}
static const video_overlay_interface_t gl_overlay_interface = {
gl_overlay_enable,
gl_overlay_load,
@ -2413,7 +2405,6 @@ static void gl_get_overlay_interface(void *data,
}
#endif
static retro_proc_address_t gl_get_proc_address(void *data, const char *sym)
{
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;
}
static void gl_apply_state_changes(void *data)
{
gl_t *gl = (gl_t*)data;
@ -2467,7 +2457,6 @@ static void gl_apply_state_changes(void *data)
gl->should_resize = true;
}
static void gl_get_video_output_size(void *data,
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
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);
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
static uintptr_t gl_load_texture(void *video_data, void *data,
bool threaded, enum texture_filter_type filter_type)
{
uintptr_t id = 0;
#ifdef HAVE_THREADS
if (threaded)
{
@ -2558,8 +2534,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data,
default:
break;
}
id=video_thread_custom_cmd(data, func);
return id;
return video_thread_texture_load(data, func);
}
#endif
@ -2567,22 +2542,14 @@ static uintptr_t gl_load_texture(void *video_data, void *data,
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;
GLuint* glid = (GLuint*)data;
#ifdef HAVE_THREADS
if (threaded)
{
custom_command_method_t func = video_texture_unload_wrap_gl;
video_thread_custom_cmd((void *)&data, func);
return;
}
#endif
video_texture_unload_gl(&data);
glid = (GLuint)id;
glDeleteTextures(1, &glid);
}
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;
}
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;
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)
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;
return true;
}

View File

@ -710,7 +710,7 @@ typedef struct video_poke_interface
const void *mat_data);
uintptr_t (*load_texture)(void *video_data, void *data,
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,
unsigned height, bool fullscreen);
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);
}
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;
if (!thr)
return;
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)
@ -1426,7 +1428,7 @@ bool video_thread_font_init(const void **font_driver, void **font_handle,
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)
{
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,
bool is_threaded);
unsigned video_thread_custom_cmd(void *data,
unsigned video_thread_texture_load(void *data,
custom_command_method_t func);
RETRO_END_DECLS