vulkan: Handle incompatible depth format using null binding. (#2892)

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
This commit is contained in:
squidbus
2025-05-09 08:43:20 -07:00
committed by GitHub
parent 8e7c5a4d99
commit b130fe6ed5
7 changed files with 55 additions and 17 deletions

View File

@@ -281,6 +281,11 @@ constexpr AmdGpu::Image ImageResource::GetSharp(const Info& info) const noexcept
// Fall back to null image if unbound.
return AmdGpu::Image::Null();
}
const auto data_fmt = image.GetDataFmt();
if (is_depth && data_fmt != AmdGpu::DataFormat::Format16 &&
data_fmt != AmdGpu::DataFormat::Format32) {
return AmdGpu::Image::NullDepth();
}
return image;
}