From 3122e2d073e2bdd134fed9ddc319dc579e8fe10e Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Thu, 20 Aug 2020 03:51:39 +0200 Subject: [PATCH] comp: Use define for number of plane vertices --- src/xrt/compositor/main/comp_layer_renderer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xrt/compositor/main/comp_layer_renderer.c b/src/xrt/compositor/main/comp_layer_renderer.c index 444b55815..0f8f123a4 100644 --- a/src/xrt/compositor/main/comp_layer_renderer.c +++ b/src/xrt/compositor/main/comp_layer_renderer.c @@ -334,7 +334,8 @@ _init_graphics_pipeline(struct comp_layer_renderer *self, } // clang-format off -float plane_vertices[6 * 5] = { +#define PLANE_VERTICES 6 +static float plane_vertices[PLANE_VERTICES * 5] = { -0.5, -0.5, 0, 0, 1, 0.5, -0.5, 0, 1, 1, 0.5, 0.5, 0, 1, 0, @@ -358,7 +359,7 @@ _init_vertex_buffer(struct comp_layer_renderer *self) &self->vertex_buffer.memory)) return false; - self->vertex_buffer.size = 6; + self->vertex_buffer.size = PLANE_VERTICES; return vk_update_buffer(vk, plane_vertices, sizeof(float) * ARRAY_SIZE(plane_vertices),