diff --git a/src/video_core/texture_cache/image.cpp b/src/video_core/texture_cache/image.cpp index b464f3d7..727e89e4 100644 --- a/src/video_core/texture_cache/image.cpp +++ b/src/video_core/texture_cache/image.cpp @@ -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; } } diff --git a/src/video_core/texture_cache/image.h b/src/video_core/texture_cache/image.h index 1b577046..5ba68726 100644 --- a/src/video_core/texture_cache/image.h +++ b/src/video_core/texture_cache/image.h @@ -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;