mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
webgpu: Refactor webgpu crate (#32255)
* wgpu(_core) -> wgc * Refactor webgpu crate split lib.rs into multiple modules
This commit is contained in:
parent
c4f8599404
commit
168d43f24a
21 changed files with 1475 additions and 1413 deletions
|
@ -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};
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -95,7 +95,7 @@ use style::dom::OpaqueNode;
|
|||
use style::thread_state::{self, ThreadState};
|
||||
use time::precise_time_ns;
|
||||
use url::Position;
|
||||
use webgpu::identity::WebGPUMsg;
|
||||
use webgpu::WebGPUMsg;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::DocumentId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue