diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /third_party/rust/wgpu-hal/src/metal | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/wgpu-hal/src/metal')
-rw-r--r-- | third_party/rust/wgpu-hal/src/metal/adapter.rs | 4 | ||||
-rw-r--r-- | third_party/rust/wgpu-hal/src/metal/command.rs | 4 | ||||
-rw-r--r-- | third_party/rust/wgpu-hal/src/metal/device.rs | 15 | ||||
-rw-r--r-- | third_party/rust/wgpu-hal/src/metal/mod.rs | 8 | ||||
-rw-r--r-- | third_party/rust/wgpu-hal/src/metal/surface.rs | 4 |
5 files changed, 28 insertions, 7 deletions
diff --git a/third_party/rust/wgpu-hal/src/metal/adapter.rs b/third_party/rust/wgpu-hal/src/metal/adapter.rs index 9ec777b0f0..6211896838 100644 --- a/third_party/rust/wgpu-hal/src/metal/adapter.rs +++ b/third_party/rust/wgpu-hal/src/metal/adapter.rs @@ -18,7 +18,9 @@ impl super::Adapter { } } -impl crate::Adapter<super::Api> for super::Adapter { +impl crate::Adapter for super::Adapter { + type A = super::Api; + unsafe fn open( &self, features: wgt::Features, diff --git a/third_party/rust/wgpu-hal/src/metal/command.rs b/third_party/rust/wgpu-hal/src/metal/command.rs index 6f1a0d9c2f..341712c323 100644 --- a/third_party/rust/wgpu-hal/src/metal/command.rs +++ b/third_party/rust/wgpu-hal/src/metal/command.rs @@ -168,7 +168,9 @@ impl super::CommandState { } } -impl crate::CommandEncoder<super::Api> for super::CommandEncoder { +impl crate::CommandEncoder for super::CommandEncoder { + type A = super::Api; + unsafe fn begin_encoding(&mut self, label: crate::Label) -> Result<(), crate::DeviceError> { let queue = &self.raw_queue.lock(); let retain_references = self.shared.settings.retain_command_buffer_references; diff --git a/third_party/rust/wgpu-hal/src/metal/device.rs b/third_party/rust/wgpu-hal/src/metal/device.rs index d7fd06c8f3..179429f5d7 100644 --- a/third_party/rust/wgpu-hal/src/metal/device.rs +++ b/third_party/rust/wgpu-hal/src/metal/device.rs @@ -273,7 +273,9 @@ impl super::Device { } } -impl crate::Device<super::Api> for super::Device { +impl crate::Device for super::Device { + type A = super::Api; + unsafe fn exit(self, _queue: super::Queue) {} unsafe fn create_buffer(&self, desc: &crate::BufferDescriptor) -> DeviceResult<super::Buffer> { @@ -706,7 +708,16 @@ impl crate::Device<super::Api> for super::Device { for (&stage, counter) in super::NAGA_STAGES.iter().zip(bg.counters.iter_mut()) { let stage_bit = map_naga_stage(stage); let mut dynamic_offsets_count = 0u32; - for (entry, layout) in desc.entries.iter().zip(desc.layout.entries.iter()) { + let layout_and_entry_iter = desc.entries.iter().map(|entry| { + let layout = desc + .layout + .entries + .iter() + .find(|layout_entry| layout_entry.binding == entry.binding) + .expect("internal error: no layout entry found with binding slot"); + (entry, layout) + }); + for (entry, layout) in layout_and_entry_iter { let size = layout.count.map_or(1, |c| c.get()); if let wgt::BindingType::Buffer { has_dynamic_offset: true, diff --git a/third_party/rust/wgpu-hal/src/metal/mod.rs b/third_party/rust/wgpu-hal/src/metal/mod.rs index 62fbf3d49d..6aeafb0f86 100644 --- a/third_party/rust/wgpu-hal/src/metal/mod.rs +++ b/third_party/rust/wgpu-hal/src/metal/mod.rs @@ -80,7 +80,9 @@ impl Instance { } } -impl crate::Instance<Api> for Instance { +impl crate::Instance for Instance { + type A = Api; + unsafe fn init(_desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> { profiling::scope!("Init Metal Backend"); // We do not enable metal validation based on the validation flags as it affects the entire @@ -365,7 +367,9 @@ impl std::borrow::Borrow<Texture> for SurfaceTexture { unsafe impl Send for SurfaceTexture {} unsafe impl Sync for SurfaceTexture {} -impl crate::Queue<Api> for Queue { +impl crate::Queue for Queue { + type A = Api; + unsafe fn submit( &self, command_buffers: &[&CommandBuffer], diff --git a/third_party/rust/wgpu-hal/src/metal/surface.rs b/third_party/rust/wgpu-hal/src/metal/surface.rs index a97eff0aae..889e319493 100644 --- a/third_party/rust/wgpu-hal/src/metal/surface.rs +++ b/third_party/rust/wgpu-hal/src/metal/surface.rs @@ -169,7 +169,9 @@ impl super::Surface { } } -impl crate::Surface<super::Api> for super::Surface { +impl crate::Surface for super::Surface { + type A = super::Api; + unsafe fn configure( &self, device: &super::Device, |