diff options
| author | 2021-02-13 16:49:24 -0500 | |
|---|---|---|
| committer | 2021-03-13 12:16:03 -0500 | |
| commit | 20eb368e147e1c27f05d6923c51596f8dfe24e89 (patch) | |
| tree | a8b1c8eb79eb55e189a10dfd43b8b6bb1449220f /src/video_core/textures/decoders.cpp | |
| parent | host_shaders: Modify shader cmake integration to allow for larger shaders (diff) | |
| download | yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.gz yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.xz yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.zip | |
renderer_vulkan: Accelerate ASTC decoding
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 62685a183..3a463d5db 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -17,26 +17,7 @@ | |||
| 17 | #include "video_core/textures/texture.h" | 17 | #include "video_core/textures/texture.h" |
| 18 | 18 | ||
| 19 | namespace Tegra::Texture { | 19 | namespace Tegra::Texture { |
| 20 | |||
| 21 | namespace { | 20 | namespace { |
| 22 | /** | ||
| 23 | * This table represents the internal swizzle of a gob, in format 16 bytes x 2 sector packing. | ||
| 24 | * Calculates the offset of an (x, y) position within a swizzled texture. | ||
| 25 | * Taken from the Tegra X1 Technical Reference Manual. pages 1187-1188 | ||
| 26 | */ | ||
| 27 | constexpr SwizzleTable MakeSwizzleTableConst() { | ||
| 28 | SwizzleTable table{}; | ||
| 29 | for (u32 y = 0; y < table.size(); ++y) { | ||
| 30 | for (u32 x = 0; x < table[0].size(); ++x) { | ||
| 31 | table[y][x] = ((x % 64) / 32) * 256 + ((y % 8) / 2) * 64 + ((x % 32) / 16) * 32 + | ||
| 32 | (y % 2) * 16 + (x % 16); | ||
| 33 | } | ||
| 34 | } | ||
| 35 | return table; | ||
| 36 | } | ||
| 37 | |||
| 38 | constexpr SwizzleTable SWIZZLE_TABLE = MakeSwizzleTableConst(); | ||
| 39 | |||
| 40 | template <bool TO_LINEAR> | 21 | template <bool TO_LINEAR> |
| 41 | void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixel, u32 width, | 22 | void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixel, u32 width, |
| 42 | u32 height, u32 depth, u32 block_height, u32 block_depth, u32 stride_alignment) { | 23 | u32 height, u32 depth, u32 block_height, u32 block_depth, u32 stride_alignment) { |
| @@ -91,10 +72,6 @@ void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixe | |||
| 91 | } | 72 | } |
| 92 | } // Anonymous namespace | 73 | } // Anonymous namespace |
| 93 | 74 | ||
| 94 | SwizzleTable MakeSwizzleTable() { | ||
| 95 | return SWIZZLE_TABLE; | ||
| 96 | } | ||
| 97 | |||
| 98 | void UnswizzleTexture(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixel, | 75 | void UnswizzleTexture(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixel, |
| 99 | u32 width, u32 height, u32 depth, u32 block_height, u32 block_depth, | 76 | u32 width, u32 height, u32 depth, u32 block_height, u32 block_depth, |
| 100 | u32 stride_alignment) { | 77 | u32 stride_alignment) { |