texture_cache: don't set color attachment usage flag for packed images

This commit is contained in:
psucien 2024-06-15 10:21:07 +02:00
parent fd8ceacef7
commit bdb235716a
2 changed files with 13 additions and 1 deletions

View File

@ -57,6 +57,17 @@ bool ImageInfo::IsBlockCoded() const {
}
}
bool ImageInfo::IsPacked() const {
switch (pixel_format) {
case vk::Format::eB5G5R5A1UnormPack16:
[[fallthrough]];
case vk::Format::eB5G6R5UnormPack16:
return true;
default:
return false;
}
}
bool ImageInfo::IsDepthStencil() const {
switch (pixel_format) {
case vk::Format::eD16Unorm:
@ -76,7 +87,7 @@ static vk::ImageUsageFlags ImageUsageFlags(const ImageInfo& info) {
if (info.IsDepthStencil()) {
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
} else {
if (!info.IsBlockCoded()) {
if (!info.IsBlockCoded() && !info.IsPacked()) {
usage |= vk::ImageUsageFlagBits::eColorAttachment;
}
}

View File

@ -43,6 +43,7 @@ struct ImageInfo {
explicit ImageInfo(const AmdGpu::Image& image) noexcept;
bool IsBlockCoded() const;
bool IsPacked() const;
bool IsDepthStencil() const;
bool is_tiled = false;