Skip to content

Commit 8444fbe

Browse files
authored
vulkan: fix issues querying multiview support (#2934)
1 parent e59c330 commit 8444fbe

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ the same every time it is rendered, we now warn if it is missing.
103103
- `DownlevelCapabilities::default()` now returns the `ANISOTROPIC_FILTERING` flag set to true so DX12 lists `ANISOTROPIC_FILTERING` as true again by @cwfitzgerald in [#2851](https://github.com/gfx-rs/wgpu/pull/2851)
104104
- Properly query format features for UAV/SRV usages of depth formats by @cwfitzgerald in [#2856](https://github.com/gfx-rs/wgpu/pull/2856)
105105

106+
#### Vulkan
107+
- Vulkan 1.0 drivers that support `VK_KHR_multiview` now properly report the `MULTIVIEW` feature as supported by @i509VCB in [#2934](https://github.com/gfx-rs/wgpu/pull/2934).
108+
- Stop using `VkPhysicalDevice11Features` in Vulkan 1.1 which is confusingly provided in Vulkan 1.2 by @i509VCB in [#2934](https://github.com/gfx-rs/wgpu/pull/2934).
109+
106110
#### GLES
107111
- Fix depth stencil texture format capability by @jinleili in [#2854](https://github.com/gfx-rs/wgpu/pull/2854)
108112
- `get_texture_format_features` now only returns usages for formats it actually supports by @cwfitzgerald in [#2856](https://github.com/gfx-rs/wgpu/pull/2856)

wgpu-hal/src/vulkan/adapter.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fn indexing_features() -> wgt::Features {
1515
#[derive(Debug, Default)]
1616
pub struct PhysicalDeviceFeatures {
1717
core: vk::PhysicalDeviceFeatures,
18-
vulkan_1_1: Option<vk::PhysicalDeviceVulkan11Features>,
1918
pub(super) vulkan_1_2: Option<vk::PhysicalDeviceVulkan12Features>,
2019
pub(super) descriptor_indexing: Option<vk::PhysicalDeviceDescriptorIndexingFeaturesEXT>,
2120
imageless_framebuffer: Option<vk::PhysicalDeviceImagelessFramebufferFeaturesKHR>,
@@ -177,15 +176,6 @@ impl PhysicalDeviceFeatures {
177176
//.shader_resource_residency(requested_features.contains(wgt::Features::SHADER_RESOURCE_RESIDENCY))
178177
.geometry_shader(requested_features.contains(wgt::Features::SHADER_PRIMITIVE_INDEX))
179178
.build(),
180-
vulkan_1_1: if api_version >= vk::API_VERSION_1_1 {
181-
Some(
182-
vk::PhysicalDeviceVulkan11Features::builder()
183-
.multiview(requested_features.contains(wgt::Features::MULTIVIEW))
184-
.build(),
185-
)
186-
} else {
187-
None
188-
},
189179
vulkan_1_2: if api_version >= vk::API_VERSION_1_2 {
190180
Some(
191181
vk::PhysicalDeviceVulkan12Features::builder()
@@ -316,7 +306,9 @@ impl PhysicalDeviceFeatures {
316306
} else {
317307
None
318308
},
319-
multiview: if enabled_extensions.contains(&vk::KhrMultiviewFn::name()) {
309+
multiview: if api_version >= vk::API_VERSION_1_1
310+
|| enabled_extensions.contains(&vk::KhrMultiviewFn::name())
311+
{
320312
Some(
321313
vk::PhysicalDeviceMultiviewFeatures::builder()
322314
.multiview(requested_features.contains(wgt::Features::MULTIVIEW))
@@ -451,10 +443,6 @@ impl PhysicalDeviceFeatures {
451443

452444
let intel_windows = caps.properties.vendor_id == db::intel::VENDOR && cfg!(windows);
453445

454-
if let Some(ref vulkan_1_1) = self.vulkan_1_1 {
455-
features.set(F::MULTIVIEW, vulkan_1_1.multiview != 0);
456-
}
457-
458446
if let Some(ref vulkan_1_2) = self.vulkan_1_2 {
459447
const STORAGE: F = F::STORAGE_RESOURCE_BINDING_ARRAY;
460448
if Self::all_features_supported(
@@ -891,10 +879,13 @@ impl super::InstanceShared {
891879
let core = vk::PhysicalDeviceFeatures::default();
892880
let mut builder = vk::PhysicalDeviceFeatures2KHR::builder().features(core);
893881

894-
if capabilities.properties.api_version >= vk::API_VERSION_1_1 {
882+
// `VK_KHR_multiview` is promoted to 1.1
883+
if capabilities.properties.api_version >= vk::API_VERSION_1_1
884+
|| capabilities.supports_extension(vk::KhrMultiviewFn::name())
885+
{
895886
let next = features
896-
.vulkan_1_1
897-
.insert(vk::PhysicalDeviceVulkan11Features::default());
887+
.multiview
888+
.insert(vk::PhysicalDeviceMultiviewFeatures::default());
898889
builder = builder.push_next(next);
899890
}
900891

0 commit comments

Comments
 (0)