aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2024-05-08 15:53:39 +0200
committerGitHub <noreply@github.com>2024-05-08 13:53:39 +0000
commit168d43f24a18184afadc6aa8646537289c85860a (patch)
tree138629b4b003141fbb5c6cb8fcf8cee3272664c2 /components/script/dom
parentc4f8599404e52da58e9e4e8f8aef3e7efa4996c9 (diff)
downloadservo-168d43f24a18184afadc6aa8646537289c85860a.tar.gz
servo-168d43f24a18184afadc6aa8646537289c85860a.zip
webgpu: Refactor webgpu crate (#32255)
* wgpu(_core) -> wgc * Refactor webgpu crate split lib.rs into multiple modules
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/globalscope.rs3
-rw-r--r--components/script/dom/gpu.rs4
-rw-r--r--components/script/dom/gpubuffer.rs7
-rw-r--r--components/script/dom/gpucanvascontext.rs2
-rw-r--r--components/script/dom/gpucommandencoder.rs2
-rw-r--r--components/script/dom/gpucomputepassencoder.rs2
-rw-r--r--components/script/dom/gpuconvert.rs2
-rw-r--r--components/script/dom/gpudevice.rs7
-rw-r--r--components/script/dom/gpuqueue.rs3
-rw-r--r--components/script/dom/gpurenderbundleencoder.rs2
-rw-r--r--components/script/dom/gpurenderpassencoder.rs2
-rw-r--r--components/script/dom/gputexture.rs5
-rw-r--r--components/script/dom/identityhub.rs6
13 files changed, 22 insertions, 25 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 5948ee302cf..32febf8ab8e 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -56,8 +56,7 @@ use script_traits::{
};
use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
use uuid::Uuid;
-use webgpu::identity::WebGPUOpResult;
-use webgpu::{ErrorScopeId, WebGPUDevice};
+use webgpu::{ErrorScopeId, WebGPUDevice, WebGPUOpResult};
use super::bindings::trace::HashMapTracedValues;
use crate::dom::bindings::cell::{DomRefCell, RefMut};
diff --git a/components/script/dom/gpu.rs b/components/script/dom/gpu.rs
index d3babad3850..1dbd852f0f3 100644
--- a/components/script/dom/gpu.rs
+++ b/components/script/dom/gpu.rs
@@ -10,7 +10,7 @@ use ipc_channel::router::ROUTER;
use js::jsapi::Heap;
use script_traits::ScriptMsg;
use webgpu::wgt::PowerPreference;
-use webgpu::{wgpu, WebGPUResponse, WebGPUResponseResult};
+use webgpu::{wgc, WebGPUResponse, WebGPUResponseResult};
use super::bindings::codegen::Bindings::WebGPUBinding::GPUTextureFormat;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
@@ -117,7 +117,7 @@ impl GPUMethods for GPU {
if script_to_constellation_chan
.send(ScriptMsg::RequestAdapter(
sender,
- wgpu::instance::RequestAdapterOptions {
+ wgc::instance::RequestAdapterOptions {
power_preference,
compatible_surface: None,
force_fallback_adapter: options.forceFallbackAdapter,
diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/gpubuffer.rs
index 400bfa3c57d..bb747a998cc 100644
--- a/components/script/dom/gpubuffer.rs
+++ b/components/script/dom/gpubuffer.rs
@@ -11,9 +11,10 @@ use std::sync::{Arc, Mutex};
use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSharedMemory;
use js::typedarray::{ArrayBuffer, ArrayBufferU8};
-use webgpu::identity::WebGPUOpResult;
-use webgpu::wgpu::device::HostMap;
-use webgpu::{WebGPU, WebGPUBuffer, WebGPURequest, WebGPUResponse, WebGPUResponseResult};
+use webgpu::wgc::device::HostMap;
+use webgpu::{
+ WebGPU, WebGPUBuffer, WebGPUOpResult, WebGPURequest, WebGPUResponse, WebGPUResponseResult,
+};
use super::bindings::buffer_source::{create_new_external_array_buffer, HeapBufferSource};
use crate::dom::bindings::cell::DomRefCell;
diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/gpucanvascontext.rs
index 775b21530ab..0aa45648f8e 100644
--- a/components/script/dom/gpucanvascontext.rs
+++ b/components/script/dom/gpucanvascontext.rs
@@ -9,7 +9,7 @@ use dom_struct::dom_struct;
use euclid::default::Size2D;
use ipc_channel::ipc;
use script_layout_interface::HTMLCanvasDataSource;
-use webgpu::wgpu::id;
+use webgpu::wgc::id;
use webgpu::{wgt, WebGPU, WebGPURequest, WebGPUTexture, PRESENTATION_BUFFER_COUNT};
use webrender_api::{
units, ExternalImageData, ExternalImageId, ExternalImageType, ImageData, ImageDescriptor,
diff --git a/components/script/dom/gpucommandencoder.rs b/components/script/dom/gpucommandencoder.rs
index 7bd5de4af94..8f26601b122 100644
--- a/components/script/dom/gpucommandencoder.rs
+++ b/components/script/dom/gpucommandencoder.rs
@@ -7,7 +7,7 @@ use std::cell::Cell;
use std::collections::HashSet;
use dom_struct::dom_struct;
-use webgpu::wgpu::command as wgpu_com;
+use webgpu::wgc::command as wgpu_com;
use webgpu::{self, wgt, WebGPU, WebGPURequest};
use crate::dom::bindings::cell::DomRefCell;
diff --git a/components/script/dom/gpucomputepassencoder.rs b/components/script/dom/gpucomputepassencoder.rs
index 40264947eb5..cb0153b3c22 100644
--- a/components/script/dom/gpucomputepassencoder.rs
+++ b/components/script/dom/gpucomputepassencoder.rs
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
-use webgpu::wgpu::command::{compute_commands as wgpu_comp, ComputePass};
+use webgpu::wgc::command::{compute_commands as wgpu_comp, ComputePass};
use webgpu::{WebGPU, WebGPURequest};
use super::bindings::error::Fallible;
diff --git a/components/script/dom/gpuconvert.rs b/components/script/dom/gpuconvert.rs
index 82b6b1dc2f0..bdfa9b8dd35 100644
--- a/components/script/dom/gpuconvert.rs
+++ b/components/script/dom/gpuconvert.rs
@@ -4,7 +4,7 @@
use std::borrow::Cow;
-use webgpu::wgpu::command as wgpu_com;
+use webgpu::wgc::command as wgpu_com;
use webgpu::wgt;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
diff --git a/components/script/dom/gpudevice.rs b/components/script/dom/gpudevice.rs
index b7a705261ef..f208ee37c47 100644
--- a/components/script/dom/gpudevice.rs
+++ b/components/script/dom/gpudevice.rs
@@ -13,12 +13,11 @@ use std::sync::{Arc, Mutex};
use dom_struct::dom_struct;
use js::jsapi::{Heap, JSObject};
-use webgpu::identity::WebGPUOpResult;
-use webgpu::wgpu::id::{BindGroupLayoutId, PipelineLayoutId};
-use webgpu::wgpu::{
+use webgpu::wgc::id::{BindGroupLayoutId, PipelineLayoutId};
+use webgpu::wgc::{
binding_model as wgpu_bind, command as wgpu_com, pipeline as wgpu_pipe, resource as wgpu_res,
};
-use webgpu::{self, wgt, ErrorScopeId, WebGPU, WebGPURequest};
+use webgpu::{self, wgt, ErrorScopeId, WebGPU, WebGPUOpResult, WebGPURequest};
use super::bindings::codegen::UnionTypes::GPUPipelineLayoutOrGPUAutoLayoutMode;
use super::bindings::error::Fallible;
diff --git a/components/script/dom/gpuqueue.rs b/components/script/dom/gpuqueue.rs
index bcc60eb5dd2..4a2fef174b3 100644
--- a/components/script/dom/gpuqueue.rs
+++ b/components/script/dom/gpuqueue.rs
@@ -6,8 +6,7 @@ use std::rc::Rc;
use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSharedMemory;
-use webgpu::identity::WebGPUOpResult;
-use webgpu::{wgt, WebGPU, WebGPUQueue, WebGPURequest, WebGPUResponse};
+use webgpu::{wgt, WebGPU, WebGPUOpResult, WebGPUQueue, WebGPURequest, WebGPUResponse};
use super::bindings::codegen::Bindings::WebGPUBinding::{GPUImageCopyTexture, GPUImageDataLayout};
use super::gpu::{response_async, AsyncWGPUListener};
diff --git a/components/script/dom/gpurenderbundleencoder.rs b/components/script/dom/gpurenderbundleencoder.rs
index 6287b8233d7..7fb3de9c489 100644
--- a/components/script/dom/gpurenderbundleencoder.rs
+++ b/components/script/dom/gpurenderbundleencoder.rs
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
-use webgpu::wgpu::command::{bundle_ffi as wgpu_bundle, RenderBundleEncoder};
+use webgpu::wgc::command::{bundle_ffi as wgpu_bundle, RenderBundleEncoder};
use webgpu::{wgt, WebGPU, WebGPURenderBundle, WebGPURequest};
use super::bindings::codegen::Bindings::WebGPUBinding::GPUIndexFormat;
diff --git a/components/script/dom/gpurenderpassencoder.rs b/components/script/dom/gpurenderpassencoder.rs
index ee3d1621ba3..a0a87ad4f4d 100644
--- a/components/script/dom/gpurenderpassencoder.rs
+++ b/components/script/dom/gpurenderpassencoder.rs
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
-use webgpu::wgpu::command::{render_commands as wgpu_render, RenderPass};
+use webgpu::wgc::command::{render_commands as wgpu_render, RenderPass};
use webgpu::{wgt, WebGPU, WebGPURequest};
use super::bindings::codegen::Bindings::WebGPUBinding::GPUIndexFormat;
diff --git a/components/script/dom/gputexture.rs b/components/script/dom/gputexture.rs
index 0b7db7a16fd..4f97024f774 100644
--- a/components/script/dom/gputexture.rs
+++ b/components/script/dom/gputexture.rs
@@ -6,9 +6,8 @@ use std::cell::Cell;
use std::string::String;
use dom_struct::dom_struct;
-use webgpu::identity::WebGPUOpResult;
-use webgpu::wgpu::resource;
-use webgpu::{wgt, WebGPU, WebGPURequest, WebGPUTexture, WebGPUTextureView};
+use webgpu::wgc::resource;
+use webgpu::{wgt, WebGPU, WebGPUOpResult, WebGPURequest, WebGPUTexture, WebGPUTextureView};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
diff --git a/components/script/dom/identityhub.rs b/components/script/dom/identityhub.rs
index 976637dac51..391afa641c9 100644
--- a/components/script/dom/identityhub.rs
+++ b/components/script/dom/identityhub.rs
@@ -3,16 +3,16 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use smallvec::SmallVec;
-use webgpu::wgpu::id::markers::{
+use webgpu::wgc::id::markers::{
Adapter, BindGroup, BindGroupLayout, Buffer, CommandEncoder, ComputePipeline, Device,
PipelineLayout, RenderBundle, RenderPipeline, Sampler, ShaderModule, Texture, TextureView,
};
-use webgpu::wgpu::id::{
+use webgpu::wgc::id::{
AdapterId, BindGroupId, BindGroupLayoutId, BufferId, CommandEncoderId, ComputePipelineId,
DeviceId, PipelineLayoutId, RenderBundleId, RenderPipelineId, SamplerId, ShaderModuleId,
TextureId, TextureViewId,
};
-use webgpu::wgpu::identity::IdentityManager;
+use webgpu::wgc::identity::IdentityManager;
use webgpu::wgt::Backend;
#[derive(Debug)]