From c16568cf32891699e57ffb07d24c3dbecc60c242 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Mar 2020 22:05:51 +0100 Subject: [PATCH] (gfx drivers display) No more video_frame_info dependency --- gfx/common/metal/MenuDisplay.h | 10 +++++----- gfx/common/metal/MenuDisplay.m | 14 +++++++------- gfx/drivers_display/gfx_display_ctr.c | 10 ++++------ gfx/drivers_display/gfx_display_d3d10.c | 13 ++++++------- gfx/drivers_display/gfx_display_d3d11.c | 12 ++++++------ gfx/drivers_display/gfx_display_d3d12.c | 12 ++++++------ gfx/drivers_display/gfx_display_d3d8.c | 22 ++++++++-------------- gfx/drivers_display/gfx_display_d3d9.c | 12 +++++------- gfx/drivers_display/gfx_display_gdi.c | 11 ++++------- gfx/drivers_display/gfx_display_gl.c | 17 +++++++++-------- gfx/drivers_display/gfx_display_gl1.c | 8 +++++--- gfx/drivers_display/gfx_display_gl_core.c | 14 +++++++------- gfx/drivers_display/gfx_display_metal.m | 22 ++++++++++++++-------- gfx/drivers_display/gfx_display_switch.c | 7 ++++--- gfx/drivers_display/gfx_display_vita2d.c | 11 ++++------- gfx/drivers_display/gfx_display_vulkan.c | 12 ++++++------ gfx/drivers_display/gfx_display_wiiu.c | 10 +++++----- gfx/gfx_display.c | 15 +++++++++------ gfx/gfx_display.h | 7 ++++--- 19 files changed, 118 insertions(+), 121 deletions(-) diff --git a/gfx/common/metal/MenuDisplay.h b/gfx/common/metal/MenuDisplay.h index a40afd5952..102657d8cd 100644 --- a/gfx/common/metal/MenuDisplay.h +++ b/gfx/common/metal/MenuDisplay.h @@ -1,6 +1,6 @@ -// -// Created by Stuart Carnie on 6/24/18. -// +/* + * Created by Stuart Carnie on 6/24/18. + */ #import @@ -12,8 +12,8 @@ @property (nonatomic, readwrite) MTLClearColor clearColor; - (instancetype)initWithContext:(Context *)context; -- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video; -- (void)draw:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video; +- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw; +- (void)draw:(gfx_display_ctx_draw_t *)draw; - (void)setScissorRect:(MTLScissorRect)rect; - (void)clearScissorRect; diff --git a/gfx/common/metal/MenuDisplay.m b/gfx/common/metal/MenuDisplay.m index db4d6109ae..bb69b314a8 100644 --- a/gfx/common/metal/MenuDisplay.m +++ b/gfx/common/metal/MenuDisplay.m @@ -1,13 +1,13 @@ -// -// Created by Stuart Carnie on 6/24/18. -// +/* + * Created by Stuart Carnie on 6/24/18. + */ #import "Context.h" #import "MenuDisplay.h" #import "ShaderTypes.h" #import "menu_driver.h" #import -// TODO(sgc): this dependency is incorrect +/* TODO(sgc): this dependency is incorrect */ #import "../metal_common.h" @implementation MenuDisplay @@ -102,7 +102,7 @@ } } -- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video +- (void)drawPipeline:(gfx_display_ctx_draw_t *)draw { static struct video_coords blank_coords; @@ -117,7 +117,7 @@ switch (draw->pipeline.id) { - // ribbon + /* ribbon */ default: case VIDEO_SHADER_MENU: case VIDEO_SHADER_MENU_2: @@ -142,7 +142,7 @@ _uniforms.time += 0.01; } -- (void)draw:(gfx_display_ctx_draw_t *)draw video:(video_frame_info_t *)video +- (void)draw:(gfx_display_ctx_draw_t *)draw { const float *vertex = draw->coords->vertex ?: MenuDisplay.defaultVertices; const float *tex_coord = draw->coords->tex_coord ?: MenuDisplay.defaultTexCoords; diff --git a/gfx/drivers_display/gfx_display_ctr.c b/gfx/drivers_display/gfx_display_ctr.c index 6b072d491a..78ee7726f9 100644 --- a/gfx/drivers_display/gfx_display_ctr.c +++ b/gfx/drivers_display/gfx_display_ctr.c @@ -37,12 +37,12 @@ static void gfx_display_ctr_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_ctr_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { int colorR, colorG, colorB, colorA; struct ctr_texture *texture = NULL; const float *color = NULL; - ctr_video_t *ctr = (ctr_video_t*)video_info->userdata; + ctr_video_t *ctr = (ctr_video_t*)data; if (!ctr || !draw) return; @@ -135,9 +135,7 @@ static void gfx_display_ctr_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_ctr_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} + void *data, unsigned video_width, unsigned video_height) { } static void gfx_display_ctr_restore_clear_color(void) { @@ -146,7 +144,7 @@ static void gfx_display_ctr_restore_clear_color(void) #endif } -static void gfx_display_ctr_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) +static void gfx_display_ctr_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data) { if (!clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_d3d10.c b/gfx/drivers_display/gfx_display_d3d10.c index c03c9007f3..02ee78aac4 100644 --- a/gfx/drivers_display/gfx_display_d3d10.c +++ b/gfx/drivers_display/gfx_display_d3d10.c @@ -60,10 +60,10 @@ static void gfx_display_d3d10_blend_end(void *data) 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) + void *data, unsigned video_width, unsigned video_height) { int vertex_count; - d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata; + d3d10_video_t* d3d10 = (d3d10_video_t*)data; if (!d3d10 || !draw || !draw->texture) return; @@ -182,9 +182,9 @@ static void gfx_display_d3d10_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d10_draw_pipeline(gfx_display_ctx_draw_t* draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { - d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata; + d3d10_video_t* d3d10 = (d3d10_video_t*)data; if (!d3d10 || !draw) return; @@ -240,10 +240,9 @@ static void gfx_display_d3d10_draw_pipeline(gfx_display_ctx_draw_t* draw, static void gfx_display_d3d10_restore_clear_color(void) {} static void gfx_display_d3d10_clear_color( - gfx_display_ctx_clearcolor_t* clearcolor, - video_frame_info_t *video_info) + gfx_display_ctx_clearcolor_t* clearcolor, void *data) { - d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata; + d3d10_video_t* d3d10 = (d3d10_video_t*)data; if (!d3d10 || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_d3d11.c b/gfx/drivers_display/gfx_display_d3d11.c index 73e43f4cb3..a9b218e96d 100644 --- a/gfx/drivers_display/gfx_display_d3d11.c +++ b/gfx/drivers_display/gfx_display_d3d11.c @@ -59,10 +59,10 @@ static void gfx_display_d3d11_blend_end(void *data) 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) + void *data, unsigned video_width, unsigned video_height) { int vertex_count; - d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata; + d3d11_video_t *d3d11 = (d3d11_video_t*)data; if (!d3d11 || !draw || !draw->texture) return; @@ -181,9 +181,9 @@ static void gfx_display_d3d11_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d11_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { - d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata; + d3d11_video_t *d3d11 = (d3d11_video_t*)data; if (!d3d11 || !draw) return; @@ -240,9 +240,9 @@ static void gfx_display_d3d11_restore_clear_color(void) {} static void gfx_display_d3d11_clear_color( gfx_display_ctx_clearcolor_t* clearcolor, - video_frame_info_t *video_info) + void *data) { - d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata; + d3d11_video_t *d3d11 = (d3d11_video_t*)data; if (!d3d11 || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_d3d12.c b/gfx/drivers_display/gfx_display_d3d12.c index e228816eaf..ccd9823fcc 100644 --- a/gfx/drivers_display/gfx_display_d3d12.c +++ b/gfx/drivers_display/gfx_display_d3d12.c @@ -61,10 +61,10 @@ static void gfx_display_d3d12_blend_end(void *data) 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) + void *data, unsigned video_width, unsigned video_height) { int vertex_count; - d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + d3d12_video_t *d3d12 = (d3d12_video_t*)data; if (!d3d12 || !draw || !draw->texture) return; @@ -198,9 +198,9 @@ static void gfx_display_d3d12_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d12_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { - d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + d3d12_video_t *d3d12 = (d3d12_video_t*)data; if (!d3d12 || !draw) return; @@ -261,9 +261,9 @@ static void gfx_display_d3d12_draw_pipeline(gfx_display_ctx_draw_t *draw, static void gfx_display_d3d12_restore_clear_color(void) {} static void gfx_display_d3d12_clear_color( - gfx_display_ctx_clearcolor_t* clearcolor, video_frame_info_t *video_info) + gfx_display_ctx_clearcolor_t* clearcolor, void *data) { - d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + d3d12_video_t *d3d12 = (d3d12_video_t*)data; if (!d3d12 || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_d3d8.c b/gfx/drivers_display/gfx_display_d3d8.c index dfc8de16ab..315fc88bfb 100644 --- a/gfx/drivers_display/gfx_display_d3d8.c +++ b/gfx/drivers_display/gfx_display_d3d8.c @@ -113,13 +113,13 @@ static void gfx_display_d3d8_bind_texture(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d8_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, + unsigned video_width, + unsigned video_height) { unsigned i; math_matrix_4x4 mop, m1, m2; - d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; + d3d8_video_t *d3d = (d3d8_video_t*)data; Vertex * pv = NULL; const float *vertex = NULL; const float *tex_coord = NULL; @@ -221,20 +221,14 @@ static void gfx_display_d3d8_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d8_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} - -static void gfx_display_d3d8_restore_clear_color(void) -{ - /* not needed */ -} + void *data, unsigned video_width, unsigned video_height) { } +static void gfx_display_d3d8_restore_clear_color(void) { } static void gfx_display_d3d8_clear_color( - gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) + gfx_display_ctx_clearcolor_t *clearcolor, void *data) { DWORD clear_color = 0; - d3d8_video_t *d3d = (d3d8_video_t*)video_info->userdata; + d3d8_video_t *d3d = (d3d8_video_t*)data; if (!d3d || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_d3d9.c b/gfx/drivers_display/gfx_display_d3d9.c index 4ad88c136c..fdf06dd085 100644 --- a/gfx/drivers_display/gfx_display_d3d9.c +++ b/gfx/drivers_display/gfx_display_d3d9.c @@ -114,18 +114,16 @@ static void gfx_display_d3d9_bind_texture(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d9_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { unsigned i; math_matrix_4x4 mop, m1, m2; LPDIRECT3DDEVICE9 dev; - d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata; + d3d9_video_t *d3d = (d3d9_video_t*)data; Vertex * pv = NULL; const float *vertex = NULL; const float *tex_coord = NULL; const float *color = NULL; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; if (!d3d || !draw || draw->pipeline.id) return; @@ -216,7 +214,7 @@ static void gfx_display_d3d9_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_d3d9_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { #if defined(HAVE_HLSL) || defined(HAVE_CG) static float t = 0; @@ -267,11 +265,11 @@ static void gfx_display_d3d9_restore_clear_color(void) static void gfx_display_d3d9_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { LPDIRECT3DDEVICE9 dev; DWORD clear_color = 0; - d3d9_video_t *d3d = (d3d9_video_t*)video_info->userdata; + d3d9_video_t *d3d = (d3d9_video_t*)data; if (!d3d || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_gdi.c b/gfx/drivers_display/gfx_display_gdi.c index 1e2aace5c3..3fef9bbedc 100644 --- a/gfx/drivers_display/gfx_display_gdi.c +++ b/gfx/drivers_display/gfx_display_gdi.c @@ -37,11 +37,10 @@ static void gfx_display_gdi_blend_begin(void *data) { } static void gfx_display_gdi_blend_end(void *data) { } static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { struct gdi_texture *texture = NULL; - gdi_t *gdi = (gdi_t*)video_info->userdata; - unsigned video_height = video_info->height; + gdi_t *gdi = (gdi_t*)data; BITMAPINFO info = {{0}}; if (!gdi || !draw || draw->x < 0 || draw->y < 0 || draw->width <= 1 || draw->height <= 1) @@ -108,15 +107,13 @@ static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_gdi_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } - + void *data, unsigned video_width, unsigned video_height) { } static void gfx_display_gdi_viewport(gfx_display_ctx_draw_t *draw, void *data) { } - static void gfx_display_gdi_restore_clear_color(void) { } static void gfx_display_gdi_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { (void)clearcolor; diff --git a/gfx/drivers_display/gfx_display_gl.c b/gfx/drivers_display/gfx_display_gl.c index a8229ac92f..f1381907e8 100644 --- a/gfx/drivers_display/gfx_display_gl.c +++ b/gfx/drivers_display/gfx_display_gl.c @@ -218,11 +218,9 @@ gfx_display_gl_discard_draw_rectangle(gfx_display_ctx_draw_t *draw, #endif static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { - gl_t *gl = (gl_t*)video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; + gl_t *gl = (gl_t*)data; if (!gl || !draw) return; @@ -259,12 +257,15 @@ static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw, gl->coords.color = gl->white_color_ptr; } -static void gfx_display_gl_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) +static void gfx_display_gl_draw_pipeline( + gfx_display_ctx_draw_t *draw, + void *data, + unsigned video_width, + unsigned video_height) { #ifdef HAVE_SHADERPIPELINE struct uniform_info uniform_param; - gl_t *gl = (gl_t*)video_info->userdata; + gl_t *gl = (gl_t*)data; static float t = 0; video_coord_array_t *ca = gfx_display_get_coords_array(); @@ -342,7 +343,7 @@ static void gfx_display_gl_restore_clear_color(void) static void gfx_display_gl_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { if (!clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_gl1.c b/gfx/drivers_display/gfx_display_gl1.c index f3c5ab97f5..8a3f2b8693 100644 --- a/gfx/drivers_display/gfx_display_gl1.c +++ b/gfx/drivers_display/gfx_display_gl1.c @@ -100,10 +100,12 @@ static void gfx_display_gl1_viewport(gfx_display_ctx_draw_t *draw, } static void gfx_display_gl1_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, + unsigned video_width, + unsigned video_height) { video_shader_ctx_mvp_t mvp; - gl1_t *gl1 = (gl1_t*)video_info->userdata; + gl1_t *gl1 = (gl1_t*)data; if (!gl1 || !draw) return; @@ -177,7 +179,7 @@ static void gfx_display_gl1_restore_clear_color(void) static void gfx_display_gl1_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { if (!clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_gl_core.c b/gfx/drivers_display/gfx_display_gl_core.c index 64fc62b706..5e41c9ad1a 100644 --- a/gfx/drivers_display/gfx_display_gl_core.c +++ b/gfx/drivers_display/gfx_display_gl_core.c @@ -78,7 +78,9 @@ static void gfx_display_gl_core_viewport(gfx_display_ctx_draw_t *draw, void *dat } static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, + unsigned video_width, + unsigned video_height) { #ifdef HAVE_SHADERPIPELINE float output_size[2]; @@ -87,9 +89,7 @@ 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 = (gl_core_t*)video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; + gl_core_t *gl = (gl_core_t*)data; if (!gl || !draw) return; @@ -152,13 +152,13 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, } static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { const float *vertex = NULL; const float *tex_coord = NULL; const float *color = NULL; GLuint texture = 0; - gl_core_t *gl = (gl_core_t*)video_info->userdata; + gl_core_t *gl = (gl_core_t*)data; const struct gl_core_buffer_locations *loc = NULL; @@ -292,7 +292,7 @@ static void gfx_display_gl_core_restore_clear_color(void) static void gfx_display_gl_core_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { if (!clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_metal.m b/gfx/drivers_display/gfx_display_metal.m index fcef602dd1..f24958ee20 100644 --- a/gfx/drivers_display/gfx_display_metal.m +++ b/gfx/drivers_display/gfx_display_metal.m @@ -63,22 +63,28 @@ static void gfx_display_metal_blend_end(void *data) } static void gfx_display_metal_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, + unsigned video_width, + unsigned video_height) { - MetalDriver *md = (__bridge MetalDriver *)video_info->userdata; + MetalDriver *md = (__bridge MetalDriver *)data; if (!md || !draw) return; - [md.display draw:draw video:video_info]; + [md.display draw:draw]; } -static void gfx_display_metal_draw_pipeline(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) +static void gfx_display_metal_draw_pipeline( + gfx_display_ctx_draw_t *draw, + void *data, + unsigned video_width, + unsigned video_height) { - MetalDriver *md = (__bridge MetalDriver *)video_info->userdata; + MetalDriver *md = (__bridge MetalDriver *)data; if (!md || !draw) return; - [md.display drawPipeline:draw video:video_info]; + [md.display drawPipeline:draw]; } static void gfx_display_metal_viewport(gfx_display_ctx_draw_t *draw, @@ -114,9 +120,9 @@ static void gfx_display_metal_restore_clear_color(void) { } static void gfx_display_metal_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { - MetalDriver *md = (__bridge MetalDriver *)video_info->userdata; + MetalDriver *md = (__bridge MetalDriver *)data; if (!md) return; diff --git a/gfx/drivers_display/gfx_display_switch.c b/gfx/drivers_display/gfx_display_switch.c index 7c5ad0a157..b1eb4dd036 100644 --- a/gfx/drivers_display/gfx_display_switch.c +++ b/gfx/drivers_display/gfx_display_switch.c @@ -26,14 +26,15 @@ static void *gfx_display_switch_get_default_mvp(void *data) { return NULL; } static void gfx_display_switch_blend_begin(void *data) { } static void gfx_display_switch_blend_end(void *data) { } static void gfx_display_switch_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } + void *data, unsigned video_width, unsigned video_height) { } static void gfx_display_switch_draw_pipeline( - gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { } + gfx_display_ctx_draw_t *draw, + void *data, unsigned video_width, unsigned video_height) { } static void gfx_display_switch_viewport(gfx_display_ctx_draw_t *draw, void *data) { } static void gfx_display_switch_restore_clear_color(void) { } -static void gfx_display_switch_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info) { } +static void gfx_display_switch_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data) { } static bool gfx_display_switch_font_init_first( void **font_handle, void *video_data, diff --git a/gfx/drivers_display/gfx_display_vita2d.c b/gfx/drivers_display/gfx_display_vita2d.c index 302e7d20df..b856e75019 100644 --- a/gfx/drivers_display/gfx_display_vita2d.c +++ b/gfx/drivers_display/gfx_display_vita2d.c @@ -85,14 +85,14 @@ static void gfx_display_vita2d_viewport(gfx_display_ctx_draw_t *draw, } static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { unsigned i; struct vita2d_texture *texture = NULL; const float *vertex = NULL; const float *tex_coord = NULL; const float *color = NULL; - vita_video_t *vita2d = (vita_video_t*)video_info->userdata; + vita_video_t *vita2d = (vita_video_t*)data; if (!vita2d || !draw) return; @@ -145,9 +145,7 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_vita2d_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) -{ -} + void *data, unsigned video_width, unsigned video_height) { } static void gfx_display_vita2d_restore_clear_color(void) { @@ -155,8 +153,7 @@ static void gfx_display_vita2d_restore_clear_color(void) } static void gfx_display_vita2d_clear_color( - gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + gfx_display_ctx_clearcolor_t *clearcolor, void *data) { if (!clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_vulkan.c b/gfx/drivers_display/gfx_display_vulkan.c index a333b3a973..47cd1e6aee 100644 --- a/gfx/drivers_display/gfx_display_vulkan.c +++ b/gfx/drivers_display/gfx_display_vulkan.c @@ -116,7 +116,7 @@ static void gfx_display_vk_viewport(gfx_display_ctx_draw_t *draw, } static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { #ifdef HAVE_SHADERPIPELINE static uint8_t ubo_scratch_data[768]; @@ -125,7 +125,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw, static struct video_coords blank_coords; float output_size[2]; video_coord_array_t *ca = NULL; - vk_t *vk = (vk_t*)video_info->userdata; + vk_t *vk = (vk_t*)data; if (!vk || !draw) return; @@ -191,7 +191,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw, } static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { unsigned i; struct vk_buffer_range range; @@ -200,7 +200,7 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw, const float *tex_coord = NULL; const float *color = NULL; struct vk_vertex *pv = NULL; - vk_t *vk = (vk_t*)video_info->userdata; + vk_t *vk = (vk_t*)data; if (!vk || !draw) return; @@ -301,11 +301,11 @@ static void gfx_display_vk_restore_clear_color(void) static void gfx_display_vk_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { VkClearRect rect; VkClearAttachment attachment; - vk_t *vk = (vk_t*)video_info->userdata; + vk_t *vk = (vk_t*)data; if (!vk || !clearcolor) return; diff --git a/gfx/drivers_display/gfx_display_wiiu.c b/gfx/drivers_display/gfx_display_wiiu.c index 9c55cf4421..849c536524 100644 --- a/gfx/drivers_display/gfx_display_wiiu.c +++ b/gfx/drivers_display/gfx_display_wiiu.c @@ -36,9 +36,9 @@ static void gfx_display_wiiu_blend_end(void *data) { } 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) + void *data, unsigned video_width, unsigned video_height) { - wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata; + wiiu_video_t *wiiu = (wiiu_video_t*)data; if (!wiiu || !draw) return; @@ -205,10 +205,10 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw, } static void gfx_display_wiiu_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) + void *data, unsigned video_width, unsigned video_height) { video_coord_array_t *ca = NULL; - wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata; + wiiu_video_t *wiiu = (wiiu_video_t*)data; if (!wiiu || !draw) return; @@ -267,7 +267,7 @@ static void gfx_display_wiiu_restore_clear_color(void) static void gfx_display_wiiu_clear_color( gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info) + void *data) { if (!clearcolor) return; diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index c9ea65cc13..4ac74605a9 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -80,12 +80,12 @@ static void *gfx_display_null_get_default_mvp(void *data) { return NULL; } static void gfx_display_null_blend_begin(void *data) { } static void gfx_display_null_blend_end(void *data) { } static void gfx_display_null_draw(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } + void *data, unsigned width, unsigned height) { } static void gfx_display_null_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) { } + void *data, unsigned width, unsigned height) { } 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) { } +static void gfx_display_null_clear_color(gfx_display_ctx_clearcolor_t *clearcolor, void *data) { } static bool gfx_display_null_font_init_first( void **font_handle, void *video_data, @@ -741,7 +741,8 @@ void gfx_display_draw(gfx_display_ctx_draw_t *draw, return; if (draw->width <= 0) return; - dispctx->draw(draw, video_info); + dispctx->draw(draw, video_info->userdata, + video_info->width, video_info->height); } void gfx_display_draw_blend(gfx_display_ctx_draw_t *draw, @@ -755,7 +756,8 @@ void gfx_display_draw_blend(gfx_display_ctx_draw_t *draw, if (draw->width <= 0) return; gfx_display_blend_begin(video_info->userdata); - dispctx->draw(draw, video_info); + dispctx->draw(draw, video_info->userdata, + video_info->width, video_info->height); gfx_display_blend_end(video_info->userdata); } @@ -763,7 +765,8 @@ void gfx_display_draw_pipeline(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { if (dispctx && draw && dispctx->draw_pipeline) - dispctx->draw_pipeline(draw, video_info); + dispctx->draw_pipeline(draw, video_info->userdata, + video_info->width, video_info->height); } void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw, diff --git a/gfx/gfx_display.h b/gfx/gfx_display.h index 23e5c58d02..05a7188dfa 100644 --- a/gfx/gfx_display.h +++ b/gfx/gfx_display.h @@ -105,10 +105,11 @@ typedef struct gfx_display_ctx_draw gfx_display_ctx_draw_t; typedef struct gfx_display_ctx_driver { /* Draw graphics to the screen. */ - void (*draw)(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info); + void (*draw)(gfx_display_ctx_draw_t *draw, + void *data, unsigned video_width, unsigned video_height); /* Draw one of the menu pipeline shaders. */ void (*draw_pipeline)(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info); + void *data, unsigned video_width, unsigned video_height); void (*viewport)(gfx_display_ctx_draw_t *draw, void *data); /* Start blending operation. */ void (*blend_begin)(void *data); @@ -118,7 +119,7 @@ typedef struct gfx_display_ctx_driver void (*restore_clear_color)(void); /* Set the color to be used when clearing the screen */ void (*clear_color)(gfx_display_ctx_clearcolor_t *clearcolor, - video_frame_info_t *video_info); + void *data); /* Get the default Model-View-Projection matrix */ void *(*get_default_mvp)(void *data); /* Get the default vertices matrix */