summaryrefslogtreecommitdiff
path: root/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp17
1 files changed, 14 insertions, 3 deletions
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;
}