summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-13 21:15:08 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-06-16 02:19:00 +0200
commitc4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b (patch)
tree1d8b154c9e2ab468af6f867be6fe93a632a50428 /src/video_core/texture_cache
parentMerge pull request #6470 from ameerj/lm-silence (diff)
downloadyuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.gz
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.bz2
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.lz
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.xz
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.zst
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.zip
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/util.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 906604a39..0d3e0804f 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -47,6 +47,7 @@
#include "video_core/texture_cache/formatter.h"
#include "video_core/texture_cache/samples_helper.h"
#include "video_core/texture_cache/util.h"
+#include "video_core/textures/astc.h"
#include "video_core/textures/decoders.h"
namespace VideoCommon {
@@ -884,8 +885,16 @@ void ConvertImage(std::span<const u8> input, const ImageInfo& info, std::span<u8
ASSERT(copy.image_extent == mip_size);
ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width));
ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height));
- DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent,
- output.subspan(output_offset));
+ if (IsPixelFormatASTC(info.format)) {
+ ASSERT(copy.image_extent.depth == 1);
+ Tegra::Texture::ASTC::Decompress(input.subspan(copy.buffer_offset),
+ copy.image_extent.width, copy.image_extent.height,
+ copy.image_subresource.num_layers, tile_size.width,
+ tile_size.height, output.subspan(output_offset));
+ } else {
+ DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent,
+ output.subspan(output_offset));
+ }
copy.buffer_offset = output_offset;
copy.buffer_row_length = mip_size.width;
copy.buffer_image_height = mip_size.height;