Workaround qcomm resolve attachment bug

This commit is contained in:
Connor Fitzgerald
2021-12-06 13:21:49 -05:00
committed by Dzmitry Malyshau
parent f4bdf5c9a7
commit d51f70e8a4
3 changed files with 16 additions and 0 deletions

View File

@@ -881,6 +881,10 @@ impl super::Instance {
== db::intel::DEVICE_SKY_LAKE_MASK);
// TODO: only enable for particular devices
workarounds |= super::Workarounds::SEPARATE_ENTRY_POINTS;
workarounds.set(
super::Workarounds::EMPTY_RESOLVE_ATTACHMENT_LISTS,
phd_capabilities.properties.vendor_id == db::qualcomm::VENDOR,
);
};
if phd_capabilities.properties.api_version == vk::API_VERSION_1_0

View File

@@ -136,6 +136,15 @@ impl super::DeviceShared {
.pipeline_bind_point(vk::PipelineBindPoint::GRAPHICS)
.color_attachments(&color_refs)
.resolve_attachments(&resolve_refs);
if self
.workarounds
.contains(super::Workarounds::EMPTY_RESOLVE_ATTACHMENT_LISTS)
&& resolve_refs.is_empty()
{
vk_subpass.p_resolve_attachments = ptr::null();
}
if let Some(ref reference) = ds_ref {
vk_subpass = vk_subpass.depth_stencil_attachment(reference)
}

View File

@@ -172,6 +172,9 @@ bitflags::bitflags!(
pub struct Workarounds: u32 {
/// Only generate SPIR-V for one entry point at a time.
const SEPARATE_ENTRY_POINTS = 0x1;
/// Qualcomm OOMs when there are zero color attachments but a non-null pointer
/// to a subpass resolve attachment array. This nulls out that pointer in that case.
const EMPTY_RESOLVE_ATTACHMENT_LISTS = 0x2;
}
);