diff options
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) { |