(drivers_display) Get rid of video_frame_info argument for

get_default_mvp
This commit is contained in:
twinaphex 2020-03-08 19:59:03 +01:00
parent 3e706fe5b2
commit 874510152e
19 changed files with 37 additions and 54 deletions

View File

@ -40,7 +40,6 @@ typedef struct d3d9_renderchain_driver
void (*chain_free)(void *data);
void *(*chain_new)(void);
bool (*init)(d3d9_video_t *d3d,
const video_info_t *video_info,
LPDIRECT3DDEVICE9 dev,
const D3DVIEWPORT9 *final_viewport,
const struct LinkInfo *info,

View File

@ -227,7 +227,6 @@ static bool d3d9_init_chain(d3d9_video_t *d3d, const video_info_t *video_info)
if (
!d3d->renderchain_driver->init(
d3d,
&d3d->video_info,
d3d->dev, &d3d->final_viewport, &link_info,
d3d->video_info.rgb32)
)

View File

@ -28,13 +28,8 @@
#include "../../ctr/gpu_old.h"
static const float *gfx_display_ctr_get_default_vertices(void) { return NULL; }
static const float *gfx_display_ctr_get_default_tex_coords(void) { return NULL; }
static void *gfx_display_ctr_get_default_mvp(video_frame_info_t *video_info)
{
return NULL;
}
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) { }

View File

@ -38,7 +38,7 @@ static const float* gfx_display_d3d10_get_default_tex_coords(void)
return NULL;
}
static void* gfx_display_d3d10_get_default_mvp(video_frame_info_t *video_info)
static void* gfx_display_d3d10_get_default_mvp(void *data)
{
return NULL;
}

View File

@ -37,7 +37,7 @@ static const float* gfx_display_d3d11_get_default_tex_coords(void)
return NULL;
}
static void* gfx_display_d3d11_get_default_mvp(video_frame_info_t *video_info)
static void* gfx_display_d3d11_get_default_mvp(void *data)
{
return NULL;
}

View File

@ -37,7 +37,7 @@ static const float* gfx_display_d3d12_get_default_tex_coords(void)
return NULL;
}
static void* gfx_display_d3d12_get_default_mvp(video_frame_info_t *video_info)
static void* gfx_display_d3d12_get_default_mvp(void *data)
{
return NULL;
}

View File

@ -53,7 +53,7 @@ static const float *gfx_display_d3d8_get_default_tex_coords(void)
return &d3d8_tex_coords[0];
}
static void *gfx_display_d3d8_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_d3d8_get_default_mvp(void *data)
{
static math_matrix_4x4 id;
matrix_4x4_identity(id);
@ -188,7 +188,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);
draw->matrix_data = gfx_display_d3d8_get_default_mvp(video_info->userdata);
/* ugh */
matrix_4x4_scale(m1, 2.0, 2.0, 0);

View File

@ -53,7 +53,7 @@ static const float *gfx_display_d3d9_get_default_tex_coords(void)
return &d3d9_tex_coords[0];
}
static void *gfx_display_d3d9_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_d3d9_get_default_mvp(void *data)
{
static math_matrix_4x4 id;
matrix_4x4_identity(id);
@ -183,7 +183,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);
draw->matrix_data = gfx_display_d3d9_get_default_mvp(video_info->userdata);
/* ugh */
matrix_4x4_scale(m1, 2.0, 2.0, 0);

View File

@ -32,18 +32,9 @@
#include "../common/gdi_common.h"
#endif
static void *gfx_display_gdi_get_default_mvp(video_frame_info_t *video_info)
{
return NULL;
}
static void gfx_display_gdi_blend_begin(video_frame_info_t *video_info)
{
}
static void gfx_display_gdi_blend_end(video_frame_info_t *video_info)
{
}
static void *gfx_display_gdi_get_default_mvp(void *data) { return NULL; }
static void gfx_display_gdi_blend_begin(video_frame_info_t *video_info) { }
static void gfx_display_gdi_blend_end(video_frame_info_t *video_info) { }
static void gfx_display_gdi_draw(gfx_display_ctx_draw_t *draw,
video_frame_info_t *video_info)

View File

