summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wgpu-hal/src/gles
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/rust/wgpu-hal/src/gles/adapter.rs4
-rw-r--r--third_party/rust/wgpu-hal/src/gles/command.rs4
-rw-r--r--third_party/rust/wgpu-hal/src/gles/device.rs21
-rw-r--r--third_party/rust/wgpu-hal/src/gles/egl.rs8
-rw-r--r--third_party/rust/wgpu-hal/src/gles/queue.rs4
-rw-r--r--third_party/rust/wgpu-hal/src/gles/web.rs8
-rw-r--r--third_party/rust/wgpu-hal/src/gles/wgl.rs8
7 files changed, 44 insertions, 13 deletions
diff --git a/third_party/rust/wgpu-hal/src/gles/adapter.rs b/third_party/rust/wgpu-hal/src/gles/adapter.rs
index c09725e85f..b9d044337c 100644
--- a/third_party/rust/wgpu-hal/src/gles/adapter.rs
+++ b/third_party/rust/wgpu-hal/src/gles/adapter.rs
@@ -922,7 +922,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/gles/command.rs b/third_party/rust/wgpu-hal/src/gles/command.rs
index 4385e2a31e..258dee76e5 100644
--- a/third_party/rust/wgpu-hal/src/gles/command.rs
+++ b/third_party/rust/wgpu-hal/src/gles/command.rs
@@ -250,7 +250,9 @@ impl super::CommandEncoder {
}
}
-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> {
self.state = State::default();
self.cmd_buffer.label = label.map(str::to_string);
diff --git a/third_party/rust/wgpu-hal/src/gles/device.rs b/third_party/rust/wgpu-hal/src/gles/device.rs
index 2678488cf8..50c07f3ff0 100644
--- a/third_party/rust/wgpu-hal/src/gles/device.rs
+++ b/third_party/rust/wgpu-hal/src/gles/device.rs
@@ -483,7 +483,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) {
let gl = &self.shared.context.lock();
unsafe { gl.delete_vertex_array(self.main_vao) };
@@ -1123,8 +1125,10 @@ impl crate::Device<super::Api> for super::Device {
!0;
bg_layout
.entries
- .last()
- .map_or(0, |b| b.binding as usize + 1)
+ .iter()
+ .map(|b| b.binding)
+ .max()
+ .map_or(0, |idx| idx as usize + 1)
]
.into_boxed_slice();
@@ -1177,7 +1181,16 @@ impl crate::Device<super::Api> for super::Device {
) -> Result<super::BindGroup, crate::DeviceError> {
let mut contents = Vec::new();
- 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 binding = match layout.ty {
wgt::BindingType::Buffer { .. } => {
let bb = &desc.buffers[entry.resource_index as usize];
diff --git a/third_party/rust/wgpu-hal/src/gles/egl.rs b/third_party/rust/wgpu-hal/src/gles/egl.rs
index f4bfcf5487..b166f4f102 100644
--- a/third_party/rust/wgpu-hal/src/gles/egl.rs
+++ b/third_party/rust/wgpu-hal/src/gles/egl.rs
@@ -703,7 +703,9 @@ impl Instance {
unsafe impl Send for Instance {}
unsafe impl Sync for Instance {}
-impl crate::Instance<super::Api> for Instance {
+impl crate::Instance for Instance {
+ type A = super::Api;
+
unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> {
profiling::scope!("Init OpenGL (EGL) Backend");
#[cfg(Emscripten)]
@@ -1165,7 +1167,9 @@ impl Surface {
}
}
-impl crate::Surface<super::Api> for Surface {
+impl crate::Surface for Surface {
+ type A = super::Api;
+
unsafe fn configure(
&self,
device: &super::Device,
diff --git a/third_party/rust/wgpu-hal/src/gles/queue.rs b/third_party/rust/wgpu-hal/src/gles/queue.rs
index 5db5af9a16..29dfb79d04 100644
--- a/third_party/rust/wgpu-hal/src/gles/queue.rs
+++ b/third_party/rust/wgpu-hal/src/gles/queue.rs
@@ -1748,7 +1748,9 @@ impl super::Queue {
}
}
-impl crate::Queue<super::Api> for super::Queue {
+impl crate::Queue for super::Queue {
+ type A = super::Api;
+
unsafe fn submit(
&self,
command_buffers: &[&super::CommandBuffer],
diff --git a/third_party/rust/wgpu-hal/src/gles/web.rs b/third_party/rust/wgpu-hal/src/gles/web.rs
index 797d6f91d7..ab2ccef8b6 100644
--- a/third_party/rust/wgpu-hal/src/gles/web.rs
+++ b/third_party/rust/wgpu-hal/src/gles/web.rs
@@ -116,7 +116,9 @@ unsafe impl Sync for Instance {}
#[cfg(send_sync)]
unsafe impl Send for Instance {}
-impl crate::Instance<super::Api> for Instance {
+impl crate::Instance for Instance {
+ type A = super::Api;
+
unsafe fn init(_desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> {
profiling::scope!("Init OpenGL (WebGL) Backend");
Ok(Instance {
@@ -309,7 +311,9 @@ impl Surface {
}
}
-impl crate::Surface<super::Api> for Surface {
+impl crate::Surface for Surface {
+ type A = super::Api;
+
unsafe fn configure(
&self,
device: &super::Device,
diff --git a/third_party/rust/wgpu-hal/src/gles/wgl.rs b/third_party/rust/wgpu-hal/src/gles/wgl.rs
index c9039090b7..2564892969 100644
--- a/third_party/rust/wgpu-hal/src/gles/wgl.rs
+++ b/third_party/rust/wgpu-hal/src/gles/wgl.rs
@@ -422,7 +422,9 @@ fn create_instance_device() -> Result<InstanceDevice, crate::InstanceError> {
Ok(InstanceDevice { dc, _tx: drop_tx })
}
-impl crate::Instance<super::Api> for Instance {
+impl crate::Instance for Instance {
+ type A = super::Api;
+
unsafe fn init(desc: &crate::InstanceDescriptor) -> Result<Self, crate::InstanceError> {
profiling::scope!("Init OpenGL (WGL) Backend");
let opengl_module = unsafe { LoadLibraryA("opengl32.dll\0".as_ptr() as *const _) };
@@ -676,7 +678,9 @@ impl Surface {
}
}
-impl crate::Surface<super::Api> for Surface {
+impl crate::Surface for Surface {
+ type A = super::Api;
+
unsafe fn configure(
&self,
device: &super::Device,