浏览代码

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

ReinUsesLisp 6 年之前
父节点
当前提交
134f3ff9b4
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/video_core/textures/astc.cpp

+ 2 - 0
src/video_core/textures/astc.cpp

@@ -811,6 +811,8 @@ static void DecodeColorValues(u32* out, u8* data, const u32* modes, const u32 nP
 
 
     // We now have enough to decode our s32eger sequence.
     // We now have enough to decode our s32eger sequence.
     std::vector<IntegerEncodedValue> decodedColorValues;
     std::vector<IntegerEncodedValue> decodedColorValues;
+    decodedColorValues.reserve(32);
+
     InputBitStream colorStream(data);
     InputBitStream colorStream(data);
     DecodeIntegerSequence(decodedColorValues, colorStream, range, nValues);
     DecodeIntegerSequence(decodedColorValues, colorStream, range, nValues);