aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/mod.rs42
-rw-r--r--components/script/dom/navigator.rs2
-rw-r--r--components/script/dom/webgpu/gpu.rs (renamed from components/script/dom/gpu.rs)3
-rw-r--r--components/script/dom/webgpu/gpuadapter.rs (renamed from components/script/dom/gpuadapter.rs)7
-rw-r--r--components/script/dom/webgpu/gpuadapterinfo.rs (renamed from components/script/dom/gpuadapterinfo.rs)7
-rw-r--r--components/script/dom/webgpu/gpubindgroup.rs (renamed from components/script/dom/gpubindgroup.rs)0
-rw-r--r--components/script/dom/webgpu/gpubindgrouplayout.rs (renamed from components/script/dom/gpubindgrouplayout.rs)0
-rw-r--r--components/script/dom/webgpu/gpubuffer.rs (renamed from components/script/dom/gpubuffer.rs)10
-rw-r--r--components/script/dom/webgpu/gpubufferusage.rs (renamed from components/script/dom/gpubufferusage.rs)0
-rw-r--r--components/script/dom/webgpu/gpucanvascontext.rs (renamed from components/script/dom/gpucanvascontext.rs)17
-rw-r--r--components/script/dom/webgpu/gpucolorwrite.rs (renamed from components/script/dom/gpucolorwrite.rs)0
-rw-r--r--components/script/dom/webgpu/gpucommandbuffer.rs (renamed from components/script/dom/gpucommandbuffer.rs)0
-rw-r--r--components/script/dom/webgpu/gpucommandencoder.rs (renamed from components/script/dom/gpucommandencoder.rs)2
-rw-r--r--components/script/dom/webgpu/gpucompilationinfo.rs (renamed from components/script/dom/gpucompilationinfo.rs)11
-rw-r--r--components/script/dom/webgpu/gpucompilationmessage.rs (renamed from components/script/dom/gpucompilationmessage.rs)6
-rw-r--r--components/script/dom/webgpu/gpucomputepassencoder.rs (renamed from components/script/dom/gpucomputepassencoder.rs)0
-rw-r--r--components/script/dom/webgpu/gpucomputepipeline.rs (renamed from components/script/dom/gpucomputepipeline.rs)0
-rw-r--r--components/script/dom/webgpu/gpuconvert.rs (renamed from components/script/dom/gpuconvert.rs)11
-rw-r--r--components/script/dom/webgpu/gpudevice.rs (renamed from components/script/dom/gpudevice.rs)14
-rw-r--r--components/script/dom/webgpu/gpudevicelostinfo.rs (renamed from components/script/dom/gpudevicelostinfo.rs)5
-rw-r--r--components/script/dom/webgpu/gpuerror.rs (renamed from components/script/dom/gpuerror.rs)2
-rw-r--r--components/script/dom/webgpu/gpuinternalerror.rs (renamed from components/script/dom/gpuinternalerror.rs)2
-rw-r--r--components/script/dom/webgpu/gpumapmode.rs (renamed from components/script/dom/gpumapmode.rs)0
-rw-r--r--components/script/dom/webgpu/gpuoutofmemoryerror.rs (renamed from components/script/dom/gpuoutofmemoryerror.rs)2
-rw-r--r--components/script/dom/webgpu/gpupipelineerror.rs (renamed from components/script/dom/gpupipelineerror.rs)2
-rw-r--r--components/script/dom/webgpu/gpupipelinelayout.rs (renamed from components/script/dom/gpupipelinelayout.rs)0
-rw-r--r--components/script/dom/webgpu/gpuqueryset.rs (renamed from components/script/dom/gpuqueryset.rs)4
-rw-r--r--components/script/dom/webgpu/gpuqueue.rs (renamed from components/script/dom/gpuqueue.rs)3
-rw-r--r--components/script/dom/webgpu/gpurenderbundle.rs (renamed from components/script/dom/gpurenderbundle.rs)0
-rw-r--r--components/script/dom/webgpu/gpurenderbundleencoder.rs (renamed from components/script/dom/gpurenderbundleencoder.rs)4
-rw-r--r--components/script/dom/webgpu/gpurenderpassencoder.rs (renamed from components/script/dom/gpurenderpassencoder.rs)5
-rw-r--r--components/script/dom/webgpu/gpurenderpipeline.rs (renamed from components/script/dom/gpurenderpipeline.rs)0
-rw-r--r--components/script/dom/webgpu/gpusampler.rs (renamed from components/script/dom/gpusampler.rs)0
-rw-r--r--components/script/dom/webgpu/gpushadermodule.rs (renamed from components/script/dom/gpushadermodule.rs)6
-rw-r--r--components/script/dom/webgpu/gpushaderstage.rs (renamed from components/script/dom/gpushaderstage.rs)0
-rw-r--r--components/script/dom/webgpu/gpusupportedfeatures.rs (renamed from components/script/dom/gpusupportedfeatures.rs)2
-rw-r--r--components/script/dom/webgpu/gpusupportedlimits.rs (renamed from components/script/dom/gpusupportedlimits.rs)7
-rw-r--r--components/script/dom/webgpu/gputexture.rs (renamed from components/script/dom/gputexture.rs)2
-rw-r--r--components/script/dom/webgpu/gputextureusage.rs (renamed from components/script/dom/gputextureusage.rs)0
-rw-r--r--components/script/dom/webgpu/gputextureview.rs (renamed from components/script/dom/gputextureview.rs)0
-rw-r--r--components/script/dom/webgpu/gpuuncapturederrorevent.rs (renamed from components/script/dom/gpuuncapturederrorevent.rs)0
-rw-r--r--components/script/dom/webgpu/gpuvalidationerror.rs (renamed from components/script/dom/gpuvalidationerror.rs)2
-rw-r--r--components/script/dom/webgpu/mod.rs44
-rw-r--r--components/script/dom/workernavigator.rs2
44 files changed, 108 insertions, 118 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index 3631b553f2d..9ff950d92f3 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -327,46 +327,6 @@ pub mod gamepadevent;
pub mod gamepadhapticactuator;
pub mod gamepadpose;
pub mod globalscope;
-pub mod gpu;
-pub mod gpuadapter;
-pub mod gpuadapterinfo;
-pub mod gpubindgroup;
-pub mod gpubindgrouplayout;
-pub mod gpubuffer;
-pub mod gpubufferusage;
-pub mod gpucanvascontext;
-pub mod gpucolorwrite;
-pub mod gpucommandbuffer;
-pub mod gpucommandencoder;
-pub mod gpucompilationinfo;
-pub mod gpucompilationmessage;
-pub mod gpucomputepassencoder;
-pub mod gpucomputepipeline;
-pub mod gpuconvert;
-pub mod gpudevice;
-pub mod gpudevicelostinfo;
-pub mod gpuerror;
-pub mod gpuinternalerror;
-pub mod gpumapmode;
-pub mod gpuoutofmemoryerror;
-pub mod gpupipelineerror;
-pub mod gpupipelinelayout;
-pub mod gpuqueryset;
-pub mod gpuqueue;
-pub mod gpurenderbundle;
-pub mod gpurenderbundleencoder;
-pub mod gpurenderpassencoder;
-pub mod gpurenderpipeline;
-pub mod gpusampler;
-pub mod gpushadermodule;
-pub mod gpushaderstage;
-pub mod gpusupportedfeatures;
-pub mod gpusupportedlimits;
-pub mod gputexture;
-pub mod gputextureusage;
-pub mod gputextureview;
-pub mod gpuuncapturederrorevent;
-pub mod gpuvalidationerror;
pub mod hashchangeevent;
pub mod headers;
pub mod history;
@@ -619,6 +579,8 @@ pub mod websocket;
mod webxr;
#[cfg(feature = "webxr")]
pub use self::webxr::*;
+mod webgpu;
+pub use self::webgpu::*;
pub mod wheelevent;
pub mod window;
pub mod windowproxy;
diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs
index 16325907f32..559f23b1c2b 100644
--- a/components/script/dom/navigator.rs
+++ b/components/script/dom/navigator.rs
@@ -19,7 +19,6 @@ use crate::dom::bindings::utils::to_frozen_array;
use crate::dom::bluetooth::Bluetooth;
use crate::dom::gamepad::Gamepad;
use crate::dom::gamepadevent::GamepadEventType;
-use crate::dom::gpu::GPU;
use crate::dom::mediadevices::MediaDevices;
use crate::dom::mediasession::MediaSession;
use crate::dom::mimetypearray::MimeTypeArray;
@@ -27,6 +26,7 @@ use crate::dom::navigatorinfo;
use crate::dom::permissions::Permissions;
use crate::dom::pluginarray::PluginArray;
use crate::dom::serviceworkercontainer::ServiceWorkerContainer;
+use crate::dom::webgpu::gpu::GPU;
use crate::dom::window::Window;
#[cfg(feature = "webxr")]
use crate::dom::xrsystem::XRSystem;
diff --git a/components/script/dom/gpu.rs b/components/script/dom/webgpu/gpu.rs
index f6302ca59f1..f955db7c350 100644
--- a/components/script/dom/gpu.rs
+++ b/components/script/dom/webgpu/gpu.rs
@@ -12,9 +12,8 @@ use script_traits::ScriptMsg;
use webgpu::wgt::PowerPreference;
use webgpu::{wgc, WebGPUResponse};
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUTextureFormat;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUMethods, GPUPowerPreference, GPURequestAdapterOptions,
+ GPUMethods, GPUPowerPreference, GPURequestAdapterOptions, GPUTextureFormat,
};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
diff --git a/components/script/dom/gpuadapter.rs b/components/script/dom/webgpu/gpuadapter.rs
index 4fa8d12dfa7..da81c8d7d4c 100644
--- a/components/script/dom/gpuadapter.rs
+++ b/components/script/dom/webgpu/gpuadapter.rs
@@ -10,22 +10,21 @@ use webgpu::wgc::instance::RequestDeviceError;
use webgpu::wgt::MemoryHints;
use webgpu::{wgt, WebGPU, WebGPUAdapter, WebGPURequest, WebGPUResponse};
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUDeviceLostReason;
use super::gpusupportedfeatures::GPUSupportedFeatures;
use super::gpusupportedlimits::set_limit;
-use super::types::{GPUAdapterInfo, GPUSupportedLimits};
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUAdapterMethods, GPUDeviceDescriptor,
+ GPUAdapterMethods, GPUDeviceDescriptor, GPUDeviceLostReason,
};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
-use crate::dom::gpu::{response_async, AsyncWGPUListener};
use crate::dom::gpudevice::GPUDevice;
use crate::dom::gpusupportedfeatures::gpu_to_wgt_feature;
use crate::dom::promise::Promise;
+use crate::dom::types::{GPUAdapterInfo, GPUSupportedLimits};
+use crate::dom::webgpu::gpu::{response_async, AsyncWGPUListener};
use crate::realms::InRealm;
use crate::script_runtime::CanGc;
diff --git a/components/script/dom/gpuadapterinfo.rs b/components/script/dom/webgpu/gpuadapterinfo.rs
index bb9a9aeb863..0cda8bed2d7 100644
--- a/components/script/dom/gpuadapterinfo.rs
+++ b/components/script/dom/webgpu/gpuadapterinfo.rs
@@ -5,10 +5,9 @@
use dom_struct::dom_struct;
use webgpu::wgt::AdapterInfo;
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUAdapterInfoMethods;
-use super::bindings::reflector::reflect_dom_object;
-use super::bindings::root::DomRoot;
-use crate::dom::bindings::reflector::Reflector;
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUAdapterInfoMethods;
+use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
+use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use crate::test::DOMString;
diff --git a/components/script/dom/gpubindgroup.rs b/components/script/dom/webgpu/gpubindgroup.rs
index 7992e3825d0..7992e3825d0 100644
--- a/components/script/dom/gpubindgroup.rs
+++ b/components/script/dom/webgpu/gpubindgroup.rs
diff --git a/components/script/dom/gpubindgrouplayout.rs b/components/script/dom/webgpu/gpubindgrouplayout.rs
index c09c36ade58..c09c36ade58 100644
--- a/components/script/dom/gpubindgrouplayout.rs
+++ b/components/script/dom/webgpu/gpubindgrouplayout.rs
diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/webgpu/gpubuffer.rs
index e7bddcde8f1..cab38d067c2 100644
--- a/components/script/dom/gpubuffer.rs
+++ b/components/script/dom/webgpu/gpubuffer.rs
@@ -12,22 +12,20 @@ use js::typedarray::ArrayBuffer;
use webgpu::wgc::device::HostMap;
use webgpu::{wgt, Mapping, WebGPU, WebGPUBuffer, WebGPURequest, WebGPUResponse};
-use super::bindings::buffer_source::DataBlock;
-use super::bindings::codegen::Bindings::WebGPUBinding::{
- GPUBufferDescriptor, GPUBufferMapState, GPUFlagsConstant, GPUMapModeFlags,
-};
+use crate::dom::bindings::buffer_source::DataBlock;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUBufferMethods, GPUMapModeConstants, GPUSize64,
+ GPUBufferDescriptor, GPUBufferMapState, GPUBufferMethods, GPUFlagsConstant,
+ GPUMapModeConstants, GPUMapModeFlags, GPUSize64,
};
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::USVString;
use crate::dom::globalscope::GlobalScope;
-use crate::dom::gpu::{response_async, AsyncWGPUListener};
use crate::dom::gpudevice::GPUDevice;
use crate::dom::promise::Promise;
+use crate::dom::webgpu::gpu::{response_async, AsyncWGPUListener};
use crate::realms::InRealm;
use crate::script_runtime::{CanGc, JSContext};
diff --git a/components/script/dom/gpubufferusage.rs b/components/script/dom/webgpu/gpubufferusage.rs
index b35768d25d5..b35768d25d5 100644
--- a/components/script/dom/gpubufferusage.rs
+++ b/components/script/dom/webgpu/gpubufferusage.rs
diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/webgpu/gpucanvascontext.rs
index 2f443c2d7ea..2766f318c8a 100644
--- a/components/script/dom/gpucanvascontext.rs
+++ b/components/script/dom/webgpu/gpucanvascontext.rs
@@ -18,23 +18,20 @@ use webgpu::{
use webrender_api::units::DeviceIntSize;
use webrender_api::ImageKey;
-use super::bindings::codegen::Bindings::WebGPUBinding::{
- GPUCanvasAlphaMode, GPUTextureFormat, GPUTextureUsageConstants,
-};
-use super::bindings::codegen::UnionTypes::HTMLCanvasElementOrOffscreenCanvas;
-use super::bindings::error::{Error, Fallible};
-use super::bindings::root::MutNullableDom;
-use super::bindings::str::USVString;
use super::gpuconvert::convert_texture_descriptor;
use super::gputexture::GPUTexture;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUTexture_Binding::GPUTextureMethods;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUCanvasConfiguration, GPUCanvasContextMethods, GPUDeviceMethods, GPUExtent3D,
- GPUExtent3DDict, GPUObjectDescriptorBase, GPUTextureDescriptor, GPUTextureDimension,
+ GPUCanvasAlphaMode, GPUCanvasConfiguration, GPUCanvasContextMethods, GPUDeviceMethods,
+ GPUExtent3D, GPUExtent3DDict, GPUObjectDescriptorBase, GPUTextureDescriptor,
+ GPUTextureDimension, GPUTextureFormat, GPUTextureUsageConstants,
};
+use crate::dom::bindings::codegen::UnionTypes::HTMLCanvasElementOrOffscreenCanvas;
+use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
-use crate::dom::bindings::root::{DomRoot, LayoutDom};
+use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
+use crate::dom::bindings::str::USVString;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlcanvaselement::{HTMLCanvasElement, LayoutCanvasRenderingContextHelpers};
use crate::dom::node::{document_from_node, Node, NodeDamage};
diff --git a/components/script/dom/gpucolorwrite.rs b/components/script/dom/webgpu/gpucolorwrite.rs
index 29e19826342..29e19826342 100644
--- a/components/script/dom/gpucolorwrite.rs
+++ b/components/script/dom/webgpu/gpucolorwrite.rs
diff --git a/components/script/dom/gpucommandbuffer.rs b/components/script/dom/webgpu/gpucommandbuffer.rs
index 120af69a480..120af69a480 100644
--- a/components/script/dom/gpucommandbuffer.rs
+++ b/components/script/dom/webgpu/gpucommandbuffer.rs
diff --git a/components/script/dom/gpucommandencoder.rs b/components/script/dom/webgpu/gpucommandencoder.rs
index 9dcec03540c..67d78c0fcc9 100644
--- a/components/script/dom/gpucommandencoder.rs
+++ b/components/script/dom/webgpu/gpucommandencoder.rs
@@ -9,13 +9,13 @@ use webgpu::{
WebGPURenderPass, WebGPURequest,
};
-use super::bindings::error::Fallible;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUCommandBufferDescriptor, GPUCommandEncoderDescriptor, GPUCommandEncoderMethods,
GPUComputePassDescriptor, GPUExtent3D, GPUImageCopyBuffer, GPUImageCopyTexture,
GPURenderPassDescriptor, GPUSize64,
};
+use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::USVString;
diff --git a/components/script/dom/gpucompilationinfo.rs b/components/script/dom/webgpu/gpucompilationinfo.rs
index 4bfa849d49e..08751c03d57 100644
--- a/components/script/dom/gpucompilationinfo.rs
+++ b/components/script/dom/webgpu/gpucompilationinfo.rs
@@ -6,13 +6,12 @@ use dom_struct::dom_struct;
use js::rust::MutableHandleValue;
use webgpu::ShaderCompilationInfo;
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUCompilationInfoMethods;
-use super::bindings::import::module::DomRoot;
-use super::bindings::reflector::reflect_dom_object_with_proto;
-use super::bindings::utils::to_frozen_array;
-use super::types::GPUCompilationMessage;
-use crate::dom::bindings::reflector::Reflector;
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUCompilationInfoMethods;
+use crate::dom::bindings::import::module::DomRoot;
+use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, Reflector};
+use crate::dom::bindings::utils::to_frozen_array;
use crate::dom::globalscope::GlobalScope;
+use crate::dom::types::GPUCompilationMessage;
use crate::script_runtime::{CanGc, JSContext};
#[dom_struct]
diff --git a/components/script/dom/gpucompilationmessage.rs b/components/script/dom/webgpu/gpucompilationmessage.rs
index dbdf87bdede..d811e8baf6e 100644
--- a/components/script/dom/gpucompilationmessage.rs
+++ b/components/script/dom/webgpu/gpucompilationmessage.rs
@@ -7,12 +7,12 @@
use dom_struct::dom_struct;
use webgpu::ShaderCompilationInfo;
-use super::bindings::codegen::Bindings::WebGPUBinding::{
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUCompilationMessageMethods, GPUCompilationMessageType,
};
-use super::bindings::root::DomRoot;
-use super::types::GlobalScope;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
+use crate::dom::bindings::root::DomRoot;
+use crate::dom::types::GlobalScope;
use crate::test::DOMString;
#[dom_struct]
diff --git a/components/script/dom/gpucomputepassencoder.rs b/components/script/dom/webgpu/gpucomputepassencoder.rs
index e75157b32fc..e75157b32fc 100644
--- a/components/script/dom/gpucomputepassencoder.rs
+++ b/components/script/dom/webgpu/gpucomputepassencoder.rs
diff --git a/components/script/dom/gpucomputepipeline.rs b/components/script/dom/webgpu/gpucomputepipeline.rs
index 4d905126c71..4d905126c71 100644
--- a/components/script/dom/gpucomputepipeline.rs
+++ b/components/script/dom/webgpu/gpucomputepipeline.rs
diff --git a/components/script/dom/gpuconvert.rs b/components/script/dom/webgpu/gpuconvert.rs
index c3817c75ea1..db2390a03b0 100644
--- a/components/script/dom/gpuconvert.rs
+++ b/components/script/dom/webgpu/gpuconvert.rs
@@ -11,20 +11,17 @@ use webgpu::wgc::pipeline::ProgrammableStageDescriptor;
use webgpu::wgc::resource::TextureDescriptor;
use webgpu::wgt::{self, AstcBlock, AstcChannel};
-use super::bindings::codegen::Bindings::WebGPUBinding::{
- GPUProgrammableStage, GPUTextureDescriptor, GPUTextureDimension,
-};
-use super::bindings::error::Error;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUAddressMode, GPUBindGroupEntry, GPUBindGroupLayoutEntry, GPUBindingResource,
GPUBlendComponent, GPUBlendFactor, GPUBlendOperation, GPUBufferBindingType, GPUColor,
GPUCompareFunction, GPUCullMode, GPUExtent3D, GPUFilterMode, GPUFrontFace, GPUImageCopyBuffer,
GPUImageCopyTexture, GPUImageDataLayout, GPUIndexFormat, GPULoadOp, GPUObjectDescriptorBase,
- GPUOrigin3D, GPUPrimitiveState, GPUPrimitiveTopology, GPUSamplerBindingType,
- GPUStencilOperation, GPUStorageTextureAccess, GPUStoreOp, GPUTextureAspect, GPUTextureFormat,
+ GPUOrigin3D, GPUPrimitiveState, GPUPrimitiveTopology, GPUProgrammableStage,
+ GPUSamplerBindingType, GPUStencilOperation, GPUStorageTextureAccess, GPUStoreOp,
+ GPUTextureAspect, GPUTextureDescriptor, GPUTextureDimension, GPUTextureFormat,
GPUTextureSampleType, GPUTextureViewDimension, GPUVertexFormat,
};
-use crate::dom::bindings::error::Fallible;
+use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::types::GPUDevice;
impl From<GPUTextureFormat> for wgt::TextureFormat {
diff --git a/components/script/dom/gpudevice.rs b/components/script/dom/webgpu/gpudevice.rs
index b62f800f3e6..945c7491874 100644
--- a/components/script/dom/gpudevice.rs
+++ b/components/script/dom/webgpu/gpudevice.rs
@@ -19,33 +19,29 @@ use webgpu::{
WebGPUResponse,
};
-use super::bindings::codegen::Bindings::WebGPUBinding::{GPUPipelineErrorReason, GPUTextureFormat};
-use super::bindings::codegen::UnionTypes::GPUPipelineLayoutOrGPUAutoLayoutMode;
-use super::bindings::error::Fallible;
use super::gpu::AsyncWGPUListener;
use super::gpudevicelostinfo::GPUDeviceLostInfo;
use super::gpupipelineerror::GPUPipelineError;
use super::gpusupportedlimits::GPUSupportedLimits;
-use super::types::GPUError;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::EventBinding::EventInit;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUBindGroupDescriptor, GPUBindGroupLayoutDescriptor, GPUBufferDescriptor,
GPUCommandEncoderDescriptor, GPUComputePipelineDescriptor, GPUDeviceLostReason,
- GPUDeviceMethods, GPUErrorFilter, GPUPipelineLayoutDescriptor,
+ GPUDeviceMethods, GPUErrorFilter, GPUPipelineErrorReason, GPUPipelineLayoutDescriptor,
GPURenderBundleEncoderDescriptor, GPURenderPipelineDescriptor, GPUSamplerDescriptor,
- GPUShaderModuleDescriptor, GPUSupportedLimitsMethods, GPUTextureDescriptor,
+ GPUShaderModuleDescriptor, GPUSupportedLimitsMethods, GPUTextureDescriptor, GPUTextureFormat,
GPUUncapturedErrorEventInit, GPUVertexStepMode,
};
-use crate::dom::bindings::error::Error;
+use crate::dom::bindings::codegen::UnionTypes::GPUPipelineLayoutOrGPUAutoLayoutMode;
+use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::{DOMString, USVString};
use crate::dom::bindings::trace::RootedTraceableBox;
use crate::dom::eventtarget::EventTarget;
use crate::dom::globalscope::GlobalScope;
-use crate::dom::gpu::response_async;
use crate::dom::gpuadapter::GPUAdapter;
use crate::dom::gpubindgroup::GPUBindGroup;
use crate::dom::gpubindgrouplayout::GPUBindGroupLayout;
@@ -62,6 +58,8 @@ use crate::dom::gpusupportedfeatures::GPUSupportedFeatures;
use crate::dom::gputexture::GPUTexture;
use crate::dom::gpuuncapturederrorevent::GPUUncapturedErrorEvent;
use crate::dom::promise::Promise;
+use crate::dom::types::GPUError;
+use crate::dom::webgpu::gpu::response_async;
use crate::realms::InRealm;
use crate::script_runtime::CanGc;
diff --git a/components/script/dom/gpudevicelostinfo.rs b/components/script/dom/webgpu/gpudevicelostinfo.rs
index 3219c0fe202..ea33986a84f 100644
--- a/components/script/dom/gpudevicelostinfo.rs
+++ b/components/script/dom/webgpu/gpudevicelostinfo.rs
@@ -6,8 +6,9 @@
use dom_struct::dom_struct;
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUDeviceLostReason;
-use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUDeviceLostInfoMethods;
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
+ GPUDeviceLostInfoMethods, GPUDeviceLostReason,
+};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
diff --git a/components/script/dom/gpuerror.rs b/components/script/dom/webgpu/gpuerror.rs
index 20ecff210d6..a4de08cc18b 100644
--- a/components/script/dom/gpuerror.rs
+++ b/components/script/dom/webgpu/gpuerror.rs
@@ -6,12 +6,12 @@ use dom_struct::dom_struct;
use js::rust::HandleObject;
use webgpu::{Error, ErrorFilter};
-use super::types::{GPUInternalError, GPUOutOfMemoryError, GPUValidationError};
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{GPUErrorFilter, GPUErrorMethods};
use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
+use crate::dom::types::{GPUInternalError, GPUOutOfMemoryError, GPUValidationError};
use crate::script_runtime::CanGc;
#[dom_struct]
diff --git a/components/script/dom/gpuinternalerror.rs b/components/script/dom/webgpu/gpuinternalerror.rs
index 4be5be9a22e..c622d4ff495 100644
--- a/components/script/dom/gpuinternalerror.rs
+++ b/components/script/dom/webgpu/gpuinternalerror.rs
@@ -5,12 +5,12 @@
use dom_struct::dom_struct;
use js::rust::HandleObject;
-use super::types::GPUError;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUInternalError_Binding::GPUInternalErrorMethods;
use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
+use crate::dom::types::GPUError;
use crate::script_runtime::CanGc;
#[dom_struct]
diff --git a/components/script/dom/gpumapmode.rs b/components/script/dom/webgpu/gpumapmode.rs
index 4db3455483d..4db3455483d 100644
--- a/components/script/dom/gpumapmode.rs
+++ b/components/script/dom/webgpu/gpumapmode.rs
diff --git a/components/script/dom/gpuoutofmemoryerror.rs b/components/script/dom/webgpu/gpuoutofmemoryerror.rs
index 22763e89c48..01c77ef8185 100644
--- a/components/script/dom/gpuoutofmemoryerror.rs
+++ b/components/script/dom/webgpu/gpuoutofmemoryerror.rs
@@ -5,12 +5,12 @@
use dom_struct::dom_struct;
use js::rust::HandleObject;
-use super::types::GPUError;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUOutOfMemoryError_Binding::GPUOutOfMemoryErrorMethods;
use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
+use crate::dom::types::GPUError;
use crate::script_runtime::CanGc;
#[dom_struct]
diff --git a/components/script/dom/gpupipelineerror.rs b/components/script/dom/webgpu/gpupipelineerror.rs
index d8a4bb5a587..ae2b57bc781 100644
--- a/components/script/dom/gpupipelineerror.rs
+++ b/components/script/dom/webgpu/gpupipelineerror.rs
@@ -5,7 +5,7 @@
use dom_struct::dom_struct;
use js::rust::HandleObject;
-use super::bindings::codegen::Bindings::WebGPUBinding::{
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUPipelineErrorInit, GPUPipelineErrorMethods, GPUPipelineErrorReason,
};
use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
diff --git a/components/script/dom/gpupipelinelayout.rs b/components/script/dom/webgpu/gpupipelinelayout.rs
index c1cbbdb72ab..c1cbbdb72ab 100644
--- a/components/script/dom/gpupipelinelayout.rs
+++ b/components/script/dom/webgpu/gpupipelinelayout.rs
diff --git a/components/script/dom/gpuqueryset.rs b/components/script/dom/webgpu/gpuqueryset.rs
index 40e734f9eec..d2c3eb03336 100644
--- a/components/script/dom/gpuqueryset.rs
+++ b/components/script/dom/webgpu/gpuqueryset.rs
@@ -6,9 +6,9 @@
use dom_struct::dom_struct;
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUQuerySetMethods;
-use super::bindings::str::USVString;
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUQuerySetMethods;
use crate::dom::bindings::reflector::Reflector;
+use crate::dom::bindings::str::USVString;
#[dom_struct]
pub struct GPUQuerySet {
diff --git a/components/script/dom/gpuqueue.rs b/components/script/dom/webgpu/gpuqueue.rs
index 40983567990..403628737d3 100644
--- a/components/script/dom/gpuqueue.rs
+++ b/components/script/dom/webgpu/gpuqueue.rs
@@ -8,11 +8,10 @@ use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSharedMemory;
use webgpu::{wgt, WebGPU, WebGPUQueue, WebGPURequest, WebGPUResponse};
-use super::bindings::codegen::Bindings::WebGPUBinding::{GPUImageCopyTexture, GPUImageDataLayout};
use super::gpu::{response_async, AsyncWGPUListener};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUExtent3D, GPUQueueMethods, GPUSize64,
+ GPUExtent3D, GPUImageCopyTexture, GPUImageDataLayout, GPUQueueMethods, GPUSize64,
};
use crate::dom::bindings::codegen::UnionTypes::ArrayBufferViewOrArrayBuffer as BufferSource;
use crate::dom::bindings::error::{Error, Fallible};
diff --git a/components/script/dom/gpurenderbundle.rs b/components/script/dom/webgpu/gpurenderbundle.rs
index aae120b970b..aae120b970b 100644
--- a/components/script/dom/gpurenderbundle.rs
+++ b/components/script/dom/webgpu/gpurenderbundle.rs
diff --git a/components/script/dom/gpurenderbundleencoder.rs b/components/script/dom/webgpu/gpurenderbundleencoder.rs
index fdaf6fa534e..3f23db60706 100644
--- a/components/script/dom/gpurenderbundleencoder.rs
+++ b/components/script/dom/webgpu/gpurenderbundleencoder.rs
@@ -10,10 +10,10 @@ use webgpu::wgc::command::{
};
use webgpu::{wgt, WebGPU, WebGPURenderBundle, WebGPURequest};
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUIndexFormat;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPURenderBundleDescriptor, GPURenderBundleEncoderDescriptor, GPURenderBundleEncoderMethods,
+ GPUIndexFormat, GPURenderBundleDescriptor, GPURenderBundleEncoderDescriptor,
+ GPURenderBundleEncoderMethods,
};
use crate::dom::bindings::import::module::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
diff --git a/components/script/dom/gpurenderpassencoder.rs b/components/script/dom/webgpu/gpurenderpassencoder.rs
index 36d425a4789..ea77df69d02 100644
--- a/components/script/dom/gpurenderpassencoder.rs
+++ b/components/script/dom/webgpu/gpurenderpassencoder.rs
@@ -5,12 +5,11 @@
use dom_struct::dom_struct;
use webgpu::{wgt, RenderCommand, WebGPU, WebGPURenderPass, WebGPURequest};
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUIndexFormat;
-use super::bindings::error::Fallible;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
- GPUColor, GPURenderPassEncoderMethods,
+ GPUColor, GPUIndexFormat, GPURenderPassEncoderMethods,
};
+use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::num::Finite;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
diff --git a/components/script/dom/gpurenderpipeline.rs b/components/script/dom/webgpu/gpurenderpipeline.rs
index 0cf8754ecbf..0cf8754ecbf 100644
--- a/components/script/dom/gpurenderpipeline.rs
+++ b/components/script/dom/webgpu/gpurenderpipeline.rs
diff --git a/components/script/dom/gpusampler.rs b/components/script/dom/webgpu/gpusampler.rs
index ad7aa3e8b89..ad7aa3e8b89 100644
--- a/components/script/dom/gpusampler.rs
+++ b/components/script/dom/webgpu/gpusampler.rs
diff --git a/components/script/dom/gpushadermodule.rs b/components/script/dom/webgpu/gpushadermodule.rs
index 4febc758637..44cc8fa8115 100644
--- a/components/script/dom/gpushadermodule.rs
+++ b/components/script/dom/webgpu/gpushadermodule.rs
@@ -9,8 +9,6 @@ use webgpu::{WebGPU, WebGPURequest, WebGPUResponse, WebGPUShaderModule};
use super::gpu::AsyncWGPUListener;
use super::gpucompilationinfo::GPUCompilationInfo;
-use super::promise::Promise;
-use super::types::GPUDevice;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUShaderModuleDescriptor, GPUShaderModuleMethods,
@@ -20,7 +18,9 @@ use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::USVString;
use crate::dom::bindings::trace::RootedTraceableBox;
use crate::dom::globalscope::GlobalScope;
-use crate::dom::gpu::response_async;
+use crate::dom::promise::Promise;
+use crate::dom::types::GPUDevice;
+use crate::dom::webgpu::gpu::response_async;
use crate::realms::InRealm;
use crate::script_runtime::CanGc;
diff --git a/components/script/dom/gpushaderstage.rs b/components/script/dom/webgpu/gpushaderstage.rs
index 611ffb12283..611ffb12283 100644
--- a/components/script/dom/gpushaderstage.rs
+++ b/components/script/dom/webgpu/gpushaderstage.rs
diff --git a/components/script/dom/gpusupportedfeatures.rs b/components/script/dom/webgpu/gpusupportedfeatures.rs
index 07242113f9e..8cc161e172c 100644
--- a/components/script/dom/gpusupportedfeatures.rs
+++ b/components/script/dom/webgpu/gpusupportedfeatures.rs
@@ -9,12 +9,12 @@ use indexmap::IndexSet;
use js::rust::HandleObject;
use webgpu::wgt::Features;
-use super::bindings::like::Setlike;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUFeatureName, GPUSupportedFeaturesMethods,
};
use crate::dom::bindings::error::Fallible;
+use crate::dom::bindings::like::Setlike;
use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
diff --git a/components/script/dom/gpusupportedlimits.rs b/components/script/dom/webgpu/gpusupportedlimits.rs
index bbad05face0..15f1172da18 100644
--- a/components/script/dom/gpusupportedlimits.rs
+++ b/components/script/dom/webgpu/gpusupportedlimits.rs
@@ -7,10 +7,9 @@ use num_traits::bounds::UpperBounded;
use webgpu::wgt::Limits;
use GPUSupportedLimits_Binding::GPUSupportedLimitsMethods;
-use super::bindings::codegen::Bindings::WebGPUBinding::GPUSupportedLimits_Binding;
-use super::bindings::reflector::reflect_dom_object;
-use super::bindings::root::DomRoot;
-use crate::dom::bindings::reflector::Reflector;
+use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUSupportedLimits_Binding;
+use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
+use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
#[dom_struct]
diff --git a/components/script/dom/gputexture.rs b/components/script/dom/webgpu/gputexture.rs
index 50913734ad5..b37197f4a90 100644
--- a/components/script/dom/gputexture.rs
+++ b/components/script/dom/webgpu/gputexture.rs
@@ -8,13 +8,13 @@ use dom_struct::dom_struct;
use webgpu::wgc::resource;
use webgpu::{wgt, WebGPU, WebGPURequest, WebGPUTexture, WebGPUTextureView};
-use super::bindings::error::Fallible;
use super::gpuconvert::convert_texture_descriptor;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
GPUTextureAspect, GPUTextureDescriptor, GPUTextureDimension, GPUTextureFormat,
GPUTextureMethods, GPUTextureViewDescriptor,
};
+use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::USVString;
diff --git a/components/script/dom/gputextureusage.rs b/components/script/dom/webgpu/gputextureusage.rs
index f2d9645364b..f2d9645364b 100644
--- a/components/script/dom/gputextureusage.rs
+++ b/components/script/dom/webgpu/gputextureusage.rs
diff --git a/components/script/dom/gputextureview.rs b/components/script/dom/webgpu/gputextureview.rs
index 3c8d484fca3..3c8d484fca3 100644
--- a/components/script/dom/gputextureview.rs
+++ b/components/script/dom/webgpu/gputextureview.rs
diff --git a/components/script/dom/gpuuncapturederrorevent.rs b/components/script/dom/webgpu/gpuuncapturederrorevent.rs
index 0ee3871d98d..0ee3871d98d 100644
--- a/components/script/dom/gpuuncapturederrorevent.rs
+++ b/components/script/dom/webgpu/gpuuncapturederrorevent.rs
diff --git a/components/script/dom/gpuvalidationerror.rs b/components/script/dom/webgpu/gpuvalidationerror.rs
index f29e5bc4e5b..0b20375e728 100644
--- a/components/script/dom/gpuvalidationerror.rs
+++ b/components/script/dom/webgpu/gpuvalidationerror.rs
@@ -5,12 +5,12 @@
use dom_struct::dom_struct;
use js::rust::HandleObject;
-use super::types::GPUError;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUValidationError_Binding::GPUValidationErrorMethods;
use crate::dom::bindings::reflector::reflect_dom_object_with_proto;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
+use crate::dom::types::GPUError;
use crate::script_runtime::CanGc;
#[dom_struct]
diff --git a/components/script/dom/webgpu/mod.rs b/components/script/dom/webgpu/mod.rs
new file mode 100644
index 00000000000..22994a942bc
--- /dev/null
+++ b/components/script/dom/webgpu/mod.rs
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+pub mod gpu;
+pub mod gpuadapter;
+pub mod gpuadapterinfo;
+pub mod gpubindgroup;
+pub mod gpubindgrouplayout;
+pub mod gpubuffer;
+pub mod gpubufferusage;
+pub mod gpucanvascontext;
+pub mod gpucolorwrite;
+pub mod gpucommandbuffer;
+pub mod gpucommandencoder;
+pub mod gpucompilationinfo;
+pub mod gpucompilationmessage;
+pub mod gpucomputepassencoder;
+pub mod gpucomputepipeline;
+pub mod gpuconvert;
+pub mod gpudevice;
+pub mod gpudevicelostinfo;
+pub mod gpuerror;
+pub mod gpuinternalerror;
+pub mod gpumapmode;
+pub mod gpuoutofmemoryerror;
+pub mod gpupipelineerror;
+pub mod gpupipelinelayout;
+pub mod gpuqueryset;
+pub mod gpuqueue;
+pub mod gpurenderbundle;
+pub mod gpurenderbundleencoder;
+pub mod gpurenderpassencoder;
+pub mod gpurenderpipeline;
+pub mod gpusampler;
+pub mod gpushadermodule;
+pub mod gpushaderstage;
+pub mod gpusupportedfeatures;
+pub mod gpusupportedlimits;
+pub mod gputexture;
+pub mod gputextureusage;
+pub mod gputextureview;
+pub mod gpuuncapturederrorevent;
+pub mod gpuvalidationerror;
diff --git a/components/script/dom/workernavigator.rs b/components/script/dom/workernavigator.rs
index b2c84137fce..e25278f1b62 100644
--- a/components/script/dom/workernavigator.rs
+++ b/components/script/dom/workernavigator.rs
@@ -10,10 +10,10 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
use crate::dom::bindings::str::DOMString;
use crate::dom::bindings::utils::to_frozen_array;
-use crate::dom::gpu::GPU;
use crate::dom::navigator::hardware_concurrency;
use crate::dom::navigatorinfo;
use crate::dom::permissions::Permissions;
+use crate::dom::webgpu::gpu::GPU;
use crate::dom::workerglobalscope::WorkerGlobalScope;
use crate::script_runtime::JSContext;