vulkan: correctly set INDEPENDENT_BLEND,make runable on Android 8.x

This commit is contained in:
Jinlei Li authored and Dzmitry Malyshau committed 2022-02-22 15:45:05 -05:00
1 parent 01628a1fad
commit 7f3c6f7019
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -2313,7 +2313,7 @@ impl<A: HalApi> Device<A> {
.any(|ct| ct.write_mask != first.write_mask || ct.blend != first.blend)
} {
log::info!("Color targets: {:?}", color_targets);
self.require_downlevel_flags(wgt::DownlevelFlags::INDEPENDENT_BLENDING)?;
self.require_downlevel_flags(wgt::DownlevelFlags::INDEPENDENT_BLEND)?;
}
let mut io = validation::StageIo::default();
+1 -1
View File
@@ -275,7 +275,7 @@ impl super::Adapter {
// as we emulate the `start_instance`. But we can't deal with negatives...
downlevel_flags.set(wgt::DownlevelFlags::BASE_VERTEX, ver >= (3, 2));
downlevel_flags.set(
wgt::DownlevelFlags::INDEPENDENT_BLENDING,
wgt::DownlevelFlags::INDEPENDENT_BLEND,
ver >= (3, 2) || extensions.contains("GL_EXT_draw_buffers_indexed"),
);
downlevel_flags.set(
+2 -1
View File
@@ -103,7 +103,7 @@ impl PhysicalDeviceFeatures {
// Features is a bitfield so we need to map everything manually
core: vk::PhysicalDeviceFeatures::builder()
.robust_buffer_access(private_caps.robust_buffer_access)
.independent_blend(true)
.independent_blend(downlevel_flags.contains(wgt::DownlevelFlags::INDEPENDENT_BLEND))
.sample_rate_shading(
downlevel_flags.contains(wgt::DownlevelFlags::MULTISAMPLED_SHADING),
)
@@ -358,6 +358,7 @@ impl PhysicalDeviceFeatures {
self.core.fragment_stores_and_atomics != 0,
);
dl_flags.set(Df::MULTISAMPLED_SHADING, self.core.sample_rate_shading != 0);
dl_flags.set(Df::INDEPENDENT_BLEND, self.core.independent_blend != 0);
features.set(
F::INDIRECT_FIRST_INSTANCE,
+2 -3
View File
@@ -901,12 +901,11 @@ bitflags::bitflags! {
const CUBE_ARRAY_TEXTURES = 1 << 7;
/// Supports comparison samplers.
const COMPARISON_SAMPLERS = 1 << 8;
/// Supports different blending modes per color target.
const INDEPENDENT_BLENDING = 1 << 9;
/// Supports different blend operations per color attachment.
const INDEPENDENT_BLEND = 1 << 9;
/// Supports storage buffers in vertex shaders.
const VERTEX_STORAGE = 1 << 10;
/// Supports samplers with anisotropic filtering. Note this isn't actually required by
/// WebGPU, the implementation is allowed to completely ignore aniso clamp. This flag is
/// here for native backends so they can comunicate to the user of aniso is enabled.