Turn video_shader_driver_set_mvp into macro

This commit is contained in:
twinaphex 2016-11-20 16:45:06 +01:00
parent dd0a8d1778
commit ef610312e7
8 changed files with 12 additions and 21 deletions

View File

@ -51,7 +51,7 @@ static void renderchain_set_mvp(void *data, unsigned vp_width,
mvp.data = d3d;
mvp.matrix = NULL;
video_shadser_driver_set_mvp(&mvp);
video_shadser_driver_set_mvp(mvp);
#elif defined(HAVE_D3D8)
D3DXMATRIX p_out, p_rotate, mat;
D3DXMatrixOrthoOffCenterLH(&mat, 0, vp_width, vp_height, 0, 0.0f, 1.0f);

View File

@ -249,7 +249,7 @@ static void gl_render_overlay(gl_t *gl)
mvp.data = gl;
mvp.matrix = &gl->mvp_no_rot;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
for (i = 0; i < gl->overlays; i++)
{
@ -1053,7 +1053,7 @@ static INLINE void gl_draw_texture(gl_t *gl)
mvp.data = gl;
mvp.matrix = &gl->mvp_no_rot;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glEnable(GL_BLEND);
@ -1252,7 +1252,7 @@ static bool gl_frame(void *data, const void *frame,
mvp.data = gl;
mvp.matrix = &gl->mvp;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

View File

@ -342,7 +342,7 @@ void gl_renderchain_render(gl_t *gl,
mvp.data = gl;
mvp.matrix = &gl->mvp;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
@ -418,7 +418,7 @@ void gl_renderchain_render(gl_t *gl,
mvp.data = gl;
mvp.matrix = &gl->mvp;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
gl->coords.tex_coord = gl->tex_info.coord;

View File

@ -264,7 +264,7 @@ static void gl_raster_font_draw_vertices(gl_raster_t *font, const video_coords_t
mvp.data = font->gl;
mvp.matrix = &font->gl->mvp_no_rot;
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glDrawArrays(GL_TRIANGLES, 0, coords->vertices);
}

View File

@ -234,17 +234,6 @@ bool video_shader_driver_info(video_shader_ctx_info_t *shader_info)
return true;
}
bool video_shader_driver_set_mvp(video_shader_ctx_mvp_t *mvp)
{
if ( mvp
&& mvp->matrix
&& current_shader
&& current_shader->set_mvp
&& current_shader->set_mvp(mvp->data, shader_data, mvp->matrix))
return true;
return false;
}
bool video_shader_driver_filter_type(video_shader_ctx_filter_t *filter)
{
if ( filter

View File

@ -297,7 +297,9 @@ bool video_shader_driver_scale(video_shader_ctx_scale_t *scaler);
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info);
bool video_shader_driver_set_mvp(video_shader_ctx_mvp_t *mvp);
#define video_shader_driver_set_mvp(mvp) \
if (mvp.matrix && current_shader && current_shader->set_mvp) \
current_shader->set_mvp(mvp.data, shader_data, mvp.matrix) \
bool video_shader_driver_filter_type(video_shader_ctx_filter_t *filter);

View File

@ -175,7 +175,7 @@ static void menu_display_d3d_draw(void *data)
mat = (math_matrix_4x4*)
menu_display_d3d_get_default_mvp();
video_shader_driver_set_coords(d3d, draw->coords);
video_shader_driver_set_mvp(d3d, mat);
video_shader_driver_set_mvp(mat);
#endif
d3d_draw_primitive(d3d->dev, (D3DPRIMITIVETYPE)

View File

@ -146,7 +146,7 @@ static void menu_display_gl_draw(void *data)
mvp.matrix = draw->matrix_data ? (math_matrix_4x4*)draw->matrix_data
: (math_matrix_4x4*)menu_display_gl_get_default_mvp();
video_shader_driver_set_mvp(&mvp);
video_shader_driver_set_mvp(mvp);
glDrawArrays(menu_display_prim_to_gl_enum(
draw->prim_type), 0, draw->coords->vertices);