From 014077c89bb3c50718d56430f387109ad43508b6 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 13 Jan 2025 20:56:13 +1100 Subject: basic picking and debug rendering --- video.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'video.cpp') diff --git a/video.cpp b/video.cpp index 1d9e00f..6d52a57 100644 --- a/video.cpp +++ b/video.cpp @@ -274,6 +274,19 @@ static VkCullModeFlags get_vk_cull_mode(Cull_Mode mode) { return VK_CULL_MODE_NONE; } +static VkPrimitiveTopology get_topology(Geo_Type type) { + switch (type) { + case Geo_Type::triangles: + return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + case Geo_Type::lines: + return VK_PRIMITIVE_TOPOLOGY_LINE_LIST; + case Geo_Type::points: + return VK_PRIMITIVE_TOPOLOGY_POINT_LIST; + } + assert(0); + return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; +} + static VkFormat get_vk_format(Texture_Format fmt) { switch (fmt) { case texture_format_r8i: return VK_FORMAT_R8_UNORM; @@ -2847,11 +2860,9 @@ void Pipeline_Vk::init_input_assembly( sizeof ia ); (void)dev; - (void)desc; - (void)info; zero(&ia, sizeof ia); ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - ia.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + ia.topology = get_topology(desc.geo); info.pInputAssemblyState = &ia; } -- cgit v1.2.3-54-g00ecf