mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
(drivers_display) cleanups
This commit is contained in:
parent
ab517428fd
commit
60b26bd490
@ -31,7 +31,8 @@ static int scx0, scx1, scy0, scy1;
|
||||
/* This array contains problematic GPU drivers
|
||||
* that have problems when we draw outside the
|
||||
* bounds of the framebuffer */
|
||||
static const struct {
|
||||
static const struct
|
||||
{
|
||||
const char *str;
|
||||
int len;
|
||||
} scissor_device_strings[] = {
|
||||
@ -236,11 +237,11 @@ static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw,
|
||||
#endif
|
||||
|
||||
if (!draw->coords->vertex)
|
||||
draw->coords->vertex = gfx_display_gl_get_default_vertices();
|
||||
draw->coords->vertex = &gl_vertexes[0];
|
||||
if (!draw->coords->tex_coord)
|
||||
draw->coords->tex_coord = gfx_display_gl_get_default_tex_coords();
|
||||
draw->coords->tex_coord = &gl_tex_coords[0];
|
||||
if (!draw->coords->lut_tex_coord)
|
||||
draw->coords->lut_tex_coord = gfx_display_gl_get_default_tex_coords();
|
||||
draw->coords->lut_tex_coord = &gl_tex_coords[0];
|
||||
|
||||
gfx_display_gl_viewport(draw, gl);
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)draw->texture);
|
||||
@ -248,7 +249,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(gl));
|
||||
: (math_matrix_4x4*)&gl->mvp_no_rot);
|
||||
|
||||
|
||||
glDrawArrays(gfx_display_prim_to_gl_enum(
|
||||
|
@ -61,11 +61,6 @@ static const float *gfx_display_gl_core_get_default_vertices(void)
|
||||
return &gl_core_vertexes[0];
|
||||
}
|
||||
|
||||
static const float *gfx_display_gl_core_get_default_color(void)
|
||||
{
|
||||
return &gl_core_colors[0];
|
||||
}
|
||||
|
||||
static const float *gfx_display_gl_core_get_default_tex_coords(void)
|
||||
{
|
||||
return &gl_core_tex_coords[0];
|
||||
@ -128,7 +123,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(gl),
|
||||
&gl->mvp_no_rot,
|
||||
sizeof(math_matrix_4x4));
|
||||
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4),
|
||||
output_size,
|
||||
@ -173,9 +168,9 @@ static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw,
|
||||
if (!vertex)
|
||||
vertex = gfx_display_gl_core_get_default_vertices();
|
||||
if (!tex_coord)
|
||||
tex_coord = gfx_display_gl_core_get_default_tex_coords();
|
||||
tex_coord = &gl_core_tex_coords[0];
|
||||
if (!color)
|
||||
color = gfx_display_gl_core_get_default_color();
|
||||
color = &gl_core_colors[0];
|
||||
|
||||
gfx_display_gl_core_viewport(draw, gl);
|
||||
|
||||
@ -241,7 +236,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(gl);
|
||||
? (const math_matrix_4x4*)draw->matrix_data : (const math_matrix_4x4*)&gl->mvp_no_rot;
|
||||
if (gl->pipelines.alpha_blend_loc.flat_ubo_vertex >= 0)
|
||||
glUniform4fv(gl->pipelines.alpha_blend_loc.flat_ubo_vertex,
|
||||
4, mat->data);
|
||||
|
@ -103,15 +103,15 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw,
|
||||
color = draw->coords->color;
|
||||
|
||||
if (!vertex)
|
||||
vertex = gfx_display_vita2d_get_default_vertices();
|
||||
vertex = &vita2d_vertexes[0];
|
||||
if (!tex_coord)
|
||||
tex_coord = gfx_display_vita2d_get_default_tex_coords();
|
||||
tex_coord = &vita2d_tex_coords[0];
|
||||
if (!draw->coords->lut_tex_coord)
|
||||
draw->coords->lut_tex_coord = gfx_display_vita2d_get_default_tex_coords();
|
||||
draw->coords->lut_tex_coord = &vita2d_tex_coords[0];
|
||||
if (!texture)
|
||||
return;
|
||||
if (!color)
|
||||
color = gfx_display_vita2d_get_default_color();
|
||||
color = &vita2d_colors[0];
|
||||
|
||||
gfx_display_vita2d_viewport(draw, vita2d);
|
||||
|
||||
@ -136,7 +136,7 @@ static void gfx_display_vita2d_draw(gfx_display_ctx_draw_t *draw,
|
||||
{
|
||||
default:
|
||||
{
|
||||
vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, gfx_display_vita2d_get_default_mvp(vita2d));
|
||||
vita2d_draw_array_textured_mat(texture, vertices, draw->coords->vertices, &vita2d->mvp_no_rot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -61,11 +61,6 @@ static const float *gfx_display_vk_get_default_vertices(void)
|
||||
return &vk_vertexes[0];
|
||||
}
|
||||
|
||||
static const float *gfx_display_vk_get_default_color(void)
|
||||
{
|
||||
return &vk_colors[0];
|
||||
}
|
||||
|
||||
static const float *gfx_display_vk_get_default_tex_coords(void)
|
||||
{
|
||||
return &vk_tex_coords[0];
|
||||
@ -205,21 +200,21 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw,
|
||||
if (!vk || !draw)
|
||||
return;
|
||||
|
||||
texture = (struct vk_texture*)draw->texture;
|
||||
vertex = draw->coords->vertex;
|
||||
tex_coord = draw->coords->tex_coord;
|
||||
color = draw->coords->color;
|
||||
texture = (struct vk_texture*)draw->texture;
|
||||
vertex = draw->coords->vertex;
|
||||
tex_coord = draw->coords->tex_coord;
|
||||
color = draw->coords->color;
|
||||
|
||||
if (!vertex)
|
||||
vertex = gfx_display_vk_get_default_vertices();
|
||||
vertex = &vk_vertexes[0];
|
||||
if (!tex_coord)
|
||||
tex_coord = gfx_display_vk_get_default_tex_coords();
|
||||
tex_coord = &vk_tex_coords[0];
|
||||
if (!draw->coords->lut_tex_coord)
|
||||
draw->coords->lut_tex_coord = gfx_display_vk_get_default_tex_coords();
|
||||
draw->coords->lut_tex_coord = &vk_tex_coords[0];
|
||||
if (!texture)
|
||||
texture = &vk->display.blank_texture;
|
||||
texture = &vk->display.blank_texture;
|
||||
if (!color)
|
||||
color = gfx_display_vk_get_default_color();
|
||||
color = &vk_colors[0];
|
||||
|
||||
gfx_display_vk_viewport(draw, vk);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user