diff options
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 13 |
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 | ||
| 52 | namespace VideoCommon { | 53 | namespace 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; |