Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VK_EXT_robustness2 only when not using an outdated intel iGPU driver #4602

Merged
merged 11 commits into from
Dec 7, 2023
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ Bottom level categories:

## Unreleased

### Bug Fixes

#### Vulkan
- Use `VK_EXT_robustness2` only when not using an outdated intel iGPU driver. By @TheoDulka in [#4602](https://github.com/gfx-rs/wgpu/pull/4602).

For naga changelogs at or before v0.14.0. See [naga's changelog](naga/CHANGELOG.md).

## v0.18.0 (2023-10-25)
Expand All @@ -57,7 +62,7 @@ By @Zoxc in [#4248](https://github.com/gfx-rs/wgpu/pull/4248)
Timestamp queries are now supported on both Metal and Desktop OpenGL. On Apple chips on Metal, they only support timestamp queries in command buffers or in the renderpass descriptor,
they do not support them inside a pass.

Metal: By @Wumpf in [#4008](https://github.com/gfx-rs/wgpu/pull/4008)
Metal: By @Wumpf in [#4008](https://github.com/gfx-rs/wgpu/pull/4008)
OpenGL: By @Zoxc in [#4267](https://github.com/gfx-rs/wgpu/pull/4267)

### Render/Compute Pass Query Writes
Expand Down Expand Up @@ -180,7 +185,7 @@ let instance = wgpu::Instance::new(InstanceDescriptor {
});
```

`gles_minor_version`: By @PJB3005 in [#3998](https://github.com/gfx-rs/wgpu/pull/3998)
`gles_minor_version`: By @PJB3005 in [#3998](https://github.com/gfx-rs/wgpu/pull/3998)
`flags`: By @nical in [#4230](https://github.com/gfx-rs/wgpu/pull/4230)

### Many New Examples!
Expand Down Expand Up @@ -226,7 +231,7 @@ By @teoxoy in [#4185](https://github.com/gfx-rs/wgpu/pull/4185)
- Add trace-level logging for most entry points in wgpu-core By @nical in [4183](https://github.com/gfx-rs/wgpu/pull/4183)
- Add `Rgb10a2Uint` format. By @teoxoy in [4199](https://github.com/gfx-rs/wgpu/pull/4199)
- Validate that resources are used on the right device. By @nical in [4207](https://github.com/gfx-rs/wgpu/pull/4207)
- Expose instance flags.
- Expose instance flags.
- Add support for the bgra8unorm-storage feature. By @jinleili and @nical in [#4228](https://github.com/gfx-rs/wgpu/pull/4228)
- Calls to lost devices now return `DeviceError::Lost` instead of `DeviceError::Invalid`. By @bradwerth in [#4238]([https://github.com/gfx-rs/wgpu/pull/4238])
- Let the `"strict_asserts"` feature enable check that wgpu-core's lock-ordering tokens are unique per thread. By @jimblandy in [#4258]([https://github.com/gfx-rs/wgpu/pull/4258])
Expand Down
31 changes: 30 additions & 1 deletion wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,9 @@ impl super::InstanceShared {
.insert(vk::PhysicalDeviceImageRobustnessFeaturesEXT::default());
builder = builder.push_next(next);
}
if capabilities.supports_extension(vk::ExtRobustness2Fn::name()) {
if !is_intel_igpu_outdated_for_robustness2(capabilities.properties, capabilities.driver)
&& capabilities.supports_extension(vk::ExtRobustness2Fn::name())
TheoDulka marked this conversation as resolved.
Show resolved Hide resolved
{
let next = features
.robustness2
.insert(vk::PhysicalDeviceRobustness2FeaturesEXT::default());
Expand Down Expand Up @@ -1778,3 +1780,30 @@ fn supports_bgra8unorm_storage(
&& features3.contains(vk::FormatFeatureFlags2::STORAGE_WRITE_WITHOUT_FORMAT)
}
}

// For https://github.com/gfx-rs/wgpu/issues/4599
// Intel iGPUs with outdated drivers can break rendering if `VK_EXT_robustness2` is used.
// Driver version 31.0.101.2115 works, but there's probably an earlier functional version.
fn is_intel_igpu_outdated_for_robustness2(
props: vk::PhysicalDeviceProperties,
driver: Option<vk::PhysicalDeviceDriverPropertiesKHR>,
) -> bool {
use crate::auxil::cstr_from_bytes_until_nul;

const DRIVER_VERSION_31_0_101: u32 = 0x194000;
const DRIVER_VERSION_WORKING: u32 = DRIVER_VERSION_31_0_101 + 2115;
TheoDulka marked this conversation as resolved.
Show resolved Hide resolved

let is_outdated = props.vendor_id == crate::auxil::db::intel::VENDOR
&& props.device_type == vk::PhysicalDeviceType::INTEGRATED_GPU
&& props.driver_version < DRIVER_VERSION_WORKING
&& cstr_from_bytes_until_nul(&driver.unwrap_or_default().driver_info)
.unwrap_or_default()
.to_str()
.unwrap_or_default()
== "Intel driver";
TheoDulka marked this conversation as resolved.
Show resolved Hide resolved

if is_outdated {
log::trace!("Disabling robustBufferAccess2 and robustImageAccess2: IntegratedGpu Intel Driver is outdated. Found with version 0x{:X} less than 0x{:X}, the known good driver (31.0.101.2115)", props.driver_version, DRIVER_VERSION_WORKING);
}
is_outdated
}
Loading