From 14ab8d90ae8d5226c1b9627b7a1d7e3206e17479 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Wed, 29 Mar 2023 10:09:27 -0700 Subject: [PATCH] [vello_shaders] Use the per_entry_point_map option for MSL --- vello_shaders/src/compile/msl.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vello_shaders/src/compile/msl.rs b/vello_shaders/src/compile/msl.rs index 04d432d..7fa8740 100644 --- a/vello_shaders/src/compile/msl.rs +++ b/vello_shaders/src/compile/msl.rs @@ -3,7 +3,7 @@ use naga::back::msl; use super::{BindType, ShaderInfo}; pub fn translate(shader: &ShaderInfo) -> Result { - let mut map = msl::PerStageMap::default(); + let mut map = msl::EntryPointResourceMap::default(); let mut buffer_index = 0u8; let mut image_index = 0u8; let mut binding_map = msl::BindingMap::default(); @@ -26,18 +26,22 @@ pub fn translate(shader: &ShaderInfo) -> Result { target.mutable = resource.ty.is_mutable(); binding_map.insert(binding, target); } - map.cs = msl::PerStageResources { - resources: binding_map, - push_constant_buffer: None, - sizes_buffer: Some(30), - }; + map.insert( + "main".to_string(), + msl::EntryPointResources { + resources: binding_map, + push_constant_buffer: None, + sizes_buffer: Some(30), + }, + ); let options = msl::Options { lang_version: (2, 0), - per_stage_map: map, + per_entry_point_map: map, inline_samplers: vec![], spirv_cross_compatibility: false, fake_missing_bindings: false, bounds_check_policies: naga::proc::BoundsCheckPolicies::default(), + zero_initialize_workgroup_memory: false, }; let (source, _) = msl::write_string( &shader.module,