diff options
author | quou <quou@disroot.org> | 2025-01-13 20:56:13 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-13 20:56:13 +1100 |
commit | 014077c89bb3c50718d56430f387109ad43508b6 (patch) | |
tree | 02fa1ab03218fc22de4d875b7d8d593cbc19d67c /video.cpp | |
parent | 4d5cdc97a044a39fabbfb980b2e48a817a6e485f (diff) |
basic picking and debug rendering
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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; } |