@ -91,9 +91,9 @@ static const float *gfx_display_gl_get_default_tex_coords(void)
return &gl_tex_coords[0];
}
static void *gfx_display_gl_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_gl_get_default_mvp(void *data)
{
gl_t *gl = (gl_t*)video_info->userdata;
gl_t *gl = (gl_t*)data;
if (!gl)
return NULL;
@ -250,7 +250,7 @@ static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw,
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));
: (math_matrix_4x4*)gfx_display_gl_get_default_mvp(video_info->userdata));
glDrawArrays(gfx_display_prim_to_gl_enum(

View File

@ -54,9 +54,9 @@ static const float *gfx_display_gl1_get_default_tex_coords(void)
return &gl1_menu_tex_coords[0];
}
static void *gfx_display_gl1_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_gl1_get_default_mvp(void *data)
{
gl1_t *gl1 = (gl1_t*)video_info->userdata;
gl1_t *gl1 = (gl1_t*)data;
if (!gl1)
return NULL;
@ -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);
: (math_matrix_4x4*)gfx_display_gl1_get_default_mvp(video_info->userdata);
glMatrixMode(GL_PROJECTION);
glPushMatrix();

View File

@ -48,9 +48,9 @@ static const float gl_core_colors[] = {
1.0f, 1.0f, 1.0f, 1.0f,
};
static void *gfx_display_gl_core_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_gl_core_get_default_mvp(void *data)
{
gl_core_t *gl_core = (gl_core_t*)video_info->userdata;
gl_core_t *gl_core = (gl_core_t*)data;
if (!gl_core)
return NULL;
return &gl_core->mvp_no_rot;
@ -129,7 +129,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),
gfx_display_gl_core_get_default_mvp(video_info->userdata),
sizeof(math_matrix_4x4));
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4),
output_size,
@ -242,7 +242,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);
? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_gl_core_get_default_mvp(video_info->userdata);
if (gl->pipelines.alpha_blend_loc.flat_ubo_vertex >= 0)
glUniform4fv(gl->pipelines.alpha_blend_loc.flat_ubo_vertex,
4, mat->data);

View File

@ -35,9 +35,9 @@ static const float *gfx_display_metal_get_default_tex_coords(void)
return [MenuDisplay defaultTexCoords];
}
static void *gfx_display_metal_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_metal_get_default_mvp(void *data)
{
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
MetalDriver *md = (__bridge MetalDriver *)data;
if (!md)
return NULL;

View File

@ -22,7 +22,7 @@
#include "../gfx_display.h"
static void *gfx_display_switch_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_switch_get_default_mvp(void *data)
{
return NULL;
}

View File

@ -64,10 +64,9 @@ static const float *gfx_display_vita2d_get_default_tex_coords(void)
return &vita2d_tex_coords[0];
}
static void *gfx_display_vita2d_get_default_mvp(
video_frame_info_t *video_info)
static void *gfx_display_vita2d_get_default_mvp(void *data)
{
vita_video_t *vita2d = (vita_video_t*)video_info->userdata;
vita_video_t *vita2d = (vita_video_t*)data;
if (!vita2d)
return NULL;
@ -141,13 +140,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);
? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)gfx_display_vita2d_get_default_mvp(video_info->userdata);
switch (draw->pipeline.id)
{
default:
{
vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, gfx_display_vita2d_get_default_mvp(video_info));
vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, gfx_display_vita2d_get_default_mvp(video_info->userdata));
break;
}
}

View File

@ -48,9 +48,9 @@ static const float vk_colors[] = {
1.0f, 1.0f, 1.0f, 1.0f,
};
static void *gfx_display_vk_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_vk_get_default_mvp(void *data)
{
vk_t *vk = (vk_t*)video_info->userdata;
vk_t *vk = (vk_t*)data;
if (!vk)
return NULL;
return &vk->mvp_no_rot;
@ -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),
gfx_display_vk_get_default_mvp(video_info->userdata),
sizeof(math_matrix_4x4));
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4),
output_size,
@ -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);
? draw->matrix_data : gfx_display_vk_get_default_mvp(video_info->userdata);
call.uniform_size = sizeof(math_matrix_4x4);
call.vbo = ⦥
call.vertices = draw->coords->vertices;

View File

@ -38,7 +38,7 @@ static const float *gfx_display_wiiu_get_default_tex_coords(void)
return NULL;
}
static void *gfx_display_wiiu_get_default_mvp(video_frame_info_t *video_info)
static void *gfx_display_wiiu_get_default_mvp(void *data)
{
return NULL;
}

View File

@ -76,7 +76,7 @@ static gfx_display_t *disp_get_ptr(void)
return &dispgfx;
}
static void *gfx_display_null_get_default_mvp(video_frame_info_t *video_info) { return NULL; }
static void *gfx_display_null_get_default_mvp(void *data) { return NULL; }
static void gfx_display_null_blend_begin(video_frame_info_t *video_info) { }
static void gfx_display_null_blend_end(video_frame_info_t *video_info) { }
static void gfx_display_null_draw(gfx_display_ctx_draw_t *draw,
@ -801,7 +801,7 @@ void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw,
if (dispctx && dispctx->get_default_mvp)
draw->matrix_data = (math_matrix_4x4*)dispctx->get_default_mvp(
video_info);
video_info->userdata);
}
void gfx_display_draw_gradient(gfx_display_ctx_draw_t *draw,
@ -1240,7 +1240,7 @@ void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw,
)
return;
b = (math_matrix_4x4*)dispctx->get_default_mvp(video_info);
b = (math_matrix_4x4*)dispctx->get_default_mvp(video_info->userdata);
if (!b)
return;

View File

@ -121,7 +121,7 @@ typedef struct gfx_display_ctx_driver
void (*clear_color)(gfx_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info);
/* Get the default Model-View-Projection matrix */
void *(*get_default_mvp)(video_frame_info_t *video_info);
void *(*get_default_mvp)(void *data);
/* Get the default vertices matrix */
const float *(*get_default_vertices)(void);
/* Get the default texture coordinates matrix */