mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Workaround qcomm resolve attachment bug
This commit is contained in:
committed by
Dzmitry Malyshau
parent
f4bdf5c9a7
commit
d51f70e8a4
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user