Skip to content

Commit

Permalink
vulkan: missing to account for cull_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev authored and kvark committed Dec 29, 2024
1 parent 0a05316 commit ae57beb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blade-graphics/src/vulkan/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ impl crate::traits::ShaderDevice for super::Context {
})
.front_face(map_front_face(desc.primitive.front_face))
.line_width(1.0);
if let Some(face) = desc.primitive.cull_mode {
vk_rasterization = vk_rasterization.cull_mode(map_cull_face(face));
}

let mut vk_depth_clip_state =
vk::PipelineRasterizationDepthClipStateCreateInfoEXT::default()
.depth_clip_enable(false);
Expand Down Expand Up @@ -666,6 +670,13 @@ fn map_front_face(front_face: crate::FrontFace) -> vk::FrontFace {
}
}

fn map_cull_face(face: crate::Face) -> vk::CullModeFlags {
match face {
crate::Face::Front => vk::CullModeFlags::FRONT,
crate::Face::Back => vk::CullModeFlags::BACK,
}
}

fn map_comparison(fun: crate::CompareFunction) -> vk::CompareOp {
use crate::CompareFunction as Cf;
match fun {
Expand Down

0 comments on commit ae57beb

Please sign in to comment.