Răsfoiți Sursa

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

ReinUsesLisp 6 ani în urmă
părinte
comite
3377b78ea7
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      src/video_core/textures/astc.cpp

+ 2 - 0
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,