From 4992d877c752e824f5611f1c36cfd4ac1e0530ea Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 19 Oct 2026 06:41:16 +0200 Subject: [PATCH] Fix the Intel HD 520/530 crash at device creation (#746) wgpu 30 creates a Vulkan descriptor pool with no pool sizes while it creates the device. Vulkan allows that only since 1.3.215; Intel's Windows driver for 6th-10th gen integrated GPUs (igvk64.dll, HD 520/530, UHD 620/630) reads past the empty array and crashes with 0xc0000005 inside request_device, right after the game logs its renderer (gfx-rs/wgpu#9845). Apply the upstream fix (gfx-rs/wgpu#10124: one sampler entry when the pool would be empty), which no wgpu release has yet, through [patch.crates-io]. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 2 -- Cargo.toml | 8 ++++++++ THIRD_PARTY_NOTICES.md | 7 +++++++ third_party/wgpu-hal/src/vulkan/descriptor.rs | 11 +++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9eb13c20..daac1a352 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4601,8 +4601,6 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "30.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58" dependencies = [ "android_system_properties", "arrayvec", diff --git a/Cargo.toml b/Cargo.toml index e417933fd..409bf4689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,14 @@ type_complexity = "allow" needless_range_loop = "allow" large_enum_variant = "allow" +# wgpu-hal 30.0.1 with gfx-rs/wgpu#10124: wgpu 30 creates a Vulkan descriptor +# pool with no pool sizes while it creates the device, which Vulkan allows only +# since 1.3.215, and Intel's Windows driver for 6th-10th gen iGPUs (HD 520/530, +# UHD 620/630) crashes on it with an access violation (#746). Drop this and the +# folder once a wgpu release has the fix. +[patch.crates-io] +wgpu-hal = { path = "third_party/wgpu-hal" } + # Line tables keep file:line in backtraces; full debug info made every # example and test binary hundreds of megabytes and slow to link. [profile.dev] diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 585224f8f..368813ecf 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -29,3 +29,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` + +## wgpu-hal + +`third_party/wgpu-hal` is [wgpu-hal](https://github.com/gfx-rs/wgpu) 30.0.1 by the gfx-rs +developers, with one upstream fix applied +([gfx-rs/wgpu#10124](https://github.com/gfx-rs/wgpu/pull/10124)). It is licensed under MIT or +Apache-2.0; both licenses are in that folder (`LICENSE.MIT`, `LICENSE.APACHE`). diff --git a/third_party/wgpu-hal/src/vulkan/descriptor.rs b/third_party/wgpu-hal/src/vulkan/descriptor.rs index 07df9b898..99fd5c69b 100644 --- a/third_party/wgpu-hal/src/vulkan/descriptor.rs +++ b/third_party/wgpu-hal/src/vulkan/descriptor.rs @@ -318,6 +318,17 @@ fn create_descriptor_pool( }) .collect::>(); + // Prior to Vulkan 1.3.215 `poolSizeCount` was required to be non-zero, so + // add a single small sampler entry if `pool_sizes` would otherwise be + // empty. + let mut pool_sizes = pool_sizes; + if pool_sizes.is_empty() { + pool_sizes.push(vk::DescriptorPoolSize { + ty: Dt::SAMPLER, + descriptor_count: 1, + }); + } + let mut flags = vk::DescriptorPoolCreateFlags::FREE_DESCRIPTOR_SET; if key.update_after_bind { flags |= vk::DescriptorPoolCreateFlags::UPDATE_AFTER_BIND;