librashader/librashader-runtime-wgpu/src/util.rs

15 lines
411 B
Rust
Raw Normal View History

2023-12-13 11:02:49 +11:00
use wgpu::ShaderStages;
use librashader_reflect::reflect::semantics::BindingStage;
pub fn binding_stage_to_wgpu_stage(stage_mask: BindingStage) -> ShaderStages {
let mut mask = ShaderStages::empty();
if stage_mask.contains(BindingStage::VERTEX) {
mask |= ShaderStages::VERTEX;
}
if stage_mask.contains(BindingStage::FRAGMENT) {
mask |= ShaderStages::FRAGMENT;
}
mask
}