diff options
Diffstat (limited to 'op_crates/webgpu/lib.rs')
-rw-r--r-- | op_crates/webgpu/lib.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/op_crates/webgpu/lib.rs b/op_crates/webgpu/lib.rs index 046472905..5c3b99329 100644 --- a/op_crates/webgpu/lib.rs +++ b/op_crates/webgpu/lib.rs @@ -18,8 +18,8 @@ use std::rc::Rc; pub use wgpu_core; pub use wgpu_types; -use error::DOMExceptionOperationError; -use error::WebGPUError; +use error::DomExceptionOperationError; +use error::WebGpuError; #[macro_use] mod macros { @@ -71,22 +71,22 @@ fn check_unstable(state: &OpState, api_name: &str) { type Instance = wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>; -struct WebGPUAdapter(wgpu_core::id::AdapterId); -impl Resource for WebGPUAdapter { +struct WebGpuAdapter(wgpu_core::id::AdapterId); +impl Resource for WebGpuAdapter { fn name(&self) -> Cow<str> { "webGPUAdapter".into() } } -struct WebGPUDevice(wgpu_core::id::DeviceId); -impl Resource for WebGPUDevice { +struct WebGpuDevice(wgpu_core::id::DeviceId); +impl Resource for WebGpuDevice { fn name(&self) -> Cow<str> { "webGPUDevice".into() } } -struct WebGPUQuerySet(wgpu_core::id::QuerySetId); -impl Resource for WebGPUQuerySet { +struct WebGpuQuerySet(wgpu_core::id::QuerySetId); +impl Resource for WebGpuQuerySet { fn name(&self) -> Cow<str> { "webGPUQuerySet".into() } @@ -255,7 +255,7 @@ pub async fn op_webgpu_request_adapter( "maxUniformBufferBindingSize": adapter_limits.max_uniform_buffer_binding_size }); - let rid = state.resource_table.add(WebGPUAdapter(adapter)); + let rid = state.resource_table.add(WebGpuAdapter(adapter)); Ok(json!({ "rid": rid, @@ -267,7 +267,7 @@ pub async fn op_webgpu_request_adapter( #[derive(Deserialize)] #[serde(rename_all = "camelCase")] -struct GPULimits { +struct GpuLimits { _max_texture_dimension1d: Option<u32>, _max_texture_dimension2d: Option<u32>, _max_texture_dimension3d: Option<u32>, @@ -293,7 +293,7 @@ pub struct RequestDeviceArgs { adapter_rid: ResourceId, label: Option<String>, non_guaranteed_features: Option<Vec<String>>, - non_guaranteed_limits: Option<GPULimits>, + non_guaranteed_limits: Option<GpuLimits>, } pub async fn op_webgpu_request_device( @@ -304,7 +304,7 @@ pub async fn op_webgpu_request_device( let mut state = state.borrow_mut(); let adapter_resource = state .resource_table - .get::<WebGPUAdapter>(args.adapter_rid) + .get::<WebGpuAdapter>(args.adapter_rid) .ok_or_else(bad_resource_id)?; let adapter = adapter_resource.0; let instance = state.borrow::<Instance>(); @@ -430,7 +430,7 @@ pub async fn op_webgpu_request_device( std::marker::PhantomData )); if let Some(err) = maybe_err { - return Err(DOMExceptionOperationError::new(&err.to_string()).into()); + return Err(DomExceptionOperationError::new(&err.to_string()).into()); } let device_features = @@ -449,7 +449,7 @@ pub async fn op_webgpu_request_device( "maxUniformBufferBindingSize": limits.max_uniform_buffer_binding_size, }); - let rid = state.resource_table.add(WebGPUDevice(device)); + let rid = state.resource_table.add(WebGpuDevice(device)); Ok(json!({ "rid": rid, @@ -476,7 +476,7 @@ pub fn op_webgpu_create_query_set( ) -> Result<Value, AnyError> { let device_resource = state .resource_table - .get::<WebGPUDevice>(args.device_rid) + .get::<WebGpuDevice>(args.device_rid) .ok_or_else(bad_resource_id)?; let device = device_resource.0; let instance = &state.borrow::<Instance>(); @@ -542,10 +542,10 @@ pub fn op_webgpu_create_query_set( std::marker::PhantomData )); - let rid = state.resource_table.add(WebGPUQuerySet(query_set)); + let rid = state.resource_table.add(WebGpuQuerySet(query_set)); Ok(json!({ "rid": rid, - "err": maybe_err.map(WebGPUError::from), + "err": maybe_err.map(WebGpuError::from), })) } |