mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Revert "(GL) Cleanups"
This reverts commit 5bab7e44605887aa5de62834860a411acb953093.
This commit is contained in:
parent
5bab7e4460
commit
43884758c5
@ -630,7 +630,7 @@ static void gl2_renderchain_render(
|
||||
(const struct video_coords*)&gl->coords);
|
||||
|
||||
video_info->cb_set_mvp(gl,
|
||||
gl->shader_data, &gl->mvp);
|
||||
video_info->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
@ -705,7 +705,7 @@ static void gl2_renderchain_render(
|
||||
(const struct video_coords*)&gl->coords);
|
||||
|
||||
video_info->cb_set_mvp(gl,
|
||||
gl->shader_data, &gl->mvp);
|
||||
video_info->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
@ -1963,9 +1963,9 @@ static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
/* Ensure that we reset the attrib array. */
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
@ -1977,7 +1977,7 @@ static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||
(const struct video_coords*)&gl->coords);
|
||||
|
||||
video_info->cb_set_mvp(gl,
|
||||
gl->shader_data, &gl->mvp_no_rot);
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
{
|
||||
@ -2234,8 +2234,9 @@ static INLINE void gl_set_shader_viewports(gl_t *gl)
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl, gl->shader_data, i, true);
|
||||
if (video_info.shader_driver && video_info.shader_driver->use)
|
||||
video_info.shader_driver->use(gl,
|
||||
video_info.shader_data, i, true);
|
||||
|
||||
gl_set_viewport(gl, &video_info,
|
||||
width, height, false, true);
|
||||
@ -2348,9 +2349,9 @@ static void gl_render_osd_background(
|
||||
video_driver_set_viewport(video_info->width,
|
||||
video_info->height, true, false);
|
||||
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
if (gl->shader->set_coords)
|
||||
gl->shader->set_coords(gl, gl->shader_data,
|
||||
@ -2361,7 +2362,7 @@ static void gl_render_osd_background(
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
|
||||
video_info->cb_set_mvp(gl,
|
||||
gl->shader_data, &gl->mvp_no_rot);
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
uniform_param.type = UNIFORM_4F;
|
||||
uniform_param.enabled = true;
|
||||
@ -2455,9 +2456,9 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture);
|
||||
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
@ -2466,7 +2467,7 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
(const struct video_coords*)&gl->coords);
|
||||
|
||||
video_info->cb_set_mvp(gl,
|
||||
gl->shader_data, &gl->mvp_no_rot);
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
@ -2530,9 +2531,9 @@ static bool gl_frame(void *data, const void *frame,
|
||||
if (gl->core_context_in_use)
|
||||
gl2_renderchain_bind_vao(gl->renderchain_data);
|
||||
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, 1, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 1, true);
|
||||
|
||||
#ifdef IOS
|
||||
/* Apparently the viewport is lost each frame, thanks Apple. */
|
||||
@ -2667,7 +2668,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl->shader->set_coords(gl, gl->shader_data,
|
||||
(const struct video_coords*)&gl->coords);
|
||||
|
||||
video_info->cb_set_mvp(gl, gl->shader_data, &gl->mvp);
|
||||
video_info->cb_set_mvp(gl, video_info->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
@ -2726,9 +2727,9 @@ static bool gl_frame(void *data, const void *frame,
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
if (gl->hw_render_fbo_init)
|
||||
{
|
||||
if (gl->shader->use)
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, 0, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 0, true);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ static void gl_raster_font_draw_vertices(gl_raster_t *font,
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
video_info->cb_set_mvp(font->gl,
|
||||
font->gl->shader_data, &font->gl->mvp_no_rot);
|
||||
video_info->shader_data, &font->gl->mvp_no_rot);
|
||||
|
||||
glDrawArrays(GL_TRIANGLES, 0, coords->vertices);
|
||||
}
|
||||
|
@ -2842,6 +2842,8 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->input_driver_nonblock_state = input_driver_is_nonblock_state();
|
||||
|
||||
video_info->context_data = video_context_data;
|
||||
video_info->shader_driver = current_shader;
|
||||
video_info->shader_data = current_shader_data;
|
||||
|
||||
video_info->cb_update_window_title = current_video_context.update_window_title;
|
||||
video_info->cb_swap_buffers = current_video_context.swap_buffers;
|
||||
|
@ -493,7 +493,9 @@ typedef struct video_frame_info
|
||||
const void *mat_data);
|
||||
|
||||
void *context_data;
|
||||
void *shader_data;
|
||||
void *userdata;
|
||||
const shader_backend_t *shader_driver;
|
||||
} video_frame_info_t;
|
||||
|
||||
typedef void (*update_window_title_cb)(void*, void*);
|
||||
|
Loading…
x
Reference in New Issue
Block a user