aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2024-12-21 06:18:27 +0100
committerGitHub <noreply@github.com>2024-12-21 05:18:27 +0000
commit626ef037f3963f1a1425fd61d9c2d4eb5359fb43 (patch)
treec015aae0461b53366fe3083d2cc384bb0c7ec6c4 /components
parent1d5aac8875ccdbaab2510e816d1e92ff336f3cc9 (diff)
downloadservo-626ef037f3963f1a1425fd61d9c2d4eb5359fb43.tar.gz
servo-626ef037f3963f1a1425fd61d9c2d4eb5359fb43.zip
Update wgpu for supporting TextureView.usage (#34721)
* Update wgpu and add support for TextureView.usage https://github.com/gfx-rs/wgpu/commit/53f40794f275329a48efc7d1c637c91b8e51327d Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Disable wgpu logging Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * remove unused wgpu features Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * new expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * re Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update deny.toml Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/webgpu/gpucommandencoder.rs4
-rw-r--r--components/script/dom/webgpu/gputexture.rs1
-rw-r--r--components/script/dom/webidls/WebGPU.webidl1
-rw-r--r--components/webgpu/Cargo.toml2
4 files changed, 5 insertions, 3 deletions
diff --git a/components/script/dom/webgpu/gpucommandencoder.rs b/components/script/dom/webgpu/gpucommandencoder.rs
index 7567e187cd2..779b0af95b0 100644
--- a/components/script/dom/webgpu/gpucommandencoder.rs
+++ b/components/script/dom/webgpu/gpucommandencoder.rs
@@ -158,13 +158,13 @@ impl GPUCommandEncoderMethods<crate::DomTypeHolder> for GPUCommandEncoder {
depth: wgpu_com::PassChannel {
load_op: ds.depthLoadOp.as_ref().map(Convert::convert),
store_op: ds.depthStoreOp.as_ref().map(Convert::convert),
- clear_value: *ds.depthClearValue.unwrap_or_default(),
+ clear_value: ds.depthClearValue.map(|v| *v),
read_only: ds.depthReadOnly,
},
stencil: wgpu_com::PassChannel {
load_op: ds.stencilLoadOp.as_ref().map(Convert::convert),
store_op: ds.stencilStoreOp.as_ref().map(Convert::convert),
- clear_value: ds.stencilClearValue,
+ clear_value: Some(ds.stencilClearValue),
read_only: ds.stencilReadOnly,
},
view: ds.view.id().0,
diff --git a/components/script/dom/webgpu/gputexture.rs b/components/script/dom/webgpu/gputexture.rs
index 04680f42652..a07537d73b1 100644
--- a/components/script/dom/webgpu/gputexture.rs
+++ b/components/script/dom/webgpu/gputexture.rs
@@ -189,6 +189,7 @@ impl GPUTextureMethods<crate::DomTypeHolder> for GPUTexture {
.map(|f| self.device.validate_texture_format_required_features(&f))
.transpose()?,
dimension: descriptor.dimension.map(|dimension| dimension.convert()),
+ usage: Some(wgt::TextureUsages::from_bits_retain(descriptor.usage)),
range: wgt::ImageSubresourceRange {
aspect: match descriptor.aspect {
GPUTextureAspect::All => wgt::TextureAspect::All,
diff --git a/components/script/dom/webidls/WebGPU.webidl b/components/script/dom/webidls/WebGPU.webidl
index ef402b53169..3e8b1f44ce7 100644
--- a/components/script/dom/webidls/WebGPU.webidl
+++ b/components/script/dom/webidls/WebGPU.webidl
@@ -268,6 +268,7 @@ GPUTextureView includes GPUObjectBase;
dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase {
GPUTextureFormat format;
GPUTextureViewDimension dimension;
+ GPUTextureUsageFlags usage = 0;
GPUTextureAspect aspect = "all";
GPUIntegerCoordinate baseMipLevel = 0;
GPUIntegerCoordinate mipLevelCount;
diff --git a/components/webgpu/Cargo.toml b/components/webgpu/Cargo.toml
index f3a20f19ad3..fe456cecef7 100644
--- a/components/webgpu/Cargo.toml
+++ b/components/webgpu/Cargo.toml
@@ -23,7 +23,7 @@ servo_config = { path = "../config" }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
-wgpu-core = { workspace = true, features = ["replay", "trace", "wgsl"] }
+wgpu-core = { workspace = true, features = ["serde", "wgsl"] }
wgpu-types = { workspace = true }
# We want the wgpu-core Metal backend on macOS and iOS.