diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index c36b2014b9..ca1b3255da 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -876,6 +876,7 @@ impl super::PrivateCapabilities { | F::MAPPABLE_PRIMARY_BUFFERS | F::VERTEX_WRITABLE_STORAGE | F::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES + | F::PUSH_CONSTANTS | F::POLYGON_MODE_LINE | F::CLEAR_COMMANDS; diff --git a/wgpu-hal/src/metal/command.rs b/wgpu-hal/src/metal/command.rs index 465d91e197..d497a4c0e6 100644 --- a/wgpu-hal/src/metal/command.rs +++ b/wgpu-hal/src/metal/command.rs @@ -592,7 +592,27 @@ impl crate::CommandEncoder for super::CommandEncoder { _offset: u32, _data: &[u32], ) { - //TODO + if _stages.contains(wgt::ShaderStages::COMPUTE) { + self.state.compute.as_ref().unwrap().set_bytes( + _offset as _, + (_data.len() * WORD_SIZE) as u64, + _data.as_ptr() as _, + ) + } + if _stages.contains(wgt::ShaderStages::VERTEX) { + self.state.render.as_ref().unwrap().set_vertex_bytes( + _offset as _, + (_data.len() * WORD_SIZE) as u64, + _data.as_ptr() as _, + ) + } + if _stages.contains(wgt::ShaderStages::FRAGMENT) { + self.state.render.as_ref().unwrap().set_fragment_bytes( + _offset as _, + (_data.len() * WORD_SIZE) as u64, + _data.as_ptr() as _, + ) + } } unsafe fn insert_debug_marker(&mut self, label: &str) {