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:
Generated
-2
@@ -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",
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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`).
|
||||
|
||||
+11
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user