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 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-19 06:41:16 +02:00
parent 79f78f904b
commit 4992d877c7
4 changed files with 26 additions and 2 deletions
+11
View File
@@ -318,6 +318,17 @@ fn create_descriptor_pool(
})
.collect::<ArrayVec<_, NR_OF_DESCRIPTOR_TYPES>>();
// 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;