Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

astc: Call std::vector::reserve on texelWeightValues to avoid reallocating

ReinUsesLisp8412a20f0055
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index eb93b44bd1..5c65844ddd 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -1538,6 +1538,8 @@ static void DecompressBlock(const u8 inBuf[16], const u32 blockWidth, const u32
memset(texelWeightData + clearByteStart, 0, 16 - clearByteStart);
std::vector<IntegerEncodedValue> texelWeightValues;
+ texelWeightValues.reserve(64);
+
InputBitStream weightStream(texelWeightData);
DecodeIntegerSequence(texelWeightValues, weightStream, weightParams.m_MaxWeight,