From 810dc5aa271d87312001081bb4cbb161ad135c6c Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Tue, 1 Mar 2022 15:02:25 +0800 Subject: [PATCH] gl | metal: updates the upper bounds of the extends of `SurfaceCapabilities` --- wgpu-hal/src/gles/adapter.rs | 5 +++-- wgpu-hal/src/gles/mod.rs | 1 + wgpu-hal/src/metal/adapter.rs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index ae76bce77a..61dcd56b91 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -494,6 +494,7 @@ impl super::Adapter { private_caps, workarounds, shading_language_version, + max_texture_size, }), }, info: Self::make_info(vendor, renderer), @@ -718,8 +719,8 @@ impl crate::Adapter for super::Adapter { height: 4, depth_or_array_layers: 1, }..=wgt::Extent3d { - width: 4096, - height: 4096, + width: self.shared.max_texture_size, + height: self.shared.max_texture_size, depth_or_array_layers: 1, }, usage: crate::TextureUses::COLOR_TARGET, diff --git a/wgpu-hal/src/gles/mod.rs b/wgpu-hal/src/gles/mod.rs index d62799814f..8c7dde0da2 100644 --- a/wgpu-hal/src/gles/mod.rs +++ b/wgpu-hal/src/gles/mod.rs @@ -182,6 +182,7 @@ struct AdapterShared { private_caps: PrivateCapabilities, workarounds: Workarounds, shading_language_version: naga::back::glsl::Version, + max_texture_size: u32, } pub struct Adapter { diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 83c8809ddd..a51686188f 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -380,8 +380,8 @@ impl crate::Adapter for super::Adapter { height: 4, depth_or_array_layers: 1, }..=wgt::Extent3d { - width: 4096, - height: 4096, + width: pc.max_texture_size as u32, + height: pc.max_texture_size as u32, depth_or_array_layers: 1, }, usage: crate::TextureUses::COLOR_TARGET | crate::TextureUses::COPY_DST, //TODO: expose more