mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +00:00
Pass chain userdata to renderchain driver
This commit is contained in:
parent
241df59771
commit
05ab278aca
@ -595,7 +595,7 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
|
||||
if (gl->renderchain_driver->init_texture_reference)
|
||||
gl->renderchain_driver->init_texture_reference(
|
||||
gl, i, internal_fmt,
|
||||
gl, gl->renderchain_data, i, internal_fmt,
|
||||
texture_fmt, texture_type);
|
||||
}
|
||||
|
||||
@ -894,11 +894,11 @@ static void gl_pbo_async_readback(gl_t *gl)
|
||||
gl->pbo_readback_valid[gl->pbo_readback_index] = true;
|
||||
|
||||
if (gl->renderchain_driver->readback)
|
||||
gl->renderchain_driver->readback(gl,
|
||||
gl->renderchain_driver->readback(gl, gl->renderchain_data,
|
||||
video_pixel_get_alignment(gl->vp.width * sizeof(uint32_t)),
|
||||
fmt, type, NULL);
|
||||
if (gl->renderchain_driver->unbind_pbo)
|
||||
gl->renderchain_driver->unbind_pbo();
|
||||
gl->renderchain_driver->unbind_pbo(gl, gl->renderchain_data);
|
||||
}
|
||||
|
||||
static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
@ -983,7 +983,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
context_bind_hw_render(false);
|
||||
|
||||
if (gl->core_context_in_use && gl->renderchain_driver->bind_vao)
|
||||
gl->renderchain_driver->bind_vao(gl);
|
||||
gl->renderchain_driver->bind_vao(gl, gl->renderchain_data);
|
||||
|
||||
video_info->cb_shader_use(gl, video_info->shader_data, 1, true);
|
||||
|
||||
@ -997,11 +997,12 @@ static bool gl_frame(void *data, const void *frame,
|
||||
{
|
||||
if (gl->renderchain_driver->recompute_pass_sizes)
|
||||
gl->renderchain_driver->recompute_pass_sizes(
|
||||
gl, frame_width, frame_height,
|
||||
gl, gl->renderchain_data, frame_width, frame_height,
|
||||
gl->vp_out_width, gl->vp_out_height);
|
||||
|
||||
if (gl->renderchain_driver->start_render)
|
||||
gl->renderchain_driver->start_render(gl, video_info);
|
||||
gl->renderchain_driver->start_render(gl, gl->renderchain_data,
|
||||
video_info);
|
||||
}
|
||||
|
||||
if (gl->should_resize)
|
||||
@ -1019,12 +1020,14 @@ static bool gl_frame(void *data, const void *frame,
|
||||
if (gl->fbo_inited)
|
||||
{
|
||||
if (gl->renderchain_driver->check_fbo_dimensions)
|
||||
gl->renderchain_driver->check_fbo_dimensions(gl);
|
||||
gl->renderchain_driver->check_fbo_dimensions(gl,
|
||||
gl->renderchain_data);
|
||||
|
||||
/* Go back to what we're supposed to do,
|
||||
* render to FBO #0. */
|
||||
if (gl->renderchain_driver->start_render)
|
||||
gl->renderchain_driver->start_render(gl, video_info);
|
||||
gl->renderchain_driver->start_render(gl, gl->renderchain_data,
|
||||
video_info);
|
||||
}
|
||||
else
|
||||
gl_set_viewport(gl, video_info, width, height, false, true);
|
||||
@ -1043,7 +1046,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl_update_input_size(gl, frame_width, frame_height, pitch, true);
|
||||
|
||||
if (gl->renderchain_driver->copy_frame)
|
||||
gl->renderchain_driver->copy_frame(gl,
|
||||
gl->renderchain_driver->copy_frame(gl, gl->renderchain_data,
|
||||
video_info, frame, frame_width, frame_height, pitch);
|
||||
}
|
||||
|
||||
@ -1061,12 +1064,12 @@ static bool gl_frame(void *data, const void *frame,
|
||||
if (!gl->fbo_inited)
|
||||
{
|
||||
if (gl->renderchain_driver->bind_backbuffer)
|
||||
gl->renderchain_driver->bind_backbuffer();
|
||||
gl->renderchain_driver->bind_backbuffer(gl, gl->renderchain_data);
|
||||
gl_set_viewport(gl, video_info, width, height, false, true);
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->restore_default_state)
|
||||
gl->renderchain_driver->restore_default_state(gl);
|
||||
gl->renderchain_driver->restore_default_state(gl, gl->renderchain_data);
|
||||
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
@ -1128,12 +1131,14 @@ static bool gl_frame(void *data, const void *frame,
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
if (gl->fbo_inited && gl->renderchain_driver->renderchain_render)
|
||||
gl->renderchain_driver->renderchain_render(gl, video_info,
|
||||
gl->renderchain_driver->renderchain_render(gl, gl->renderchain_data,
|
||||
video_info,
|
||||
frame_count, &gl->tex_info, &feedback_info);
|
||||
|
||||
/* Set prev textures. */
|
||||
if (gl->renderchain_driver->bind_prev_texture)
|
||||
gl->renderchain_driver->bind_prev_texture(gl, &gl->tex_info);
|
||||
gl->renderchain_driver->bind_prev_texture(gl, gl->renderchain_data,
|
||||
&gl->tex_info);
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (gl->menu_texture_enable)
|
||||
@ -1168,7 +1173,8 @@ static bool gl_frame(void *data, const void *frame,
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
if (gl->renderchain_driver->disable_client_arrays)
|
||||
gl->renderchain_driver->disable_client_arrays();
|
||||
gl->renderchain_driver->disable_client_arrays(gl,
|
||||
gl->renderchain_data);
|
||||
}
|
||||
|
||||
/* Screenshots. */
|
||||
@ -1176,6 +1182,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
{
|
||||
if (gl->renderchain_driver->readback)
|
||||
gl->renderchain_driver->readback(gl,
|
||||
gl->renderchain_data,
|
||||
4, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
gl->readback_buffer_screenshot);
|
||||
}
|
||||
@ -1208,12 +1215,14 @@ static bool gl_frame(void *data, const void *frame,
|
||||
|
||||
if (gl->renderchain_driver->fence_iterate)
|
||||
gl->renderchain_driver->fence_iterate(gl,
|
||||
gl->renderchain_data,
|
||||
video_info->hard_sync_frames);
|
||||
}
|
||||
|
||||
if (gl->core_context_in_use &&
|
||||
gl->renderchain_driver->unbind_vao)
|
||||
gl->renderchain_driver->unbind_vao(gl);
|
||||
gl->renderchain_driver->unbind_vao(gl,
|
||||
gl->renderchain_data);
|
||||
|
||||
context_bind_hw_render(true);
|
||||
|
||||
@ -1243,7 +1252,7 @@ static void gl_deinit_chain(gl_t *gl)
|
||||
return;
|
||||
|
||||
if (gl->renderchain_driver->chain_free)
|
||||
gl->renderchain_driver->chain_free(gl->renderchain_data);
|
||||
gl->renderchain_driver->chain_free(gl, gl->renderchain_data);
|
||||
|
||||
gl->renderchain_driver = NULL;
|
||||
gl->renderchain_data = NULL;
|
||||
@ -1260,14 +1269,14 @@ static void gl_free(void *data)
|
||||
if (gl->have_sync)
|
||||
{
|
||||
if (gl->renderchain_driver->fence_free)
|
||||
gl->renderchain_driver->fence_free(gl);
|
||||
gl->renderchain_driver->fence_free(gl, gl->renderchain_data);
|
||||
}
|
||||
|
||||
font_driver_free_osd();
|
||||
video_shader_driver_deinit();
|
||||
|
||||
if (gl->renderchain_driver->disable_client_arrays)
|
||||
gl->renderchain_driver->disable_client_arrays();
|
||||
gl->renderchain_driver->disable_client_arrays(gl, gl->renderchain_data);
|
||||
|
||||
glDeleteTextures(gl->textures, gl->texture);
|
||||
|
||||
@ -1296,13 +1305,13 @@ static void gl_free(void *data)
|
||||
if (gl->core_context_in_use)
|
||||
{
|
||||
if (gl->renderchain_driver->unbind_vao)
|
||||
gl->renderchain_driver->unbind_vao(gl);
|
||||
gl->renderchain_driver->unbind_vao(gl, gl->renderchain_data);
|
||||
if (gl->renderchain_driver->free_vao)
|
||||
gl->renderchain_driver->free_vao(gl);
|
||||
gl->renderchain_driver->free_vao(gl, gl->renderchain_data);
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->free)
|
||||
gl->renderchain_driver->free(gl);
|
||||
gl->renderchain_driver->free(gl, gl->renderchain_data);
|
||||
gl_deinit_chain(gl);
|
||||
|
||||
video_context_driver_free();
|
||||
@ -1464,7 +1473,7 @@ static bool gl_init_pbo_readback(gl_t *gl)
|
||||
gl->vp.height * sizeof(uint32_t), NULL);
|
||||
}
|
||||
if (gl->renderchain_driver->unbind_pbo)
|
||||
gl->renderchain_driver->unbind_pbo();
|
||||
gl->renderchain_driver->unbind_pbo(gl, gl->renderchain_data);
|
||||
|
||||
#ifndef HAVE_OPENGLES3
|
||||
{
|
||||
@ -1776,11 +1785,11 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->restore_default_state)
|
||||
gl->renderchain_driver->restore_default_state(gl);
|
||||
gl->renderchain_driver->restore_default_state(gl, gl->renderchain_data);
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
if (gl->renderchain_driver->new_vao)
|
||||
gl->renderchain_driver->new_vao(gl);
|
||||
gl->renderchain_driver->new_vao(gl, gl->renderchain_data);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
@ -1928,13 +1937,13 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
gl_init_textures_data(gl);
|
||||
|
||||
if (gl->renderchain_driver->init)
|
||||
gl->renderchain_driver->init(gl, gl->tex_w, gl->tex_h);
|
||||
gl->renderchain_driver->init(gl, gl->renderchain_data, gl->tex_w, gl->tex_h);
|
||||
|
||||
if (gl->has_fbo)
|
||||
{
|
||||
if (gl->hw_render_use &&
|
||||
gl->renderchain_driver->init_hw_render &&
|
||||
!gl->renderchain_driver->init_hw_render(gl, gl->tex_w, gl->tex_h))
|
||||
!gl->renderchain_driver->init_hw_render(gl, gl->renderchain_data, gl->tex_w, gl->tex_h))
|
||||
{
|
||||
RARCH_ERR("[GL]: Hardware rendering context initialization failed.\n");
|
||||
goto error;
|
||||
@ -2112,7 +2121,7 @@ static bool gl_set_shader(void *data,
|
||||
if (gl->fbo_inited)
|
||||
{
|
||||
if (gl->renderchain_driver->deinit_fbo)
|
||||
gl->renderchain_driver->deinit_fbo(gl);
|
||||
gl->renderchain_driver->deinit_fbo(gl, gl->renderchain_data);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
}
|
||||
@ -2144,7 +2153,7 @@ static bool gl_set_shader(void *data,
|
||||
{
|
||||
if (gl->hw_render_use && gl->fbo_inited &&
|
||||
gl->renderchain_driver->deinit_hw_render)
|
||||
gl->renderchain_driver->deinit_hw_render(gl);
|
||||
gl->renderchain_driver->deinit_hw_render(gl, gl->renderchain_data);
|
||||
|
||||
glDeleteTextures(gl->textures, gl->texture);
|
||||
#if defined(HAVE_PSGL)
|
||||
@ -2158,11 +2167,13 @@ static bool gl_set_shader(void *data,
|
||||
gl_init_textures_data(gl);
|
||||
|
||||
if (gl->hw_render_use && gl->renderchain_driver->init_hw_render)
|
||||
gl->renderchain_driver->init_hw_render(gl, gl->tex_w, gl->tex_h);
|
||||
gl->renderchain_driver->init_hw_render(gl, gl->renderchain_data,
|
||||
gl->tex_w, gl->tex_h);
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->init)
|
||||
gl->renderchain_driver->init(gl, gl->tex_w, gl->tex_h);
|
||||
gl->renderchain_driver->init(gl, gl->renderchain_data,
|
||||
gl->tex_w, gl->tex_h);
|
||||
|
||||
/* Apparently need to set viewport for passes when we aren't using FBOs. */
|
||||
gl_set_shader_viewports(gl);
|
||||
@ -2186,7 +2197,7 @@ static void gl_viewport_info(void *data, struct video_viewport *vp)
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl->renderchain_driver || !gl->renderchain_driver->viewport_info)
|
||||
return;
|
||||
gl->renderchain_driver->viewport_info(data, vp);
|
||||
gl->renderchain_driver->viewport_info(gl, gl->renderchain_data, vp);
|
||||
}
|
||||
|
||||
static bool gl_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
@ -2194,7 +2205,8 @@ static bool gl_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl->renderchain_driver || !gl->renderchain_driver->read_viewport)
|
||||
return false;
|
||||
return gl->renderchain_driver->read_viewport(data, buffer, is_idle);
|
||||
return gl->renderchain_driver->read_viewport(gl, gl->renderchain_data,
|
||||
buffer, is_idle);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -2525,7 +2537,7 @@ static void gl_set_coords(void *handle_data, void *shader_data,
|
||||
{
|
||||
gl_t *gl = (gl_t*)handle_data;
|
||||
if (gl && gl->renderchain_driver->set_coords)
|
||||
gl->renderchain_driver->set_coords(handle_data,
|
||||
gl->renderchain_driver->set_coords(gl, gl->renderchain_data,
|
||||
shader_data, coords);
|
||||
}
|
||||
|
||||
@ -2534,7 +2546,7 @@ static void gl_set_mvp(void *data, void *shader_data,
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (gl && gl->renderchain_driver->set_mvp)
|
||||
gl->renderchain_driver->set_mvp(data,
|
||||
gl->renderchain_driver->set_mvp(gl, gl->renderchain_data,
|
||||
shader_data, mat_data);
|
||||
}
|
||||
|
||||
|
@ -57,9 +57,9 @@ typedef struct gl1_renderchain
|
||||
|
||||
GLenum min_filter_to_mag(GLenum type);
|
||||
|
||||
void gl1_renderchain_free(void *data)
|
||||
void gl1_renderchain_free(void *data, void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
(void)chain_data;
|
||||
(void)gl;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,8 @@ typedef struct gl2_renderchain
|
||||
#endif
|
||||
|
||||
/* Prototypes */
|
||||
static void gl2_renderchain_bind_backbuffer(void)
|
||||
static void gl2_renderchain_bind_backbuffer(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
#ifdef IOS
|
||||
/* There is no default frame buffer on iOS. */
|
||||
@ -257,7 +258,8 @@ static void gl_check_fbo_dimension(gl_t *gl, unsigned i,
|
||||
/* On resize, we might have to recreate our FBOs
|
||||
* due to "Viewport" scale, and set a new viewport. */
|
||||
|
||||
static void gl2_renderchain_check_fbo_dimensions(void *data)
|
||||
static void gl2_renderchain_check_fbo_dimensions(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
int i;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
@ -280,6 +282,7 @@ static void gl2_renderchain_check_fbo_dimensions(void *data)
|
||||
|
||||
static void gl2_renderchain_render(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
video_frame_info_t *video_info,
|
||||
uint64_t frame_count,
|
||||
const struct video_tex_info *tex_info,
|
||||
@ -391,7 +394,7 @@ static void gl2_renderchain_render(
|
||||
set_texture_coords(fbo_tex_coords, xamt, yamt);
|
||||
|
||||
/* Push final FBO to list. */
|
||||
fbo_info = &fbo_tex_info[gl->fbo_pass - 1];
|
||||
fbo_info = &fbo_tex_info[gl->fbo_pass - 1];
|
||||
|
||||
fbo_info->tex = gl->fbo_texture[gl->fbo_pass - 1];
|
||||
fbo_info->input_size[0] = prev_rect->img_width;
|
||||
@ -402,7 +405,7 @@ static void gl2_renderchain_render(
|
||||
fbo_tex_info_cnt++;
|
||||
|
||||
/* Render our FBO texture to back buffer. */
|
||||
gl2_renderchain_bind_backbuffer();
|
||||
gl2_renderchain_bind_backbuffer(gl, chain_data);
|
||||
|
||||
shader_info.data = gl;
|
||||
shader_info.idx = gl->fbo_pass + 1;
|
||||
@ -455,7 +458,8 @@ static void gl2_renderchain_render(
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
}
|
||||
|
||||
static void gl2_renderchain_deinit_fbo(void *data)
|
||||
static void gl2_renderchain_deinit_fbo(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
@ -481,7 +485,9 @@ static void gl2_renderchain_deinit_fbo(void *data)
|
||||
gl->fbo_feedback = 0;
|
||||
}
|
||||
|
||||
static void gl2_renderchain_deinit_hw_render(void *data)
|
||||
static void gl2_renderchain_deinit_hw_render(
|
||||
void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -498,12 +504,12 @@ static void gl2_renderchain_deinit_hw_render(void *data)
|
||||
context_bind_hw_render(false);
|
||||
}
|
||||
|
||||
void gl2_renderchain_free(void *data)
|
||||
static void gl2_renderchain_free(void *data, void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
gl2_renderchain_deinit_fbo(gl);
|
||||
gl2_renderchain_deinit_hw_render(gl);
|
||||
gl2_renderchain_deinit_fbo(gl, chain_data);
|
||||
gl2_renderchain_deinit_hw_render(gl, chain_data);
|
||||
}
|
||||
|
||||
static bool gl_create_fbo_targets(gl_t *gl)
|
||||
@ -683,6 +689,7 @@ static void gl_create_fbo_textures(gl_t *gl)
|
||||
|
||||
static void gl2_renderchain_recompute_pass_sizes(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
unsigned width, unsigned height,
|
||||
unsigned vp_width, unsigned vp_height)
|
||||
{
|
||||
@ -745,6 +752,7 @@ static void gl2_renderchain_recompute_pass_sizes(
|
||||
}
|
||||
|
||||
static void gl2_renderchain_start_render(void *data,
|
||||
void *chain_data,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
/* Used when rendering to an FBO.
|
||||
@ -779,7 +787,8 @@ static void gl2_renderchain_start_render(void *data,
|
||||
|
||||
/* Set up render to texture. */
|
||||
void gl2_renderchain_init(
|
||||
void *data, unsigned fbo_width, unsigned fbo_height)
|
||||
void *data, void *chain_data,
|
||||
unsigned fbo_width, unsigned fbo_height)
|
||||
{
|
||||
int i;
|
||||
unsigned width, height;
|
||||
@ -847,6 +856,7 @@ void gl2_renderchain_init(
|
||||
}
|
||||
|
||||
gl2_renderchain_recompute_pass_sizes(gl,
|
||||
chain_data,
|
||||
fbo_width, fbo_height, width, height);
|
||||
|
||||
for (i = 0; i < gl->fbo_pass; i++)
|
||||
@ -887,6 +897,7 @@ void gl2_renderchain_init(
|
||||
|
||||
static bool gl2_renderchain_init_hw_render(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
GLenum status;
|
||||
@ -975,7 +986,7 @@ static bool gl2_renderchain_init_hw_render(
|
||||
}
|
||||
}
|
||||
|
||||
gl2_renderchain_bind_backbuffer();
|
||||
gl2_renderchain_bind_backbuffer(gl, chain_data);
|
||||
gl->hw_render_fbo_init = true;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
@ -984,6 +995,7 @@ static bool gl2_renderchain_init_hw_render(
|
||||
|
||||
static void gl2_renderchain_bind_prev_texture(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
const struct video_tex_info *tex_info)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
@ -1007,7 +1019,8 @@ static void gl2_renderchain_bind_prev_texture(
|
||||
}
|
||||
|
||||
static void gl2_renderchain_viewport_info(
|
||||
void *data, struct video_viewport *vp)
|
||||
void *data, void *chain_data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
unsigned top_y, top_dist;
|
||||
@ -1026,7 +1039,9 @@ static void gl2_renderchain_viewport_info(
|
||||
}
|
||||
|
||||
static bool gl2_renderchain_read_viewport(
|
||||
void *data, uint8_t *buffer, bool is_idle)
|
||||
void *data,
|
||||
void *chain_data,
|
||||
uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
unsigned num_pixels = 0;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
@ -1127,9 +1142,9 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
void gl2_renderchain_free_internal(void *data)
|
||||
void gl2_renderchain_free_internal(void *data, void *chain_data)
|
||||
{
|
||||
gl2_renderchain_t *cg_data = (gl2_renderchain_t*)data;
|
||||
gl2_renderchain_t *cg_data = (gl2_renderchain_t*)chain_data;
|
||||
|
||||
if (!cg_data)
|
||||
return;
|
||||
@ -1147,7 +1162,8 @@ static void *gl2_renderchain_new(void)
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENGLES
|
||||
static void gl2_renderchain_bind_vao(void *data)
|
||||
static void gl2_renderchain_bind_vao(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -1155,7 +1171,8 @@ static void gl2_renderchain_bind_vao(void *data)
|
||||
glBindVertexArray(gl->vao);
|
||||
}
|
||||
|
||||
static void gl2_renderchain_unbind_vao(void *data)
|
||||
static void gl2_renderchain_unbind_vao(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -1163,7 +1180,8 @@ static void gl2_renderchain_unbind_vao(void *data)
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
static void gl2_renderchain_new_vao(void *data)
|
||||
static void gl2_renderchain_new_vao(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -1171,7 +1189,8 @@ static void gl2_renderchain_new_vao(void *data)
|
||||
glGenVertexArrays(1, &gl->vao);
|
||||
}
|
||||
|
||||
static void gl2_renderchain_free_vao(void *data)
|
||||
static void gl2_renderchain_free_vao(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -1180,7 +1199,9 @@ static void gl2_renderchain_free_vao(void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gl2_renderchain_restore_default_state(void *data)
|
||||
static void gl2_renderchain_restore_default_state(
|
||||
void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
@ -1196,6 +1217,7 @@ static void gl2_renderchain_restore_default_state(void *data)
|
||||
|
||||
static void gl2_renderchain_copy_frame(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
video_frame_info_t *video_info,
|
||||
const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
@ -1338,7 +1360,8 @@ static void gl2_renderchain_bind_pbo(unsigned idx)
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, (GLuint)idx);
|
||||
}
|
||||
|
||||
static void gl2_renderchain_unbind_pbo(void)
|
||||
static void gl2_renderchain_unbind_pbo(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
}
|
||||
@ -1352,6 +1375,7 @@ static void gl2_renderchain_init_pbo(unsigned size,
|
||||
#endif
|
||||
|
||||
static void gl2_renderchain_readback(void *data,
|
||||
void *chain_data,
|
||||
unsigned alignment,
|
||||
unsigned fmt, unsigned type,
|
||||
void *src)
|
||||
@ -1370,8 +1394,10 @@ static void gl2_renderchain_readback(void *data,
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENGLES
|
||||
static void gl2_renderchain_fence_iterate(void *data, unsigned
|
||||
hard_sync_frames)
|
||||
static void gl2_renderchain_fence_iterate(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
unsigned hard_sync_frames)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
@ -1390,7 +1416,8 @@ static void gl2_renderchain_fence_iterate(void *data, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
static void gl2_renderchain_fence_free(void *data)
|
||||
static void gl2_renderchain_fence_free(void *data,
|
||||
void *chain_data)
|
||||
{
|
||||
unsigned i;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
@ -1406,7 +1433,7 @@ static void gl2_renderchain_fence_free(void *data)
|
||||
#endif
|
||||
|
||||
static void gl2_renderchain_init_textures_reference(
|
||||
void *data, unsigned i,
|
||||
void *data, void *chain_data, unsigned i,
|
||||
unsigned internal_fmt, unsigned texture_fmt,
|
||||
unsigned texture_type)
|
||||
{
|
||||
|
@ -838,56 +838,68 @@ typedef struct d3d_renderchain_driver
|
||||
typedef struct gl_renderchain_driver
|
||||
{
|
||||
void (*set_coords)(void *handle_data,
|
||||
void *chain_data,
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
void (*set_mvp)(void *data, void *shader_data,
|
||||
void (*set_mvp)(void *data,
|
||||
void *chain_data,
|
||||
void *shader_data,
|
||||
const void *mat_data);
|
||||
void (*init_texture_reference)(
|
||||
void *data, unsigned i,
|
||||
void *data, void *chain_data, unsigned i,
|
||||
unsigned internal_fmt, unsigned texture_fmt,
|
||||
unsigned texture_type);
|
||||
void (*fence_iterate)(void *data, unsigned hard_sync_frames);
|
||||
void (*fence_free)(void *data);
|
||||
void (*fence_iterate)(void *data, void *chain_data,
|
||||
unsigned hard_sync_frames);
|
||||
void (*fence_free)(void *data, void *chain_data);
|
||||
void (*readback)(void *data,
|
||||
void *chain_data,
|
||||
unsigned alignment,
|
||||
unsigned fmt, unsigned type,
|
||||
void *src);
|
||||
void (*init_pbo)(unsigned size, const void *data);
|
||||
void (*bind_pbo)(unsigned idx);
|
||||
void (*unbind_pbo)(void);
|
||||
void (*unbind_pbo)(void *data, void *chain_data);
|
||||
void (*copy_frame)(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
video_frame_info_t *video_info,
|
||||
const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch);
|
||||
void (*restore_default_state)(void *data);
|
||||
void (*new_vao)(void *data);
|
||||
void (*free_vao)(void *data);
|
||||
void (*bind_vao)(void *data);
|
||||
void (*unbind_vao)(void *data);
|
||||
void (*disable_client_arrays)(void);
|
||||
void (*restore_default_state)(void *data, void *chain_data);
|
||||
void (*new_vao)(void *data, void *chain_data);
|
||||
void (*free_vao)(void *data, void *chain_data);
|
||||
void (*bind_vao)(void *data, void *chain_data);
|
||||
void (*unbind_vao)(void *data, void *chain_data);
|
||||
void (*disable_client_arrays)(void *data, void *chain_data);
|
||||
void (*ff_vertex)(const void *data);
|
||||
void (*ff_matrix)(const void *data);
|
||||
void (*bind_backbuffer)(void);
|
||||
void (*deinit_fbo)(void *data);
|
||||
void (*bind_backbuffer)(void *data, void *chain_data);
|
||||
void (*deinit_fbo)(void *data, void *chain_data);
|
||||
void (*viewport_info)(
|
||||
void *data, struct video_viewport *vp);
|
||||
void *data, void *chain_data, struct video_viewport *vp);
|
||||
bool (*read_viewport)(
|
||||
void *data, uint8_t *buffer, bool is_idle);
|
||||
void *data, void *chain_data, uint8_t *buffer, bool is_idle);
|
||||
void (*bind_prev_texture)(
|
||||
void *data,
|
||||
void *chain_data,
|
||||
const struct video_tex_info *tex_info);
|
||||
void (*chain_free)(void *data);
|
||||
void (*chain_free)(void *data, void *chain_data);
|
||||
void *(*chain_new)(void);
|
||||
void (*init)(void *data, unsigned fbo_width, unsigned fbo_height);
|
||||
bool (*init_hw_render)(void *data, unsigned width, unsigned height);
|
||||
void (*free)(void *data);
|
||||
void (*deinit_hw_render)(void *data);
|
||||
void (*start_render)(void *data, video_frame_info_t *video_info);
|
||||
void (*check_fbo_dimensions)(void *data);
|
||||
void (*init)(void *data, void *chain_data,
|
||||
unsigned fbo_width, unsigned fbo_height);
|
||||
bool (*init_hw_render)(void *data, void *chain_data,
|
||||
unsigned width, unsigned height);
|
||||
void (*free)(void *data, void *chain_data);
|
||||
void (*deinit_hw_render)(void *data, void *chain_data);
|
||||
void (*start_render)(void *data, void *chain_data,
|
||||
video_frame_info_t *video_info);
|
||||
void (*check_fbo_dimensions)(void *data, void *chain_data);
|
||||
void (*recompute_pass_sizes)(void *data,
|
||||
void *chain_data,
|
||||
unsigned width, unsigned height,
|
||||
unsigned vp_width, unsigned vp_height);
|
||||
void (*renderchain_render)(void *data,
|
||||
void *chain_data,
|
||||
video_frame_info_t *video_info,
|
||||
uint64_t frame_count,
|
||||
const struct video_tex_info *tex_info,
|
||||
|
Loading…
x
Reference in New Issue
Block a user