mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Add MULTISAMPLED_SHADING downlevel flag (#2425)
* Fix msaa-line example's unnecessary MSAA data store * Add MULTISAMPLED_SHADING downlevel flag
This commit is contained in:
@@ -100,7 +100,9 @@ impl PhysicalDeviceFeatures {
|
||||
core: vk::PhysicalDeviceFeatures::builder()
|
||||
.robust_buffer_access(private_caps.robust_buffer_access)
|
||||
.independent_blend(true)
|
||||
.sample_rate_shading(true)
|
||||
.sample_rate_shading(
|
||||
downlevel_flags.contains(wgt::DownlevelFlags::MULTISAMPLED_SHADING),
|
||||
)
|
||||
.image_cube_array(
|
||||
downlevel_flags.contains(wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES),
|
||||
)
|
||||
@@ -342,6 +344,7 @@ impl PhysicalDeviceFeatures {
|
||||
Df::FRAGMENT_WRITABLE_STORAGE,
|
||||
self.core.fragment_stores_and_atomics != 0,
|
||||
);
|
||||
dl_flags.set(Df::MULTISAMPLED_SHADING, self.core.sample_rate_shading != 0);
|
||||
|
||||
features.set(
|
||||
F::INDIRECT_FIRST_INSTANCE,
|
||||
@@ -929,13 +932,6 @@ impl super::Instance {
|
||||
);
|
||||
return None;
|
||||
}
|
||||
if phd_features.core.sample_rate_shading == 0 {
|
||||
log::warn!(
|
||||
"sample_rate_shading feature is not supported, hiding adapter: {}",
|
||||
info.name
|
||||
);
|
||||
return None;
|
||||
}
|
||||
if !phd_capabilities.supports_extension(vk::AmdNegativeViewportHeightFn::name())
|
||||
&& !phd_capabilities.supports_extension(vk::KhrMaintenance1Fn::name())
|
||||
&& phd_capabilities.properties.api_version < vk::API_VERSION_1_2
|
||||
|
||||
@@ -909,6 +909,9 @@ bitflags::bitflags! {
|
||||
|
||||
/// Supports storage buffers in fragment shaders.
|
||||
const FRAGMENT_STORAGE = 1 << 12;
|
||||
|
||||
/// Supports sample shading and multisample interpolation.
|
||||
const MULTISAMPLED_SHADING = 1 << 13;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user