diff options
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -250,6 +250,15 @@ struct Vram_Allocator { void free(Allocation& alloc); }; +static VkCullModeFlags get_vk_cull_mode(Cull_Mode mode) { + switch (mode) { + case Cull_Mode::none: return VK_CULL_MODE_NONE; + case Cull_Mode::back: return VK_CULL_MODE_BACK_BIT; + case Cull_Mode::front: return VK_CULL_MODE_FRONT_BIT; + } + assert(0); + return VK_CULL_MODE_NONE; +} static VkFormat get_vk_format(Texture_Format fmt) { switch (fmt) { @@ -2631,14 +2640,13 @@ void Pipeline_Vk::init_rasterisation( sizeof ri ); (void)dev; - (void)desc; zero(&ri, sizeof ri); ri.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; ri.depthClampEnable = VK_FALSE; ri.rasterizerDiscardEnable = VK_FALSE; ri.polygonMode = VK_POLYGON_MODE_FILL; ri.lineWidth = 1.0f; - ri.cullMode = VK_CULL_MODE_NONE; + ri.cullMode = get_vk_cull_mode(desc.cull_mode); ri.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE; ri.depthBiasEnable = VK_FALSE; info.pRasterizationState = &ri; |