summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-13 15:15:08 -0400
committerGravatar ameerj2021-06-15 20:19:00 -0400
commitc4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b (patch)
tree1d8b154c9e2ab468af6f867be6fe93a632a50428 /src/video_core/texture_cache
parentMerge pull request #6470 from ameerj/lm-silence (diff)
downloadyuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.gz
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.tar.xz
yuzu-c4ff7ecf511edb8adc2f2d8eff9d51212a87dc6b.zip
textures: Reintroduce CPU ASTC decoder
Users may want to fall back to the CPU ASTC texture decoder due to hangs and crashes that may be caused by keeping the GPU under compute heavy loads for extended periods of time. This is especially the case in games such as Astral Chain which make extensive use of ASTC textures.
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 @@
47#include "video_core/texture_cache/formatter.h" 47#include "video_core/texture_cache/formatter.h"
48#include "video_core/texture_cache/samples_helper.h" 48#include "video_core/texture_cache/samples_helper.h"
49#include "video_core/texture_cache/util.h" 49#include "video_core/texture_cache/util.h"
50#include "video_core/textures/astc.h"
50#include "video_core/textures/decoders.h" 51#include "video_core/textures/decoders.h"
51 52
52namespace VideoCommon { 53namespace VideoCommon {
@@ -884,8 +885,16 @@ void ConvertImage(std::span<const u8> input, const ImageInfo& info, std::span<u8
884 ASSERT(copy.image_extent == mip_size); 885 ASSERT(copy.image_extent == mip_size);
885 ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); 886 ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width));
886 ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); 887 ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height));
887 DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, 888 if (IsPixelFormatASTC(info.format)) {
888 output.subspan(output_offset)); 889 ASSERT(copy.image_extent.depth == 1);
890 Tegra::Texture::ASTC::Decompress(input.subspan(copy.buffer_offset),
891 copy.image_extent.width, copy.image_extent.height,
892 copy.image_subresource.num_layers, tile_size.width,
893 tile_size.height, output.subspan(output_offset));
894 } else {
895 DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent,
896 output.subspan(output_offset));
897 }
889 copy.buffer_offset = output_offset; 898 copy.buffer_offset = output_offset;
890 copy.buffer_row_length = mip_size.width; 899 copy.buffer_row_length = mip_size.width;
891 copy.buffer_image_height = mip_size.height; 900 copy.buffer_image_height = mip_size.height;