From 6136035f2eeb0bf463fbd622cb708af2aa083ab5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 19 Aug 2020 04:59:14 +0200 Subject: [PATCH] Optimize vulkan_write_quad_vbo --- gfx/common/vulkan_common.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index e9e71fd06f..ec721d3dfd 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -598,11 +598,13 @@ static INLINE void vulkan_write_quad_vbo(struct vk_vertex *pv, for (i = 0; i < 6; i++) { - pv[i].x = x + strip[2 * i + 0] * width; - pv[i].y = y + strip[2 * i + 1] * height; - pv[i].tex_x = tex_x + strip[2 * i + 0] * tex_width; - pv[i].tex_y = tex_y + strip[2 * i + 1] * tex_height; - pv[i].color = *color; + float strip1 = strip[2 * i + 0]; + float strip2 = strip[2 * i + 1]; + pv[i].x = x + strip1 * width; + pv[i].y = y + strip2 * height; + pv[i].tex_x = tex_x + strip1 * tex_width; + pv[i].tex_y = tex_y + strip2 * tex_height; + pv[i].color = *color; } }