diff --git a/gfx/drivers_display/gfx_display_ctr.c b/gfx/drivers_display/gfx_display_ctr.c index 9200def997..d9ca443ca1 100644 --- a/gfx/drivers_display/gfx_display_ctr.c +++ b/gfx/drivers_display/gfx_display_ctr.c @@ -34,7 +34,7 @@ static void *gfx_display_ctr_get_default_mvp(void *data) { return NULL; } static void gfx_display_ctr_blend_begin(video_frame_info_t *video_info) { } static void gfx_display_ctr_blend_end(video_frame_info_t *video_info) { } static void gfx_display_ctr_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } + void *data) { } static void gfx_display_ctr_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) diff --git a/gfx/drivers_display/gfx_display_d3d10.c b/gfx/drivers_display/gfx_display_d3d10.c index e3238c982f..a2963aa66d 100644 --- a/gfx/drivers_display/gfx_display_d3d10.c +++ b/gfx/drivers_display/gfx_display_d3d10.c @@ -57,10 +57,7 @@ static void gfx_display_d3d10_blend_end(video_frame_info_t *video_info) d3d10->blend_disable, NULL, D3D10_DEFAULT_SAMPLE_MASK); } -static void gfx_display_d3d10_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_d3d10_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_d3d10_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) diff --git a/gfx/drivers_display/gfx_display_d3d11.c b/gfx/drivers_display/gfx_display_d3d11.c index 328bb48922..218e9281ea 100644 --- a/gfx/drivers_display/gfx_display_d3d11.c +++ b/gfx/drivers_display/gfx_display_d3d11.c @@ -56,10 +56,7 @@ static void gfx_display_d3d11_blend_end(video_frame_info_t *video_info) d3d11->blend_disable, NULL, D3D11_DEFAULT_SAMPLE_MASK); } -static void gfx_display_d3d11_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_d3d11_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_d3d11_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) diff --git a/gfx/drivers_display/gfx_display_d3d12.c b/gfx/drivers_display/gfx_display_d3d12.c index 7621a9f222..d36b9b244d 100644 --- a/gfx/drivers_display/gfx_display_d3d12.c +++ b/gfx/drivers_display/gfx_display_d3d12.c @@ -58,10 +58,7 @@ static void gfx_display_d3d12_blend_end(video_frame_info_t *video_info) D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe); } -static void gfx_display_d3d12_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_d3d12_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_d3d12_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) @@ -176,7 +173,7 @@ static void gfx_display_d3d12_draw(gfx_display_ctx_draw_t *draw, if (texture->dirty) { d3d12_upload_texture(d3d12->queue.cmd, - texture, video_info->userdata); + texture, d3d12); if (vertex_count > 1) D3D12SetPipelineState(d3d12->queue.cmd, diff --git a/gfx/drivers_display/gfx_display_d3d8.c b/gfx/drivers_display/gfx_display_d3d8.c index cfe483f732..0e903d9048 100644 --- a/gfx/drivers_display/gfx_display_d3d8.c +++ b/gfx/drivers_display/gfx_display_d3d8.c @@ -98,10 +98,7 @@ static void gfx_display_d3d8_blend_end(video_frame_info_t *video_info) d3d8_disable_blend_func(d3d->dev); } -static void gfx_display_d3d8_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_d3d8_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_d3d8_bind_texture(gfx_display_ctx_draw_t *draw, d3d8_video_t *d3d) @@ -188,7 +185,7 @@ static void gfx_display_d3d8_draw(gfx_display_ctx_draw_t *draw, d3d8_vertex_buffer_unlock(d3d->menu_display.buffer); if (!draw->matrix_data) - draw->matrix_data = gfx_display_d3d8_get_default_mvp(video_info->userdata); + draw->matrix_data = gfx_display_d3d8_get_default_mvp(d3d); /* ugh */ matrix_4x4_scale(m1, 2.0, 2.0, 0); diff --git a/gfx/drivers_display/gfx_display_d3d9.c b/gfx/drivers_display/gfx_display_d3d9.c index cf95e5f868..0ccb35ae30 100644 --- a/gfx/drivers_display/gfx_display_d3d9.c +++ b/gfx/drivers_display/gfx_display_d3d9.c @@ -98,10 +98,7 @@ static void gfx_display_d3d9_blend_end(video_frame_info_t *video_info) d3d9_disable_blend_func(d3d->dev); } -static void gfx_display_d3d9_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_d3d9_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_d3d9_bind_texture(gfx_display_ctx_draw_t *draw, d3d9_video_t *d3d) @@ -183,7 +180,7 @@ static void gfx_display_d3d9_draw(gfx_display_ctx_draw_t *draw, d3d->menu_display.buffer); if (!draw->matrix_data) - draw->matrix_data = gfx_display_d3d9_get_default_mvp(video_info->userdata); + draw->matrix_data = gfx_display_d3d9_get_default_mvp(d3d); /* ugh */ matrix_4x4_scale(m1, 2.0, 2.0, 0); diff --git a/gfx/drivers_display/gfx_display_gdi.c b/gfx/drivers_display/gfx_display_gdi.c index 53256ef92b..0bcb72bb3d 100644 --- a/gfx/drivers_display/gfx_display_gdi.c +++ b/gfx/drivers_display/gfx_display_gdi.c @@ -112,10 +112,7 @@ static void gfx_display_gdi_draw_pipeline(gfx_display_ctx_draw_t *draw, { } -static void gfx_display_gdi_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} +static void gfx_display_gdi_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_gdi_restore_clear_color(void) { diff --git a/gfx/drivers_display/gfx_display_gl.c b/gfx/drivers_display/gfx_display_gl.c index 763cde5b9b..a789ace08b 100644 --- a/gfx/drivers_display/gfx_display_gl.c +++ b/gfx/drivers_display/gfx_display_gl.c @@ -135,7 +135,7 @@ static void gfx_display_gl_blend_end(video_frame_info_t *video_info) } static void gfx_display_gl_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data) { if (draw) glViewport(draw->x, draw->y, draw->width, draw->height); @@ -244,13 +244,13 @@ static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw, if (!draw->coords->lut_tex_coord) draw->coords->lut_tex_coord = gfx_display_gl_get_default_tex_coords(); - gfx_display_gl_viewport(draw, video_info); + gfx_display_gl_viewport(draw, gl); glBindTexture(GL_TEXTURE_2D, (GLuint)draw->texture); gl->shader->set_coords(gl->shader_data, draw->coords); gl->shader->set_mvp(gl->shader_data, draw->matrix_data ? (math_matrix_4x4*)draw->matrix_data - : (math_matrix_4x4*)gfx_display_gl_get_default_mvp(video_info->userdata)); + : (math_matrix_4x4*)gfx_display_gl_get_default_mvp(gl)); glDrawArrays(gfx_display_prim_to_gl_enum( diff --git a/gfx/drivers_display/gfx_display_gl1.c b/gfx/drivers_display/gfx_display_gl1.c index 07103d56bc..b3b5d3d487 100644 --- a/gfx/drivers_display/gfx_display_gl1.c +++ b/gfx/drivers_display/gfx_display_gl1.c @@ -93,7 +93,7 @@ static void gfx_display_gl1_blend_end(video_frame_info_t *video_info) } static void gfx_display_gl1_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data) { if (draw) glViewport(draw->x, draw->y, draw->width, draw->height); @@ -115,7 +115,7 @@ static void gfx_display_gl1_draw(gfx_display_ctx_draw_t *draw, if (!draw->coords->lut_tex_coord) draw->coords->lut_tex_coord = gfx_display_gl1_get_default_tex_coords(); - gfx_display_gl1_viewport(draw, video_info); + gfx_display_gl1_viewport(draw, gl1); glEnable(GL_TEXTURE_2D); @@ -123,7 +123,7 @@ static void gfx_display_gl1_draw(gfx_display_ctx_draw_t *draw, mvp.data = gl1; mvp.matrix = draw->matrix_data ? (math_matrix_4x4*)draw->matrix_data - : (math_matrix_4x4*)gfx_display_gl1_get_default_mvp(video_info->userdata); + : (math_matrix_4x4*)gfx_display_gl1_get_default_mvp(gl1); glMatrixMode(GL_PROJECTION); glPushMatrix(); diff --git a/gfx/drivers_display/gfx_display_gl_core.c b/gfx/drivers_display/gfx_display_gl_core.c index 0e00fc5940..79c2f6fce8 100644 --- a/gfx/drivers_display/gfx_display_gl_core.c +++ b/gfx/drivers_display/gfx_display_gl_core.c @@ -71,8 +71,7 @@ static const float *gfx_display_gl_core_get_default_tex_coords(void) return &gl_core_tex_coords[0]; } -static void gfx_display_gl_core_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) +static void gfx_display_gl_core_viewport(gfx_display_ctx_draw_t *draw, void *data) { if (draw) glViewport(draw->x, draw->y, draw->width, draw->height); @@ -88,11 +87,11 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, static float t = 0.0f; float yflip = 0.0f; video_coord_array_t *ca = NULL; - gl_core_t *gl_core = (gl_core_t*)video_info->userdata; + gl_core_t *gl = (gl_core_t*)video_info->userdata; unsigned video_width = video_info->width; unsigned video_height = video_info->height; - if (!gl_core || !draw) + if (!gl || !draw) return; draw->x = 0; @@ -129,7 +128,7 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, /* Match UBO layout in shader. */ memcpy(ubo_scratch_data, - gfx_display_gl_core_get_default_mvp(video_info->userdata), + gfx_display_gl_core_get_default_mvp(gl), sizeof(math_matrix_4x4)); memcpy(ubo_scratch_data + sizeof(math_matrix_4x4), output_size, @@ -178,7 +177,7 @@ static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw, if (!color) color = gfx_display_gl_core_get_default_color(); - gfx_display_gl_core_viewport(draw, video_info); + gfx_display_gl_core_viewport(draw, gl); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture); @@ -242,7 +241,7 @@ static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw, if (!loc) { const math_matrix_4x4 *mat = draw->matrix_data - ? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_gl_core_get_default_mvp(video_info->userdata); + ? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_gl_core_get_default_mvp(gl); if (gl->pipelines.alpha_blend_loc.flat_ubo_vertex >= 0) glUniform4fv(gl->pipelines.alpha_blend_loc.flat_ubo_vertex, 4, mat->data); diff --git a/gfx/drivers_display/gfx_display_metal.m b/gfx/drivers_display/gfx_display_metal.m index 2e8ab033aa..f2c957bb95 100644 --- a/gfx/drivers_display/gfx_display_metal.m +++ b/gfx/drivers_display/gfx_display_metal.m @@ -82,9 +82,7 @@ static void gfx_display_metal_draw_pipeline(gfx_display_ctx_draw_t *draw, video_ } static void gfx_display_metal_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} + void *data) } { } static void gfx_display_metal_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height) { diff --git a/gfx/drivers_display/gfx_display_switch.c b/gfx/drivers_display/gfx_display_switch.c index 5c591d9e17..ce282e7f70 100644 --- a/gfx/drivers_display/gfx_display_switch.c +++ b/gfx/drivers_display/gfx_display_switch.c @@ -46,9 +46,7 @@ static void gfx_display_switch_draw_pipeline( } static void gfx_display_switch_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} + void *data) { } static void gfx_display_switch_restore_clear_color(void) { diff --git a/gfx/drivers_display/gfx_display_vita2d.c b/gfx/drivers_display/gfx_display_vita2d.c index bdb8a6702a..4ea68b7926 100644 --- a/gfx/drivers_display/gfx_display_vita2d.c +++ b/gfx/drivers_display/gfx_display_vita2d.c @@ -85,11 +85,10 @@ static void gfx_display_vita2d_blend_end(video_frame_info_t *video_info) } static void gfx_display_vita2d_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data) { - if (draw){ + if (draw) vita2d_set_viewport(draw->x, draw->y, draw->width, draw->height); - } } static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw, @@ -121,7 +120,7 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw, if (!color) color = gfx_display_vita2d_get_default_color(); - gfx_display_vita2d_viewport(draw, video_info); + gfx_display_vita2d_viewport(draw, vita2d); vita2d_texture_tint_vertex *vertices = (vita2d_texture_tint_vertex *)vita2d_pool_memalign( draw->coords->vertices * sizeof(vita2d_texture_tint_vertex), @@ -140,13 +139,13 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw, } const math_matrix_4x4 *mat = draw->matrix_data - ? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_vita2d_get_default_mvp(video_info->userdata); + ? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_vita2d_get_default_mvp(vita2d); switch (draw->pipeline.id) { default: { - vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, gfx_display_vita2d_get_default_mvp(video_info->userdata)); + vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, gfx_display_vita2d_get_default_mvp(vita2d)); break; } } diff --git a/gfx/drivers_display/gfx_display_vulkan.c b/gfx/drivers_display/gfx_display_vulkan.c index 8c6ffd8060..5ebb980db0 100644 --- a/gfx/drivers_display/gfx_display_vulkan.c +++ b/gfx/drivers_display/gfx_display_vulkan.c @@ -100,9 +100,9 @@ static unsigned to_menu_pipeline( #endif static void gfx_display_vk_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data) { - vk_t *vk = (vk_t*)video_info->userdata; + vk_t *vk = (vk_t*)data; if (!vk || !draw) return; @@ -164,7 +164,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw, /* Match UBO layout in shader. */ memcpy(ubo_scratch_data, - gfx_display_vk_get_default_mvp(video_info->userdata), + gfx_display_vk_get_default_mvp(vk), sizeof(math_matrix_4x4)); memcpy(ubo_scratch_data + sizeof(math_matrix_4x4), output_size, @@ -221,7 +221,7 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw, if (!color) color = gfx_display_vk_get_default_color(); - gfx_display_vk_viewport(draw, video_info); + gfx_display_vk_viewport(draw, vk); vk->tracker.dirty |= VULKAN_DIRTY_DYNAMIC_BIT; @@ -284,7 +284,7 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw, (texture->default_smooth ? vk->samplers.linear : vk->samplers.nearest); call.uniform = draw->matrix_data - ? draw->matrix_data : gfx_display_vk_get_default_mvp(video_info->userdata); + ? draw->matrix_data : gfx_display_vk_get_default_mvp(vk); call.uniform_size = sizeof(math_matrix_4x4); call.vbo = ⦥ call.vertices = draw->coords->vertices; diff --git a/gfx/drivers_display/gfx_display_wiiu.c b/gfx/drivers_display/gfx_display_wiiu.c index 7830e10ff6..a057bdf9d9 100644 --- a/gfx/drivers_display/gfx_display_wiiu.c +++ b/gfx/drivers_display/gfx_display_wiiu.c @@ -53,11 +53,7 @@ static void gfx_display_wiiu_blend_end(video_frame_info_t *video_info) } -static void gfx_display_wiiu_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ - -} +static void gfx_display_wiiu_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index 1b77c4694b..9b23dfb8fa 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -83,8 +83,7 @@ static void gfx_display_null_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { } static void gfx_display_null_draw_pipeline(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { } -static void gfx_display_null_viewport(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } +static void gfx_display_null_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_null_restore_clear_color(void) { } static void gfx_display_null_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) { } diff --git a/gfx/gfx_display.h b/gfx/gfx_display.h index 02599d4daa..ee62ff1365 100644 --- a/gfx/gfx_display.h +++ b/gfx/gfx_display.h @@ -109,8 +109,7 @@ typedef struct gfx_display_ctx_driver /* Draw one of the menu pipeline shaders. */ void (*draw_pipeline)(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info); - void (*viewport)(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info); + void (*viewport)(gfx_display_ctx_draw_t *draw, void *data); /* Start blending operation. */ void (*blend_begin)(video_frame_info_t *video_info); /* Finish blending operation. */