Skip to content

Commit

Permalink
Merge pull request #18557 from GermanAizek/reserve-add
Browse files Browse the repository at this point in the history
Using reserve in different places PPSSPP
  • Loading branch information
hrydgard committed Dec 15, 2023
2 parents 41bbc83 + 0748ce6 commit bbcaeb9
Show file tree
Hide file tree
Showing 35 changed files with 59 additions and 7 deletions.
1 change: 1 addition & 0 deletions Common/File/VFS/ZipFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ bool ZipFileReader::GetFileListing(const char *orig_path, std::vector<File::File

INFO_LOG(SYSTEM, "Listing %s", orig_path);

listing->reserve(directories.size() + files.size());
for (auto diter = directories.begin(); diter != directories.end(); ++diter) {
File::FileInfo info;
info.name = *diter;
Expand Down
2 changes: 2 additions & 0 deletions Common/GPU/D3D11/thin3d_d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ InputLayout *D3D11DrawContext::CreateInputLayout(const InputLayoutDesc &desc) {
inputLayout->desc = desc;

// Translate to D3D11 elements;
inputLayout->elements.reserve(desc.attributes.size());
for (size_t i = 0; i < desc.attributes.size(); i++) {
D3D11_INPUT_ELEMENT_DESC el;
el.AlignedByteOffset = desc.attributes[i].offset;
Expand Down Expand Up @@ -1142,6 +1143,7 @@ Pipeline *D3D11DrawContext::CreateGraphicsPipeline(const PipelineDesc &desc, con

std::vector<D3D11ShaderModule *> shaders;
D3D11ShaderModule *vshader = nullptr;
shaders.reserve(desc.shaders.size());
for (auto iter : desc.shaders) {
iter->AddRef();

Expand Down
1 change: 1 addition & 0 deletions Common/GPU/GPUBackendCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ static std::set<GPUMemoryManager *> g_pushBuffers;
std::vector<GPUMemoryManager *> GetActiveGPUMemoryManagers() {
std::vector<GPUMemoryManager *> buffers;
std::lock_guard<std::mutex> guard(g_pushBufferListMutex);
buffers.reserve(g_pushBuffers.size());
for (auto iter : g_pushBuffers) {
buffers.push_back(iter);
}
Expand Down
8 changes: 6 additions & 2 deletions Common/GPU/OpenGL/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,12 @@ bool OpenGLPipeline::LinkShaders(const PipelineDesc &desc) {
std::vector<GLRProgram::UniformLocQuery> queries;
int samplersToCheck;
if (!samplers_.is_empty()) {
for (int i = 0; i < (int)std::min((const uint32_t)samplers_.size(), MAX_TEXTURE_SLOTS); i++) {
int size = std::min((const uint32_t)samplers_.size(), MAX_TEXTURE_SLOTS);
queries.reserve(size);
for (int i = 0; i < size; i++) {
queries.push_back({ &locs_->samplerLocs_[i], samplers_[i].name, true });
}
samplersToCheck = (int)std::min((const uint32_t)samplers_.size(), MAX_TEXTURE_SLOTS);
samplersToCheck = size;
} else {
queries.push_back({ &locs_->samplerLocs_[0], "sampler0" });
queries.push_back({ &locs_->samplerLocs_[1], "sampler1" });
Expand All @@ -1315,6 +1317,7 @@ bool OpenGLPipeline::LinkShaders(const PipelineDesc &desc) {
}

_assert_(queries.size() <= MAX_TEXTURE_SLOTS);
queries.reserve(dynamicUniforms.uniforms.size());
for (size_t i = 0; i < dynamicUniforms.uniforms.size(); ++i) {
queries.push_back({ &locs_->dynamicUniformLocs_[i], dynamicUniforms.uniforms[i].name });
}
Expand Down Expand Up @@ -1432,6 +1435,7 @@ void OpenGLInputLayout::Compile(const InputLayoutDesc &desc) {
stride = desc.stride;

std::vector<GLRInputLayout::Entry> entries;
entries.reserve(desc.attributes.size());
for (auto &attr : desc.attributes) {
GLRInputLayout::Entry entry;
entry.location = attr.location;
Expand Down
1 change: 1 addition & 0 deletions Common/GPU/Vulkan/VulkanMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static const double PUSH_GARBAGE_COLLECTION_DELAY = 10.0;
VulkanPushPool::VulkanPushPool(VulkanContext *vulkan, const char *name, size_t originalBlockSize, VkBufferUsageFlags usage)
: vulkan_(vulkan), name_(name), originalBlockSize_(originalBlockSize), usage_(usage) {
RegisterGPUMemoryManager(this);
blocks_.reserve(VulkanContext::MAX_INFLIGHT_FRAMES);
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
blocks_.push_back(CreateBlock(originalBlockSize));
blocks_.back().original = true;
Expand Down
2 changes: 2 additions & 0 deletions Common/GPU/Vulkan/VulkanQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ bool VulkanQueueRunner::CreateSwapchain(VkCommandBuffer cmdInit) {
return false;
}

swapchainImages_.reserve(swapchainImageCount_);
for (uint32_t i = 0; i < swapchainImageCount_; i++) {
SwapchainImageData sc_buffer{};
sc_buffer.image = swapchainImages[i];
Expand Down Expand Up @@ -495,6 +496,7 @@ void VulkanQueueRunner::ApplyMGSHack(std::vector<VKRStep *> &steps) {
_assert_(steps[i + copies.size()]->stepType == VKRStepType::RENDER);
// Combine the renders.
for (int j = 1; j < (int)renders.size(); j++) {
steps[i + copies.size()]->commands.reserve(renders[j]->commands.size());
for (int k = 0; k < (int)renders[j]->commands.size(); k++) {
steps[i + copies.size()]->commands.push_back(renders[j]->commands[k]);
}
Expand Down
8 changes: 6 additions & 2 deletions Common/GPU/Vulkan/thin3d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,11 +1550,15 @@ std::vector<std::string> VKContext::GetFeatureList() const {
std::vector<std::string> VKContext::GetExtensionList(bool device, bool enabledOnly) const {
std::vector<std::string> extensions;
if (enabledOnly) {
for (auto &iter : (device ? vulkan_->GetDeviceExtensionsEnabled() : vulkan_->GetInstanceExtensionsEnabled())) {
const auto& enabled = (device ? vulkan_->GetDeviceExtensionsEnabled() : vulkan_->GetInstanceExtensionsEnabled());
extensions.reserve(enabled.size());
for (auto &iter : enabled) {
extensions.push_back(iter);
}
} else {
for (auto &iter : (device ? vulkan_->GetDeviceExtensionsAvailable() : vulkan_->GetInstanceExtensionsAvailable())) {
const auto& available = (device ? vulkan_->GetDeviceExtensionsAvailable() : vulkan_->GetInstanceExtensionsAvailable());
extensions.reserve(available.size());
for (auto &iter : available) {
extensions.push_back(iter.extensionName);
}
}
Expand Down
1 change: 1 addition & 0 deletions Common/Input/InputState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ std::vector<InputMapping> tabRightKeys;
static std::unordered_map<InputDeviceID, int> uiFlipAnalogY;

static void AppendKeys(std::vector<InputMapping> &keys, const std::vector<InputMapping> &newKeys) {
keys.reserve(newKeys.size());
for (auto iter = newKeys.begin(); iter != newKeys.end(); ++iter) {
keys.push_back(*iter);
}
Expand Down
1 change: 1 addition & 0 deletions Common/Render/ManagedTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Draw::Texture *CreateTextureFromTempImage(Draw::DrawContext *draw, const TempIma
desc.mipLevels = generateMips ? potentialLevels : image.numLevels;
desc.generateMips = generateMips && potentialLevels > image.numLevels;
desc.tag = name;
desc.initData.reserve(image.numLevels);
for (int i = 0; i < image.numLevels; i++) {
desc.initData.push_back(image.levels[i]);
}
Expand Down
1 change: 1 addition & 0 deletions Common/UI/IconCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ void IconCache::Decimate(int64_t maxSize) {
};

std::vector<SortEntry> sortEntries;
sortEntries.reserve(cache_.size());
for (auto iter : cache_) {
sortEntries.push_back({ iter.first, iter.second.usedTimeStamp, iter.second.data.size() });
}
Expand Down
1 change: 1 addition & 0 deletions Core/Debugger/DisassemblyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ void DisassemblyFunction::addOpcodeSequence(u32 start, u32 end)
DisassemblyOpcode* opcode = new DisassemblyOpcode(start,(end-start)/4);
std::lock_guard<std::recursive_mutex> guard(lock_);
entries[start] = opcode;
lineAddresses.reserve((end - start) / 4);
for (u32 pos = start; pos < end; pos += 4)
{
lineAddresses.push_back(pos);
Expand Down
1 change: 1 addition & 0 deletions Core/Dialog/PSPGamedataInstallDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace
std::vector<std::string> GetPSPFileList (const std::string &dirpath) {
std::vector<std::string> FileList;
auto Fileinfos = pspFileSystem.GetDirListing(dirpath);
FileList.reserve(Fileinfos.size());

for (auto it = Fileinfos.begin(); it != Fileinfos.end(); ++it) {
std::string info = (*it).name;
Expand Down
1 change: 1 addition & 0 deletions Core/FileLoaders/DiskCachingFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ std::vector<Path> DiskCachingFileLoader::GetCachedPathsInUse() {

// This is on the file loader so that it can manage the caches_.
std::vector<Path> files;
files.reserve(caches_.size());

for (auto it : caches_) {
files.push_back(it.first);
Expand Down
1 change: 1 addition & 0 deletions Core/FileSystems/ISOFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ std::vector<PSPFileInfo> ISOFileSystem::GetDirListing(const std::string &path, b
const std::string dot(".");
const std::string dotdot("..");

myVector.reserve(entry->children.size() - 2);
for (size_t i = 0; i < entry->children.size(); i++) {
TreeEntry *e = entry->children[i];

Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/ARM64/Arm64IRCompSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ void Arm64JitBackend::CompIR_ValidateAddress(IRInst inst) {
ANDI2R(SCRATCH1, SCRATCH1, 0x3FFFFFFF, SCRATCH2);

std::vector<FixupBranch> validJumps;
validJumps.reserve(3);

FixupBranch unaligned;
if (alignment == 2) {
Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/ARM64/Arm64IRJit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ bool Arm64JitBackend::CompileBlock(IRBlock *block, int block_num, bool preload)
regs_.Start(block);

std::vector<const u8 *> addresses;
addresses.reserve(block->GetNumInstructions());
for (int i = 0; i < block->GetNumInstructions(); ++i) {
const IRInst &inst = block->GetInstructions()[i];
regs_.SetIRIndex(i);
Expand Down
2 changes: 2 additions & 0 deletions Core/MIPS/IR/IRJit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,15 @@ JitBlockDebugInfo IRBlockCache::GetBlockDebugInfo(int blockNum) const {
ir.GetRange(start, size);
debugInfo.originalAddress = start; // TODO

debugInfo.origDisasm.reserve(((start + size) - start) / 4);
for (u32 addr = start; addr < start + size; addr += 4) {
char temp[256];
MIPSDisAsm(Memory::Read_Instruction(addr), addr, temp, sizeof(temp), true);
std::string mipsDis = temp;
debugInfo.origDisasm.push_back(mipsDis);
}

debugInfo.irDisasm.reserve(ir.GetNumInstructions());
for (int i = 0; i < ir.GetNumInstructions(); i++) {
IRInst inst = ir.GetInstructions()[i];
char buffer[256];
Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/JitCommon/JitBlockCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ JitBlockDebugInfo JitBlockCache::GetBlockDebugInfo(int blockNum) const {
JitBlockDebugInfo debugInfo{};
const JitBlock *block = GetBlock(blockNum);
debugInfo.originalAddress = block->originalAddress;
debugInfo.origDisasm.reserve(((block->originalAddress + block->originalSize * 4) - block->originalAddress) / 4);
for (u32 addr = block->originalAddress; addr <= block->originalAddress + block->originalSize * 4; addr += 4) {
char temp[256];
MIPSDisAsm(Memory::Read_Instruction(addr), addr, temp, sizeof(temp), true);
Expand Down
2 changes: 2 additions & 0 deletions Core/MIPS/JitCommon/JitCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ std::vector<std::string> DisassembleArm2(const u8 *data, int size) {

char temp[256];
int bkpt_count = 0;
lines.reserve(size / 4);
for (int i = 0; i < size; i += 4) {
const u32 *codePtr = (const u32 *)(data + i);
u32 inst = codePtr[0];
Expand Down Expand Up @@ -196,6 +197,7 @@ std::vector<std::string> DisassembleArm64(const u8 *data, int size) {

char temp[256];
int bkpt_count = 0;
lines.reserve(size / 4);
for (int i = 0; i < size; i += 4) {
const u32 *codePtr = (const u32 *)(data + i);
uint64_t addr = (intptr_t)codePtr;
Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/RiscV/RiscVJit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bool RiscVJitBackend::CompileBlock(IRBlock *block, int block_num, bool preload)
regs_.Start(block);

std::vector<const u8 *> addresses;
addresses.reserve(block->GetNumInstructions());
for (int i = 0; i < block->GetNumInstructions(); ++i) {
const IRInst &inst = block->GetInstructions()[i];
regs_.SetIRIndex(i);
Expand Down
3 changes: 2 additions & 1 deletion Core/MIPS/x86/Jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ void Jit::CheckMemoryBreakpoint(int instructionOffset, MIPSGPReg rs, int offset)
SetJumpTarget(skipCheck);
}
} else {
const auto memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
const auto &memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
bool possible = !memchecks.empty();
if (!possible)
return;
Expand All @@ -908,6 +908,7 @@ void Jit::CheckMemoryBreakpoint(int instructionOffset, MIPSGPReg rs, int offset)
FlushAll();

std::vector<FixupBranch> hitChecks;
hitChecks.reserve(memchecks.size());
for (auto it = memchecks.begin(), end = memchecks.end(); it != end; ++it) {
if (it->end != 0) {
CMP(32, R(RAX), Imm32(it->start - size));
Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/x86/JitSafeMem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ void JitSafeMemFuncs::CreateWriteFunc(int bits, const void *fallbackFunc) {
void JitSafeMemFuncs::CheckDirectEAX() {
// Clear any cache/kernel bits.
AND(32, R(EAX), Imm32(0x3FFFFFFF));
skips_.reserve(3);

CMP(32, R(EAX), Imm32(PSP_GetUserMemoryEnd()));
FixupBranch tooHighRAM = J_CC(CC_AE);
Expand Down
6 changes: 4 additions & 2 deletions Core/MIPS/x86/X64IRCompSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void X64JitBackend::CompIR_Breakpoint(IRInst inst) {
}
bool isWrite = MIPSAnalyst::IsOpMemoryWrite(checkedPC);

const auto memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
const auto &memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
// We can trivially skip if there are no checks for this type (i.e. read vs write.)
if (memchecks.empty())
break;
Expand All @@ -159,7 +159,8 @@ void X64JitBackend::CompIR_Breakpoint(IRInst inst) {
FlushAll();

std::vector<FixupBranch> hitChecks;
for (auto it : memchecks) {
hitChecks.reserve(memchecks.size());
for (const auto &it : memchecks) {
if (it.end != 0) {
CMP(32, R(SCRATCH1), Imm32(it.start - size));
FixupBranch skipNext = J_CC(CC_BE);
Expand Down Expand Up @@ -382,6 +383,7 @@ void X64JitBackend::CompIR_ValidateAddress(IRInst inst) {
AND(32, R(SCRATCH1), Imm32(0x3FFFFFFF));

std::vector<FixupBranch> validJumps;
validJumps.reserve(3);

FixupBranch unaligned;
if (alignment != 1) {
Expand Down
1 change: 1 addition & 0 deletions Core/Util/GameDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ GameDB g_gameDB;

static void SplitCSVLine(const std::string_view str, std::vector<std::string_view> &result) {
result.clear();
result.reserve(str.size() + 1);

int indexCommaToLeftOfColumn = 0;
int indexCommaToRightOfColumn = -1;
Expand Down
1 change: 1 addition & 0 deletions GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ VertexDecoder *DrawEngineCommon::GetVertexDecoder(u32 vtype) {

std::vector<std::string> DrawEngineCommon::DebugGetVertexLoaderIDs() {
std::vector<std::string> ids;
ids.reserve(decoderMap_.size());
decoderMap_.Iterate([&](const uint32_t vtype, VertexDecoder *decoder) {
std::string id;
id.resize(sizeof(vtype));
Expand Down
1 change: 1 addition & 0 deletions GPU/Common/FragmentShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu

std::vector<const char*> extensions;
if (ShaderLanguageIsOpenGL(compat.shaderLanguage)) {
extensions.reserve(4);
if (stencilToAlpha == REPLACE_ALPHA_DUALSOURCE && gl_extensions.EXT_blend_func_extended) {
extensions.push_back("#extension GL_EXT_blend_func_extended : require");
}
Expand Down
2 changes: 2 additions & 0 deletions GPU/Common/GeometryShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ bool GenerateGeometryShader(const GShaderID &id, char *buffer, const ShaderLangu
}

std::vector<VaryingDef> varyings, outVaryings;
varyings.reserve(4);
outVaryings.reserve(4);

if (id.Bit(GS_BIT_DO_TEXTURE)) {
varyings.push_back(VaryingDef{ "vec3", "v_texcoord", Draw::SEM_TEXCOORD0, 0, "highp" });
Expand Down
1 change: 1 addition & 0 deletions GPU/Common/VertexShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
bool highpTexcoord = false;

std::vector<const char*> extensions;
extensions.reserve(6);
if (ShaderLanguageIsOpenGL(compat.shaderLanguage)) {
if (gl_extensions.EXT_gpu_shader4) {
extensions.push_back("#extension GL_EXT_gpu_shader4 : enable");
Expand Down
2 changes: 2 additions & 0 deletions GPU/D3D11/ShaderManagerD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ std::vector<std::string> ShaderManagerD3D11::DebugGetShaderIDs(DebugShaderType t
switch (type) {
case SHADER_TYPE_VERTEX:
{
ids.reserve(vsCache_.size());
for (auto iter : vsCache_) {
iter.first.ToString(&id);
ids.push_back(id);
Expand All @@ -259,6 +260,7 @@ std::vector<std::string> ShaderManagerD3D11::DebugGetShaderIDs(DebugShaderType t
}
case SHADER_TYPE_FRAGMENT:
{
ids.reserve(fsCache_.size());
for (auto iter : fsCache_) {
iter.first.ToString(&id);
ids.push_back(id);
Expand Down
2 changes: 2 additions & 0 deletions GPU/Directx9/ShaderManagerDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ std::vector<std::string> ShaderManagerDX9::DebugGetShaderIDs(DebugShaderType typ
switch (type) {
case SHADER_TYPE_VERTEX:
{
ids.reserve(vsCache_.size());
for (auto iter : vsCache_) {
iter.first.ToString(&id);
ids.push_back(id);
Expand All @@ -675,6 +676,7 @@ std::vector<std::string> ShaderManagerDX9::DebugGetShaderIDs(DebugShaderType typ
break;
case SHADER_TYPE_FRAGMENT:
{
ids.reserve(fsCache_.size());
for (auto iter : fsCache_) {
iter.first.ToString(&id);
ids.push_back(id);
Expand Down
1 change: 1 addition & 0 deletions GPU/GLES/DrawEngineGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void DrawEngineGLES::InitDeviceObjects() {

int stride = sizeof(TransformedVertex);
std::vector<GLRInputLayout::Entry> entries;
entries.reserve(5);
entries.push_back({ ATTR_POSITION, 4, GL_FLOAT, GL_FALSE, offsetof(TransformedVertex, x) });
entries.push_back({ ATTR_TEXCOORD, 3, GL_FLOAT, GL_FALSE, offsetof(TransformedVertex, u) });
entries.push_back({ ATTR_COLOR0, 4, GL_UNSIGNED_BYTE, GL_TRUE, offsetof(TransformedVertex, color0) });
Expand Down
2 changes: 2 additions & 0 deletions GPU/GLES/ShaderManagerGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ std::vector<std::string> ShaderManagerGLES::DebugGetShaderIDs(DebugShaderType ty
switch (type) {
case SHADER_TYPE_VERTEX:
{
ids.reserve(vsCache_.size());
vsCache_.Iterate([&](const VShaderID &id, Shader *shader) {
std::string idstr;
id.ToString(&idstr);
Expand All @@ -924,6 +925,7 @@ std::vector<std::string> ShaderManagerGLES::DebugGetShaderIDs(DebugShaderType ty
break;
case SHADER_TYPE_FRAGMENT:
{
ids.reserve(fsCache_.size());
fsCache_.Iterate([&](const FShaderID &id, Shader *shader) {
std::string idstr;
id.ToString(&idstr);
Expand Down
1 change: 1 addition & 0 deletions GPU/Vulkan/PipelineManagerVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ std::vector<std::string> PipelineManagerVulkan::DebugGetObjectIDs(DebugShaderTyp
switch (type) {
case SHADER_TYPE_PIPELINE:
{
ids.reserve(pipelines_.size());
pipelines_.Iterate([&](const VulkanPipelineKey &key, VulkanPipeline *value) {
std::string id;
key.ToString(&id);
Expand Down
Loading

0 comments on commit bbcaeb9

Please sign in to comment.