diff --git a/Cargo.lock b/Cargo.lock index 89f82212dd0f8..f08f84dbfa17c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1867,7 +1867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -4077,7 +4077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -4512,7 +4512,7 @@ checksum = "956787520e75e9bd233246045d19f42fb73242759cc57fba9611d940ae96d4b0" [[package]] name = "naga" version = "23.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=4da7c263ed075e5d1ac7ee5640712542830e6330#4da7c263ed075e5d1ac7ee5640712542830e6330" +source = "git+https://github.com/sagudev/wgpu?branch=TextureViewDesc-usage#36f7f7d58fb5f31cdc0e885a2b6e59f19ebcea2f" dependencies = [ "arrayvec", "bit-set", @@ -5913,7 +5913,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -7177,7 +7177,7 @@ dependencies = [ "fastrand", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -8338,7 +8338,7 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu-core" version = "23.0.1" -source = "git+https://github.com/gfx-rs/wgpu?rev=4da7c263ed075e5d1ac7ee5640712542830e6330#4da7c263ed075e5d1ac7ee5640712542830e6330" +source = "git+https://github.com/sagudev/wgpu?branch=TextureViewDesc-usage#36f7f7d58fb5f31cdc0e885a2b6e59f19ebcea2f" dependencies = [ "arrayvec", "bit-vec", @@ -8363,7 +8363,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "23.0.1" -source = "git+https://github.com/gfx-rs/wgpu?rev=4da7c263ed075e5d1ac7ee5640712542830e6330#4da7c263ed075e5d1ac7ee5640712542830e6330" +source = "git+https://github.com/sagudev/wgpu?branch=TextureViewDesc-usage#36f7f7d58fb5f31cdc0e885a2b6e59f19ebcea2f" dependencies = [ "android_system_properties", "arrayvec", @@ -8406,7 +8406,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "23.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=4da7c263ed075e5d1ac7ee5640712542830e6330#4da7c263ed075e5d1ac7ee5640712542830e6330" +source = "git+https://github.com/sagudev/wgpu?branch=TextureViewDesc-usage#36f7f7d58fb5f31cdc0e885a2b6e59f19ebcea2f" dependencies = [ "bitflags 2.6.0", "js-sys", @@ -8448,7 +8448,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d2ec1081590c7..a383a1786fd11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -155,8 +155,8 @@ webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65" } webrender_traits = { path = "components/shared/webrender" } webxr = { git = "https://github.com/servo/webxr" } webxr-api = { git = "https://github.com/servo/webxr" } -wgpu-core = { git = "https://github.com/gfx-rs/wgpu", rev = "4da7c263ed075e5d1ac7ee5640712542830e6330" } -wgpu-types = { git = "https://github.com/gfx-rs/wgpu", rev = "4da7c263ed075e5d1ac7ee5640712542830e6330" } +wgpu-core = { git = "https://github.com/sagudev/wgpu", branch = "TextureViewDesc-usage" } +wgpu-types = { git = "https://github.com/sagudev/wgpu", branch = "TextureViewDesc-usage" } windows-sys = "0.59" wr_malloc_size_of = { git = "https://github.com/servo/webrender", branch = "0.65" } xi-unicode = "0.3.0" diff --git a/components/script/dom/webgpu/gputexture.rs b/components/script/dom/webgpu/gputexture.rs index 04680f4265287..a07537d73b1a6 100644 --- a/components/script/dom/webgpu/gputexture.rs +++ b/components/script/dom/webgpu/gputexture.rs @@ -189,6 +189,7 @@ impl GPUTextureMethods 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 ef402b5316957..3e8b1f44ce700 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;