From ace20ba4a4774ae3c42f2ef5566c7113f3b980b3 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Sat, 19 Jun 2021 10:56:13 -0400 Subject: astc_decoder.comp: Remove unnecessary LUT SSBOs We can move them to instead be compile time constants within the shader. --- src/video_core/textures/astc.cpp | 8 ++++---- src/video_core/textures/astc.h | 9 +-------- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/video_core/textures') diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index b6e2022f2..7b756ba41 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp @@ -269,7 +269,7 @@ static void DecodeQuintBlock(InputBitStream& bits, IntegerEncodedVector& result, static void DecodeIntegerSequence(IntegerEncodedVector& result, InputBitStream& bits, u32 maxRange, u32 nValues) { // Determine encoding parameters - IntegerEncodedValue val = EncodingsValues[maxRange]; + IntegerEncodedValue val = ASTC_ENCODINGS_VALUES[maxRange]; // Start decoding u32 nValsDecoded = 0; @@ -310,7 +310,7 @@ struct TexelWeightParams { nIdxs *= 2; } - return EncodingsValues[m_MaxWeight].GetBitLength(nIdxs); + return ASTC_ENCODINGS_VALUES[m_MaxWeight].GetBitLength(nIdxs); } u32 GetNumWeightValues() const { @@ -755,12 +755,12 @@ static void DecodeColorValues(u32* out, std::span data, const u32* modes, co // figure out the max value for each of them... u32 range = 256; while (--range > 0) { - IntegerEncodedValue val = EncodingsValues[range]; + IntegerEncodedValue val = ASTC_ENCODINGS_VALUES[range]; u32 bitLength = val.GetBitLength(nValues); if (bitLength <= nBitsForColorData) { // Find the smallest possible range that matches the given encoding while (--range > 0) { - IntegerEncodedValue newval = EncodingsValues[range]; + IntegerEncodedValue newval = ASTC_ENCODINGS_VALUES[range]; if (!newval.MatchesEncoding(val)) { break; } diff --git a/src/video_core/textures/astc.h b/src/video_core/textures/astc.h index 441e8eb04..0229ae122 100644 --- a/src/video_core/textures/astc.h +++ b/src/video_core/textures/astc.h @@ -77,7 +77,7 @@ constexpr std::array MakeEncodedValues() { return encodings; } -constexpr std::array EncodingsValues = MakeEncodedValues(); +constexpr std::array ASTC_ENCODINGS_VALUES = MakeEncodedValues(); // Replicates low num_bits such that [(to_bit - 1):(to_bit - 1 - from_bit)] // is the same as [(num_bits - 1):0] and repeats all the way down. @@ -120,13 +120,6 @@ constexpr auto REPLICATE_6_BIT_TO_8_TABLE = MakeReplicateTable(); constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable(); constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable(); -struct AstcBufferData { - decltype(EncodingsValues) encoding_values = EncodingsValues; - decltype(REPLICATE_6_BIT_TO_8_TABLE) replicate_6_to_8 = REPLICATE_6_BIT_TO_8_TABLE; - decltype(REPLICATE_7_BIT_TO_8_TABLE) replicate_7_to_8 = REPLICATE_7_BIT_TO_8_TABLE; - decltype(REPLICATE_8_BIT_TO_8_TABLE) replicate_8_to_8 = REPLICATE_8_BIT_TO_8_TABLE; -} constexpr ASTC_BUFFER_DATA; - void Decompress(std::span data, uint32_t width, uint32_t height, uint32_t depth, uint32_t block_width, uint32_t block_height, std::span output); -- cgit v1.2.3