Skip to content

Commit

Permalink
Merge pull request #363 from armansito/pr-shaders-zero-init-wg-mem
Browse files Browse the repository at this point in the history
[shaders][msl] Enable `zero_initialize_workgroup_memory` setting
[shaders] Enable CONTROL_FLOW_UNIFORMITY validation check
  • Loading branch information
armansito authored Sep 22, 2023
2 parents 530cde9 + ddabca8 commit e121dd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions crates/shaders/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ pub struct ShaderInfo {
impl ShaderInfo {
pub fn new(source: String, entry_point: &str) -> Result<ShaderInfo, Error> {
let module = wgsl::parse_str(&source)?;
let module_info = naga::valid::Validator::new(
ValidationFlags::all() & !ValidationFlags::CONTROL_FLOW_UNIFORMITY,
Capabilities::all(),
)
.validate(&module)?;
let module_info = naga::valid::Validator::new(ValidationFlags::all(), Capabilities::all())
.validate(&module)?;
let (entry_index, entry) = module
.entry_points
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/shaders/src/compile/msl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn translate(shader: &ShaderInfo) -> Result<String, naga_msl::Error> {
spirv_cross_compatibility: false,
fake_missing_bindings: false,
bounds_check_policies: naga::proc::BoundsCheckPolicies::default(),
zero_initialize_workgroup_memory: false,
zero_initialize_workgroup_memory: true,
};
let (source, _) = naga_msl::write_string(
&shader.module,
Expand Down

0 comments on commit e121dd4

Please sign in to comment.