aboutsummaryrefslogtreecommitdiffstats
path: root/components/webgpu/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/webgpu/lib.rs')
-rw-r--r--components/webgpu/lib.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/components/webgpu/lib.rs b/components/webgpu/lib.rs
index 20a1b0cdaa8..14210d1e683 100644
--- a/components/webgpu/lib.rs
+++ b/components/webgpu/lib.rs
@@ -54,6 +54,7 @@ const DEVICE_POLL_INTERVAL: u64 = 100;
pub const PRESENTATION_BUFFER_COUNT: usize = 10;
#[derive(Debug, Deserialize, Serialize)]
+#[allow(clippy::large_enum_variant)]
pub enum WebGPUResponse {
RequestAdapter {
adapter_info: wgt::AdapterInfo,
@@ -330,6 +331,12 @@ impl WebGPU {
}
}
+type WebGPUBufferMaps<'a> =
+ HashMap<id::BufferId, Rc<BufferMapInfo<'a, Option<WebGPUResponseResult>>>>;
+type WebGPUPresentBufferMaps<'a> =
+ HashMap<id::BufferId, Rc<BufferMapInfo<'a, (Option<ErrorScopeId>, WebGPURequest)>>>;
+
+#[allow(clippy::upper_case_acronyms)] // Name of the library
struct WGPU<'a> {
receiver: IpcReceiver<(Option<ErrorScopeId>, WebGPURequest)>,
sender: IpcSender<(Option<ErrorScopeId>, WebGPURequest)>,
@@ -340,10 +347,9 @@ struct WGPU<'a> {
// Track invalid adapters https://gpuweb.github.io/gpuweb/#invalid
_invalid_adapters: Vec<WebGPUAdapter>,
// Buffers with pending mapping
- buffer_maps: HashMap<id::BufferId, Rc<BufferMapInfo<'a, Option<WebGPUResponseResult>>>>,
+ buffer_maps: WebGPUBufferMaps<'a>,
// Presentation Buffers with pending mapping
- present_buffer_maps:
- HashMap<id::BufferId, Rc<BufferMapInfo<'a, (Option<ErrorScopeId>, WebGPURequest)>>>,
+ present_buffer_maps: WebGPUPresentBufferMaps<'a>,
//TODO: Remove this (https://github.com/gfx-rs/wgpu/issues/867)
error_command_encoders: RefCell<HashMap<id::CommandEncoderId, String>>,
webrender_api: RenderApi,