diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index 8de4766520..6417670f26 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -586,36 +586,58 @@ static INLINE void vulkan_write_quad_vbo(struct vk_vertex *pv, float tex_x, float tex_y, float tex_width, float tex_height, const struct vk_color *color) { - pv[0].x = x + 0.0f * width; - pv[0].y = y + 0.0f * height; - pv[0].tex_x = tex_x + 0.0f * tex_width; - pv[0].tex_y = tex_y + 0.0f * tex_height; - pv[0].color = *color; - pv[1].x = x + 0.0f * width; - pv[1].y = y + 1.0f * height; - pv[1].tex_x = tex_x + 0.0f * tex_width; - pv[1].tex_y = tex_y + 1.0f * tex_height; - pv[1].color = *color; - pv[2].x = x + 1.0f * width; - pv[2].y = y + 0.0f * height; - pv[2].tex_x = tex_x + 1.0f * tex_width; - pv[2].tex_y = tex_y + 0.0f * tex_height; - pv[2].color = *color; - pv[3].x = x + 1.0f * width; - pv[3].y = y + 1.0f * height; - pv[3].tex_x = tex_x + 1.0f * tex_width; - pv[3].tex_y = tex_y + 1.0f * tex_height; - pv[3].color = *color; - pv[4].x = x + 1.0f * width; - pv[4].y = y + 0.0f * height; - pv[4].tex_x = tex_x + 1.0f * tex_width; - pv[4].tex_y = tex_y + 0.0f * tex_height; - pv[4].color = *color; - pv[5].x = x + 0.0f * width; - pv[5].y = y + 1.0f * height; - pv[5].tex_x = tex_x + 0.0f * tex_width; - pv[5].tex_y = tex_y + 1.0f * tex_height; - pv[5].color = *color; + float r = color->r; + float g = color->g; + float b = color->b; + float a = color->a; + pv[0].x = x + 0.0f * width; + pv[0].y = y + 0.0f * height; + pv[0].tex_x = tex_x + 0.0f * tex_width; + pv[0].tex_y = tex_y + 0.0f * tex_height; + pv[0].color.r = r; + pv[0].color.g = g; + pv[0].color.b = b; + pv[0].color.a = a; + pv[1].x = x + 0.0f * width; + pv[1].y = y + 1.0f * height; + pv[1].tex_x = tex_x + 0.0f * tex_width; + pv[1].tex_y = tex_y + 1.0f * tex_height; + pv[1].color.r = r; + pv[1].color.g = g; + pv[1].color.b = b; + pv[1].color.a = a; + pv[2].x = x + 1.0f * width; + pv[2].y = y + 0.0f * height; + pv[2].tex_x = tex_x + 1.0f * tex_width; + pv[2].tex_y = tex_y + 0.0f * tex_height; + pv[2].color.r = r; + pv[2].color.g = g; + pv[2].color.b = b; + pv[2].color.a = a; + pv[3].x = x + 1.0f * width; + pv[3].y = y + 1.0f * height; + pv[3].tex_x = tex_x + 1.0f * tex_width; + pv[3].tex_y = tex_y + 1.0f * tex_height; + pv[3].color.r = r; + pv[3].color.g = g; + pv[3].color.b = b; + pv[3].color.a = a; + pv[4].x = x + 1.0f * width; + pv[4].y = y + 0.0f * height; + pv[4].tex_x = tex_x + 1.0f * tex_width; + pv[4].tex_y = tex_y + 0.0f * tex_height; + pv[4].color.r = r; + pv[4].color.g = g; + pv[4].color.b = b; + pv[4].color.a = a; + pv[5].x = x + 0.0f * width; + pv[5].y = y + 1.0f * height; + pv[5].tex_x = tex_x + 0.0f * tex_width; + pv[5].tex_y = tex_y + 1.0f * tex_height; + pv[5].color.r = r; + pv[5].color.g = g; + pv[5].color.b = b; + pv[5].color.a = a; } struct vk_buffer vulkan_create_buffer(