(drivers_display) Cleanups

This commit is contained in:
twinaphex 2020-09-11 14:21:09 +02:00
parent 6a82772b72
commit 6f6b15aedd
1 changed files with 7 additions and 11 deletions

View File

@ -66,12 +66,6 @@ static const float *gfx_display_vk_get_default_tex_coords(void)
return &vk_tex_coords[0]; return &vk_tex_coords[0];
} }
static unsigned to_display_pipeline(
enum gfx_display_prim_type type, bool blend)
{
return ((type == GFX_DISPLAY_PRIM_TRIANGLESTRIP) << 1) | (blend << 0);
}
#ifdef HAVE_SHADERPIPELINE #ifdef HAVE_SHADERPIPELINE
static unsigned to_menu_pipeline( static unsigned to_menu_pipeline(
enum gfx_display_prim_type type, unsigned pipeline) enum gfx_display_prim_type type, unsigned pipeline)
@ -159,7 +153,7 @@ static void gfx_display_vk_draw_pipeline(gfx_display_ctx_draw_t *draw,
/* Match UBO layout in shader. */ /* Match UBO layout in shader. */
memcpy(ubo_scratch_data, memcpy(ubo_scratch_data,
gfx_display_vk_get_default_mvp(vk), &vk->mvp_no_rot,
sizeof(math_matrix_4x4)); sizeof(math_matrix_4x4));
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4), memcpy(ubo_scratch_data + sizeof(math_matrix_4x4),
output_size, output_size,
@ -270,16 +264,18 @@ static void gfx_display_vk_draw(gfx_display_ctx_draw_t *draw,
default: default:
{ {
struct vk_draw_triangles call; struct vk_draw_triangles call;
unsigned
call.pipeline = vk->display.pipelines[ disp_pipeline = ((draw->prim_type ==
to_display_pipeline(draw->prim_type, vk->display.blend)]; GFX_DISPLAY_PRIM_TRIANGLESTRIP) << 1) |
(vk->display.blend << 0);
call.pipeline = vk->display.pipelines[disp_pipeline];
call.texture = texture; call.texture = texture;
call.sampler = texture->mipmap ? call.sampler = texture->mipmap ?
vk->samplers.mipmap_linear : vk->samplers.mipmap_linear :
(texture->default_smooth ? vk->samplers.linear (texture->default_smooth ? vk->samplers.linear
: vk->samplers.nearest); : vk->samplers.nearest);
call.uniform = draw->matrix_data call.uniform = draw->matrix_data
? draw->matrix_data : gfx_display_vk_get_default_mvp(vk); ? draw->matrix_data : &vk->mvp_no_rot;
call.uniform_size = sizeof(math_matrix_4x4); call.uniform_size = sizeof(math_matrix_4x4);
call.vbo = &range; call.vbo = &range;
call.vertices = draw->coords->vertices; call.vertices = draw->coords->vertices;