Skip to content

Commit

Permalink
Fix Subgroup Ops on VK 1.2 Device (#5624)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored May 14, 2024
1 parent 65d8c94 commit 7078b0a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ for message in compilation_info

By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410)



### New features

#### General
Expand All @@ -78,6 +76,10 @@ By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410)

### Bug Fixes

#### Vulkan

- Fix enablement of subgroup ops extension on Vulkan devices that don't support Vulkan 1.3. By @cwfitzgerald in [#5624](https://github.com/gfx-rs/wgpu/pull/5624).

#### GLES / OpenGL

- Fix regression on OpenGL (EGL) where non-sRGB still used sRGB [#5642](https://github.com/gfx-rs/wgpu/pull/5642)
Expand Down
4 changes: 1 addition & 3 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,6 @@ impl super::Instance {
}),
image_format_list: phd_capabilities.device_api_version >= vk::API_VERSION_1_2
|| phd_capabilities.supports_extension(khr::image_format_list::NAME),
subgroup_size_control: phd_features
.subgroup_size_control
.map_or(false, |ext| ext.subgroup_size_control == vk::TRUE),
};
let capabilities = crate::Capabilities {
limits: phd_capabilities.to_wgpu_limits(),
Expand Down Expand Up @@ -1766,6 +1763,7 @@ impl super::Adapter {
vendor_id: self.phd_capabilities.properties.vendor_id,
timestamp_period: self.phd_capabilities.properties.limits.timestamp_period,
private_caps: self.private_caps.clone(),
features,
workarounds: self.workarounds,
render_passes: Mutex::new(Default::default()),
framebuffers: Mutex::new(Default::default()),
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ impl super::Device {
};

let mut flags = vk::PipelineShaderStageCreateFlags::empty();
if self.shared.private_caps.subgroup_size_control {
if self.shared.features.contains(wgt::Features::SUBGROUP) {
flags |= vk::PipelineShaderStageCreateFlags::ALLOW_VARYING_SUBGROUP_SIZE
}

Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ struct PrivateCapabilities {
robust_image_access2: bool,
zero_initialize_workgroup_memory: bool,
image_format_list: bool,
subgroup_size_control: bool,
}

bitflags::bitflags!(
Expand Down Expand Up @@ -342,6 +341,7 @@ struct DeviceShared {
timestamp_period: f32,
private_caps: PrivateCapabilities,
workarounds: Workarounds,
features: wgt::Features,
render_passes: Mutex<rustc_hash::FxHashMap<RenderPassKey, vk::RenderPass>>,
framebuffers: Mutex<rustc_hash::FxHashMap<FramebufferKey, vk::Framebuffer>>,
}
Expand Down

0 comments on commit 7078b0a

Please sign in to comment.