diff options
| author | 2021-03-30 19:31:52 -0300 | |
|---|---|---|
| committer | 2021-03-30 19:31:52 -0300 | |
| commit | 5ee669466fcebd2258229ed6bfe6b5e5529e0200 (patch) | |
| tree | 6dbf84fb5c2c9656f1d1ef6c46b2527ea1a205ff /src/video_core/texture_cache | |
| parent | Merge pull request #6116 from german77/userArgument (diff) | |
| parent | astc_decoder: Refactor for style and more efficient memory use (diff) | |
| download | yuzu-5ee669466fcebd2258229ed6bfe6b5e5529e0200.tar.gz yuzu-5ee669466fcebd2258229ed6bfe6b5e5529e0200.tar.xz yuzu-5ee669466fcebd2258229ed6bfe6b5e5529e0200.zip | |
Merge pull request #5927 from ameerj/astc-compute
video_core: Accelerate ASTC texture decoding using compute shaders
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/accelerated_swizzle.h | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 14 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/video_core/texture_cache/accelerated_swizzle.h b/src/video_core/texture_cache/accelerated_swizzle.h index 6ec5c78c4..a11c924e1 100644 --- a/src/video_core/texture_cache/accelerated_swizzle.h +++ b/src/video_core/texture_cache/accelerated_swizzle.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | namespace VideoCommon::Accelerated { | 13 | namespace VideoCommon::Accelerated { |
| 14 | 14 | ||
| 15 | struct BlockLinearSwizzle2DParams { | 15 | struct BlockLinearSwizzle2DParams { |
| 16 | std::array<u32, 3> origin; | 16 | alignas(16) std::array<u32, 3> origin; |
| 17 | std::array<s32, 3> destination; | 17 | alignas(16) std::array<s32, 3> destination; |
| 18 | u32 bytes_per_block_log2; | 18 | u32 bytes_per_block_log2; |
| 19 | u32 layer_stride; | 19 | u32 layer_stride; |
| 20 | u32 block_size; | 20 | u32 block_size; |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 2c42d1449..c22dd0148 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -47,7 +47,6 @@ | |||
| 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" | ||
| 51 | #include "video_core/textures/decoders.h" | 50 | #include "video_core/textures/decoders.h" |
| 52 | 51 | ||
| 53 | namespace VideoCommon { | 52 | namespace VideoCommon { |
| @@ -879,17 +878,8 @@ void ConvertImage(std::span<const u8> input, const ImageInfo& info, std::span<u8 | |||
| 879 | ASSERT(copy.image_extent == mip_size); | 878 | ASSERT(copy.image_extent == mip_size); |
| 880 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); | 879 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); |
| 881 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); | 880 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); |
| 882 | 881 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, | |
| 883 | if (IsPixelFormatASTC(info.format)) { | 882 | output.subspan(output_offset)); |
| 884 | ASSERT(copy.image_extent.depth == 1); | ||
| 885 | Tegra::Texture::ASTC::Decompress(input.subspan(copy.buffer_offset), | ||
| 886 | copy.image_extent.width, copy.image_extent.height, | ||
| 887 | copy.image_subresource.num_layers, tile_size.width, | ||
| 888 | tile_size.height, output.subspan(output_offset)); | ||
| 889 | } else { | ||
| 890 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, | ||
| 891 | output.subspan(output_offset)); | ||
| 892 | } | ||
| 893 | copy.buffer_offset = output_offset; | 883 | copy.buffer_offset = output_offset; |
| 894 | copy.buffer_row_length = mip_size.width; | 884 | copy.buffer_row_length = mip_size.width; |
| 895 | copy.buffer_image_height = mip_size.height; | 885 | copy.buffer_image_height = mip_size.height; |