diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 6908bac28..38f9e92b6 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -413,7 +413,7 @@ void CaptureContext::AddFakeProfileMarkers() DrawFlags drawFlags = DrawFlags::Copy | DrawFlags::Resolve | DrawFlags::SetMarker | DrawFlags::CmdList; - for(int i = 1; i < draws.count; i++) + for(int32_t i = 1; i < draws.count(); i++) { if(draws[refdraw].flags & drawFlags) { @@ -490,7 +490,7 @@ void CaptureContext::AddFakeProfileMarkers() .toUtf8() .data(); - mark.children.create(end - start + 1); + mark.children.resize(end - start + 1); for(int j = start; j <= end; j++) { @@ -504,16 +504,13 @@ void CaptureContext::AddFakeProfileMarkers() refdraw = i; } - if(start < draws.count) + if(start < draws.count()) { - for(int j = start; j < draws.count; j++) + for(int j = start; j < draws.count(); j++) ret.push_back(draws[j]); } - m_Drawcalls.clear(); - m_Drawcalls.create(ret.count()); - for(int i = 0; i < ret.count(); i++) - m_Drawcalls[i] = ret[i]; + m_Drawcalls = ret; } void CaptureContext::CloseLogfile() @@ -588,7 +585,7 @@ void CaptureContext::SetEventID(const QVector &exclude, uint32_t s void CaptureContext::AddMessages(const rdctype::array &msgs) { - m_UnreadMessageCount += msgs.count; + m_UnreadMessageCount += msgs.count(); for(const DebugMessage &msg : msgs) m_DebugMessages.push_back(msg); diff --git a/qrenderdoc/Code/FormatElement.cpp b/qrenderdoc/Code/FormatElement.cpp index 1f957c5db..7205ce025 100644 --- a/qrenderdoc/Code/FormatElement.cpp +++ b/qrenderdoc/Code/FormatElement.cpp @@ -822,12 +822,12 @@ uint32_t FormatElement::byteSize() const QString TypeString(const ShaderVariable &v) { - if(v.members.count > 0 || v.isStruct) + if(!v.members.isEmpty() || v.isStruct) { if(v.isStruct) return lit("struct"); else - return QFormatStr("%1[%2]").arg(TypeString(v.members[0])).arg(v.members.count); + return QFormatStr("%1[%2]").arg(TypeString(v.members[0])).arg(v.members.count()); } QString typeStr = ToQStr(v.type); @@ -888,7 +888,7 @@ QString RowString(const ShaderVariable &v, uint32_t row, VarType type) QString VarString(const ShaderVariable &v) { - if(v.members.count > 0) + if(!v.members.isEmpty()) return QString(); if(v.rows == 1) @@ -907,7 +907,7 @@ QString VarString(const ShaderVariable &v) QString RowTypeString(const ShaderVariable &v) { - if(v.members.count > 0 || v.isStruct) + if(!v.members.isEmpty() || v.isStruct) { if(v.isStruct) return lit("struct"); diff --git a/qrenderdoc/Code/Interface/CommonPipelineState.cpp b/qrenderdoc/Code/Interface/CommonPipelineState.cpp index 3f6498434..28a127927 100644 --- a/qrenderdoc/Code/Interface/CommonPipelineState.cpp +++ b/qrenderdoc/Code/Interface/CommonPipelineState.cpp @@ -194,28 +194,28 @@ Viewport CommonPipelineState::GetViewport(int index) if(LogLoaded()) { - if(IsLogD3D11() && index < m_D3D11->m_RS.Viewports.count) + if(IsLogD3D11() && index < m_D3D11->m_RS.Viewports.count()) { ret.x = m_D3D11->m_RS.Viewports[index].X; ret.y = m_D3D11->m_RS.Viewports[index].Y; ret.width = m_D3D11->m_RS.Viewports[index].Width; ret.height = m_D3D11->m_RS.Viewports[index].Height; } - else if(IsLogD3D12() && index < m_D3D12->m_RS.Viewports.count) + else if(IsLogD3D12() && index < m_D3D12->m_RS.Viewports.count()) { ret.x = m_D3D12->m_RS.Viewports[index].X; ret.y = m_D3D12->m_RS.Viewports[index].Y; ret.width = m_D3D12->m_RS.Viewports[index].Width; ret.height = m_D3D12->m_RS.Viewports[index].Height; } - else if(IsLogGL() && index < m_GL->m_Rasterizer.Viewports.count) + else if(IsLogGL() && index < m_GL->m_Rasterizer.Viewports.count()) { ret.x = m_GL->m_Rasterizer.Viewports[index].Left; ret.y = m_GL->m_Rasterizer.Viewports[index].Bottom; ret.width = m_GL->m_Rasterizer.Viewports[index].Width; ret.height = m_GL->m_Rasterizer.Viewports[index].Height; } - else if(IsLogVK() && index < m_Vulkan->VP.viewportScissors.count) + else if(IsLogVK() && index < m_Vulkan->VP.viewportScissors.count()) { ret.x = m_Vulkan->VP.viewportScissors[index].vp.x; ret.y = m_Vulkan->VP.viewportScissors[index].vp.y; @@ -610,8 +610,8 @@ QVector CommonPipelineState::GetVBuffers() { if(IsLogD3D11()) { - ret.resize(m_D3D11->m_IA.vbuffers.count); - for(int i = 0; i < m_D3D11->m_IA.vbuffers.count; i++) + ret.resize(m_D3D11->m_IA.vbuffers.count()); + for(int i = 0; i < m_D3D11->m_IA.vbuffers.count(); i++) { ret[i].Buffer = m_D3D11->m_IA.vbuffers[i].Buffer; ret[i].ByteOffset = m_D3D11->m_IA.vbuffers[i].Offset; @@ -620,8 +620,8 @@ QVector CommonPipelineState::GetVBuffers() } else if(IsLogD3D12()) { - ret.resize(m_D3D12->m_IA.vbuffers.count); - for(int i = 0; i < m_D3D12->m_IA.vbuffers.count; i++) + ret.resize(m_D3D12->m_IA.vbuffers.count()); + for(int i = 0; i < m_D3D12->m_IA.vbuffers.count(); i++) { ret[i].Buffer = m_D3D12->m_IA.vbuffers[i].Buffer; ret[i].ByteOffset = m_D3D12->m_IA.vbuffers[i].Offset; @@ -630,8 +630,8 @@ QVector CommonPipelineState::GetVBuffers() } else if(IsLogGL()) { - ret.resize(m_GL->m_VtxIn.vbuffers.count); - for(int i = 0; i < m_GL->m_VtxIn.vbuffers.count; i++) + ret.resize(m_GL->m_VtxIn.vbuffers.count()); + for(int i = 0; i < m_GL->m_VtxIn.vbuffers.count(); i++) { ret[i].Buffer = m_GL->m_VtxIn.vbuffers[i].Buffer; ret[i].ByteOffset = m_GL->m_VtxIn.vbuffers[i].Offset; @@ -640,12 +640,12 @@ QVector CommonPipelineState::GetVBuffers() } else if(IsLogVK()) { - ret.resize(m_Vulkan->VI.binds.count); - for(int i = 0; i < m_Vulkan->VI.binds.count; i++) + ret.resize(m_Vulkan->VI.binds.count()); + for(int i = 0; i < m_Vulkan->VI.binds.count(); i++) { ret[i].Buffer = - i < m_Vulkan->VI.vbuffers.count ? m_Vulkan->VI.vbuffers[i].buffer : ResourceId(); - ret[i].ByteOffset = i < m_Vulkan->VI.vbuffers.count ? m_Vulkan->VI.vbuffers[i].offset : 0; + i < m_Vulkan->VI.vbuffers.count() ? m_Vulkan->VI.vbuffers[i].buffer : ResourceId(); + ret[i].ByteOffset = i < m_Vulkan->VI.vbuffers.count() ? m_Vulkan->VI.vbuffers[i].offset : 0; ret[i].ByteStride = m_Vulkan->VI.binds[i].bytestride; } } @@ -664,13 +664,13 @@ QVector CommonPipelineState::GetVertexInputs() auto &layouts = m_D3D11->m_IA.layouts; - QVector ret(layouts.count); - for(int i = 0; i < layouts.count; i++) + QVector ret(layouts.count()); + for(int i = 0; i < layouts.count(); i++) { QString semName = layouts[i].SemanticName; bool needsSemanticIdx = false; - for(int j = 0; j < layouts.count; j++) + for(int j = 0; j < layouts.count(); j++) { if(i != j && !semName.compare(layouts[j].SemanticName, Qt::CaseInsensitive)) { @@ -701,7 +701,7 @@ QVector CommonPipelineState::GetVertexInputs() if(m_D3D11->m_IA.Bytecode != NULL) { rdctype::array &sig = m_D3D11->m_IA.Bytecode->InputSig; - for(int ia = 0; ia < sig.count; ia++) + for(int ia = 0; ia < sig.count(); ia++) { if(!semName.compare(sig[ia].semanticName, Qt::CaseInsensitive) && sig[ia].semanticIndex == layouts[i].SemanticIndex) @@ -721,13 +721,13 @@ QVector CommonPipelineState::GetVertexInputs() auto &layouts = m_D3D12->m_IA.layouts; - QVector ret(layouts.count); - for(int i = 0; i < layouts.count; i++) + QVector ret(layouts.count()); + for(int i = 0; i < layouts.count(); i++) { QString semName = layouts[i].SemanticName; bool needsSemanticIdx = false; - for(int j = 0; j < layouts.count; j++) + for(int j = 0; j < layouts.count(); j++) { if(i != j && !semName.compare(layouts[j].SemanticName, Qt::CaseInsensitive)) { @@ -758,7 +758,7 @@ QVector CommonPipelineState::GetVertexInputs() if(m_D3D12->m_VS.ShaderDetails != NULL) { rdctype::array &sig = m_D3D12->m_VS.ShaderDetails->InputSig; - for(int ia = 0; ia < sig.count; ia++) + for(int ia = 0; ia < sig.count(); ia++) { if(!semName.compare(sig[ia].semanticName, Qt::CaseInsensitive) && sig[ia].semanticIndex == layouts[i].SemanticIndex) @@ -777,7 +777,7 @@ QVector CommonPipelineState::GetVertexInputs() auto &attrs = m_GL->m_VtxIn.attributes; int num = 0; - for(int i = 0; i < attrs.count; i++) + for(int i = 0; i < attrs.count(); i++) { int attrib = -1; if(m_GL->m_VS.ShaderDetails != NULL) @@ -790,8 +790,8 @@ QVector CommonPipelineState::GetVertexInputs() } int a = 0; - QVector ret(attrs.count); - for(int i = 0; i < attrs.count && a < num; i++) + QVector ret(attrs.count()); + for(int i = 0; i < attrs.count() && a < num; i++) { ret[a].Name = lit("attr%1").arg(i); memset(&ret[a].GenericValue, 0, sizeof(PixelValue)); @@ -806,7 +806,7 @@ QVector CommonPipelineState::GetVertexInputs() { int attrib = m_GL->m_VS.BindpointMapping.InputAttributes[i]; - if(attrib >= 0 && attrib < m_GL->m_VS.ShaderDetails->InputSig.count) + if(attrib >= 0 && attrib < m_GL->m_VS.ShaderDetails->InputSig.count()) ret[a].Name = m_GL->m_VS.ShaderDetails->InputSig[attrib].varName; if(attrib == -1) @@ -851,12 +851,12 @@ QVector CommonPipelineState::GetVertexInputs() auto &attrs = m_Vulkan->VI.attrs; int num = 0; - for(int i = 0; i < attrs.count; i++) + for(int i = 0; i < attrs.count(); i++) { int attrib = -1; if(m_Vulkan->m_VS.ShaderDetails != NULL) { - if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count) + if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count()) attrib = m_Vulkan->m_VS.BindpointMapping.InputAttributes[attrs[i].location]; } else @@ -868,14 +868,14 @@ QVector CommonPipelineState::GetVertexInputs() int a = 0; QVector ret(num); - for(int i = 0; i < attrs.count && a < num; i++) + for(int i = 0; i < attrs.count() && a < num; i++) { ret[a].Name = lit("attr%1").arg(i); memset(&ret[a].GenericValue, 0, sizeof(PixelValue)); ret[a].VertexBuffer = (int)attrs[i].binding; ret[a].RelativeByteOffset = attrs[i].byteoffset; ret[a].PerInstance = false; - if(attrs[i].binding < (uint32_t)m_Vulkan->VI.binds.count) + if(attrs[i].binding < (uint32_t)m_Vulkan->VI.binds.count()) ret[a].PerInstance = m_Vulkan->VI.binds[attrs[i].binding].perInstance; ret[a].InstanceRate = 1; ret[a].Format = attrs[i].format; @@ -885,10 +885,10 @@ QVector CommonPipelineState::GetVertexInputs() { int attrib = -1; - if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count) + if(attrs[i].location < (uint32_t)m_Vulkan->m_VS.BindpointMapping.InputAttributes.count()) attrib = m_Vulkan->m_VS.BindpointMapping.InputAttributes[attrs[i].location]; - if(attrib >= 0 && attrib < m_Vulkan->m_VS.ShaderDetails->InputSig.count) + if(attrib >= 0 && attrib < m_Vulkan->m_VS.ShaderDetails->InputSig.count()) ret[a].Name = m_Vulkan->m_VS.ShaderDetails->InputSig[attrib].varName; if(attrib == -1) @@ -918,12 +918,12 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t { const D3D11Pipe::Shader &s = GetD3D11Stage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count) + if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) { const BindpointMap &bind = s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; - if(bind.bind >= s.ConstantBuffers.count) + if(bind.bind >= s.ConstantBuffers.count()) return BoundCBuffer(); const D3D11Pipe::CBuffer &descriptor = s.ConstantBuffers[bind.bind]; @@ -937,12 +937,13 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count) + if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) { const BindpointMap &bind = s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; - if(bind.bindset >= s.Spaces.count || bind.bind >= s.Spaces[bind.bindset].ConstantBuffers.count) + if(bind.bindset >= s.Spaces.count() || + bind.bind >= s.Spaces[bind.bindset].ConstantBuffers.count()) return BoundCBuffer(); const D3D12Pipe::CBuffer &descriptor = s.Spaces[bind.bindset].ConstantBuffers[bind.bind]; @@ -956,13 +957,13 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t { const GLPipe::Shader &s = GetGLStage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count) + if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) { if(s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint >= 0) { int uboIdx = s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint].bind; - if(uboIdx >= 0 && uboIdx < m_GL->UniformBuffers.count) + if(uboIdx >= 0 && uboIdx < m_GL->UniformBuffers.count()) { const GLPipe::Buffer &b = m_GL->UniformBuffers[uboIdx]; @@ -979,7 +980,7 @@ BoundCBuffer CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t stage == ShaderStage::Compute ? m_Vulkan->compute : m_Vulkan->graphics; const VKPipe::Shader &s = GetVulkanStage(stage); - if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count) + if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count()) { const BindpointMap &bind = s.BindpointMapping.ConstantBlocks[s.ShaderDetails->ConstantBlocks[BufIdx].bindPoint]; @@ -1020,7 +1021,7 @@ QMap> CommonPipelineState::GetReadOnlyResou { const D3D11Pipe::Shader &s = GetD3D11Stage(stage); - for(int i = 0; i < s.SRVs.count; i++) + for(int i = 0; i < s.SRVs.count(); i++) { BindpointMap key(0, i); BoundResource val; @@ -1039,9 +1040,9 @@ QMap> CommonPipelineState::GetReadOnlyResou { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - for(int space = 0; space < s.Spaces.count; space++) + for(int space = 0; space < s.Spaces.count(); space++) { - for(int reg = 0; reg < s.Spaces[space].SRVs.count; reg++) + for(int reg = 0; reg < s.Spaces[space].SRVs.count(); reg++) { const D3D12Pipe::View &bind = s.Spaces[space].SRVs[reg]; BindpointMap key(space, reg); @@ -1065,7 +1066,7 @@ QMap> CommonPipelineState::GetReadOnlyResou } else if(IsLogGL()) { - for(int i = 0; i < m_GL->Textures.count; i++) + for(int i = 0; i < m_GL->Textures.count(); i++) { BindpointMap key(0, i); BoundResource val; @@ -1087,10 +1088,10 @@ QMap> CommonPipelineState::GetReadOnlyResou ShaderStageMask mask = MaskForStage(stage); - for(int set = 0; set < descsets.count; set++) + for(int set = 0; set < descsets.count(); set++) { const auto &descset = descsets[set]; - for(int slot = 0; slot < descset.bindings.count; slot++) + for(int slot = 0; slot < descset.bindings.count(); slot++) { const auto &bind = descset.bindings[slot]; if((bind.type == BindType::ImageSampler || bind.type == BindType::InputAttachment || @@ -1130,7 +1131,7 @@ QMap> CommonPipelineState::GetReadWriteReso { if(stage == ShaderStage::Compute) { - for(int i = 0; i < m_D3D11->m_CS.UAVs.count; i++) + for(int i = 0; i < m_D3D11->m_CS.UAVs.count(); i++) { BindpointMap key(0, i); BoundResource val; @@ -1156,7 +1157,7 @@ QMap> CommonPipelineState::GetReadWriteReso ret[key] = {val}; } - for(int i = 0; i < m_D3D11->m_OM.UAVs.count - uavstart; i++) + for(int i = 0; i < m_D3D11->m_OM.UAVs.count() - uavstart; i++) { BindpointMap key(0, i + uavstart); BoundResource val; @@ -1174,9 +1175,9 @@ QMap> CommonPipelineState::GetReadWriteReso { const D3D12Pipe::Shader &s = GetD3D12Stage(stage); - for(int space = 0; space < s.Spaces.count; space++) + for(int space = 0; space < s.Spaces.count(); space++) { - for(int reg = 0; reg < s.Spaces[space].UAVs.count; reg++) + for(int reg = 0; reg < s.Spaces[space].UAVs.count(); reg++) { const D3D12Pipe::View &bind = s.Spaces[space].UAVs[reg]; BindpointMap key(space, reg); @@ -1198,7 +1199,7 @@ QMap> CommonPipelineState::GetReadWriteReso } else if(IsLogGL()) { - for(int i = 0; i < m_GL->Images.count; i++) + for(int i = 0; i < m_GL->Images.count(); i++) { BindpointMap key(0, i); BoundResource val; @@ -1218,10 +1219,10 @@ QMap> CommonPipelineState::GetReadWriteReso ShaderStageMask mask = MaskForStage(stage); - for(int set = 0; set < descsets.count; set++) + for(int set = 0; set < descsets.count(); set++) { const auto &descset = descsets[set]; - for(int slot = 0; slot < descset.bindings.count; slot++) + for(int slot = 0; slot < descset.bindings.count(); slot++) { const auto &bind = descset.bindings[slot]; if((bind.type == BindType::ReadWriteBuffer || bind.type == BindType::ReadWriteImage || @@ -1285,7 +1286,7 @@ BoundResource CommonPipelineState::GetDepthTarget() const auto &rp = m_Vulkan->Pass.renderpass; const auto &fb = m_Vulkan->Pass.framebuffer; - if(rp.depthstencilAttachment >= 0 && rp.depthstencilAttachment < fb.attachments.count) + if(rp.depthstencilAttachment >= 0 && rp.depthstencilAttachment < fb.attachments.count()) { BoundResource ret; ret.Id = fb.attachments[rp.depthstencilAttachment].img; @@ -1310,8 +1311,8 @@ QVector CommonPipelineState::GetOutputTargets() { if(IsLogD3D11()) { - ret.resize(m_D3D11->m_OM.RenderTargets.count); - for(int i = 0; i < m_D3D11->m_OM.RenderTargets.count; i++) + ret.resize(m_D3D11->m_OM.RenderTargets.count()); + for(int i = 0; i < m_D3D11->m_OM.RenderTargets.count(); i++) { ret[i].Id = m_D3D11->m_OM.RenderTargets[i].Resource; ret[i].HighestMip = (int)m_D3D11->m_OM.RenderTargets[i].HighestMip; @@ -1321,8 +1322,8 @@ QVector CommonPipelineState::GetOutputTargets() } else if(IsLogD3D12()) { - ret.resize(m_D3D12->m_OM.RenderTargets.count); - for(int i = 0; i < m_D3D12->m_OM.RenderTargets.count; i++) + ret.resize(m_D3D12->m_OM.RenderTargets.count()); + for(int i = 0; i < m_D3D12->m_OM.RenderTargets.count(); i++) { ret[i].Id = m_D3D12->m_OM.RenderTargets[i].Resource; ret[i].HighestMip = (int)m_D3D12->m_OM.RenderTargets[i].HighestMip; @@ -1332,8 +1333,8 @@ QVector CommonPipelineState::GetOutputTargets() } else if(IsLogGL()) { - ret.resize(m_GL->m_FB.m_DrawFBO.DrawBuffers.count); - for(int i = 0; i < m_GL->m_FB.m_DrawFBO.DrawBuffers.count; i++) + ret.resize(m_GL->m_FB.m_DrawFBO.DrawBuffers.count()); + for(int i = 0; i < m_GL->m_FB.m_DrawFBO.DrawBuffers.count(); i++) { int db = m_GL->m_FB.m_DrawFBO.DrawBuffers[i]; @@ -1353,10 +1354,10 @@ QVector CommonPipelineState::GetOutputTargets() int idx = 0; - ret.resize(rp.colorAttachments.count + rp.resolveAttachments.count); - for(int i = 0; i < rp.colorAttachments.count; i++) + ret.resize(rp.colorAttachments.count() + rp.resolveAttachments.count()); + for(int i = 0; i < rp.colorAttachments.count(); i++) { - if(rp.colorAttachments[i] < (uint32_t)fb.attachments.count) + if(rp.colorAttachments[i] < (uint32_t)fb.attachments.count()) { ret[idx].Id = fb.attachments[rp.colorAttachments[i]].img; ret[idx].HighestMip = (int)fb.attachments[rp.colorAttachments[i]].baseMip; @@ -1367,9 +1368,9 @@ QVector CommonPipelineState::GetOutputTargets() idx++; } - for(int i = 0; i < rp.resolveAttachments.count; i++) + for(int i = 0; i < rp.resolveAttachments.count(); i++) { - if(rp.resolveAttachments[i] < (uint32_t)fb.attachments.count) + if(rp.resolveAttachments[i] < (uint32_t)fb.attachments.count()) { ret[idx].Id = fb.attachments[rp.resolveAttachments[i]].img; ret[idx].HighestMip = (int)fb.attachments[rp.resolveAttachments[i]].baseMip; diff --git a/qrenderdoc/Code/pyrenderdoc/pyconversion.h b/qrenderdoc/Code/pyrenderdoc/pyconversion.h index 30b040a1d..1a617362b 100644 --- a/qrenderdoc/Code/pyrenderdoc/pyconversion.h +++ b/qrenderdoc/Code/pyrenderdoc/pyconversion.h @@ -387,8 +387,8 @@ struct TypeConversion, false> Py_ssize_t len = PyBytes_Size(in); - out.create((int)len); - memcpy(&out[0], PyBytes_AsString(in), out.count); + out.resize((size_t)len); + memcpy(out.data(), PyBytes_AsString(in), out.size()); return SWIG_OK; } @@ -406,7 +406,7 @@ struct TypeConversion, false> static PyObject *ConvertToPy(const rdctype::array &in, int *failIdx) { - return PyBytes_FromStringAndSize((const char *)in.elems, (Py_ssize_t)in.count); + return PyBytes_FromStringAndSize((const char *)in.data(), (Py_ssize_t)in.size()); } static PyObject *ConvertToPy(const rdctype::array &in) { return ConvertToPy(in, NULL); } @@ -423,11 +423,11 @@ struct TypeConversion, false> if(!PyList_Check(in)) return SWIG_TypeError; - out.create((int)PyList_Size(in)); + out.resize((size_t)PyList_Size(in)); - for(int i = 0; i < out.count; i++) + for(int i = 0; i < out.count(); i++) { - int ret = TypeConversion::ConvertFromPy(PyList_GetItem(in, i), out.elems[i]); + int ret = TypeConversion::ConvertFromPy(PyList_GetItem(in, i), out[i]); if(!SWIG_IsOK(ret)) { if(failIdx) @@ -445,9 +445,9 @@ struct TypeConversion, false> } static PyObject *ConvertToPyInPlace(PyObject *list, const rdctype::array &in, int *failIdx) { - for(int i = 0; i < in.count; i++) + for(int i = 0; i < in.count(); i++) { - PyObject *elem = TypeConversion::ConvertToPy(in.elems[i]); + PyObject *elem = TypeConversion::ConvertToPy(in[i]); if(elem) { @@ -515,10 +515,7 @@ struct TypeConversion if(ret == 0) { - out.count = (int)size; - out.elems = (char *)out.allocate(size + 1); - memcpy(out.elems, buf, size); - out.elems[size] = 0; + out.assign(buf, size); Py_DecRef(bytes); @@ -544,7 +541,7 @@ struct TypeConversion static PyObject *ConvertToPy(const rdctype::str &in) { - return PyUnicode_FromStringAndSize(in.elems, in.count); + return PyUnicode_FromStringAndSize(in.c_str(), in.size()); } }; diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index 077cc76b3..7cc83b4b0 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -77,6 +77,26 @@ FIXED_ARRAY_TYPEMAPS(uint16_t) } // ignore some operators SWIG doesn't have to worry about +// ignore array members +%ignore rdctype::array::array; +%ignore rdctype::array::begin; +%ignore rdctype::array::end; +%ignore rdctype::array::front; +%ignore rdctype::array::back; +%ignore rdctype::array::data; +%ignore rdctype::array::assign; +%ignore rdctype::array::insert; +%ignore rdctype::array::erase; +%ignore rdctype::array::count; +%ignore rdctype::array::capacity; +%ignore rdctype::array::size; +%ignore rdctype::array::byteSize; +%ignore rdctype::array::empty; +%ignore rdctype::array::isEmpty; +%ignore rdctype::array::resize; +%ignore rdctype::array::reserve; +%ignore rdctype::array::swap; +%ignore rdctype::array::push_back; %ignore rdctype::array::operator=; %ignore rdctype::array::operator[]; %ignore rdctype::str::operator=; diff --git a/qrenderdoc/Windows/APIInspector.cpp b/qrenderdoc/Windows/APIInspector.cpp index d9375b83c..79fed2086 100644 --- a/qrenderdoc/Windows/APIInspector.cpp +++ b/qrenderdoc/Windows/APIInspector.cpp @@ -78,7 +78,7 @@ void APIInspector::addCallstack(rdctype::array calls) ui->callstack->setUpdatesEnabled(false); ui->callstack->clear(); - if(calls.count == 1 && calls[0].count == 0) + if(calls.size() == 1 && calls[0].isEmpty()) { ui->callstack->addItem(tr("Symbols not loaded. Tools -> Resolve Symbols.")); } @@ -99,7 +99,7 @@ void APIInspector::on_apiEvents_itemSelectionChanged() APIEvent ev = node->tag().value(); - if(ev.callstack.count > 0) + if(!ev.callstack.isEmpty()) { m_Ctx.Replay().AsyncInvoke([this, ev](IReplayController *r) { rdctype::array trace = r->GetResolve(ev.callstack); @@ -126,7 +126,7 @@ void APIInspector::fillAPIView() const DrawcallDescription *draw = m_Ctx.CurSelectedDrawcall(); - if(draw != NULL && draw->events.count > 0) + if(draw != NULL && !draw->events.isEmpty()) { for(const APIEvent &ev : draw->events) { diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index e753b783e..d09e5e3e5 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1434,9 +1434,9 @@ void BufferViewer::OnEventChanged(uint32_t eventID) data = r->GetTextureData(m_BufferID, m_TexArrayIdx, m_TexMip); } - buf->data = new byte[data.count]; - memcpy(buf->data, data.elems, data.count); - buf->end = buf->data + data.count; + buf->data = new byte[data.size()]; + memcpy(buf->data, data.data(), data.size()); + buf->end = buf->data + data.size(); } GUIInvoke::call([this, buf, vsinHoriz, vsoutHoriz, gsoutHoriz] { @@ -1516,7 +1516,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) if(m_ModelVSIn->indices) m_ModelVSIn->indices->deref(); m_ModelVSIn->indices = new BufferData(); - if(draw && draw->indexByteWidth != 0 && idata.count != 0) + if(draw && draw->indexByteWidth != 0 && !idata.isEmpty()) { indices = new uint32_t[draw->numIndices]; m_ModelVSIn->indices->data = (byte *)indices; @@ -1527,19 +1527,19 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) if(draw) maxIndex = qMax(1U, draw->numIndices) - 1; - if(draw && idata.count > 0) + if(draw && !idata.isEmpty()) { maxIndex = 0; if(draw->indexByteWidth == 1) { uint8_t primRestart = m_ModelVSIn->primRestart & 0xff; - for(size_t i = 0; i < (size_t)idata.count && (uint32_t)i < draw->numIndices; i++) + for(size_t i = 0; i < idata.size() && (uint32_t)i < draw->numIndices; i++) { - if(primRestart && idata.elems[i] == primRestart) + if(primRestart && idata[i] == primRestart) continue; - indices[i] = (uint32_t)idata.elems[i]; + indices[i] = (uint32_t)idata[i]; maxIndex = qMax(maxIndex, indices[i]); } } @@ -1547,11 +1547,10 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) { uint16_t primRestart = m_ModelVSIn->primRestart & 0xffff; - uint16_t *src = (uint16_t *)idata.elems; - for(size_t i = 0; - i < (size_t)idata.count / sizeof(uint16_t) && (uint32_t)i < draw->numIndices; i++) + uint16_t *src = (uint16_t *)idata.data(); + for(size_t i = 0; i < idata.size() / sizeof(uint16_t) && (uint32_t)i < draw->numIndices; i++) { - if(primRestart && idata.elems[i] == primRestart) + if(primRestart && idata[i] == primRestart) continue; indices[i] = (uint32_t)src[i]; @@ -1562,11 +1561,11 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) { uint16_t primRestart = m_ModelVSIn->primRestart; - memcpy(indices, idata.elems, qMin((size_t)idata.count, draw->numIndices * sizeof(uint32_t))); + memcpy(indices, idata.data(), qMin(idata.size(), draw->numIndices * sizeof(uint32_t))); for(uint32_t i = 0; i < draw->numIndices; i++) { - if(primRestart && idata.elems[i] == primRestart) + if(primRestart && idata[i] == primRestart) continue; maxIndex = qMax(maxIndex, indices[i]); @@ -1625,9 +1624,9 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) rdctype::array bufdata = r->GetBufferData( vb.Buffer, vb.ByteOffset + offset * vb.ByteStride, (maxIdx + 1) * vb.ByteStride); - buf->data = new byte[bufdata.count]; - memcpy(buf->data, bufdata.elems, bufdata.count); - buf->end = buf->data + bufdata.count; + buf->data = new byte[bufdata.size()]; + memcpy(buf->data, bufdata.data(), bufdata.size()); + buf->end = buf->data + bufdata.size(); buf->stride = vb.ByteStride; } // ref passes to model @@ -1654,7 +1653,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) m_ModelVSOut->displayIndices->ref(); m_ModelVSOut->indices = new BufferData(); - if(draw && draw->indexByteWidth != 0 && idata.count != 0) + if(draw && draw->indexByteWidth != 0 && !idata.isEmpty()) { indices = new uint32_t[draw->numIndices]; m_ModelVSOut->indices->data = (byte *)indices; @@ -1662,19 +1661,18 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) if(draw->indexByteWidth == 1) { - for(size_t i = 0; i < (size_t)idata.count && (uint32_t)i < draw->numIndices; i++) - indices[i] = (uint32_t)idata.elems[i]; + for(size_t i = 0; i < idata.size() && (uint32_t)i < draw->numIndices; i++) + indices[i] = (uint32_t)idata[i]; } else if(draw->indexByteWidth == 2) { - uint16_t *src = (uint16_t *)idata.elems; - for(size_t i = 0; - i < (size_t)idata.count / sizeof(uint16_t) && (uint32_t)i < draw->numIndices; i++) + uint16_t *src = (uint16_t *)idata.data(); + for(size_t i = 0; i < idata.size() / sizeof(uint16_t) && (uint32_t)i < draw->numIndices; i++) indices[i] = (uint32_t)src[i]; } else if(draw->indexByteWidth == 4) { - memcpy(indices, idata.elems, qMin((size_t)idata.count, draw->numIndices * sizeof(uint32_t))); + memcpy(indices, idata.data(), qMin(idata.size(), draw->numIndices * sizeof(uint32_t))); } } } @@ -1684,9 +1682,9 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) BufferData *postvs = new BufferData; rdctype::array bufdata = r->GetBufferData(m_PostVS.buf, m_PostVS.offset, 0); - postvs->data = new byte[bufdata.count]; - memcpy(postvs->data, bufdata.elems, bufdata.count); - postvs->end = postvs->data + bufdata.count; + postvs->data = new byte[bufdata.size()]; + memcpy(postvs->data, bufdata.data(), bufdata.size()); + postvs->end = postvs->data + bufdata.size(); postvs->stride = m_PostVS.stride; // ref passes to model @@ -1705,9 +1703,9 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r) BufferData *postgs = new BufferData; rdctype::array bufdata = r->GetBufferData(m_PostGS.buf, m_PostGS.offset, 0); - postgs->data = new byte[bufdata.count]; - memcpy(postgs->data, bufdata.elems, bufdata.count); - postgs->end = postgs->data + bufdata.count; + postgs->data = new byte[bufdata.size()]; + memcpy(postgs->data, bufdata.data(), bufdata.size()); + postgs->end = postgs->data + bufdata.size(); postgs->stride = m_PostGS.stride; // ref passes to model @@ -2222,7 +2220,7 @@ void BufferViewer::configureMeshColumns() if(draw && vs) { - m_ModelVSOut->columns.reserve(vs->OutputSig.count); + m_ModelVSOut->columns.reserve(vs->OutputSig.count()); int i = 0, posidx = -1; for(const SigParameter &sig : vs->OutputSig) @@ -2230,7 +2228,7 @@ void BufferViewer::configureMeshColumns() FormatElement f; f.buffer = 0; - f.name = sig.varName.count > 0 ? sig.varName : sig.semanticIdxName; + f.name = !sig.varName.isEmpty() ? sig.varName : sig.semanticIdxName; f.format.compByteWidth = sizeof(float); f.format.compCount = sig.compCount; f.format.compType = sig.compType; @@ -2289,7 +2287,7 @@ void BufferViewer::configureMeshColumns() if(last) { - m_ModelGSOut->columns.reserve(last->OutputSig.count); + m_ModelGSOut->columns.reserve(last->OutputSig.count()); int i = 0, posidx = -1; for(const SigParameter &sig : last->OutputSig) @@ -2297,7 +2295,7 @@ void BufferViewer::configureMeshColumns() FormatElement f; f.buffer = 0; - f.name = sig.varName.count > 0 ? sig.varName : sig.semanticIdxName; + f.name = !sig.varName.isEmpty() ? sig.varName : sig.semanticIdxName; f.format.compByteWidth = sizeof(float); f.format.compCount = sig.compCount; f.format.compType = sig.compType; @@ -3049,7 +3047,7 @@ void BufferViewer::debugVertex() r->DebugVertex(vertid, m_Config.curInstance, index, m_Ctx.CurDrawcall()->instanceOffset, m_Ctx.CurDrawcall()->vertexOffset); - if(trace->states.count == 0) + if(trace->states.isEmpty()) { r->FreeTrace(trace); diff --git a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp index a0361faed..800c3c7a9 100644 --- a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp +++ b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp @@ -117,7 +117,7 @@ void ConstantBufferPreviewer::OnEventChanged(uint32_t eventID) updateLabels(); - if(reflection == NULL || reflection->ConstantBlocks.count <= (int)m_slot) + if(reflection == NULL || m_slot >= reflection->ConstantBlocks.size()) { setVariables({}); return; @@ -241,7 +241,7 @@ void ConstantBufferPreviewer::addVariables(RDTreeWidgetItem *root, {QFormatStr("%1.row%2").arg(v.name).arg(i), RowString(v, i), RowTypeString(v)})); } - if(v.members.count > 0) + if(!v.members.isEmpty()) addVariables(n, v.members); } } @@ -251,10 +251,10 @@ bool ConstantBufferPreviewer::updateVariables(RDTreeWidgetItem *root, const rdctype::array &newVars) { // mismatched child count? can't update - if(prevVars.count != newVars.count) + if(prevVars.size() != newVars.size()) return false; - for(int i = 0; i < prevVars.count; i++) + for(int i = 0; i < prevVars.count(); i++) { const ShaderVariable &a = prevVars[i]; const ShaderVariable &b = newVars[i]; @@ -279,7 +279,7 @@ bool ConstantBufferPreviewer::updateVariables(RDTreeWidgetItem *root, node->child(r)->setText(1, RowString(b, r)); } - if(a.members.count > 0) + if(!a.members.isEmpty()) { // recurse to update child members. This handles a and b having different number of variables bool updated = updateVariables(node, a.members, b.members); @@ -316,7 +316,7 @@ void ConstantBufferPreviewer::setVariables(const rdctype::array ui->saveCSV->setEnabled(false); - if(vars.count > 0) + if(!vars.isEmpty()) { addVariables(ui->variables->invisibleRootItem(), vars); ui->saveCSV->setEnabled(true); @@ -343,8 +343,8 @@ void ConstantBufferPreviewer::updateLabels() if(reflection != NULL) { - if(needName && (int)m_slot < reflection->ConstantBlocks.count && - reflection->ConstantBlocks[m_slot].name.count > 0) + if(needName && m_slot < reflection->ConstantBlocks.size() && + !reflection->ConstantBlocks[m_slot].name.isEmpty()) bufName = QFormatStr("<%1>").arg(reflection->ConstantBlocks[m_slot].name); } diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 6a548c081..ba535d66b 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -311,7 +311,7 @@ void CaptureDialog::vulkanLayerWarn_mouseClick() if(hasOtherJSON) { - if(otherJSONs.count > 1) + if(otherJSONs.size() > 1) msg += tr("there are other RenderDoc builds registered already. They must be disabled so that " "capture can happen without nasty clashes."); diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp index 4bb470752..f58a6744a 100644 --- a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp +++ b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp @@ -900,7 +900,7 @@ void LiveCapture::captureAdded(uint32_t ID, const QString &executable, const QSt log->name = executable; log->api = api; log->timestamp = timestamp; - log->thumb = QImage(thumbnail.elems, thumbWidth, thumbHeight, QImage::Format_RGB888) + log->thumb = QImage(thumbnail.data(), thumbWidth, thumbHeight, QImage::Format_RGB888) .copy(0, 0, thumbWidth, thumbHeight); log->saved = false; log->path = path; diff --git a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp index 57e84cefd..0066cf0ee 100644 --- a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp @@ -66,7 +66,7 @@ public: // NT paths Renderer.ListFolder(lit("/"), true, [this, homeDir](const rdctype::str &path, const rdctype::array &files) { - for(int i = 0; i < files.count; i++) + for(int i = 0; i < files.count(); i++) { FSNode *node = new FSNode(); node->parent = NULL; @@ -452,14 +452,14 @@ private: Renderer.ListFolder(makePath(node), true, [this, node](const rdctype::str &path, const rdctype::array &files) { - if(files.count == 1 && (files[0].flags & PathProperty::ErrorAccessDenied)) + if(files.count() == 1 && (files[0].flags & PathProperty::ErrorAccessDenied)) { node->file.flags |= PathProperty::ErrorAccessDenied; return; } QVector sortedFiles; - sortedFiles.reserve(files.count); + sortedFiles.reserve(files.count()); for(const PathEntry &f : files) sortedFiles.push_back(f); diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index 2ddfa88e7..abc3de5f0 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -228,7 +228,7 @@ QPair EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent, { uint lastEID = 0, lastDraw = 0; - for(int32_t i = 0; i < draws.count; i++) + for(int32_t i = 0; i < draws.count(); i++) { const DrawcallDescription &d = draws[i]; @@ -250,7 +250,7 @@ QPair EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent, lastEID = d.eventID; lastDraw = d.drawcallID; - if((draws[i].flags & DrawFlags::SetMarker) && i + 1 < draws.count) + if((draws[i].flags & DrawFlags::SetMarker) && i + 1 < draws.count()) lastEID = draws[i + 1].eventID; } diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.cpp b/qrenderdoc/Windows/PerformanceCounterViewer.cpp index 3dc4111b7..cfea0e210 100644 --- a/qrenderdoc/Windows/PerformanceCounterViewer.cpp +++ b/qrenderdoc/Windows/PerformanceCounterViewer.cpp @@ -189,7 +189,7 @@ void PerformanceCounterViewer::CaptureCounters() bool done = false; m_Ctx.Replay().AsyncInvoke([this, &done](IReplayController *controller) -> void { rdctype::array counters; - counters.create(m_SelectedCounters.size()); + counters.resize(m_SelectedCounters.size()); QMap counterDescriptions; diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index bcc5e4e32..104a5c714 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -864,14 +864,14 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL vs = resources->verticalScrollBar()->value(); resources->beginUpdate(); resources->clear(); - for(int i = 0; i < stage.SRVs.count; i++) + for(int i = 0; i < stage.SRVs.count(); i++) { const ShaderResource *shaderInput = NULL; const BindpointMap *map = NULL; if(shaderDetails) { - for(int b = 0; b < shaderDetails->ReadOnlyResources.count; b++) + for(int b = 0; b < shaderDetails->ReadOnlyResources.count(); b++) { const ShaderResource &res = shaderDetails->ReadOnlyResources[b]; const BindpointMap &bind = mapping.ReadOnlyResources[b]; @@ -894,7 +894,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL vs = samplers->verticalScrollBar()->value(); samplers->beginUpdate(); samplers->clear(); - for(int i = 0; i < stage.Samplers.count; i++) + for(int i = 0; i < stage.Samplers.count(); i++) { const D3D11Pipe::Sampler &s = stage.Samplers[i]; @@ -903,7 +903,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL if(shaderDetails) { - for(int b = 0; b < shaderDetails->Samplers.count; b++) + for(int b = 0; b < shaderDetails->Samplers.count(); b++) { const ShaderSampler &res = shaderDetails->Samplers[b]; const BindpointMap &bind = mapping.Samplers[b]; @@ -1001,7 +1001,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL vs = cbuffers->verticalScrollBar()->value(); cbuffers->beginUpdate(); cbuffers->clear(); - for(int i = 0; i < stage.ConstantBuffers.count; i++) + for(int i = 0; i < stage.ConstantBuffers.count(); i++) { const D3D11Pipe::CBuffer &b = stage.ConstantBuffers[i]; @@ -1010,7 +1010,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL if(shaderDetails) { - for(int cb = 0; cb < shaderDetails->ConstantBlocks.count; cb++) + for(int cb = 0; cb < shaderDetails->ConstantBlocks.count(); cb++) { const ConstantBlock &cbuf = shaderDetails->ConstantBlocks[cb]; const BindpointMap &bind = mapping.ConstantBlocks[cb]; @@ -1031,7 +1031,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL { QString name = tr("Constant Buffer %1").arg(ToQStr(b.Buffer)); ulong length = 1; - int numvars = shaderCBuf ? shaderCBuf->variables.count : 0; + int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; if(!filledSlot) @@ -1085,11 +1085,11 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL vs = classes->verticalScrollBar()->value(); classes->beginUpdate(); classes->clear(); - for(int i = 0; i < stage.ClassInstances.count; i++) + for(int i = 0; i < stage.ClassInstances.count(); i++) { QString interfaceName = lit("Interface %1").arg(i); - if(shaderDetails && i < shaderDetails->Interfaces.count) + if(shaderDetails && i < shaderDetails->Interfaces.count()) interfaceName = shaderDetails->Interfaces[i]; classes->addTopLevelItem(new RDTreeWidgetItem({i, interfaceName, stage.ClassInstances[i]})); @@ -1141,9 +1141,9 @@ void D3D11PipelineStateViewer::setState() QString mismatchDetails; // VS wants more elements - if(state.m_IA.Bytecode->InputSig.count < state.m_VS.ShaderDetails->InputSig.count) + if(state.m_IA.Bytecode->InputSig.count() < state.m_VS.ShaderDetails->InputSig.count()) { - int excess = state.m_VS.ShaderDetails->InputSig.count - state.m_IA.Bytecode->InputSig.count; + int excess = state.m_VS.ShaderDetails->InputSig.count() - state.m_IA.Bytecode->InputSig.count(); bool allSystem = true; @@ -1151,7 +1151,7 @@ void D3D11PipelineStateViewer::setState() // (ie. SV_VertexID or SV_InstanceID) for(int e = 0; e < excess; e++) { - if(state.m_VS.ShaderDetails->InputSig[state.m_VS.ShaderDetails->InputSig.count - 1 - e] + if(state.m_VS.ShaderDetails->InputSig[state.m_VS.ShaderDetails->InputSig.count() - 1 - e] .systemValue == ShaderBuiltin::Undefined) { allSystem = false; @@ -1167,7 +1167,7 @@ void D3D11PipelineStateViewer::setState() const rdctype::array &IA = state.m_IA.Bytecode->InputSig; const rdctype::array &VS = state.m_VS.ShaderDetails->InputSig; - int count = qMin(IA.count, VS.count); + int count = qMin(IA.count(), VS.count()); for(int i = 0; i < count; i++) { @@ -1242,7 +1242,7 @@ void D3D11PipelineStateViewer::setState() bool filledSlot = true; bool usedSlot = false; - for(int ia = 0; state.m_IA.Bytecode && ia < state.m_IA.Bytecode->InputSig.count; ia++) + for(int ia = 0; state.m_IA.Bytecode && ia < state.m_IA.Bytecode->InputSig.count(); ia++) { if(!QString(state.m_IA.Bytecode->InputSig[ia].semanticName) .compare(l.SemanticName, Qt::CaseInsensitive) && @@ -1351,7 +1351,7 @@ void D3D11PipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_IA.vbuffers.count; i++) + for(int i = 0; i < state.m_IA.vbuffers.count(); i++) { const D3D11Pipe::VB &v = state.m_IA.vbuffers[i]; @@ -1417,7 +1417,7 @@ void D3D11PipelineStateViewer::setState() vs = ui->csUAVs->verticalScrollBar()->value(); ui->csUAVs->beginUpdate(); ui->csUAVs->clear(); - for(int i = 0; i < state.m_CS.UAVs.count; i++) + for(int i = 0; i < state.m_CS.UAVs.count(); i++) { const ShaderResource *shaderInput = NULL; const BindpointMap *map = NULL; @@ -1426,7 +1426,7 @@ void D3D11PipelineStateViewer::setState() if(cs.ShaderDetails) { - for(int b = 0; b < cs.ShaderDetails->ReadWriteResources.count; b++) + for(int b = 0; b < cs.ShaderDetails->ReadWriteResources.count(); b++) { const ShaderResource &res = cs.ShaderDetails->ReadWriteResources[b]; const BindpointMap &bind = cs.BindpointMapping.ReadWriteResources[b]; @@ -1451,7 +1451,7 @@ void D3D11PipelineStateViewer::setState() vs = ui->gsStreamOut->verticalScrollBar()->value(); ui->gsStreamOut->beginUpdate(); ui->gsStreamOut->clear(); - for(int i = 0; i < state.m_SO.Outputs.count; i++) + for(int i = 0; i < state.m_SO.Outputs.count(); i++) { const D3D11Pipe::SOBind &s = state.m_SO.Outputs[i]; @@ -1503,7 +1503,7 @@ void D3D11PipelineStateViewer::setState() vs = ui->viewports->verticalScrollBar()->value(); ui->viewports->beginUpdate(); ui->viewports->clear(); - for(int i = 0; i < state.m_RS.Viewports.count; i++) + for(int i = 0; i < state.m_RS.Viewports.count(); i++) { const D3D11Pipe::Viewport &v = state.m_RS.Viewports[i]; @@ -1528,7 +1528,7 @@ void D3D11PipelineStateViewer::setState() vs = ui->scissors->verticalScrollBar()->value(); ui->scissors->beginUpdate(); ui->scissors->clear(); - for(int i = 0; i < state.m_RS.Scissors.count; i++) + for(int i = 0; i < state.m_RS.Scissors.count(); i++) { const D3D11Pipe::Scissor &s = state.m_RS.Scissors[i]; @@ -1574,7 +1574,7 @@ void D3D11PipelineStateViewer::setState() ui->targetOutputs->beginUpdate(); ui->targetOutputs->clear(); { - for(int i = 0; i < state.m_OM.RenderTargets.count; i++) + for(int i = 0; i < state.m_OM.RenderTargets.count(); i++) { addResourceRow(D3D11ViewTag(D3D11ViewTag::OMTarget, i, state.m_OM.RenderTargets[i]), NULL, NULL, ui->targetOutputs); @@ -1583,7 +1583,7 @@ void D3D11PipelineStateViewer::setState() targets[i] = true; } - for(int i = 0; i < state.m_OM.UAVs.count; i++) + for(int i = 0; i < state.m_OM.UAVs.count(); i++) { const ShaderResource *shaderInput = NULL; const BindpointMap *map = NULL; @@ -1598,7 +1598,7 @@ void D3D11PipelineStateViewer::setState() { if(stage->ShaderDetails) { - for(int b = 0; b < stage->ShaderDetails->ReadOnlyResources.count; b++) + for(int b = 0; b < stage->ShaderDetails->ReadOnlyResources.count(); b++) { const ShaderResource &res = stage->ShaderDetails->ReadOnlyResources[b]; const BindpointMap &bind = stage->BindpointMapping.ReadOnlyResources[b]; @@ -1783,7 +1783,7 @@ QString D3D11PipelineStateViewer::formatMembers(int indent, const QString &namep ret += indentstr + lit("// struct %1\n").arg(v.type.descriptor.name); ret += indentstr + lit("{\n") + formatMembers(indent + 1, v.name + lit("_"), v.type.members) + indentstr + lit("}\n"); - if(i < vars.count - 1) + if(i < vars.count() - 1) ret += lit("\n"); } else @@ -1868,7 +1868,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(stage->stage == ShaderStage::Geometry) { - for(int i = 0; i < m_Ctx.CurD3D11PipelineState().m_SO.Outputs.count; i++) + for(int i = 0; i < m_Ctx.CurD3D11PipelineState().m_SO.Outputs.count(); i++) { if(buf->ID == m_Ctx.CurD3D11PipelineState().m_SO.Outputs[i].Buffer) { @@ -2056,7 +2056,7 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int int cbufIdx = -1; - for(int i = 0; i < stage->BindpointMapping.ConstantBlocks.count; i++) + for(int i = 0; i < stage->BindpointMapping.ConstantBlocks.count(); i++) { if(stage->BindpointMapping.ConstantBlocks[i].bind == cb) { @@ -2068,7 +2068,7 @@ void D3D11PipelineStateViewer::cbuffer_itemActivated(RDTreeWidgetItem *item, int if(cbufIdx == -1) { // unused cbuffer, open regular buffer viewer - if(cb >= stage->ConstantBuffers.count) + if(cb >= stage->ConstantBuffers.count()) return; const D3D11Pipe::CBuffer &bind = stage->ConstantBuffers[cb]; @@ -2160,7 +2160,7 @@ void D3D11PipelineStateViewer::on_iaLayouts_mouseMove(QMouseEvent *e) if(idx.isValid()) { - if(idx.row() >= 0 && idx.row() < IA.layouts.count) + if(idx.row() >= 0 && idx.row() < IA.layouts.count()) { uint32_t buffer = IA.layouts[idx.row()].InputSlot; @@ -2405,7 +2405,7 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie { if(view.Format.compType == CompType::Typeless) { - if(shaderInput->variableType.members.count > 0) + if(!shaderInput->variableType.members.isEmpty()) viewFormat = format = lit("struct ") + shaderInput->variableType.descriptor.name; else viewFormat = format = shaderInput->variableType.descriptor.name; @@ -2545,7 +2545,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe else shadername = sh.name; - if(shaderDetails && shaderDetails->DebugInfo.files.count > 0) + if(shaderDetails && !shaderDetails->DebugInfo.files.isEmpty()) { shadername = QFormatStr("%1() - %2") .arg(shaderDetails->EntryPoint) @@ -2567,7 +2567,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.SRVs.count; i++) + for(int i = 0; i < sh.SRVs.count(); i++) { if(sh.SRVs[i].Object == ResourceId()) continue; @@ -2592,7 +2592,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.UAVs.count; i++) + for(int i = 0; i < sh.UAVs.count(); i++) { if(sh.UAVs[i].Object == ResourceId()) continue; @@ -2616,7 +2616,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.Samplers.count; i++) + for(int i = 0; i < sh.Samplers.count(); i++) { const D3D11Pipe::Sampler &s = sh.Samplers[i]; @@ -2678,20 +2678,20 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.ConstantBuffers.count; i++) + for(int i = 0; i < sh.ConstantBuffers.count(); i++) { ConstantBlock *shaderCBuf = NULL; if(sh.ConstantBuffers[i].Buffer == ResourceId()) continue; - if(shaderDetails && i < shaderDetails->ConstantBlocks.count && - shaderDetails->ConstantBlocks[i].name.count > 0) + if(shaderDetails && i < shaderDetails->ConstantBlocks.count() && + !shaderDetails->ConstantBlocks[i].name.isEmpty()) shaderCBuf = &shaderDetails->ConstantBlocks[i]; QString name = tr("Constant Buffer %1").arg(ToQStr(sh.ConstantBuffers[i].Buffer)); uint64_t length = 1; - int numvars = shaderCBuf ? shaderCBuf->variables.count : 0; + int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t byteSize = shaderCBuf ? shaderCBuf->byteSize : 0; if(sh.ConstantBuffers[i].Buffer == ResourceId()) @@ -2717,7 +2717,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe rows); } - if(sh.ClassInstances.count > 0) + if(!sh.ClassInstances.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Class Instances")); @@ -2725,11 +2725,11 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < sh.ClassInstances.count; i++) + for(int i = 0; i < sh.ClassInstances.count(); i++) { QString interfaceName = tr("Interface %1").arg(i); - if(sh.ShaderDetails && i < sh.ShaderDetails->Interfaces.count) + if(sh.ShaderDetails && i < sh.ShaderDetails->Interfaces.count()) interfaceName = sh.ShaderDetails->Interfaces[i]; rows.push_back({i, interfaceName, sh.ClassInstances[i]}); @@ -2888,7 +2888,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe int i = 0; for(const D3D11Pipe::Blend &b : om.m_BlendState.Blends) { - if(i >= om.RenderTargets.count) + if(i >= om.RenderTargets.count()) continue; QString mask = QFormatStr("%1%2%3%4") @@ -2960,7 +2960,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe QList rows; - for(int i = 0; i < om.RenderTargets.count; i++) + for(int i = 0; i < om.RenderTargets.count(); i++) { if(om.RenderTargets[i].Object == ResourceId()) continue; @@ -2977,7 +2977,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe rows); } - if(om.UAVs.count > 0 && om.UAVs[0].Object != ResourceId()) + if(!om.UAVs.isEmpty() && om.UAVs[0].Object != ResourceId()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Unordered Access Views")); @@ -2991,7 +2991,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe rows.push_back({i, tr("Empty"), QString(), QString(), QString(), QString(), 0, 0, 0, 0, QString(), QString(), QString()}); - for(; i < (uint32_t)om.RenderTargets.count; i++) + for(; i < (uint32_t)om.RenderTargets.count(); i++) { if(om.UAVs[i - om.UAVStartSlot].Object == ResourceId()) continue; @@ -3140,7 +3140,7 @@ void D3D11PipelineStateViewer::on_debugThread_clicked() m_Ctx.Replay().AsyncInvoke([this, thread](IReplayController *r) { ShaderDebugTrace *trace = r->DebugThread(thread.g, thread.t); - if(trace->states.count == 0) + if(trace->states.isEmpty()) { r->FreeTrace(trace); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 2e66572ce..0eedf66f5 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -635,7 +635,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, : stage->BindpointMapping.ReadOnlyResources; const rdctype::array &res = uav ? stage->ShaderDetails->ReadWriteResources : stage->ShaderDetails->ReadOnlyResources; - for(int i = 0; i < binds.count; i++) + for(int i = 0; i < binds.count(); i++) { const BindpointMap &b = binds[i]; @@ -934,9 +934,9 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL vs = resources->verticalScrollBar()->value(); resources->beginUpdate(); resources->clear(); - for(int space = 0; space < stage.Spaces.count; space++) + for(int space = 0; space < stage.Spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].SRVs.count; reg++) + for(int reg = 0; reg < stage.Spaces[space].SRVs.count(); reg++) { addResourceRow(D3D12ViewTag(D3D12ViewTag::SRV, space, reg, stage.Spaces[space].SRVs[reg]), &stage, resources); @@ -949,9 +949,9 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL vs = uavs->verticalScrollBar()->value(); uavs->beginUpdate(); uavs->clear(); - for(int space = 0; space < stage.Spaces.count; space++) + for(int space = 0; space < stage.Spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].UAVs.count; reg++) + for(int reg = 0; reg < stage.Spaces[space].UAVs.count(); reg++) { addResourceRow(D3D12ViewTag(D3D12ViewTag::UAV, space, reg, stage.Spaces[space].UAVs[reg]), &stage, uavs); @@ -964,9 +964,9 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL vs = samplers->verticalScrollBar()->value(); samplers->beginUpdate(); samplers->clear(); - for(int space = 0; space < stage.Spaces.count; space++) + for(int space = 0; space < stage.Spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].Samplers.count; reg++) + for(int reg = 0; reg < stage.Spaces[space].Samplers.count(); reg++) { const D3D12Pipe::Sampler &s = stage.Spaces[space].Samplers[reg]; @@ -980,7 +980,7 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL if(stage.ShaderDetails) { - for(int i = 0; i < stage.BindpointMapping.Samplers.count; i++) + for(int i = 0; i < stage.BindpointMapping.Samplers.count(); i++) { const BindpointMap &b = stage.BindpointMapping.Samplers[i]; const ShaderSampler &res = stage.ShaderDetails->Samplers[i]; @@ -1085,9 +1085,9 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL vs = cbuffers->verticalScrollBar()->value(); cbuffers->beginUpdate(); cbuffers->clear(); - for(int space = 0; space < stage.Spaces.count; space++) + for(int space = 0; space < stage.Spaces.count(); space++) { - for(int reg = 0; reg < stage.Spaces[space].ConstantBuffers.count; reg++) + for(int reg = 0; reg < stage.Spaces[space].ConstantBuffers.count(); reg++) { const D3D12Pipe::CBuffer &b = stage.Spaces[space].ConstantBuffers[reg]; @@ -1098,7 +1098,7 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL if(stage.ShaderDetails) { - for(int i = 0; i < stage.BindpointMapping.ConstantBlocks.count; i++) + for(int i = 0; i < stage.BindpointMapping.ConstantBlocks.count(); i++) { const BindpointMap &bm = stage.BindpointMapping.ConstantBlocks[i]; const ConstantBlock &res = stage.ShaderDetails->ConstantBlocks[i]; @@ -1148,11 +1148,11 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, QL QString name = tr("Constant Buffer %1").arg(ToQStr(b.Buffer)); ulong length = b.ByteSize; uint64_t offset = b.Offset; - int numvars = shaderCBuf ? shaderCBuf->variables.count : 0; + int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; if(b.Immediate && !b.RootValues.empty()) - bytesize = uint32_t(b.RootValues.count * 4); + bytesize = uint32_t(b.RootValues.count() * 4); if(!filledSlot) name = tr("Empty"); @@ -1243,7 +1243,8 @@ void D3D12PipelineStateViewer::setState() bool filledSlot = true; bool usedSlot = false; - for(int ia = 0; state.m_VS.ShaderDetails && ia < state.m_VS.ShaderDetails->InputSig.count; ia++) + for(int ia = 0; state.m_VS.ShaderDetails && ia < state.m_VS.ShaderDetails->InputSig.count(); + ia++) { if(!QString(state.m_VS.ShaderDetails->InputSig[ia].semanticName) .compare(l.SemanticName, Qt::CaseInsensitive) && @@ -1352,7 +1353,7 @@ void D3D12PipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_IA.vbuffers.count; i++) + for(int i = 0; i < state.m_IA.vbuffers.count(); i++) { const D3D12Pipe::VB &v = state.m_IA.vbuffers[i]; @@ -1419,7 +1420,7 @@ void D3D12PipelineStateViewer::setState() vs = ui->gsStreamOut->verticalScrollBar()->value(); ui->gsStreamOut->beginUpdate(); ui->gsStreamOut->clear(); - for(int i = 0; i < state.m_SO.Outputs.count; i++) + for(int i = 0; i < state.m_SO.Outputs.count(); i++) { const D3D12Pipe::SOBind &s = state.m_SO.Outputs[i]; @@ -1472,7 +1473,7 @@ void D3D12PipelineStateViewer::setState() vs = ui->viewports->verticalScrollBar()->value(); ui->viewports->beginUpdate(); ui->viewports->clear(); - for(int i = 0; i < state.m_RS.Viewports.count; i++) + for(int i = 0; i < state.m_RS.Viewports.count(); i++) { const D3D12Pipe::Viewport &v = state.m_RS.Viewports[i]; @@ -1491,7 +1492,7 @@ void D3D12PipelineStateViewer::setState() vs = ui->scissors->verticalScrollBar()->value(); ui->scissors->beginUpdate(); ui->scissors->clear(); - for(int i = 0; i < state.m_RS.Scissors.count; i++) + for(int i = 0; i < state.m_RS.Scissors.count(); i++) { const D3D12Pipe::Scissor &s = state.m_RS.Scissors[i]; @@ -1530,7 +1531,7 @@ void D3D12PipelineStateViewer::setState() ui->targetOutputs->beginUpdate(); ui->targetOutputs->clear(); { - for(int i = 0; i < state.m_OM.RenderTargets.count; i++) + for(int i = 0; i < state.m_OM.RenderTargets.count(); i++) { addResourceRow(D3D12ViewTag(D3D12ViewTag::OMTarget, 0, i, state.m_OM.RenderTargets[i]), NULL, ui->targetOutputs); @@ -1661,7 +1662,7 @@ QString D3D12PipelineStateViewer::formatMembers(int indent, const QString &namep ret += indentstr + lit("// struct %1\n").arg(v.type.descriptor.name); ret += indentstr + lit("{\n") + formatMembers(indent + 1, v.name + lit("_"), v.type.members) + indentstr + lit("}\n"); - if(i < vars.count - 1) + if(i < vars.count() - 1) ret += lit("\n"); } else @@ -1746,7 +1747,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in if(stage == &m_Ctx.CurD3D12PipelineState().m_GS) { - for(int i = 0; i < m_Ctx.CurD3D12PipelineState().m_SO.Outputs.count; i++) + for(int i = 0; i < m_Ctx.CurD3D12PipelineState().m_SO.Outputs.count(); i++) { if(buf->ID == m_Ctx.CurD3D12PipelineState().m_SO.Outputs[i].Buffer) { @@ -1772,7 +1773,7 @@ void D3D12PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in view.space == D3D12ViewTag::SRV ? stage->BindpointMapping.ReadOnlyResources : stage->BindpointMapping.ReadOnlyResources; - for(int i = 0; i < bindArray.count; i++) + for(int i = 0; i < bindArray.count(); i++) { if(bindArray[i].bindset == view.space && bindArray[i].bind == view.reg) { @@ -1993,7 +1994,7 @@ void D3D12PipelineStateViewer::on_iaLayouts_mouseMove(QMouseEvent *e) if(idx.isValid()) { - if(idx.row() >= 0 && idx.row() < IA.layouts.count) + if(idx.row() >= 0 && idx.row() < IA.layouts.count()) { uint32_t buffer = IA.layouts[idx.row()].InputSlot; @@ -2215,7 +2216,7 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie { if(view.Format.compType == CompType::Typeless) { - if(shaderInput->variableType.members.count > 0) + if(!shaderInput->variableType.members.isEmpty()) viewFormat = format = lit("struct ") + shaderInput->variableType.descriptor.name; else viewFormat = format = shaderInput->variableType.descriptor.name; @@ -2395,9 +2396,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count; space++) + for(int space = 0; space < sh.Spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].SRVs.count; reg++) + for(int reg = 0; reg < sh.Spaces[space].SRVs.count(); reg++) { const D3D12Pipe::View &v = sh.Spaces[space].SRVs[reg]; @@ -2410,7 +2411,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe if(sh.ShaderDetails) { - for(int i = 0; i < sh.BindpointMapping.ReadOnlyResources.count; i++) + for(int i = 0; i < sh.BindpointMapping.ReadOnlyResources.count(); i++) { const BindpointMap &b = sh.BindpointMapping.ReadOnlyResources[i]; const ShaderResource &res = sh.ShaderDetails->ReadOnlyResources[i]; @@ -2457,9 +2458,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count; space++) + for(int space = 0; space < sh.Spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].UAVs.count; reg++) + for(int reg = 0; reg < sh.Spaces[space].UAVs.count(); reg++) { const D3D12Pipe::View &v = sh.Spaces[space].UAVs[reg]; @@ -2472,7 +2473,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe if(sh.ShaderDetails) { - for(int i = 0; i < sh.BindpointMapping.ReadWriteResources.count; i++) + for(int i = 0; i < sh.BindpointMapping.ReadWriteResources.count(); i++) { const BindpointMap &b = sh.BindpointMapping.ReadWriteResources[i]; const ShaderResource &res = sh.ShaderDetails->ReadWriteResources[i]; @@ -2519,9 +2520,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count; space++) + for(int space = 0; space < sh.Spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].Samplers.count; reg++) + for(int reg = 0; reg < sh.Spaces[space].Samplers.count(); reg++) { const D3D12Pipe::Sampler &s = sh.Spaces[space].Samplers[reg]; @@ -2534,7 +2535,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe if(sh.ShaderDetails) { - for(int i = 0; i < sh.BindpointMapping.Samplers.count; i++) + for(int i = 0; i < sh.BindpointMapping.Samplers.count(); i++) { const BindpointMap &b = sh.BindpointMapping.Samplers[i]; const ShaderSampler &res = sh.ShaderDetails->Samplers[i]; @@ -2631,9 +2632,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int space = 0; space < sh.Spaces.count; space++) + for(int space = 0; space < sh.Spaces.count(); space++) { - for(int reg = 0; reg < sh.Spaces[space].ConstantBuffers.count; reg++) + for(int reg = 0; reg < sh.Spaces[space].ConstantBuffers.count(); reg++) { const D3D12Pipe::CBuffer &b = sh.Spaces[space].ConstantBuffers[reg]; @@ -2641,7 +2642,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe if(sh.ShaderDetails) { - for(int i = 0; i < sh.BindpointMapping.ConstantBlocks.count; i++) + for(int i = 0; i < sh.BindpointMapping.ConstantBlocks.count(); i++) { const BindpointMap &bm = sh.BindpointMapping.ConstantBlocks[i]; const ConstantBlock &res = sh.ShaderDetails->ConstantBlocks[i]; @@ -2679,11 +2680,11 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QString name = tr("Constant Buffer %1").arg(ToQStr(b.Buffer)); uint64_t length = b.ByteSize; uint64_t offset = b.Offset; - int numvars = shaderCBuf ? shaderCBuf->variables.count : 0; + int numvars = shaderCBuf ? shaderCBuf->variables.count() : 0; uint32_t bytesize = shaderCBuf ? shaderCBuf->byteSize : 0; if(b.Immediate && !b.RootValues.empty()) - bytesize = uint32_t(b.RootValues.count * 4); + bytesize = uint32_t(b.RootValues.count() * 4); BufferDescription *buf = m_Ctx.GetBuffer(b.Buffer); @@ -2877,7 +2878,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe int i = 0; for(const D3D12Pipe::Blend &b : om.m_BlendState.Blends) { - if(i >= om.RenderTargets.count) + if(i >= om.RenderTargets.count()) continue; QString mask = QFormatStr("%1%2%3%4") @@ -2949,7 +2950,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; - for(int i = 0; i < om.RenderTargets.count; i++) + for(int i = 0; i < om.RenderTargets.count(); i++) { if(om.RenderTargets[i].Resource == ResourceId()) continue; diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index d06988674..67ab5a597 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -618,7 +618,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * samplers->beginUpdate(); samplers->clear(); - for(int i = 0; i < state.Textures.count; i++) + for(int i = 0; i < state.Textures.count(); i++) { const GLPipe::Texture &r = state.Textures[i]; const GLPipe::Sampler &s = state.Samplers[i]; @@ -797,14 +797,14 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * vs = ubos->verticalScrollBar()->value(); ubos->beginUpdate(); ubos->clear(); - for(int i = 0; shaderDetails && i < shaderDetails->ConstantBlocks.count; i++) + for(int i = 0; shaderDetails && i < shaderDetails->ConstantBlocks.count(); i++) { const ConstantBlock &shaderCBuf = shaderDetails->ConstantBlocks[i]; int bindPoint = stage.BindpointMapping.ConstantBlocks[i].bind; const GLPipe::Buffer *b = NULL; - if(bindPoint >= 0 && bindPoint < state.UniformBuffers.count) + if(bindPoint >= 0 && bindPoint < state.UniformBuffers.count()) b = &state.UniformBuffers[bindPoint]; bool filledSlot = !shaderCBuf.bufferBacked || (b && b->Resource != ResourceId()); @@ -814,7 +814,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * { ulong offset = 0; ulong length = 0; - int numvars = shaderCBuf.variables.count; + int numvars = shaderCBuf.variables.count(); ulong byteSize = (ulong)shaderCBuf.byteSize; QString slotname = tr("Uniforms"); @@ -875,7 +875,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * vs = subs->verticalScrollBar()->value(); subs->beginUpdate(); subs->clear(); - for(int i = 0; i < stage.Subroutines.count; i++) + for(int i = 0; i < stage.Subroutines.count(); i++) subs->addTopLevelItem(new RDTreeWidgetItem({i, stage.Subroutines[i]})); subs->clearSelection(); subs->endUpdate(); @@ -886,7 +886,7 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * vs = readwrites->verticalScrollBar()->value(); readwrites->beginUpdate(); readwrites->clear(); - for(int i = 0; shaderDetails && i < shaderDetails->ReadWriteResources.count; i++) + for(int i = 0; shaderDetails && i < shaderDetails->ReadWriteResources.count(); i++) { const ShaderResource &res = shaderDetails->ReadWriteResources[i]; int bindPoint = stage.BindpointMapping.ReadWriteResources[i].bind; @@ -897,21 +897,21 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, QLabel * const GLPipe::ImageLoadStore *im = NULL; ResourceId id; - if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < state.Images.count) + if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < state.Images.count()) { im = &state.Images[bindPoint]; id = state.Images[bindPoint].Resource; } if(readWriteType == GLReadWriteType::Atomic && bindPoint >= 0 && - bindPoint < state.AtomicBuffers.count) + bindPoint < state.AtomicBuffers.count()) { bf = &state.AtomicBuffers[bindPoint]; id = state.AtomicBuffers[bindPoint].Resource; } if(readWriteType == GLReadWriteType::SSBO && bindPoint >= 0 && - bindPoint < state.ShaderStorageBuffers.count) + bindPoint < state.ShaderStorageBuffers.count()) { bf = &state.ShaderStorageBuffers[bindPoint]; id = state.ShaderStorageBuffers[bindPoint].Resource; @@ -1125,10 +1125,10 @@ void GLPipelineStateViewer::setState() if(state.m_VS.Object != ResourceId()) { int attrib = -1; - if(i < state.m_VS.BindpointMapping.InputAttributes.count) + if(i < state.m_VS.BindpointMapping.InputAttributes.count()) attrib = state.m_VS.BindpointMapping.InputAttributes[i]; - if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count) + if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count()) { name = state.m_VS.ShaderDetails->InputSig[attrib].varName; compCount = state.m_VS.ShaderDetails->InputSig[attrib].compCount; @@ -1250,7 +1250,7 @@ void GLPipelineStateViewer::setState() m_VBNodes.clear(); - for(int i = 0; i < state.m_VtxIn.vbuffers.count; i++) + for(int i = 0; i < state.m_VtxIn.vbuffers.count(); i++) { const GLPipe::VB &v = state.m_VtxIn.vbuffers[i]; @@ -1371,7 +1371,7 @@ void GLPipelineStateViewer::setState() { // accumulate identical viewports to save on visual repetition int prev = 0; - for(int i = 0; i < state.m_Rasterizer.Viewports.count; i++) + for(int i = 0; i < state.m_Rasterizer.Viewports.count(); i++) { const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev]; const GLPipe::Viewport &v2 = state.m_Rasterizer.Viewports[i]; @@ -1402,7 +1402,7 @@ void GLPipelineStateViewer::setState() } // handle the last batch (the loop above leaves the last batch un-added) - if(prev < state.m_Rasterizer.Viewports.count) + if(prev < state.m_Rasterizer.Viewports.count()) { const GLPipe::Viewport &v1 = state.m_Rasterizer.Viewports[prev]; @@ -1414,8 +1414,8 @@ void GLPipelineStateViewer::setState() ui->showEmpty->isChecked() || prev == 0) { QString indexstring; - if(prev < state.m_Rasterizer.Viewports.count - 1) - indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Viewports.count - 1); + if(prev < state.m_Rasterizer.Viewports.count() - 1) + indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Viewports.count() - 1); else indexstring = QString::number(prev); @@ -1441,7 +1441,7 @@ void GLPipelineStateViewer::setState() { // accumulate identical scissors to save on visual repetition int prev = 0; - for(int i = 0; i < state.m_Rasterizer.Scissors.count; i++) + for(int i = 0; i < state.m_Rasterizer.Scissors.count(); i++) { const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev]; const GLPipe::Scissor &s2 = state.m_Rasterizer.Scissors[i]; @@ -1477,15 +1477,15 @@ void GLPipelineStateViewer::setState() } // handle the last batch (the loop above leaves the last batch un-added) - if(prev < state.m_Rasterizer.Scissors.count) + if(prev < state.m_Rasterizer.Scissors.count()) { const GLPipe::Scissor &s1 = state.m_Rasterizer.Scissors[prev]; if(s1.Enabled || ui->showEmpty->isChecked()) { QString indexstring; - if(prev < state.m_Rasterizer.Scissors.count - 1) - indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Scissors.count - 1); + if(prev < state.m_Rasterizer.Scissors.count() - 1) + indexstring = QFormatStr("%1-%2").arg(prev).arg(state.m_Rasterizer.Scissors.count() - 1); else indexstring = QString::number(prev); @@ -1619,7 +1619,7 @@ void GLPipelineStateViewer::setState() ResourceId p; const GLPipe::Attachment *r = NULL; - if(db >= 0 && db < state.m_FB.m_DrawFBO.Color.count) + if(db >= 0 && db < state.m_FB.m_DrawFBO.Color.count()) { p = state.m_FB.m_DrawFBO.Color[db].Obj; r = &state.m_FB.m_DrawFBO.Color[db]; @@ -1660,7 +1660,7 @@ void GLPipelineStateViewer::setState() if(!tex->customName && state.m_FS.ShaderDetails) { - for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count; s++) + for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count(); s++) { if(state.m_FS.ShaderDetails->OutputSig[s].regIndex == (uint32_t)db && (state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::Undefined || @@ -1933,7 +1933,7 @@ QString GLPipelineStateViewer::formatMembers(int indent, const QString &namepref ret += indentstr + QFormatStr("// struct %1\n").arg(v.type.descriptor.name); ret += indentstr + lit("{\n") + formatMembers(indent + 1, v.name + lit("_"), v.type.members) + indentstr + lit("}\n"); - if(i < vars.count - 1) + if(i < vars.count() - 1) ret += lit("\n"); } else @@ -1995,10 +1995,10 @@ void GLPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, int c QString format = lit("// struct %1\n").arg(shaderRes.variableType.descriptor.name); - if(shaderRes.variableType.members.count > 1) + if(shaderRes.variableType.members.count() > 1) { format += tr("// members skipped as they are fixed size:\n"); - for(int i = 0; i < shaderRes.variableType.members.count - 1; i++) + for(int i = 0; i < shaderRes.variableType.members.count() - 1; i++) format += QFormatStr("%1 %2;\n") .arg(shaderRes.variableType.members[i].type.descriptor.name) .arg(shaderRes.variableType.members[i].name); @@ -2132,7 +2132,7 @@ void GLPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e) if(idx.isValid()) { - if(idx.row() >= 0 && idx.row() < VI.attributes.count) + if(idx.row() >= 0 && idx.row() < VI.attributes.count()) { uint32_t buffer = VI.attributes[idx.row()].BufferSlot; @@ -2479,7 +2479,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad QList readwriteRows; QList subRows; - for(int i = 0; i < pipe.Textures.count; i++) + for(int i = 0; i < pipe.Textures.count(); i++) { const GLPipe::Texture &r = pipe.Textures[i]; const GLPipe::Sampler &s = pipe.Samplers[i]; @@ -2508,7 +2508,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { QString slotname = QString::number(i); - if(shaderInput && shaderInput->name.count > 0) + if(shaderInput && !shaderInput->name.isEmpty()) slotname += QFormatStr(": %1").arg(shaderInput->name); uint32_t w = 1, h = 1, d = 1; @@ -2563,7 +2563,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { QString slotname = QString::number(i); - if(shaderInput && shaderInput->name.count > 0) + if(shaderInput && !shaderInput->name.isEmpty()) slotname += QFormatStr(": %1").arg(shaderInput->name); QString borderColor = QFormatStr("%1, %2, %3, %4") @@ -2637,7 +2637,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad const GLPipe::Buffer *b = NULL; - if(bindPoint >= 0 && bindPoint < pipe.UniformBuffers.count) + if(bindPoint >= 0 && bindPoint < pipe.UniformBuffers.count()) b = &pipe.UniformBuffers[bindPoint]; bool filledSlot = !shaderCBuf.bufferBacked || (b && b->Resource != ResourceId()); @@ -2647,7 +2647,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad { uint64_t offset = 0; uint64_t length = 0; - int numvars = shaderCBuf.variables.count; + int numvars = shaderCBuf.variables.count(); uint64_t byteSize = shaderCBuf.byteSize; QString slotname = tr("Uniforms"); @@ -2714,21 +2714,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad const GLPipe::ImageLoadStore *im = NULL; ResourceId id; - if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < pipe.Images.count) + if(readWriteType == GLReadWriteType::Image && bindPoint >= 0 && bindPoint < pipe.Images.count()) { im = &pipe.Images[bindPoint]; id = pipe.Images[bindPoint].Resource; } if(readWriteType == GLReadWriteType::Atomic && bindPoint >= 0 && - bindPoint < pipe.AtomicBuffers.count) + bindPoint < pipe.AtomicBuffers.count()) { bf = &pipe.AtomicBuffers[bindPoint]; id = pipe.AtomicBuffers[bindPoint].Resource; } if(readWriteType == GLReadWriteType::SSBO && bindPoint >= 0 && - bindPoint < pipe.ShaderStorageBuffers.count) + bindPoint < pipe.ShaderStorageBuffers.count()) { bf = &pipe.ShaderStorageBuffers[bindPoint]; id = pipe.ShaderStorageBuffers[bindPoint].Resource; @@ -3066,7 +3066,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram int i = 0; for(const GLPipe::Blend &b : fb.m_Blending.Blends) { - if(i >= fb.m_DrawFBO.Color.count) + if(i >= fb.m_DrawFBO.Color.count()) continue; rows.push_back({i, b.Enabled ? tr("Yes") : tr("No"), ToQStr(b.m_Blend.Source), @@ -3190,7 +3190,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram QList drawbuffers; - for(i = 0; i < fb.m_DrawFBO.DrawBuffers.count; i++) + for(i = 0; i < fb.m_DrawFBO.DrawBuffers.count(); i++) drawbuffers.push_back({fb.m_DrawFBO.DrawBuffers[i]}); xml.writeStartElement(tr("p")); diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index fb4bb66c3..a6939d10f 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -575,7 +575,7 @@ void PipelineStateViewer::MakeShaderVariablesHLSL(bool cbufferContents, { for(const ShaderConstant &v : vars) { - if(v.type.members.count > 0) + if(!v.type.members.isEmpty()) { QString def = lit("struct %1 {\n").arg(v.type.descriptor.name); @@ -670,7 +670,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta int cbufIdx = 0; for(const ConstantBlock &cbuf : shaderDetails->ConstantBlocks) { - if(cbuf.name.count > 0 && cbuf.variables.count > 0) + if(!cbuf.name.isEmpty() && !cbuf.variables.isEmpty()) { QString cbufName = cbuf.name; if(cbufName == lit("$Globals")) @@ -690,7 +690,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta for(const SigParameter &sig : shaderDetails->InputSig) hlsl += lit("\t%1 %2 : %3;\n") .arg(TypeString(sig)) - .arg(sig.varName.count > 0 ? sig.varName : lit("param%1").arg(sig.regIndex)) + .arg(!sig.varName.isEmpty() ? sig.varName : lit("param%1").arg(sig.regIndex)) .arg(D3DSemanticString(sig)); hlsl += lit("};\n\n"); @@ -698,7 +698,7 @@ QString PipelineStateViewer::GenerateHLSLStub(const ShaderReflection *shaderDeta for(const SigParameter &sig : shaderDetails->OutputSig) hlsl += lit("\t%1 %2 : %3;\n") .arg(TypeString(sig)) - .arg(sig.varName.count > 0 ? sig.varName : lit("param%1").arg(sig.regIndex)) + .arg(!sig.varName.isEmpty() ? sig.varName : lit("param%1").arg(sig.regIndex)) .arg(D3DSemanticString(sig)); hlsl += lit("};\n\n"); @@ -889,7 +889,7 @@ bool PipelineStateViewer::SaveShaderFile(const ShaderReflection *shader) QFile f(filename); if(f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - f.write((const char *)shader->RawBytes.elems, (qint64)shader->RawBytes.count); + f.write((const char *)shader->RawBytes.data(), (qint64)shader->RawBytes.size()); } else { diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index 7091d851d..266f3272c 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -693,7 +693,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, // there's no used resource at all, the first declared unused resource (which will prefer // resources with proper bindings over those without, as with the sorting mentioned above). - for(int i = 0; i < shaderDetails->Samplers.count; i++) + for(int i = 0; i < shaderDetails->Samplers.count(); i++) { const ShaderSampler &s = shaderDetails->Samplers[i]; @@ -711,7 +711,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, } } - for(int i = 0; i < shaderDetails->ReadOnlyResources.count; i++) + for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) { const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; @@ -731,7 +731,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count; i++) + for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) { const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; @@ -757,7 +757,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, BindType bindType = BindType::Unknown; ShaderStageMask stageBits = ShaderStageMask::Unknown; - if(bindset < pipe.DescSets.count && bind < pipe.DescSets[bindset].bindings.count) + if(bindset < pipe.DescSets.count() && bind < pipe.DescSets[bindset].bindings.count()) { slotBinds = &pipe.DescSets[bindset].bindings[bind].binds; bindType = pipe.DescSets[bindset].bindings[bind].type; @@ -787,7 +787,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, // consider it filled if any array element is filled bool filledSlot = false; - for(int idx = 0; slotBinds != NULL && idx < slotBinds->count; idx++) + for(int idx = 0; slotBinds != NULL && idx < slotBinds->count(); idx++) { filledSlot |= (*slotBinds)[idx].res != ResourceId(); if(bindType == BindType::Sampler || bindType == BindType::ImageSampler) @@ -805,14 +805,14 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, QString setname = QString::number(bindset); QString slotname = QString::number(bind); - if(shaderRes && shaderRes->name.count > 0) + if(shaderRes && !shaderRes->name.isEmpty()) slotname += lit(": ") + shaderRes->name; - else if(shaderSamp && shaderSamp->name.count > 0) + else if(shaderSamp && !shaderSamp->name.isEmpty()) slotname += lit(": ") + shaderSamp->name; int arrayLength = 0; if(slotBinds != NULL) - arrayLength = slotBinds->count; + arrayLength = slotBinds->count(); else arrayLength = (int)bindMap->arraySize; @@ -844,9 +844,9 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(arrayLength > 1) { - if(shaderRes && shaderRes->name.count > 0) + if(shaderRes && !shaderRes->name.isEmpty()) slotname = QFormatStr("%1[%2]: %3").arg(bind).arg(idx).arg(shaderRes->name); - else if(shaderSamp && shaderSamp->name.count > 0) + else if(shaderSamp && !shaderSamp->name.isEmpty()) slotname = QFormatStr("%1[%2]: %3").arg(bind).arg(idx).arg(shaderSamp->name); else slotname = QFormatStr("%1[%2]").arg(bind).arg(idx); @@ -1097,7 +1097,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta uint32_t slot = ~0U; if(shaderDetails != NULL) { - for(slot = 0; slot < (uint)shaderDetails->ConstantBlocks.count; slot++) + for(slot = 0; slot < (uint)shaderDetails->ConstantBlocks.count(); slot++) { ConstantBlock cb = shaderDetails->ConstantBlocks[slot]; if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset == bindset && @@ -1109,7 +1109,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta } } - if(slot >= (uint)shaderDetails->ConstantBlocks.count) + if(slot >= (uint)shaderDetails->ConstantBlocks.count()) slot = ~0U; } @@ -1117,7 +1117,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta BindType bindType = BindType::ConstantBuffer; ShaderStageMask stageBits = ShaderStageMask::Unknown; - if(bindset < pipe.DescSets.count && bind < pipe.DescSets[bindset].bindings.count) + if(bindset < pipe.DescSets.count() && bind < pipe.DescSets[bindset].bindings.count()) { slotBinds = &pipe.DescSets[bindset].bindings[bind].binds; bindType = pipe.DescSets[bindset].bindings[bind].type; @@ -1136,7 +1136,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta // consider it filled if any array element is filled (or it's push constants) bool filledSlot = cblock != NULL && !cblock->bufferBacked; - for(int idx = 0; slotBinds != NULL && idx < slotBinds->count; idx++) + for(int idx = 0; slotBinds != NULL && idx < slotBinds->count(); idx++) filledSlot |= (*slotBinds)[idx].res != ResourceId(); // if it's masked out by stage bits, act as if it's not filled, so it's marked in red @@ -1150,12 +1150,12 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta QString setname = QString::number(bindset); QString slotname = QString::number(bind); - if(cblock != NULL && cblock->name.count > 0) + if(cblock != NULL && !cblock->name.isEmpty()) slotname += lit(": ") + cblock->name; int arrayLength = 0; if(slotBinds != NULL) - arrayLength = slotBinds->count; + arrayLength = slotBinds->count(); else arrayLength = (int)bindMap->arraySize; @@ -1184,7 +1184,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta if(arrayLength > 1) { - if(cblock != NULL && cblock->name.count > 0) + if(cblock != NULL && !cblock->name.isEmpty()) slotname = QFormatStr("%1[%2]: %3").arg(bind).arg(idx).arg(cblock->name); else slotname = QFormatStr("%1[%2]").arg(bind).arg(idx); @@ -1192,7 +1192,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta QString name = tr("Empty"); uint64_t length = 0; - int numvars = cblock != NULL ? cblock->variables.count : 0; + int numvars = cblock != NULL ? cblock->variables.count() : 0; uint64_t byteSize = cblock != NULL ? cblock->byteSize : 0; QString vecrange = lit("-"); @@ -1273,10 +1273,10 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, if(shaderDetails != NULL) { QString entryFunc = shaderDetails->EntryPoint; - if(shaderDetails->DebugInfo.files.count > 0 || entryFunc != lit("main")) + if(!shaderDetails->DebugInfo.files.isEmpty() || entryFunc != lit("main")) shader->setText(entryFunc + lit("()")); - if(shaderDetails->DebugInfo.files.count > 0) + if(!shaderDetails->DebugInfo.files.isEmpty()) shader->setText(entryFunc + lit("() - ") + QFileInfo(shaderDetails->DebugInfo.files[0].first).fileName()); } @@ -1294,9 +1294,9 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, QMap samplers; - for(int bindset = 0; bindset < pipe.DescSets.count; bindset++) + for(int bindset = 0; bindset < pipe.DescSets.count(); bindset++) { - for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count; bind++) + for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count(); bind++) { addResourceRow(shaderDetails, stage, bindset, bind, pipe, resources, samplers); } @@ -1306,13 +1306,13 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // in this descriptor set (e.g. if layout mismatches) if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ReadOnlyResources.count; i++) + for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) { const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset == bindset && stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count) + pipe.DescSets[bindset].bindings.count()) { addResourceRow(shaderDetails, stage, bindset, stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bind, pipe, @@ -1320,13 +1320,13 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count; i++) + for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) { const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset == bindset && stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count) + pipe.DescSets[bindset].bindings.count()) { addResourceRow(shaderDetails, stage, bindset, stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bind, pipe, @@ -1341,11 +1341,11 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // bound at all if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ReadOnlyResources.count; i++) + for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) { const ShaderResource &ro = shaderDetails->ReadOnlyResources[i]; - if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset >= pipe.DescSets.count) + if(stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset >= pipe.DescSets.count()) { addResourceRow( shaderDetails, stage, stage.BindpointMapping.ReadOnlyResources[ro.bindPoint].bindset, @@ -1353,11 +1353,11 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, } } - for(int i = 0; i < shaderDetails->ReadWriteResources.count; i++) + for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) { const ShaderResource &rw = shaderDetails->ReadWriteResources[i]; - if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset >= pipe.DescSets.count) + if(stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset >= pipe.DescSets.count()) { addResourceRow( shaderDetails, stage, stage.BindpointMapping.ReadWriteResources[rw.bindPoint].bindset, @@ -1373,9 +1373,9 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, vs = ubos->verticalScrollBar()->value(); ubos->beginUpdate(); ubos->clear(); - for(int bindset = 0; bindset < pipe.DescSets.count; bindset++) + for(int bindset = 0; bindset < pipe.DescSets.count(); bindset++) { - for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count; bind++) + for(int bind = 0; bind < pipe.DescSets[bindset].bindings.count(); bind++) { addConstantBlockRow(shaderDetails, stage, bindset, bind, pipe, ubos); } @@ -1385,13 +1385,13 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // in this descriptor set (e.g. if layout mismatches) if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ConstantBlocks.count; i++) + for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) { ConstantBlock &cb = shaderDetails->ConstantBlocks[i]; if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset == bindset && stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind >= - pipe.DescSets[bindset].bindings.count) + pipe.DescSets[bindset].bindings.count()) { addConstantBlockRow(shaderDetails, stage, bindset, stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bind, pipe, ubos); @@ -1405,11 +1405,11 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // bound at all if(shaderDetails != NULL) { - for(int i = 0; i < shaderDetails->ConstantBlocks.count; i++) + for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) { ConstantBlock &cb = shaderDetails->ConstantBlocks[i]; - if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset >= pipe.DescSets.count && + if(stage.BindpointMapping.ConstantBlocks[cb.bindPoint].bindset >= pipe.DescSets.count() && cb.bufferBacked) { addConstantBlockRow(shaderDetails, stage, @@ -1422,7 +1422,7 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, // search for push constants and add them last if(shaderDetails != NULL) { - for(int cb = 0; cb < shaderDetails->ConstantBlocks.count; cb++) + for(int cb = 0; cb < shaderDetails->ConstantBlocks.count(); cb++) { ConstantBlock &cblock = shaderDetails->ConstantBlocks[cb]; if(cblock.bufferBacked == false) @@ -1432,7 +1432,7 @@ void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage, RDTreeWidgetItem *node = new RDTreeWidgetItem({QString(), QString(), cblock.name, tr("Push constants"), - QString(), tr("%1 Variables").arg(cblock.variables.count)}); + QString(), tr("%1 Variables").arg(cblock.variables.count())}); node->setTag(QVariant::fromValue(VulkanCBufferTag(cb, 0))); @@ -1486,10 +1486,10 @@ void VulkanPipelineStateViewer::setState() if(state.m_VS.Object != ResourceId()) { int attrib = -1; - if((int32_t)a.location < state.m_VS.BindpointMapping.InputAttributes.count) + if((int32_t)a.location < state.m_VS.BindpointMapping.InputAttributes.count()) attrib = state.m_VS.BindpointMapping.InputAttributes[a.location]; - if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count) + if(attrib >= 0 && attrib < state.m_VS.ShaderDetails->InputSig.count()) { name = state.m_VS.ShaderDetails->InputSig[attrib].varName; usedSlot = true; @@ -1597,12 +1597,12 @@ void VulkanPipelineStateViewer::setState() { int i = 0; - for(; i < qMax(state.VI.vbuffers.count, state.VI.binds.count); i++) + for(; i < qMax(state.VI.vbuffers.count(), state.VI.binds.count()); i++) { - const VKPipe::VB *vbuff = (i < state.VI.vbuffers.count ? &state.VI.vbuffers[i] : NULL); + const VKPipe::VB *vbuff = (i < state.VI.vbuffers.count() ? &state.VI.vbuffers[i] : NULL); const VKPipe::VertexBinding *bind = NULL; - for(int b = 0; b < state.VI.binds.count; b++) + for(int b = 0; b < state.VI.binds.count(); b++) { if(state.VI.binds[b].vbufferBinding == (uint32_t)i) bind = &state.VI.binds[b]; @@ -1775,7 +1775,7 @@ void VulkanPipelineStateViewer::setState() for(const VKPipe::Attachment &p : state.Pass.framebuffer.attachments) { int colIdx = -1; - for(int c = 0; c < state.Pass.renderpass.colorAttachments.count; c++) + for(int c = 0; c < state.Pass.renderpass.colorAttachments.count(); c++) { if(state.Pass.renderpass.colorAttachments[c] == (uint)i) { @@ -1784,7 +1784,7 @@ void VulkanPipelineStateViewer::setState() } } int resIdx = -1; - for(int c = 0; c < state.Pass.renderpass.resolveAttachments.count; c++) + for(int c = 0; c < state.Pass.renderpass.resolveAttachments.count(); c++) { if(state.Pass.renderpass.resolveAttachments[c] == (uint)i) { @@ -1825,7 +1825,7 @@ void VulkanPipelineStateViewer::setState() if(!tex->customName && state.m_FS.ShaderDetails != NULL) { - for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count; s++) + for(int s = 0; s < state.m_FS.ShaderDetails->OutputSig.count(); s++) { if(state.m_FS.ShaderDetails->OutputSig[s].regIndex == (uint32_t)colIdx && (state.m_FS.ShaderDetails->OutputSig[s].systemValue == ShaderBuiltin::Undefined || @@ -2009,14 +2009,14 @@ QString VulkanPipelineStateViewer::formatMembers(int indent, const QString &name for(const ShaderConstant &v : vars) { - if(v.type.members.count > 0) + if(!v.type.members.isEmpty()) { if(i > 0) ret += lit("\n"); ret += indentstr + lit("// struct %1\n").arg(v.type.descriptor.name); ret += indentstr + lit("{\n") + formatMembers(indent + 1, v.name + lit("_"), v.type.members) + indentstr + lit("}\n"); - if(i < vars.count - 1) + if(i < vars.count() - 1) ret += lit("\n"); } else @@ -2080,16 +2080,16 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i QString format = lit("// struct %1\n").arg(shaderRes.variableType.descriptor.name); - if(shaderRes.variableType.members.count > 1) + if(shaderRes.variableType.members.count() > 1) { format += lit("// members skipped as they are fixed size:\n"); - for(int i = 0; i < shaderRes.variableType.members.count - 1; i++) + for(int i = 0; i < shaderRes.variableType.members.count() - 1; i++) format += QFormatStr("%1 %2;\n") .arg(shaderRes.variableType.members[i].type.descriptor.name) .arg(shaderRes.variableType.members[i].name); } - if(shaderRes.variableType.members.count > 0) + if(!shaderRes.variableType.members.isEmpty()) { format += lit("{\n") + formatMembers(1, QString(), shaderRes.variableType.members.back().type.members) + @@ -2109,7 +2109,7 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i else if(desc.cols > 1) format += QString::number(desc.cols); - if(desc.name.count > 0) + if(!desc.name.isEmpty()) format += lit(" ") + desc.name; if(desc.elements > 1) @@ -2223,7 +2223,7 @@ void VulkanPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e) if(idx.isValid()) { - if(idx.row() >= 0 && idx.row() < VI.attrs.count) + if(idx.row() >= 0 && idx.row() < VI.attrs.count()) { uint32_t binding = VI.attrs[idx.row()].binding; @@ -2383,7 +2383,7 @@ QString VulkanPipelineStateViewer::disassembleSPIRV(const ShaderReflection *shad if(binHandle.open(QFile::WriteOnly | QIODevice::Truncate)) { binHandle.write( - QByteArray((const char *)shaderDetails->RawBytes.elems, shaderDetails->RawBytes.count)); + QByteArray((const char *)shaderDetails->RawBytes.data(), shaderDetails->RawBytes.count())); binHandle.close(); } else @@ -2592,7 +2592,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QString entryFunc = shaderDetails->EntryPoint; if(entryFunc != lit("main")) shadername = QFormatStr("%1()").arg(entryFunc); - else if(shaderDetails->DebugInfo.files.count > 0) + else if(!shaderDetails->DebugInfo.files.isEmpty()) shadername = QFormatStr("%1() - %2") .arg(entryFunc) .arg(QFileInfo(shaderDetails->DebugInfo.files[0].first).fileName()); @@ -2610,7 +2610,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: (sh.stage == ShaderStage::Compute ? m_Ctx.CurVulkanPipelineState().compute : m_Ctx.CurVulkanPipelineState().graphics); - if(shaderDetails && shaderDetails->ConstantBlocks.count > 0) + if(shaderDetails && !shaderDetails->ConstantBlocks.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("UBOs")); @@ -2618,7 +2618,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ConstantBlocks.count; i++) + for(int i = 0; i < shaderDetails->ConstantBlocks.count(); i++) { const ConstantBlock &b = shaderDetails->ConstantBlocks[i]; const BindpointMap &bindMap = sh.BindpointMapping.ConstantBlocks[i]; @@ -2632,7 +2632,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: // could maybe get range/size from ShaderVariable.reg if it's filled out // from SPIR-V side. rows.push_back({QString(), b.name, tr("Push constants"), (qulonglong)0, (qulonglong)0, - b.variables.count, b.byteSize}); + b.variables.count(), b.byteSize}); continue; } @@ -2658,7 +2658,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QString name; uint64_t byteOffset = descriptorBind.offset; uint64_t length = descriptorBind.size; - int numvars = b.variables.count; + int numvars = b.variables.count(); if(descriptorBind.res == ResourceId()) { @@ -2688,7 +2688,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: rows); } - if(shaderDetails->ReadOnlyResources.count > 0) + if(!shaderDetails->ReadOnlyResources.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Read-only Resources")); @@ -2696,7 +2696,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ReadOnlyResources.count; i++) + for(int i = 0; i < shaderDetails->ReadOnlyResources.count(); i++) { const ShaderResource &b = shaderDetails->ReadOnlyResources[i]; const BindpointMap &bindMap = sh.BindpointMapping.ReadOnlyResources[i]; @@ -2812,7 +2812,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: rows); } - if(shaderDetails->ReadWriteResources.count > 0) + if(!shaderDetails->ReadWriteResources.isEmpty()) { xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Read-write Resources")); @@ -2820,7 +2820,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; - for(int i = 0; i < shaderDetails->ReadWriteResources.count; i++) + for(int i = 0; i < shaderDetails->ReadWriteResources.count(); i++) { const ShaderResource &b = shaderDetails->ReadWriteResources[i]; const BindpointMap &bindMap = sh.BindpointMapping.ReadWriteResources[i]; @@ -3158,11 +3158,11 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeCharacters(tr("Render Pass")); xml.writeEndElement(); - if(pass.renderpass.inputAttachments.count > 0) + if(!pass.renderpass.inputAttachments.isEmpty()) { QList inputs; - for(int i = 0; i < pass.renderpass.inputAttachments.count; i++) + for(int i = 0; i < pass.renderpass.inputAttachments.count(); i++) inputs.push_back({pass.renderpass.inputAttachments[i]}); m_Common.exportHTMLTable(xml, @@ -3175,11 +3175,11 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeEndElement(); } - if(pass.renderpass.colorAttachments.count > 0) + if(!pass.renderpass.colorAttachments.isEmpty()) { QList colors; - for(int i = 0; i < pass.renderpass.colorAttachments.count; i++) + for(int i = 0; i < pass.renderpass.colorAttachments.count(); i++) colors.push_back({pass.renderpass.colorAttachments[i]}); m_Common.exportHTMLTable(xml, diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index fd68c6809..edb3db9a8 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -72,7 +72,7 @@ public: void setHistory(const rdctype::array &history) { - m_ModList.reserve(history.count); + m_ModList.reserve(history.count()); for(const PixelModification &h : history) m_ModList.push_back(h); @@ -670,7 +670,7 @@ void PixelHistoryView::startDebug(EventTag tag) trace = r->DebugPixel((uint32_t)m_Pixel.x(), (uint32_t)m_Pixel.y(), m_Display.sampleIdx, ~0U); }); - if(trace->states.count == 0) + if(trace->states.isEmpty()) { RDDialog::critical(this, tr("Debug Error"), tr("Error debugging pixel.")); m_Ctx.Replay().AsyncInvoke([trace](IReplayController *r) { r->FreeTrace(trace); }); diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 656fbc957..b604531bb 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -354,7 +354,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR &ShaderViewer::disasm_tooltipHide); } - if(shader && shader->DebugInfo.files.count > 0) + if(shader && !shader->DebugInfo.files.isEmpty()) { if(trace) setWindowTitle(QFormatStr("Debug %1() - %2").arg(shader->EntryPoint).arg(debugContext)); @@ -380,7 +380,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR if(trace || sel == NULL) sel = m_DisassemblyView; - if(shader->DebugInfo.files.count > 2) + if(shader->DebugInfo.files.size() > 2) addFileList(); ToolWindowManager::raiseToolWindow(sel); @@ -508,10 +508,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR { for(const SigParameter &s : shader->InputSig) { - QString name = s.varName.count == 0 + QString name = s.varName.isEmpty() ? s.semanticName : QFormatStr("%1 (%2)").arg(s.varName).arg(s.semanticName); - if(s.semanticName.count == 0) + if(s.semanticName.isEmpty()) name = s.varName; QString semIdx = s.needSemanticIndex ? QString::number(s.semanticIndex) : QString(); @@ -536,10 +536,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR for(const SigParameter &s : shader->OutputSig) { - QString name = s.varName.count == 0 + QString name = s.varName.isEmpty() ? s.semanticName : QFormatStr("%1 (%2)").arg(s.varName).arg(s.semanticName); - if(s.semanticName.count == 0) + if(s.semanticName.isEmpty()) name = s.varName; if(multipleStreams) @@ -912,7 +912,7 @@ bool ShaderViewer::stepNext() if(!m_Trace) return false; - if(CurrentStep() + 1 >= m_Trace->states.count) + if(CurrentStep() + 1 >= m_Trace->states.count()) return false; SetCurrentStep(CurrentStep() + 1); @@ -989,7 +989,7 @@ void ShaderViewer::runTo(int runToInstruction, bool forward, ShaderEvents condit bool firstStep = true; - while(step < m_Trace->states.count) + while(step < m_Trace->states.count()) { if(runToInstruction >= 0 && m_Trace->states[step].nextInstruction == (uint32_t)runToInstruction) break; @@ -1002,7 +1002,7 @@ void ShaderViewer::runTo(int runToInstruction, bool forward, ShaderEvents condit firstStep = false; - if(step + inc < 0 || step + inc >= m_Trace->states.count) + if(step + inc < 0 || step + inc >= m_Trace->states.count()) break; step += inc; @@ -1095,7 +1095,7 @@ void ShaderViewer::addFileList() void ShaderViewer::updateDebugging() { - if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count) + if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count()) return; const ShaderDebugState &state = m_Trace->states[m_CurrentStep]; @@ -1103,7 +1103,7 @@ void ShaderViewer::updateDebugging() uint32_t nextInst = state.nextInstruction; bool done = false; - if(m_CurrentStep == m_Trace->states.count - 1) + if(m_CurrentStep == m_Trace->states.count() - 1) { nextInst--; done = true; @@ -1133,9 +1133,9 @@ void ShaderViewer::updateDebugging() if(ui->constants->topLevelItemCount() == 0) { - for(int i = 0; i < m_Trace->cbuffers.count; i++) + for(int i = 0; i < m_Trace->cbuffers.count(); i++) { - for(int j = 0; j < m_Trace->cbuffers[i].count; j++) + for(int j = 0; j < m_Trace->cbuffers[i].count(); j++) { if(m_Trace->cbuffers[i][j].rows > 0 || m_Trace->cbuffers[i][j].columns > 0) { @@ -1149,7 +1149,7 @@ void ShaderViewer::updateDebugging() } } - for(int i = 0; i < m_Trace->inputs.count; i++) + for(int i = 0; i < m_Trace->inputs.count(); i++) { const ShaderVariable &input = m_Trace->inputs[i]; @@ -1171,7 +1171,8 @@ void ShaderViewer::updateDebugging() bool tree = false; for(int i = 0; - i < m_Mapping->ReadWriteResources.count && i < m_ShaderDetails->ReadWriteResources.count; i++) + i < m_Mapping->ReadWriteResources.count() && i < m_ShaderDetails->ReadWriteResources.count(); + i++) { BindpointMap bind = m_Mapping->ReadWriteResources[i]; @@ -1202,7 +1203,8 @@ void ShaderViewer::updateDebugging() } for(int i = 0; - i < m_Mapping->ReadOnlyResources.count && i < m_ShaderDetails->ReadOnlyResources.count; i++) + i < m_Mapping->ReadOnlyResources.count() && i < m_ShaderDetails->ReadOnlyResources.count(); + i++) { BindpointMap bind = m_Mapping->ReadOnlyResources[i]; @@ -1241,21 +1243,21 @@ void ShaderViewer::updateDebugging() if(ui->variables->topLevelItemCount() == 0) { - for(int i = 0; i < state.registers.count; i++) + for(int i = 0; i < state.registers.count(); i++) ui->variables->addTopLevelItem( new RDTreeWidgetItem({state.registers[i].name, lit("temporary"), QString()})); - for(int i = 0; i < state.indexableTemps.count; i++) + for(int i = 0; i < state.indexableTemps.count(); i++) { RDTreeWidgetItem *node = new RDTreeWidgetItem({QFormatStr("x%1").arg(i), lit("indexable"), QString()}); - for(int t = 0; t < state.indexableTemps[i].count; t++) + for(int t = 0; t < state.indexableTemps[i].count(); t++) node->addChild( new RDTreeWidgetItem({state.indexableTemps[i][t].name, lit("indexable"), QString()})); ui->variables->addTopLevelItem(node); } - for(int i = 0; i < state.outputs.count; i++) + for(int i = 0; i < state.outputs.count(); i++) ui->variables->addTopLevelItem( new RDTreeWidgetItem({state.outputs[i].name, lit("output"), QString()})); } @@ -1264,7 +1266,7 @@ void ShaderViewer::updateDebugging() int v = 0; - for(int i = 0; i < state.registers.count; i++) + for(int i = 0; i < state.registers.count(); i++) { RDTreeWidgetItem *node = ui->variables->topLevelItem(v++); @@ -1272,11 +1274,11 @@ void ShaderViewer::updateDebugging() node->setTag(QVariant::fromValue(VariableTag(VariableCategory::Temporaries, i))); } - for(int i = 0; i < state.indexableTemps.count; i++) + for(int i = 0; i < state.indexableTemps.count(); i++) { RDTreeWidgetItem *node = ui->variables->topLevelItem(v++); - for(int t = 0; t < state.indexableTemps[i].count; t++) + for(int t = 0; t < state.indexableTemps[i].count(); t++) { RDTreeWidgetItem *child = node->child(t); @@ -1285,7 +1287,7 @@ void ShaderViewer::updateDebugging() } } - for(int i = 0; i < state.outputs.count; i++) + for(int i = 0; i < state.outputs.count(); i++) { RDTreeWidgetItem *node = ui->variables->topLevelItem(v++); @@ -1363,9 +1365,9 @@ void ShaderViewer::updateDebugging() ok = false; int regindex = regidx.toInt(&ok); - if(vars && ok && regindex >= 0 && regindex < vars->count) + if(vars && ok && regindex >= 0 && regindex < vars->count()) { - const ShaderVariable &vr = vars->elems[regindex]; + const ShaderVariable &vr = (*vars)[regindex]; if(swizzle.isEmpty()) { @@ -1457,7 +1459,7 @@ int ShaderViewer::CurrentStep() void ShaderViewer::SetCurrentStep(int step) { if(m_Trace && !m_Trace->states.empty()) - m_CurrentStep = qBound(0, step, m_Trace->states.count - 1); + m_CurrentStep = qBound(0, step, m_Trace->states.count() - 1); else m_CurrentStep = 0; @@ -1860,7 +1862,7 @@ bool ShaderViewer::eventFilter(QObject *watched, QEvent *event) void ShaderViewer::disasm_tooltipShow(int x, int y) { // do nothing if there's no trace - if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count) + if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count()) return; // ignore any messages if we're already outside the viewport @@ -1896,7 +1898,7 @@ void ShaderViewer::showVariableTooltip(VariableCategory varCat, int varIdx, int { const rdctype::array *vars = GetVariableList(varCat, arrayIdx); - if(!vars || varIdx < 0 || varIdx >= vars->count) + if(!vars || varIdx < 0 || varIdx >= vars->count()) { m_TooltipVarIdx = -1; return; @@ -1915,7 +1917,7 @@ const rdctype::array *ShaderViewer::GetVariableList(VariableCate { const rdctype::array *vars = NULL; - if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count) + if(!m_Trace || m_CurrentStep < 0 || m_CurrentStep >= m_Trace->states.count()) return vars; const ShaderDebugState &state = m_Trace->states[m_CurrentStep]; @@ -1927,11 +1929,11 @@ const rdctype::array *ShaderViewer::GetVariableList(VariableCate case VariableCategory::Unknown: vars = NULL; break; case VariableCategory::Temporaries: vars = &state.registers; break; case VariableCategory::IndexTemporaries: - vars = arrayIdx < state.indexableTemps.count ? &state.indexableTemps[arrayIdx] : NULL; + vars = arrayIdx < state.indexableTemps.count() ? &state.indexableTemps[arrayIdx] : NULL; break; case VariableCategory::Inputs: vars = &m_Trace->inputs; break; case VariableCategory::Constants: - vars = arrayIdx < m_Trace->cbuffers.count ? &m_Trace->cbuffers[arrayIdx] : NULL; + vars = arrayIdx < m_Trace->cbuffers.count() ? &m_Trace->cbuffers[arrayIdx] : NULL; break; case VariableCategory::Outputs: vars = &state.outputs; break; } @@ -1976,7 +1978,7 @@ void ShaderViewer::updateVariableTooltip() return; const rdctype::array *vars = GetVariableList(m_TooltipVarCat, m_TooltipArrayIdx); - const ShaderVariable &var = vars->elems[m_TooltipVarIdx]; + const ShaderVariable &var = (*vars)[m_TooltipVarIdx]; QString text = QFormatStr("
%1\n").arg(var.name);
   text +=
diff --git a/qrenderdoc/Windows/StatisticsViewer.cpp b/qrenderdoc/Windows/StatisticsViewer.cpp
index a737fa53d..f4a6481b0 100644
--- a/qrenderdoc/Windows/StatisticsViewer.cpp
+++ b/qrenderdoc/Windows/StatisticsViewer.cpp
@@ -72,7 +72,7 @@ QString CreateSimpleIntegerHistogram(const QString &legend, const rdctype::array
   uint32_t maxCount = 0;
   int maxWithValue = 0;
 
-  for(int o = 0; o < array.count; o++)
+  for(int o = 0; o < array.count(); o++)
   {
     uint32_t value = array[o];
     if(value > 0)
@@ -111,7 +111,7 @@ void StatisticsViewer::AppendDrawStatistics()
     m_Report.append(tr("\nInstance counts:\n"));
     uint32_t maxCount = 0;
     int maxWithValue = 0;
-    int maximum = draws.counts.count;
+    int maximum = draws.counts.count();
     for(int s = 1; s < maximum; s++)
     {
       uint32_t value = draws.counts[s];
@@ -224,8 +224,8 @@ void StatisticsViewer::AppendConstantBindStatistics()
   memset(&totalConstantsPerStage, 0, sizeof(totalConstantsPerStage));
   for(auto s : indices())
   {
-    totalConstantsPerStage[s].bindslots.create(reference.bindslots.count);
-    totalConstantsPerStage[s].sizes.create(reference.sizes.count);
+    totalConstantsPerStage[s].bindslots.resize(reference.bindslots.size());
+    totalConstantsPerStage[s].sizes.resize(reference.sizes.size());
   }
 
   {
@@ -236,18 +236,18 @@ void StatisticsViewer::AppendConstantBindStatistics()
       totalConstantsPerStage[s].sets += constants[s].sets;
       totalConstantsPerStage[s].nulls += constants[s].nulls;
 
-      for(int l = 0; l < constants[s].bindslots.count; l++)
+      for(int l = 0; l < constants[s].bindslots.count(); l++)
         totalConstantsPerStage[s].bindslots[l] += constants[s].bindslots[l];
 
-      for(int z = 0; z < constants[s].sizes.count; z++)
+      for(int z = 0; z < constants[s].sizes.count(); z++)
         totalConstantsPerStage[s].sizes[z] += constants[s].sizes[z];
     }
   }
 
   ConstantBindStats totalConstantsForAllStages;
   memset(&totalConstantsForAllStages, 0, sizeof(totalConstantsForAllStages));
-  totalConstantsForAllStages.bindslots.create(totalConstantsPerStage[0].bindslots.count);
-  totalConstantsForAllStages.sizes.create(totalConstantsPerStage[0].sizes.count);
+  totalConstantsForAllStages.bindslots.resize(totalConstantsPerStage[0].bindslots.size());
+  totalConstantsForAllStages.sizes.resize(totalConstantsPerStage[0].sizes.size());
 
   for(auto s : indices())
   {
@@ -256,10 +256,10 @@ void StatisticsViewer::AppendConstantBindStatistics()
     totalConstantsForAllStages.sets += perStage.sets;
     totalConstantsForAllStages.nulls += perStage.nulls;
 
-    for(int l = 0; l < perStage.bindslots.count; l++)
+    for(int l = 0; l < perStage.bindslots.count(); l++)
       totalConstantsForAllStages.bindslots[l] += perStage.bindslots[l];
 
-    for(int z = 0; z < perStage.sizes.count; z++)
+    for(int z = 0; z < perStage.sizes.count(); z++)
       totalConstantsForAllStages.sizes[z] += perStage.sizes[z];
   }
 
@@ -286,7 +286,7 @@ void StatisticsViewer::AppendConstantBindStatistics()
   m_Report.append(tr("\nAggregate constant buffer sizes across all stages:\n"));
   uint32_t maxCount = 0;
   int maxWithValue = 0;
-  for(int s = 0; s < totalConstantsForAllStages.sizes.count; s++)
+  for(int s = 0; s < totalConstantsForAllStages.sizes.count(); s++)
   {
     uint32_t value = totalConstantsForAllStages.sizes[s];
     if(value > 0)
@@ -316,7 +316,7 @@ void StatisticsViewer::AppendSamplerBindStatistics()
   memset(&totalSamplersPerStage, 0, sizeof(totalSamplersPerStage));
   for(auto s : indices())
   {
-    totalSamplersPerStage[s].bindslots.create(reference.bindslots.count);
+    totalSamplersPerStage[s].bindslots.resize(reference.bindslots.size());
   }
 
   {
@@ -327,7 +327,7 @@ void StatisticsViewer::AppendSamplerBindStatistics()
       totalSamplersPerStage[s].sets += samplers[s].sets;
       totalSamplersPerStage[s].nulls += samplers[s].nulls;
 
-      for(int l = 0; l < samplers[s].bindslots.count; l++)
+      for(int l = 0; l < samplers[s].bindslots.count(); l++)
       {
         totalSamplersPerStage[s].bindslots[l] += samplers[s].bindslots[l];
       }
@@ -336,7 +336,7 @@ void StatisticsViewer::AppendSamplerBindStatistics()
 
   SamplerBindStats totalSamplersForAllStages;
   memset(&totalSamplersForAllStages, 0, sizeof(totalSamplersForAllStages));
-  totalSamplersForAllStages.bindslots.create(totalSamplersPerStage[0].bindslots.count);
+  totalSamplersForAllStages.bindslots.resize(totalSamplersPerStage[0].bindslots.size());
 
   for(auto s : indices())
   {
@@ -344,7 +344,7 @@ void StatisticsViewer::AppendSamplerBindStatistics()
     totalSamplersForAllStages.calls += perStage.calls;
     totalSamplersForAllStages.sets += perStage.sets;
     totalSamplersForAllStages.nulls += perStage.nulls;
-    for(int l = 0; l < perStage.bindslots.count; l++)
+    for(int l = 0; l < perStage.bindslots.count(); l++)
     {
       totalSamplersForAllStages.bindslots[l] += perStage.bindslots[l];
     }
@@ -382,8 +382,8 @@ void StatisticsViewer::AppendResourceBindStatistics()
   memset(&totalResourcesPerStage, 0, sizeof(totalResourcesPerStage));
   for(auto s : indices())
   {
-    totalResourcesPerStage[s].types.create(reference.types.count);
-    totalResourcesPerStage[s].bindslots.create(reference.bindslots.count);
+    totalResourcesPerStage[s].types.resize(reference.types.size());
+    totalResourcesPerStage[s].bindslots.resize(reference.bindslots.size());
   }
 
   {
@@ -394,12 +394,12 @@ void StatisticsViewer::AppendResourceBindStatistics()
       totalResourcesPerStage[s].sets += resources[s].sets;
       totalResourcesPerStage[s].nulls += resources[s].nulls;
 
-      for(int z = 0; z < resources[s].types.count; z++)
+      for(int z = 0; z < resources[s].types.count(); z++)
       {
         totalResourcesPerStage[s].types[z] += resources[s].types[z];
       }
 
-      for(int l = 0; l < resources[s].bindslots.count; l++)
+      for(int l = 0; l < resources[s].bindslots.count(); l++)
       {
         totalResourcesPerStage[s].bindslots[l] += resources[s].bindslots[l];
       }
@@ -408,8 +408,8 @@ void StatisticsViewer::AppendResourceBindStatistics()
 
   ResourceBindStats totalResourcesForAllStages;
   memset(&totalResourcesForAllStages, 0, sizeof(totalResourcesForAllStages));
-  totalResourcesForAllStages.types.create(totalResourcesPerStage[0].types.count);
-  totalResourcesForAllStages.bindslots.create(totalResourcesPerStage[0].bindslots.count);
+  totalResourcesForAllStages.types.resize(totalResourcesPerStage[0].types.size());
+  totalResourcesForAllStages.bindslots.resize(totalResourcesPerStage[0].bindslots.size());
 
   for(auto s : indices())
   {
@@ -417,11 +417,11 @@ void StatisticsViewer::AppendResourceBindStatistics()
     totalResourcesForAllStages.calls += perStage.calls;
     totalResourcesForAllStages.sets += perStage.sets;
     totalResourcesForAllStages.nulls += perStage.nulls;
-    for(int t = 0; t < perStage.types.count; t++)
+    for(int t = 0; t < perStage.types.count(); t++)
     {
       totalResourcesForAllStages.types[t] += perStage.types[t];
     }
-    for(int l = 0; l < perStage.bindslots.count; l++)
+    for(int l = 0; l < perStage.bindslots.count(); l++)
     {
       totalResourcesForAllStages.bindslots[l] += perStage.bindslots[l];
     }
@@ -447,7 +447,7 @@ void StatisticsViewer::AppendResourceBindStatistics()
   int maxWithCount = 0;
 
   m_Report.append(tr("\nResource types across all stages:\n"));
-  for(int s = 0; s < totalResourcesForAllStages.types.count; s++)
+  for(int s = 0; s < totalResourcesForAllStages.types.count(); s++)
   {
     uint32_t count = totalResourcesForAllStages.types[s];
     if(count > 0)
@@ -478,8 +478,8 @@ void StatisticsViewer::AppendUpdateStatistics()
 
   ResourceUpdateStats totalUpdates;
   memset(&totalUpdates, 0, sizeof(totalUpdates));
-  totalUpdates.types.create(reference.types.count);
-  totalUpdates.sizes.create(reference.sizes.count);
+  totalUpdates.types.resize(reference.types.size());
+  totalUpdates.sizes.resize(reference.sizes.size());
 
   {
     ResourceUpdateStats updates = frameInfo.stats.updates;
@@ -488,10 +488,10 @@ void StatisticsViewer::AppendUpdateStatistics()
     totalUpdates.clients += updates.clients;
     totalUpdates.servers += updates.servers;
 
-    for(int t = 0; t < updates.types.count; t++)
+    for(int t = 0; t < updates.types.count(); t++)
       totalUpdates.types[t] += updates.types[t];
 
-    for(int t = 0; t < updates.sizes.count; t++)
+    for(int t = 0; t < updates.sizes.count(); t++)
       totalUpdates.sizes[t] += updates.sizes[t];
   }
 
@@ -505,7 +505,7 @@ void StatisticsViewer::AppendUpdateStatistics()
   m_Report.append(tr("\nUpdated resource types:\n"));
   uint32_t maxCount = 0;
   int maxWithValue = 0;
-  for(int s = 1; s < totalUpdates.types.count; s++)
+  for(int s = 1; s < totalUpdates.types.count(); s++)
   {
     uint32_t value = totalUpdates.types[s];
     if(value > 0)
@@ -525,7 +525,7 @@ void StatisticsViewer::AppendUpdateStatistics()
   m_Report.append(tr("\nUpdated resource sizes:\n"));
   maxCount = 0;
   maxWithValue = 0;
-  for(int s = 0; s < totalUpdates.sizes.count; s++)
+  for(int s = 0; s < totalUpdates.sizes.count(); s++)
   {
     uint32_t value = totalUpdates.sizes[s];
     if(value > 0)
@@ -695,8 +695,8 @@ void StatisticsViewer::GenerateReport()
   uint32_t numAPIcalls =
       m_Ctx.GetLastDrawcall()->eventID - (drawCount + dispatchCount + diagnosticCount);
 
-  int numTextures = m_Ctx.GetTextures().count;
-  int numBuffers = m_Ctx.GetBuffers().count;
+  int numTextures = m_Ctx.GetTextures().count();
+  int numBuffers = m_Ctx.GetBuffers().count();
 
   uint64_t IBBytes = 0;
   uint64_t VBBytes = 0;
diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp
index 8dc94e067..e95418eee 100644
--- a/qrenderdoc/Windows/TextureViewer.cpp
+++ b/qrenderdoc/Windows/TextureViewer.cpp
@@ -135,7 +135,7 @@ BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx)
 
     ShaderBindpointMapping mapping = GetMapping(ctx);
 
-    if(index < mapping.ReadWriteResources.count)
+    if(index < mapping.ReadWriteResources.count())
     {
       BindpointMap &key = mapping.ReadWriteResources[index];
 
@@ -149,7 +149,7 @@ BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx)
 
     ShaderBindpointMapping mapping = GetMapping(ctx);
 
-    if(index < mapping.ReadOnlyResources.count)
+    if(index < mapping.ReadOnlyResources.count())
     {
       BindpointMap &key = mapping.ReadOnlyResources[index];
 
@@ -341,7 +341,7 @@ public:
     const rdctype::array src = ctx.GetTextures();
 
     texs.clear();
-    texs.reserve(src.count);
+    texs.reserve(src.count());
 
     emit beginResetModel();
 
@@ -739,9 +739,9 @@ void TextureViewer::RT_UpdateVisualRange(IReplayController *)
 
   if(!histogram.empty())
   {
-    QVector histogramVec(histogram.count);
-    if(histogram.count > 0)
-      memcpy(histogramVec.data(), histogram.elems, histogram.count * sizeof(uint32_t));
+    QVector histogramVec(histogram.count());
+    if(!histogram.isEmpty())
+      memcpy(histogramVec.data(), histogram.data(), histogram.byteSize());
 
     GUIInvoke::call([this, histogramVec]() {
       ui->rangeHistogram->setHistogramRange(ui->rangeHistogram->rangeMin(),
@@ -1997,7 +1997,7 @@ void TextureViewer::InitStageResourcePreviews(ShaderStage stage,
                                               ThumbnailStrip *prevs, int &prevIndex, bool copy,
                                               bool rw)
 {
-  for(int idx = 0; idx < mapping.count; idx++)
+  for(int idx = 0; idx < mapping.count(); idx++)
   {
     const BindpointMap &key = mapping[idx];
 
@@ -3403,7 +3403,7 @@ void TextureViewer::on_debugPixelContext_clicked()
   m_Ctx.Replay().AsyncInvoke([this, x, y](IReplayController *r) {
     ShaderDebugTrace *trace = r->DebugPixel((uint32_t)x, (uint32_t)y, m_TexDisplay.sampleIdx, ~0U);
 
-    if(trace->states.count == 0)
+    if(trace->states.isEmpty())
     {
       r->FreeTrace(trace);
 
diff --git a/qrenderdoc/Windows/TimelineBar.cpp b/qrenderdoc/Windows/TimelineBar.cpp
index 6325cf6cf..18634a53f 100644
--- a/qrenderdoc/Windows/TimelineBar.cpp
+++ b/qrenderdoc/Windows/TimelineBar.cpp
@@ -934,7 +934,7 @@ uint32_t TimelineBar::processDraws(QVector &markers, QVector &
 
   for(const DrawcallDescription &d : curDraws)
   {
-    if(d.children.count > 0)
+    if(!d.children.isEmpty())
     {
       markers.push_back(Marker());
       Marker &m = markers.back();
diff --git a/renderdoc/3rdparty/catch/catch.cpp b/renderdoc/3rdparty/catch/catch.cpp
index e5c0bd3f1..3bf2f946f 100644
--- a/renderdoc/3rdparty/catch/catch.cpp
+++ b/renderdoc/3rdparty/catch/catch.cpp
@@ -287,12 +287,12 @@ RENDERDOC_RunUnitTests(const rdctype::str &command, const rdctype::array
 #include 
 
+typedef uint8_t byte;
+
 #ifndef DOCUMENT
 #define DOCUMENT(text)
 #endif
@@ -48,14 +50,8 @@
 #define DOCUMENT4(text1, text2, text3, text4)
 #endif
 
-// we provide a basic templated type that is a fixed array that just contains a pointer to the
-// element
-// array and a size. This could easily map to C as just void* and size but in C++ at least we can be
-// type safe.
-//
-// While we can use STL elsewhere in the main library, we want to expose data to the UI layer as
-// fixed
-// arrays so that it's a plain C compatible interface.
+// here we define our own data structures that are ABI compatible between modules, as STL is not
+// safe to pass a module boundary.
 namespace rdctype
 {
 template 
@@ -76,199 +72,500 @@ pair make_pair(const A &a, const B &b)
   return ret;
 }
 
+// utility class that adds a NULL terminator to array operations only if T == char
+template 
+struct null_terminator
+{
+  // adds 1 to every allocation to ensure we have space. Happens invisibly so even capacity()
+  // doesn't know about it
+  inline static size_t allocCount(size_t c) { return c; }
+  // adds the NULL terminator after a resize operation
+  inline static void fixup(T *elems, size_t count) {}
+};
+
+template <>
+struct null_terminator
+{
+  inline static size_t allocCount(size_t c) { return c + 1; }
+  // indexing 'off the end' of elems is safe because we over-allocated above
+  inline static void fixup(char *elems, size_t count) { elems[count] = 0; }
+};
+
 template 
 struct array
 {
+protected:
   T *elems;
-  int32_t count;
+  int32_t allocatedCount;
+  int32_t usedCount;
 
-  array() : elems(0), count(0) {}
-  ~array() { Delete(); }
-  void Delete()
+  /////////////////////////////////////////////////////////////////
+  // memory management, in a dll safe way
+  static T *allocate(size_t count)
   {
-    for(int32_t i = 0; i < count; i++)
-      elems[i].~T();
-    deallocate(elems);
-    elems = 0;
-    count = 0;
+#ifdef RENDERDOC_EXPORTS
+    return (T *)malloc(count * sizeof(T));
+#else
+    return (T *)RENDERDOC_AllocArrayMem(count * sizeof(T));
+#endif
+  }
+  static void deallocate(const T *p)
+  {
+#ifdef RENDERDOC_EXPORTS
+    free((void *)p);
+#else
+    RENDERDOC_FreeArrayMem((const void *)p);
+#endif
   }
 
-#ifdef RENDERDOC_EXPORTS
-  static void *allocate(size_t s) { return malloc(s); }
-  static void deallocate(const void *p) { free((void *)p); }
-#else
-  static void *allocate(size_t s) { return RENDERDOC_AllocArrayMem(s); }
-  static void deallocate(const void *p) { RENDERDOC_FreeArrayMem(p); }
-#endif
+  inline void setUsedCount(int32_t newCount)
+  {
+    usedCount = newCount;
+    null_terminator::fixup(elems, usedCount);
+  }
 
+public:
+  typedef T value_type;
+
+  array() : elems(NULL), allocatedCount(0), usedCount(0) {}
+  ~array()
+  {
+    // clear will destruct the actual elements still existing
+    clear();
+    // then we deallocate the backing store
+    deallocate(elems);
+    elems = NULL;
+    allocatedCount = 0;
+  }
+
+  /////////////////////////////////////////////////////////////////
+  // simple accessors
   T &operator[](size_t i) { return elems[i]; }
   const T &operator[](size_t i) const { return elems[i]; }
-  array(const std::vector &in)
+  T *data() { return elems; }
+  const T *data() const { return elems; }
+  T *begin() { return elems ? elems : end(); }
+  T *end() { return elems ? elems + usedCount : NULL; }
+  T &front() { return *elems; }
+  T &back() { return *(elems + usedCount - 1); }
+  T &at(size_t idx) { return elems[idx]; }
+  const T *begin() const { return elems ? elems : end(); }
+  const T *end() const { return elems ? elems + usedCount : NULL; }
+  const T &front() const { return *elems; }
+  const T &back() const { return *(elems + usedCount - 1); }
+  size_t size() const { return (size_t)usedCount; }
+  size_t byteSize() const { return (size_t)usedCount * sizeof(T); }
+  int32_t count() const { return (int32_t)usedCount; }
+  size_t capacity() const { return (size_t)allocatedCount; }
+  bool empty() const { return usedCount == 0; }
+  bool isEmpty() const { return usedCount == 0; }
+  void clear() { resize(0); }
+  void push_back(const T &el) { insert(size(), &el, 1); }
+  /////////////////////////////////////////////////////////////////
+  // managing elements and memory
+
+  void reserve(size_t s)
   {
-    elems = 0;
-    count = 0;
-    *this = in;
-  }
-  array &operator=(const std::vector &in)
-  {
-    Delete();
-    count = (int32_t)in.size();
-    if(count == 0)
+    // if we're empty then normally reserving s==0 would do nothing, but if we need to append a null
+    // terminator then we do actually need to allocate
+    if(s == 0 && capacity() == 0 && null_terminator::allocCount(0) > 0)
     {
-      elems = 0;
+      elems = allocate(null_terminator::allocCount(0));
+      return;
     }
-    else
-    {
-      elems = (T *)allocate(sizeof(T) * count);
-      for(int32_t i = 0; i < count; i++)
-        new(elems + i) T(in[i]);
-    }
-    return *this;
+
+    // nothing to do if we already have this much space. We only size up
+    if(s <= capacity())
+      return;
+
+    // for now, just resize exactly to what's needed.
+    T *newElems = allocate(null_terminator::allocCount(s));
+
+    // copy the elements to new storage
+    for(int32_t i = 0; i < usedCount; i++)
+      new(newElems + i) T(elems[i]);
+
+    // delete the old elements
+    for(int32_t i = 0; i < usedCount; i++)
+      elems[i].~T();
+
+    // deallocate tee old storage
+    deallocate(elems);
+
+    // swap the storage. usedCount doesn't change
+    elems = newElems;
+
+    // update allocated size
+    allocatedCount = (int32_t)s;
   }
 
-  array(const std::initializer_list &in)
+  void resize(size_t s)
   {
-    elems = 0;
-    count = 0;
-    *this = in;
-  }
-  array &operator=(const std::initializer_list &in)
-  {
-    Delete();
-    count = (int32_t)in.size();
-    if(count == 0)
+    // do nothing if we're already this size
+    if(s == size())
+      return;
+
+    int32_t oldCount = usedCount;
+
+    if(s > size())
     {
-      elems = 0;
+      // make sure we have backing store allocated
+      reserve(s);
+
+      // update the currently allocated count
+      setUsedCount((int32_t)s);
+
+      // default initialise the new elements
+      for(int32_t i = oldCount; i < usedCount; i++)
+        new(elems + i) T();
     }
     else
     {
-      elems = (T *)allocate(sizeof(T) * count);
-      int i = 0;
-      for(const T &t : in)
+      // resizing down, we just need to update the count and destruct removed elements
+      setUsedCount((int32_t)s);
+
+      for(int32_t i = usedCount; i < oldCount; i++)
+        elems[i].~T();
+    }
+  }
+
+  void insert(size_t offs, const T *el, size_t count)
+  {
+    const size_t oldSize = size();
+
+    // invalid size
+    if(offs > oldSize)
+      return;
+
+    size_t newSize = oldSize + count;
+
+    // reserve more space if needed
+    reserve(newSize);
+
+    // fast path where offs == size(), for push_back
+    if(offs == oldSize)
+    {
+      // copy construct the new element into place. There was nothing here to destruct as it was
+      // unused memory
+      for(size_t i = 0; i < count; i++)
+        new(elems + offs + i) T(el[i]);
+    }
+    else
+    {
+      // we need to shuffle everything up. Iterate from the back in two stages: first into the
+      // newly-allocated elements that don't need to be destructed. Then one-by-one destructing an
+      // element (which has been moved later), and copy-constructing the new one into place
+      //
+      // e.g. an array of 6 elements, inserting 3 more at offset 1
+      //
+      // <==    old data     ==> <== new ==>
+      // [0] [1] [2] [3] [4] [5] [6] [7] [8]
+      //  A   B   C   D   E   F   .   .   .
+      //
+      // first pass:
+      //
+      // [8].copyConstruct([5])
+      // [7].copyConstruct([4])
+      // [6].copyConstruct([3])
+      //
+      // [0] [1] [2] [3] [4] [5] [6] [7] [8]
+      //  A   B   C   D*  E*  F*  D   E   F
+      //
+      // * marked elements have been moved now, so they're free to destruct.
+      //
+      // second pass:
+      // [5].destruct()
+      // [5].copyConstruct([2])
+      // [4].destruct()
+      // [4].copyConstruct([1])
+      //
+      // [0] [1] [2] [3] [4] [5] [6] [7] [8]
+      //  A   B*  C*  D*  B   C   D   E   F
+      //
+      // Note that at each point, we're moving 'count' elements along - 5->8, 4->7, 3->6, 2->5, 1->4
+      //
+      // [1] through [3] will be destructed next when we actually do the insert
+      //
+      // if we're inserting more elements than existed before, there may be gaps. E.g. if we
+      // inserted 10 in the example above we'd end up with something like:
+      //
+      // [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [a] [b] [c] [d] [e] [f]
+      //  A   B*  C*  D*  E*  F*  .   .   .   .   .   B   C   D   E   F
+      //
+      // and the second pass wouldn't have had anything to do.
+      // In the next part we just need to check if the slot was < oldCount to know if we should
+      // destruct it before inserting.
+
+      // first pass, copy
+      for(size_t i = 0; i < count; i++)
+        new(elems + oldSize + count - 1 - i) T(elems[oldSize - 1 - i]);
+
+      // second pass, destruct & copy if there was any overlap
+      if(count < oldSize - offs)
       {
-        new(elems + i) T(t);
-        i++;
+        size_t overlap = oldSize - offs - count;
+        for(size_t i = 0; i < overlap; i++)
+        {
+          // destruct old element
+          elems[oldSize - 1 - i].~T();
+          // copy from earlier
+          new(elems + oldSize - 1 - i) T(elems[oldSize - 1 - count - i]);
+        }
+      }
+
+      // elems[offs] to elems[offs + count - 1] are now free to construct into.
+      for(size_t i = 0; i < count; i++)
+      {
+        // if this was one used previously, destruct it
+        if(i < oldSize)
+          elems[offs + i].~T();
+
+        // then copy construct the new value
+        new(elems + offs + i) T(el[i]);
       }
     }
+
+    // update new size
+    setUsedCount(usedCount + (int32_t)count);
+  }
+
+  // a couple of helpers
+  inline void insert(size_t offs, const std::vector &in) { insert(offs, in.data(), in.size()); }
+  inline void insert(size_t offs, const std::initializer_list &in)
+  {
+    insert(offs, in.begin(), in.size());
+  }
+  inline void insert(size_t offs, const array &in) { insert(offs, in.data(), in.size()); }
+  inline void insert(size_t offs, const T &in) { insert(offs, &in, 1); }
+  void erase(size_t offs, size_t count = 1)
+  {
+    // invalid count
+    if(offs + count > size())
+      return;
+
+    // this is simpler to implement than insert(). We do two simpler passes:
+    //
+    // Pass 1: Iterate over the secified range, destruct it.
+    // Pass 2: Iterate over the remainder after the range (if it exists), destruct and
+    // copy-construct into new place
+
+    // destruct elements to be removed
+    for(size_t i = 0; i < count; i++)
+      elems[offs + i].~T();
+
+    // move remaining elements into place
+    for(size_t i = offs + count; i < size(); i++)
+    {
+      new(elems + i - count) T(elems[i]);
+      elems[i].~T();
+    }
+
+    // update new size
+    setUsedCount(usedCount - (int32_t)count);
+  }
+  /////////////////////////////////////////////////////////////////
+  // constructors that just forward to assign
+  array(const T *in, size_t count)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in, count);
+  }
+  array(const std::vector &in)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in);
+  }
+  array(const std::initializer_list &in)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in);
+  }
+  array(const array &in)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in);
+  }
+
+  inline void swap(array &other)
+  {
+    std::swap(elems, other.elems);
+    std::swap(allocatedCount, other.allocatedCount);
+    std::swap(usedCount, other.usedCount);
+  }
+
+  // assign forwards to operator =
+  inline void assign(const std::vector &in) { *this = in; }
+  inline void assign(const std::initializer_list &in) { *this = in; }
+  inline void assign(const array &in) { *this = in; }
+  /////////////////////////////////////////////////////////////////
+  // assignment operators
+  array &operator=(const std::vector &in)
+  {
+    // make sure we have enough space, allocating more if needed
+    reserve(in.size());
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount((int32_t)in.size());
+
+    // copy construct the new elems
+    for(int32_t i = 0; i < usedCount; i++)
+      new(elems + i) T(in[i]);
+
+    null_terminator::fixup(elems, usedCount);
+
     return *this;
   }
 
-  array(const array &o)
+  array &operator=(const std::initializer_list &in)
   {
-    elems = 0;
-    count = 0;
-    *this = o;
+    // make sure we have enough space, allocating more if needed
+    reserve(in.size());
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount((int32_t)in.size());
+
+    // copy construct the new elems
+    int32_t i = 0;
+    for(const T &t : in)
+    {
+      new(elems + i) T(t);
+      i++;
+    }
+
+    null_terminator::fixup(elems, usedCount);
+
+    return *this;
   }
 
-  array &operator=(const array &o)
+  array &operator=(const array &in)
   {
     // do nothing if we're self-assigning
-    if(this == &o)
+    if(this == &in)
       return *this;
 
-    Delete();
-    count = o.count;
-    if(count == 0)
-    {
-      elems = 0;
-    }
-    else
-    {
-      elems = (T *)allocate(sizeof(T) * o.count);
-      for(int32_t i = 0; i < count; i++)
-        new(elems + i) T(o.elems[i]);
-    }
+    // make sure we have enough space, allocating more if needed
+    reserve(in.size());
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount((int32_t)in.size());
+
+    // copy construct the new elems
+    for(int32_t i = 0; i < usedCount; i++)
+      new(elems + i) T(in[i]);
+
+    null_terminator::fixup(elems, usedCount);
+
     return *this;
   }
 
-  void create(int sz)
+  // assignment with no operator = taking a pointer and length
+  inline void assign(const T *in, size_t count)
   {
-    Delete();
-    count = sz;
-    if(sz == 0)
-    {
-      elems = 0;
-    }
-    else
-    {
-      elems = (T *)allocate(sizeof(T) * count);
-      memset(elems, 0, sizeof(T) * count);
-    }
+    // make sure we have enough space, allocating more if needed
+    reserve(count);
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount((int32_t)count);
+
+    // copy construct the new elems
+    for(int32_t i = 0; i < usedCount; i++)
+      new(elems + i) T(in[i]);
   }
 
-  // provide some of the familiar stl interface
-  size_t size() const { return (size_t)count; }
-  void clear() { Delete(); }
-  bool empty() const { return count == 0; }
-  T *begin() { return elems ? elems : end(); }
-  T *end() { return elems ? elems + count : NULL; }
-  T &front() { return *elems; }
-  T &back() { return *(elems + count - 1); }
-  const T *begin() const { return elems ? elems : end(); }
-  const T *end() const { return elems ? elems + count : NULL; }
-  const T &front() const { return *elems; }
-  const T &back() const { return *(elems + count - 1); }
+#if defined(RENDERDOC_QT_COMPAT)
+  array(const QList &in)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in);
+  }
+  inline void assign(const QList &in) { *this = in; }
+  array &operator=(const QList &in)
+  {
+    // make sure we have enough space, allocating more if needed
+    reserve(in.size());
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount(in.count());
+
+    // copy construct the new elems
+    for(int32_t i = 0; i < usedCount; i++)
+      new(elems + i) T(in[i]);
+
+    return *this;
+  }
+
+  array(const QVector &in)
+  {
+    elems = NULL;
+    allocatedCount = usedCount = 0;
+    assign(in);
+  }
+  inline void assign(const QVector &in) { *this = in; }
+  array &operator=(const QVector &in)
+  {
+    // make sure we have enough space, allocating more if needed
+    reserve(in.size());
+    // destruct the old objects
+    clear();
+
+    // update new size
+    setUsedCount(in.count());
+
+    // copy construct the new elems
+    for(int32_t i = 0; i < usedCount; i++)
+      new(elems + i) T(in[i]);
+
+    return *this;
+  }
+#endif
 };
 
 DOCUMENT("");
 struct str : public rdctype::array
 {
-  str &operator=(const std::string &in);
-  str &operator=(const char *const in);
-
+  // extra string constructors
   str() : rdctype::array() {}
-  str(const str &o) : rdctype::array() { *this = o; }
-  str(const std::string &o) : rdctype::array() { *this = o; }
-  str(const char *const o) : rdctype::array() { *this = o; }
-  str &operator=(const str &o)
+  str(const str &in) : rdctype::array() { assign(in); }
+  str(const std::string &in) : rdctype::array() { assign(in.c_str(), in.size()); }
+  str(const char *const in) : rdctype::array() { assign(in, strlen(in)); }
+  // extra string assignment
+  str &operator=(const std::string &in)
   {
-    // do nothing if we're self-assigning
-    if(this == &o)
-      return *this;
-
-    Delete();
-    count = o.count;
-    if(count == 0)
-    {
-      elems = (char *)allocate(sizeof(char));
-      elems[0] = 0;
-    }
-    else
-    {
-      elems = (char *)allocate(sizeof(char) * (o.count + 1));
-      memcpy(elems, o.elems, sizeof(char) * o.count);
-      elems[count] = 0;
-    }
-
+    assign(in.c_str(), in.size());
+    return *this;
+  }
+  str &operator=(const char *const in)
+  {
+    assign(in, strlen(in));
     return *this;
   }
 
-  DOCUMENT("");
-  void assign(const char *const in, int32_t inCount)
-  {
-    Delete();
-    count = inCount;
-    if(inCount == 0)
-    {
-      elems = (char *)allocate(sizeof(char));
-      elems[0] = 0;
-    }
-    else
-    {
-      elems = (char *)allocate(sizeof(char) * (inCount + 1));
-      if(in)
-        memcpy(elems, in, sizeof(char) * inCount);
-      elems[count] = 0;
-    }
-  }
-
+  // cast operators
+  operator std::string() const { return std::string(elems, elems + usedCount); }
 #if defined(RENDERDOC_QT_COMPAT)
-  operator QString() const { return QString::fromUtf8(elems, count); }
-  operator QVariant() const { return QVariant(QString::fromUtf8(elems, count)); }
+  operator QString() const { return QString::fromUtf8(elems, usedCount); }
+  operator QVariant() const { return QVariant(QString::fromUtf8(elems, usedCount)); }
 #endif
 
-  operator std::string() const { return std::string(elems, elems + count); }
+  // conventional data accessor
+  DOCUMENT("");
   const char *c_str() const { return elems ? elems : ""; }
+  // equality checks
   bool operator==(const char *const o) const
   {
     if(!elems)
@@ -280,42 +577,14 @@ struct str : public rdctype::array
   bool operator!=(const char *const o) const { return !(*this == o); }
   bool operator!=(const std::string &o) const { return !(*this == o); }
   bool operator!=(const str &o) const { return !(*this == o); }
+  // define ordering operators
+  bool operator<(const str &o) const { return strcmp(elems, o.elems) < 0; }
+  bool operator>(const str &o) const { return strcmp(elems, o.elems) > 0; }
 };
 
-inline str &str::operator=(const std::string &in)
+DOCUMENT("");
+struct bytebuf : public rdctype::array
 {
-  Delete();
-  count = (int32_t)in.size();
-  if(count == 0)
-  {
-    elems = (char *)allocate(sizeof(char));
-    elems[0] = 0;
-  }
-  else
-  {
-    elems = (char *)allocate(sizeof(char) * (count + 1));
-    memcpy(elems, &in[0], sizeof(char) * in.size());
-    elems[count] = 0;
-  }
-  return *this;
-}
-
-inline str &str::operator=(const char *const in)
-{
-  Delete();
-  count = (int32_t)strlen(in);
-  if(count == 0)
-  {
-    elems = (char *)allocate(sizeof(char));
-    elems[0] = 0;
-  }
-  else
-  {
-    elems = (char *)allocate(sizeof(char) * (count + 1));
-    memcpy(elems, &in[0], sizeof(char) * count);
-    elems[count] = 0;
-  }
-  return *this;
-}
+};
 
 };    // namespace rdctype
diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h
index 95f6530cc..818cc0343 100644
--- a/renderdoc/api/replay/renderdoc_replay.h
+++ b/renderdoc/api/replay/renderdoc_replay.h
@@ -38,8 +38,6 @@ inline const char *TypeName();
     return #type;                       \
   }
 
-typedef uint8_t byte;
-
 // Guidelines for documentation:
 //
 // * If you only need a short string, use DOCUMENT("Here is my string");
diff --git a/renderdoc/api/replay/shader_types.h b/renderdoc/api/replay/shader_types.h
index 67373624f..cda9d562e 100644
--- a/renderdoc/api/replay/shader_types.h
+++ b/renderdoc/api/replay/shader_types.h
@@ -29,8 +29,6 @@
 #include "basic_types.h"
 #include "replay_enums.h"
 
-typedef uint8_t byte;
-
 DOCUMENT("A ``float`` 4 component vector.")
 struct FloatVecVal
 {
diff --git a/renderdoc/common/common.h b/renderdoc/common/common.h
index 205698fab..23ee79097 100644
--- a/renderdoc/common/common.h
+++ b/renderdoc/common/common.h
@@ -387,5 +387,3 @@ void rdcassert(const char *msg, const char *file, unsigned int line, const char
 #else
 #define RDCCOMPILE_ASSERT(condition, message) static_assert(condition, message)
 #endif
-
-typedef uint8_t byte;
diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp
index 1a5fdf6a8..49f140511 100644
--- a/renderdoc/core/core.cpp
+++ b/renderdoc/core/core.cpp
@@ -36,6 +36,18 @@
 #include "stb/stb_image.h"
 #include "crash_handler.h"
 
+template <>
+string ToStrHelper::Get(const ResourceId &el)
+{
+  char tostrBuf[256] = {0};
+
+  RDCCOMPILE_ASSERT(sizeof(el) == sizeof(uint64_t), "ResourceId is no longer 1:1 with uint64_t");
+
+  StringFormat::snprintf(tostrBuf, 255, "ResID_%llu", (uint64_t &)el);
+
+  return tostrBuf;
+}
+
 #if ENABLED(RDOC_LINUX) && ENABLED(RDOC_XLIB)
 #include 
 #endif
diff --git a/renderdoc/core/image_viewer.cpp b/renderdoc/core/image_viewer.cpp
index 78460a949..c128ec351 100644
--- a/renderdoc/core/image_viewer.cpp
+++ b/renderdoc/core/image_viewer.cpp
@@ -25,7 +25,6 @@
 #include "common/dds_readwrite.h"
 #include "core/core.h"
 #include "replay/replay_driver.h"
-#include "replay/type_helpers.h"
 #include "stb/stb_image.h"
 #include "tinyexr/tinyexr.h"
 
@@ -47,7 +46,7 @@ public:
     m_FrameRecord.frameInfo.frameNumber = 1;
     RDCEraseEl(m_FrameRecord.frameInfo.stats);
 
-    create_array_uninit(m_FrameRecord.drawcallList, 1);
+    m_FrameRecord.drawcallList.resize(1);
     DrawcallDescription &d = m_FrameRecord.drawcallList[0];
     d.drawcallID = 1;
     d.eventID = 1;
@@ -55,7 +54,7 @@ public:
 
     RefreshFile();
 
-    create_array_uninit(m_PipelineState.m_OM.RenderTargets, 1);
+    m_PipelineState.m_OM.RenderTargets.resize(1);
     m_PipelineState.m_OM.RenderTargets[0].Resource = m_TextureID;
   }
 
diff --git a/renderdoc/core/remote_server.cpp b/renderdoc/core/remote_server.cpp
index 00f92bb7b..4e6c719d3 100644
--- a/renderdoc/core/remote_server.cpp
+++ b/renderdoc/core/remote_server.cpp
@@ -747,11 +747,11 @@ public:
   {
     rdctype::array out;
 
-    create_array_uninit(out, m_Proxies.size());
+    m_Proxies.reserve(m_Proxies.size());
 
     size_t i = 0;
     for(auto it = m_Proxies.begin(); it != m_Proxies.end(); ++it, ++i)
-      out[i] = it->second;
+      out.push_back(it->second);
 
     return out;
   }
@@ -774,7 +774,7 @@ public:
         uint32_t count = 0;
         ser->Serialise("", count);
 
-        create_array_uninit(out, count);
+        out.reserve(count);
 
         for(uint32_t i = 0; i < count; i++)
         {
@@ -783,7 +783,7 @@ public:
           ser->Serialise("", driver);
           ser->Serialise("", name);
 
-          out[i] = name;
+          out.push_back(name);
         }
 
         delete ser;
@@ -823,8 +823,6 @@ public:
 
   rdctype::array ListFolder(const char *path)
   {
-    rdctype::array ret;
-
     if(Android::IsHostADB(m_hostname.c_str()))
     {
       int index = 0;
@@ -851,11 +849,7 @@ public:
         }
       }
 
-      create_array_uninit(ret, packages.size());
-      for(size_t i = 0; i < packages.size(); i++)
-        ret[i] = packages[i];
-
-      return ret;
+      return packages;
     }
 
     string folderPath = path;
@@ -869,24 +863,26 @@ public:
     Serialiser *ser = NULL;
     Get(type, &ser);
 
+    rdctype::array files;
+
     if(ser)
     {
       std::vector paths;
 
       ser->Serialise("", paths);
 
-      ret = paths;
+      files = paths;
 
       delete ser;
     }
     else
     {
-      create_array_uninit(ret, 1);
-      ret.elems[0].filename = path;
-      ret.elems[0].flags = PathProperty::ErrorUnknown;
+      files.resize(1);
+      files[0].filename = path;
+      files[0].flags = PathProperty::ErrorUnknown;
     }
 
-    return ret;
+    return files;
   }
 
   uint32_t ExecuteAndInject(const char *app, const char *workingDir, const char *cmdLine,
diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp
index 714d8004a..442b76ad2 100644
--- a/renderdoc/core/replay_proxy.cpp
+++ b/renderdoc/core/replay_proxy.cpp
@@ -285,13 +285,13 @@ void Serialiser::Serialise(const char *name, ShaderDebugState &el)
   Serialise("", el.nextInstruction);
   Serialise("", el.flags);
 
-  vector > indexableTemps;
+  std::vector > indexableTemps;
 
-  int32_t numidxtemps = el.indexableTemps.count;
+  int32_t numidxtemps = el.indexableTemps.count();
   Serialise("", numidxtemps);
 
   if(m_Mode == READING)
-    create_array_uninit(el.indexableTemps, numidxtemps);
+    el.indexableTemps.resize(numidxtemps);
 
   for(int32_t i = 0; i < numidxtemps; i++)
     Serialise("", el.indexableTemps[i]);
@@ -304,11 +304,11 @@ void Serialiser::Serialise(const char *name, ShaderDebugTrace &el)
 {
   Serialise("", el.inputs);
 
-  int32_t numcbuffers = el.cbuffers.count;
+  int32_t numcbuffers = el.cbuffers.count();
   Serialise("", numcbuffers);
 
   if(m_Mode == READING)
-    create_array_uninit(el.cbuffers, numcbuffers);
+    el.cbuffers.resize(numcbuffers);
 
   for(int32_t i = 0; i < numcbuffers; i++)
     Serialise("", el.cbuffers[i]);
@@ -2532,8 +2532,7 @@ void ReplayProxy::SavePipelineState()
 
       for(int i = 0; i < 6; i++)
         if(stages[i]->Object != ResourceId())
-          stages[i]->ShaderDetails =
-              GetShader(GetLiveID(stages[i]->Object), stages[i]->entryPoint.elems);
+          stages[i]->ShaderDetails = GetShader(GetLiveID(stages[i]->Object), stages[i]->entryPoint);
     }
   }
 }
diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp
index 19caaf60f..3a4cf7262 100644
--- a/renderdoc/core/target_control.cpp
+++ b/renderdoc/core/target_control.cpp
@@ -28,7 +28,6 @@
 #include "core/core.h"
 #include "jpeg-compressor/jpgd.h"
 #include "os/os_specific.h"
-#include "replay/type_helpers.h"
 #include "serialise/serialiser.h"
 #include "socket_helpers.h"
 
@@ -136,9 +135,12 @@ void RenderDoc::TargetControlClientThread(Network::Socket *client)
       }
       file->Shutdown();
 
+      int32_t thumblen = buf.count();
+      ser.Serialise("", thumblen);
+
+      byte *data = buf.data();
       size_t sz = buf.size();
-      ser.Serialise("", buf.count);
-      ser.SerialiseBuffer("", buf.elems, sz);
+      ser.SerialiseBuffer("", data, sz);
     }
     else if(childprocs.size() != children.size())
     {
@@ -557,7 +559,7 @@ public:
 
         msg.NewCapture.path = m_CaptureCopies[msg.NewCapture.ID];
 
-        if(!RecvChunkedFile(m_Socket, ePacket_CopyCapture, msg.NewCapture.path.elems, ser, NULL))
+        if(!RecvChunkedFile(m_Socket, ePacket_CopyCapture, msg.NewCapture.path.c_str(), ser, NULL))
         {
           SAFE_DELETE(ser);
           SAFE_DELETE(m_Socket);
@@ -611,14 +613,13 @@ public:
         int w = 0;
         int h = 0;
         int comp = 3;
-        byte *thumbpixels =
-            jpgd::decompress_jpeg_image_from_memory(buf, (int)thumblen, &w, &h, &comp, 3);
+        byte *thumbpixels = jpgd::decompress_jpeg_image_from_memory(buf, thumblen, &w, &h, &comp, 3);
 
         if(w > 0 && h > 0 && thumbpixels)
         {
           msg.NewCapture.thumbWidth = w;
           msg.NewCapture.thumbHeight = h;
-          create_array_init(msg.NewCapture.thumbnail, w * h * 3, thumbpixels);
+          msg.NewCapture.thumbnail.assign(thumbpixels, w * h * 3);
         }
         else
         {
diff --git a/renderdoc/driver/d3d11/d3d11_analyse.cpp b/renderdoc/driver/d3d11/d3d11_analyse.cpp
index 8d9d4d6bc..9e9084191 100644
--- a/renderdoc/driver/d3d11/d3d11_analyse.cpp
+++ b/renderdoc/driver/d3d11/d3d11_analyse.cpp
@@ -200,7 +200,7 @@ void D3D11DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
 
     size_t dataOffset = vec * sizeof(Vec4f) + comp * sizeof(float);
 
-    if(outvars[outIdx].name.count > 0)
+    if(!outvars[outIdx].name.empty())
     {
       RDCASSERT(flatten);
 
@@ -208,7 +208,7 @@ void D3D11DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
       RDCASSERT(outvars[vec].columns == comp);
       RDCASSERT(rows == 1);
 
-      string combinedName = outvars[outIdx].name.elems;
+      std::string combinedName = outvars[outIdx].name;
       combinedName += ", " + basename;
       outvars[outIdx].name = combinedName;
       outvars[outIdx].rows = 1;
@@ -294,15 +294,15 @@ void D3D11DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
 
         var.name = outvars[outIdx].name;
 
-        vector varmembers;
-        vector *out = &outvars;
+        std::vector varmembers;
+        std::vector *out = &outvars;
         size_t rowCopy = 1;
 
         uint32_t registers = rows;
         uint32_t regLen = cols;
         const char *regName = "row";
 
-        string base = outvars[outIdx].name.elems;
+        std::string base = outvars[outIdx].name;
 
         if(!flatten)
         {
@@ -459,18 +459,14 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t
 
   if(maxReg >= 0 || inputCoverage)
   {
-    create_array(trace.inputs, maxReg + 1 + (inputCoverage ? 1 : 0));
+    trace.inputs.resize(maxReg + 1 + (inputCoverage ? 1 : 0));
     for(size_t i = 0; i < dxbc->m_InputSig.size(); i++)
     {
-      char buf[64] = {0};
-
       SigParameter &sig = dxbc->m_InputSig[i];
 
-      StringFormat::snprintf(buf, 63, "v%d", sig.regIndex);
-
       ShaderVariable v;
 
-      v.name = StringFormat::Fmt("%s (%s)", buf, sig.semanticIdxName.elems);
+      v.name = StringFormat::Fmt("v%d (%s)", sig.regIndex, sig.semanticIdxName.c_str());
       v.rows = 1;
       v.columns = sig.regChannelMask & 0x8 ? 4 : sig.regChannelMask & 0x4
                                                      ? 3
@@ -508,7 +504,7 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t
 
   if(maxReg >= 0 || specialOutputs > 0)
   {
-    create_array(initialState.outputs, maxReg + 1 + specialOutputs);
+    initialState.outputs.resize(maxReg + 1 + specialOutputs);
     for(size_t i = 0; i < dxbc->m_OutputSig.size(); i++)
     {
       SigParameter &sig = dxbc->m_OutputSig[i];
@@ -516,13 +512,9 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t
       if(sig.regIndex == ~0U)
         continue;
 
-      char buf[64] = {0};
-
-      StringFormat::snprintf(buf, 63, "o%d", sig.regIndex);
-
       ShaderVariable v;
 
-      v.name = StringFormat::Fmt("%s (%s)", buf, sig.semanticIdxName.elems);
+      v.name = StringFormat::Fmt("o%d (%s)", sig.regIndex, sig.semanticIdxName.c_str());
       v.rows = 1;
       v.columns = sig.regChannelMask & 0x8 ? 4 : sig.regChannelMask & 0x4
                                                      ? 3
@@ -576,22 +568,22 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t
     }
   }
 
-  create_array(trace.cbuffers, dxbc->m_CBuffers.size());
+  trace.cbuffers.resize(dxbc->m_CBuffers.size());
   for(size_t i = 0; i < dxbc->m_CBuffers.size(); i++)
   {
     if(dxbc->m_CBuffers[i].descriptor.type != CBuffer::Descriptor::TYPE_CBUFFER)
       continue;
 
-    vector vars;
+    std::vector vars;
 
     FillCBufferVariables(dxbc->m_CBuffers[i].variables, vars, true,
                          cbufData[dxbc->m_CBuffers[i].reg]);
 
     trace.cbuffers[i] = vars;
 
-    for(int32_t c = 0; c < trace.cbuffers[i].count; c++)
+    for(size_t c = 0; c < trace.cbuffers[i].size(); c++)
       trace.cbuffers[i][c].name = StringFormat::Fmt("cb%u[%u] (%s)", dxbc->m_CBuffers[i].reg,
-                                                    (uint32_t)c, trace.cbuffers[i][c].name.elems);
+                                                    (uint32_t)c, trace.cbuffers[i][c].name.c_str());
   }
 
   initialState.Init();
@@ -1072,7 +1064,7 @@ ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventID, uint32_t verti
   CreateShaderGlobalState(global, dxbc, 0, NULL, rs->VS.SRVs);
   State initialState = CreateShaderDebugState(ret, -1, dxbc, cbufData);
 
-  for(int32_t i = 0; i < ret.inputs.count; i++)
+  for(size_t i = 0; i < ret.inputs.size(); i++)
   {
     if(dxbc->m_InputSig[i].systemValue == ShaderBuiltin::Undefined ||
        dxbc->m_InputSig[i].systemValue ==
@@ -1082,11 +1074,11 @@ ShaderDebugTrace D3D11DebugManager::DebugVertex(uint32_t eventID, uint32_t verti
     {
       const D3D11_INPUT_ELEMENT_DESC *el = NULL;
 
-      string signame = strlower(string(dxbc->m_InputSig[i].semanticName.elems));
+      std::string signame = strlower(dxbc->m_InputSig[i].semanticName);
 
       for(size_t l = 0; l < inputlayout.size(); l++)
       {
-        string layoutname = strlower(string(inputlayout[l].SemanticName));
+        std::string layoutname = strlower(inputlayout[l].SemanticName);
 
         if(signame == layoutname && dxbc->m_InputSig[i].semanticIndex == inputlayout[l].SemanticIndex)
         {
@@ -1447,7 +1439,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
 
     for(size_t a = 0; a < arrays.size(); a++)
     {
-      if(arrays[a].first == dxbc->m_InputSig[i].semanticName.elems &&
+      if(dxbc->m_InputSig[i].semanticName == arrays[a].first &&
          arrays[a].second.first <= dxbc->m_InputSig[i].semanticIndex &&
          arrays[a].second.second >= dxbc->m_InputSig[i].semanticIndex)
       {
@@ -1491,7 +1483,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
 
             initialValues.push_back(DataOutput(-1, 0, numCols, ShaderBuiltin::Undefined, true));
 
-            string name = prevdxbc->m_OutputSig[os].semanticIdxName.elems;
+            std::string name = prevdxbc->m_OutputSig[os].semanticIdxName;
 
             extractHlsl += ToStr::Get((uint32_t)numCols) + " input_" + name + " : " + name + ";\n";
           }
@@ -1529,7 +1521,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
     if(included)
       structureStride += 4 * numCols;
 
-    string name = dxbc->m_InputSig[i].semanticIdxName.elems;
+    std::string name = dxbc->m_InputSig[i].semanticIdxName;
 
     // arrays of interpolators are handled really weirdly. They use cbuffer
     // packing rules where each new value is in a new register (rather than
@@ -1558,7 +1550,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
       for(size_t j = i + 1; j < dxbc->m_InputSig.size(); j++)
       {
         // if we've found the 'next' semantic
-        if(!strcmp(dxbc->m_InputSig[i].semanticName.elems, dxbc->m_InputSig[j].semanticName.elems) &&
+        if(dxbc->m_InputSig[i].semanticName == dxbc->m_InputSig[j].semanticName &&
            nextIdx == dxbc->m_InputSig[j].semanticIndex)
         {
           int jNumCols = (dxbc->m_InputSig[i].regChannelMask & 0x1 ? 1 : 0) +
@@ -1584,7 +1576,7 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
 
       if(arrayLength > 0)
         arrays.push_back(
-            std::make_pair(dxbc->m_InputSig[i].semanticName.elems,
+            std::make_pair(dxbc->m_InputSig[i].semanticName,
                            std::make_pair(dxbc->m_InputSig[i].semanticIndex, nextIdx - 1)));
     }
 
@@ -1931,8 +1923,8 @@ ShaderDebugTrace D3D11DebugManager::DebugPixel(uint32_t eventID, uint32_t x, uin
     State initialState = CreateShaderDebugState(traces[destIdx], destIdx, dxbc, cbufData);
 
     rdctype::array &ins = traces[destIdx].inputs;
-    if(ins.count > 0 && !strcmp(ins[ins.count - 1].name.elems, "vCoverage"))
-      ins[ins.count - 1].value.u.x = hit->coverage;
+    if(!ins.empty() && ins.back().name == "vCoverage")
+      ins.back().value.u.x = hit->coverage;
 
     initialState.semantics.coverage = hit->coverage;
     initialState.semantics.primID = hit->primitive;
diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp
index a1bb546ca..b51aea90b 100644
--- a/renderdoc/driver/d3d11/d3d11_context.cpp
+++ b/renderdoc/driver/d3d11/d3d11_context.cpp
@@ -28,7 +28,6 @@
 #include "driver/d3d11/d3d11_manager.h"
 #include "driver/d3d11/d3d11_renderstate.h"
 #include "driver/d3d11/d3d11_resources.h"
-#include "replay/type_helpers.h"
 #include "serialise/string_utils.h"
 
 WRAPPED_POOL_INST(WrappedID3D11DeviceContext);
@@ -1000,8 +999,7 @@ void WrappedID3D11DeviceContext::AddDrawcall(const DrawcallDescription &d, bool
   if(!m_DrawcallStack.empty())
   {
     DrawcallTreeNode node(draw);
-    node.children.insert(node.children.begin(), draw.children.elems,
-                         draw.children.elems + draw.children.count);
+    node.children.insert(node.children.begin(), draw.children.begin(), draw.children.end());
     m_DrawcallStack.back()->children.push_back(node);
   }
   else
@@ -1020,8 +1018,7 @@ void WrappedID3D11DeviceContext::AddEvent(string description)
   Callstack::Stackwalk *stack = m_pSerialiser->GetLastCallstack();
   if(stack)
   {
-    create_array(apievent.callstack, stack->NumLevels());
-    memcpy(apievent.callstack.elems, stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
+    apievent.callstack.assign(stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
   }
 
   m_CurEvents.push_back(apievent);
diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp
index b77347395..011398aaf 100644
--- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp
+++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp
@@ -3723,7 +3723,7 @@ void WrappedID3D11DeviceContext::Serialise_DebugMessages()
 
     string desc;
     if(m_State >= WRITING)
-      desc = debugMessages[i].description.elems;
+      desc = debugMessages[i].description;
 
     SERIALISE_ELEMENT(MessageCategory, Category, debugMessages[i].category);
     SERIALISE_ELEMENT(MessageSeverity, Severity, debugMessages[i].severity);
diff --git a/renderdoc/driver/d3d11/d3d11_counters.cpp b/renderdoc/driver/d3d11/d3d11_counters.cpp
index ddff9eee3..6cff515af 100644
--- a/renderdoc/driver/d3d11/d3d11_counters.cpp
+++ b/renderdoc/driver/d3d11/d3d11_counters.cpp
@@ -234,7 +234,7 @@ void D3D11DebugManager::FillTimers(D3D11CounterContext &ctx, const DrawcallTreeN
     const DrawcallDescription &d = drawnode.children[i].draw;
     FillTimers(ctx, drawnode.children[i]);
 
-    if(d.events.count == 0)
+    if(d.events.empty())
       continue;
 
     GPUTimer *timer = NULL;
@@ -299,7 +299,7 @@ void D3D11DebugManager::FillTimersAMD(uint32_t &eventStartID, uint32_t &sampleIn
 
     FillTimersAMD(eventStartID, sampleIndex, eventIDs, drawnode.children[i]);
 
-    if(d.events.count == 0)
+    if(d.events.empty())
       continue;
 
     eventIDs.push_back(d.eventID);
diff --git a/renderdoc/driver/d3d11/d3d11_debug.cpp b/renderdoc/driver/d3d11/d3d11_debug.cpp
index b8cbe5eea..73d9a19dc 100644
--- a/renderdoc/driver/d3d11/d3d11_debug.cpp
+++ b/renderdoc/driver/d3d11/d3d11_debug.cpp
@@ -3972,7 +3972,7 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID)
       decl.Stream = 0;
       decl.OutputSlot = 0;
 
-      decl.SemanticName = sign.semanticName.elems;
+      decl.SemanticName = sign.semanticName.c_str();
       decl.SemanticIndex = sign.semanticIndex;
       decl.StartComponent = 0;
       decl.ComponentCount = sign.compCount & 0xff;
@@ -4385,7 +4385,7 @@ void D3D11DebugManager::InitPostVSBuffers(uint32_t eventID)
       decl.Stream = 0;
       decl.OutputSlot = 0;
 
-      decl.SemanticName = sign.semanticName.elems;
+      decl.SemanticName = sign.semanticName.c_str();
       decl.SemanticIndex = sign.semanticIndex;
       decl.StartComponent = 0;
       decl.ComponentCount = sign.compCount & 0xff;
diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp
index 79345fb16..7426afe65 100644
--- a/renderdoc/driver/d3d11/d3d11_device.cpp
+++ b/renderdoc/driver/d3d11/d3d11_device.cpp
@@ -1115,29 +1115,27 @@ void WrappedID3D11Device::Serialise_CaptureScope(uint64_t offset)
 
     for(uint32_t stage = uint32_t(ShaderStage::First); stage < uint32_t(ShaderStage::Count); stage++)
     {
-      create_array(stats.constants[stage].bindslots,
-                   D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 1);
-      create_array(stats.constants[stage].sizes, ConstantBindStats::BucketCount);
+      stats.constants[stage].bindslots.resize(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + 1);
+      stats.constants[stage].sizes.resize(ConstantBindStats::BucketCount);
 
-      create_array(stats.samplers[stage].bindslots, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 1);
+      stats.samplers[stage].bindslots.resize(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT + 1);
 
-      create_array(stats.resources[stage].types, uint32_t(TextureDim::Count));
-      create_array(stats.resources[stage].bindslots,
-                   D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 1);
+      stats.resources[stage].types.resize(uint32_t(TextureDim::Count));
+      stats.resources[stage].bindslots.resize(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + 1);
     }
 
-    create_array(stats.updates.types, uint32_t(TextureDim::Count));
-    create_array(stats.updates.sizes, ResourceUpdateStats::BucketCount);
+    stats.updates.types.resize(uint32_t(TextureDim::Count));
+    stats.updates.sizes.resize(ResourceUpdateStats::BucketCount);
 
-    create_array(stats.draws.counts, DrawcallStats::BucketCount);
+    stats.draws.counts.resize(DrawcallStats::BucketCount);
 
-    create_array(stats.vertices.bindslots, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + 1);
+    stats.vertices.bindslots.resize(D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + 1);
 
-    create_array(stats.rasters.viewports, D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX + 2);
-    create_array(stats.rasters.rects, D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX + 2);
+    stats.rasters.viewports.resize(D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX + 2);
+    stats.rasters.rects.resize(D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX + 2);
 
-    create_array(stats.outputs.bindslots,
-                 D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT + D3D11_1_UAV_SLOT_COUNT + 1);
+    stats.outputs.bindslots.resize(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT + D3D11_1_UAV_SLOT_COUNT +
+                                   1);
 
     GetResourceManager()->CreateInitialContents();
   }
diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp
index b25e7fd47..ff470aabd 100644
--- a/renderdoc/driver/d3d11/d3d11_replay.cpp
+++ b/renderdoc/driver/d3d11/d3d11_replay.cpp
@@ -525,8 +525,7 @@ void D3D11Replay::SavePipelineState()
 
     ret.m_IA.name = str;
 
-    create_array_uninit(ret.m_IA.layouts, vec.size());
-
+    ret.m_IA.layouts.resize(vec.size());
     for(size_t i = 0; i < vec.size(); i++)
     {
       D3D11Pipe::Layout &l = ret.m_IA.layouts[i];
@@ -541,8 +540,7 @@ void D3D11Replay::SavePipelineState()
     }
   }
 
-  create_array_uninit(ret.m_IA.vbuffers, ARRAY_COUNT(rs->IA.VBs));
-
+  ret.m_IA.vbuffers.resize(ARRAY_COUNT(rs->IA.VBs));
   for(size_t i = 0; i < ARRAY_COUNT(rs->IA.VBs); i++)
   {
     D3D11Pipe::VB &vb = ret.m_IA.vbuffers[i];
@@ -600,7 +598,7 @@ void D3D11Replay::SavePipelineState()
 
       dst.name = str;
 
-      create_array_uninit(dst.ConstantBuffers, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT);
+      dst.ConstantBuffers.resize(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT);
       for(size_t s = 0; s < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; s++)
       {
         dst.ConstantBuffers[s].Buffer = rm->GetOriginalID(GetIDForResource(src.ConstantBuffers[s]));
@@ -608,7 +606,7 @@ void D3D11Replay::SavePipelineState()
         dst.ConstantBuffers[s].VecCount = src.CBCounts[s];
       }
 
-      create_array_uninit(dst.Samplers, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT);
+      dst.Samplers.resize(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT);
       for(size_t s = 0; s < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; s++)
       {
         D3D11Pipe::Sampler &samp = dst.Samplers[s];
@@ -620,7 +618,7 @@ void D3D11Replay::SavePipelineState()
           samp.name = GetDebugName(src.Samplers[s]);
           samp.customName = true;
 
-          if(samp.name.count == 0)
+          if(samp.name.empty())
           {
             samp.customName = false;
             samp.name = StringFormat::Fmt("Sampler %llu", samp.Samp);
@@ -646,7 +644,7 @@ void D3D11Replay::SavePipelineState()
         }
       }
 
-      create_array_uninit(dst.SRVs, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
+      dst.SRVs.resize(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
       for(size_t s = 0; s < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; s++)
       {
         D3D11Pipe::View &view = dst.SRVs[s];
@@ -747,7 +745,7 @@ void D3D11Replay::SavePipelineState()
         }
       }
 
-      create_array(dst.UAVs, D3D11_1_UAV_SLOT_COUNT);
+      dst.UAVs.resize(D3D11_1_UAV_SLOT_COUNT);
       for(size_t s = 0; dst.stage == ShaderStage::Compute && s < D3D11_1_UAV_SLOT_COUNT; s++)
       {
         D3D11Pipe::View &view = dst.UAVs[s];
@@ -829,7 +827,7 @@ void D3D11Replay::SavePipelineState()
         }
       }
 
-      create_array_uninit(dst.ClassInstances, src.NumInstances);
+      dst.ClassInstances.reserve(src.NumInstances);
       for(UINT s = 0; s < src.NumInstances; s++)
       {
         D3D11_CLASS_INSTANCE_DESC desc;
@@ -843,7 +841,7 @@ void D3D11Replay::SavePipelineState()
         count = 255;
         src.Instances[s]->GetInstanceName(instName, &count);
 
-        dst.ClassInstances[s] = instName;
+        dst.ClassInstances.push_back(instName);
       }
     }
   }
@@ -853,7 +851,7 @@ void D3D11Replay::SavePipelineState()
   /////////////////////////////////////////////////
 
   {
-    create_array_uninit(ret.m_SO.Outputs, D3D11_SO_BUFFER_SLOT_COUNT);
+    ret.m_SO.Outputs.resize(D3D11_SO_BUFFER_SLOT_COUNT);
     for(size_t s = 0; s < D3D11_SO_BUFFER_SLOT_COUNT; s++)
     {
       ret.m_SO.Outputs[s].Buffer = rm->GetOriginalID(GetIDForResource(rs->SO.Buffers[s]));
@@ -931,7 +929,7 @@ void D3D11Replay::SavePipelineState()
     }
 
     size_t i = 0;
-    create_array_uninit(ret.m_RS.Scissors, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE);
+    ret.m_RS.Scissors.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE);
     for(i = 0; i < rs->RS.NumScissors; i++)
       ret.m_RS.Scissors[i] =
           D3D11Pipe::Scissor(rs->RS.Scissors[i].left, rs->RS.Scissors[i].top,
@@ -940,7 +938,7 @@ void D3D11Replay::SavePipelineState()
     for(; i < D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; i++)
       ret.m_RS.Scissors[i] = D3D11Pipe::Scissor(0, 0, 0, 0, false);
 
-    create_array_uninit(ret.m_RS.Viewports, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE);
+    ret.m_RS.Viewports.resize(D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE);
     for(i = 0; i < rs->RS.NumViews; i++)
       ret.m_RS.Viewports[i] =
           D3D11Pipe::Viewport(rs->RS.Viewports[i].TopLeftX, rs->RS.Viewports[i].TopLeftY,
@@ -956,7 +954,7 @@ void D3D11Replay::SavePipelineState()
   /////////////////////////////////////////////////
 
   {
-    create_array_uninit(ret.m_OM.RenderTargets, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT);
+    ret.m_OM.RenderTargets.resize(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT);
     for(size_t i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
     {
       D3D11Pipe::View &view = ret.m_OM.RenderTargets[i];
@@ -1024,7 +1022,7 @@ void D3D11Replay::SavePipelineState()
 
     ret.m_OM.UAVStartSlot = rs->OM.UAVStartSlot;
 
-    create_array_uninit(ret.m_OM.UAVs, D3D11_1_UAV_SLOT_COUNT);
+    ret.m_OM.UAVs.resize(D3D11_1_UAV_SLOT_COUNT);
     for(size_t s = 0; s < D3D11_1_UAV_SLOT_COUNT; s++)
     {
       D3D11Pipe::View view;
@@ -1191,7 +1189,7 @@ void D3D11Replay::SavePipelineState()
         state1 = true;
       }
 
-      create_array_uninit(ret.m_OM.m_BlendState.Blends, 8);
+      ret.m_OM.m_BlendState.Blends.resize(8);
       for(size_t i = 0; i < 8; i++)
       {
         D3D11Pipe::Blend &blend = ret.m_OM.m_BlendState.Blends[i];
@@ -1237,7 +1235,7 @@ void D3D11Replay::SavePipelineState()
 
       blend.WriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
 
-      create_array_uninit(ret.m_OM.m_BlendState.Blends, 8);
+      ret.m_OM.m_BlendState.Blends.resize(8);
       for(size_t i = 0; i < 8; i++)
         ret.m_OM.m_BlendState.Blends[i] = blend;
     }
@@ -1722,10 +1720,7 @@ ResourceId D3D11Replay::CreateProxyTexture(const TextureDescription &templateTex
   }
 
   if(resource != NULL && templateTex.customName)
-  {
-    string name = templateTex.name.elems;
-    SetDebugName(resource, templateTex.name.elems);
-  }
+    SetDebugName(resource, templateTex.name.c_str());
 
   m_ProxyResources.push_back(resource);
 
@@ -1888,10 +1883,7 @@ ResourceId D3D11Replay::CreateProxyBuffer(const BufferDescription &templateBuf)
   }
 
   if(resource != NULL && templateBuf.customName)
-  {
-    string name = templateBuf.name.elems;
-    SetDebugName(resource, templateBuf.name.elems);
-  }
+    SetDebugName(resource, templateBuf.name.c_str());
 
   m_ProxyResources.push_back(resource);
 
diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp
index 849aefb8f..dfe2c8bc7 100644
--- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp
+++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp
@@ -3325,7 +3325,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           eventStr += StringFormat::Fmt("\tStartInstanceLocation: %u\n", args->StartInstanceLocation);
           eventStr += "}\n";
 
-          APIEvent &ev = draw.events[draw.events.count - 1];
+          APIEvent &ev = draw.events.back();
           ev.eventDesc = eventStr;
 
           RDCASSERT(ev.eventID == eid);
@@ -3370,7 +3370,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           eventStr += StringFormat::Fmt("\tStartInstanceLocation: %u\n", args->StartInstanceLocation);
           eventStr += "}\n";
 
-          APIEvent &ev = draw.events[draw.events.count - 1];
+          APIEvent &ev = draw.events.back();
           ev.eventDesc = eventStr;
 
           RDCASSERT(ev.eventID == eid);
@@ -3411,7 +3411,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           eventStr += StringFormat::Fmt("\tThreadGroupCountZ: %u\n", args->ThreadGroupCountZ);
           eventStr += "}\n";
 
-          APIEvent &ev = draw.events[draw.events.count - 1];
+          APIEvent &ev = draw.events.back();
           ev.eventDesc = eventStr;
 
           RDCASSERT(ev.eventID == eid);
@@ -3448,11 +3448,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           DrawcallDescription &draw = draws[idx].draw;
           APIEvent *ev = NULL;
 
-          for(int32_t e = 0; e < draw.events.count; e++)
+          for(APIEvent &e : draw.events)
           {
-            if(draw.events[e].eventID == eid)
+            if(e.eventID == eid)
             {
-              ev = &draw.events[e];
+              ev = &e;
               break;
             }
           }
@@ -3493,11 +3493,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           DrawcallDescription &draw = draws[idx].draw;
           APIEvent *ev = NULL;
 
-          for(int32_t e = 0; e < draw.events.count; e++)
+          for(APIEvent &e : draw.events)
           {
-            if(draw.events[e].eventID == eid)
+            if(e.eventID == eid)
             {
-              ev = &draw.events[e];
+              ev = &e;
               break;
             }
           }
@@ -3537,11 +3537,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           DrawcallDescription &draw = draws[idx].draw;
           APIEvent *ev = NULL;
 
-          for(int32_t e = 0; e < draw.events.count; e++)
+          for(APIEvent &e : draw.events)
           {
-            if(draw.events[e].eventID == eid)
+            if(e.eventID == eid)
             {
-              ev = &draw.events[e];
+              ev = &e;
               break;
             }
           }
@@ -3595,11 +3595,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in
           DrawcallDescription &draw = draws[idx].draw;
           APIEvent *ev = NULL;
 
-          for(int32_t e = 0; e < draw.events.count; e++)
+          for(APIEvent &e : draw.events)
           {
-            if(draw.events[e].eventID == eid)
+            if(e.eventID == eid)
             {
-              ev = &draw.events[e];
+              ev = &e;
               break;
             }
           }
@@ -4050,8 +4050,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect(
     // this drawcall needs an event to anchor its file offset. This is a bit of a hack,
     // but a proper solution for handling 'fake' events that don't correspond to actual
     // events in the file, or duplicates, is overkill.
-    create_array(draw.events, 1);
-    draw.events[0] = m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].curEvents.back();
+    draw.events = {m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].curEvents.back()};
     m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].curEvents.pop_back();
 
     m_Cmd->AddDrawcall(draw, false);
diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp
index 2e2dc2c1a..0d44402bc 100644
--- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp
+++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp
@@ -117,9 +117,9 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
     {
       ScopedContext msgscope(m_pSerialiser, "DebugMessage", "DebugMessage", 0, false);
 
-      string msgDesc;
+      std::string msgDesc;
       if(m_State >= WRITING)
-        msgDesc = debugMessages[i].description.elems;
+        msgDesc = debugMessages[i].description;
 
       SERIALISE_ELEMENT(MessageCategory, Category, debugMessages[i].category);
       SERIALISE_ELEMENT(MessageSeverity, Severity, debugMessages[i].severity);
diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp
index 46f261b99..1d07a13f3 100644
--- a/renderdoc/driver/d3d12/d3d12_commands.cpp
+++ b/renderdoc/driver/d3d12/d3d12_commands.cpp
@@ -765,8 +765,8 @@ void BakedCmdListInfo::ShiftForRemoved(uint32_t shiftDrawID, uint32_t shiftEID,
       draws[i].draw.eventID -= shiftEID;
       draws[i].draw.drawcallID -= shiftDrawID;
 
-      for(int32_t e = 0; e < draws[i].draw.events.count; e++)
-        draws[i].draw.events[e].eventID -= shiftEID;
+      for(APIEvent &ev : draws[i].draw.events)
+        ev.eventID -= shiftEID;
     }
 
     uint32_t lastEID = draws[idx].draw.eventID;
@@ -968,8 +968,7 @@ void D3D12CommandData::AddEvent(string description)
   Callstack::Stackwalk *stack = m_pSerialiser->GetLastCallstack();
   if(stack)
   {
-    create_array(apievent.callstack, stack->NumLevels());
-    memcpy(apievent.callstack.elems, stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
+    apievent.callstack.assign(stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
   }
 
   for(size_t i = 0; i < m_EventMessages.size(); i++)
@@ -1234,8 +1233,7 @@ void D3D12CommandData::AddDrawcall(const DrawcallDescription &d, bool hasEvents,
     if(m_LastCmdListID != ResourceId() && addUsage)
       AddUsage(node);
 
-    node.children.insert(node.children.begin(), draw.children.elems,
-                         draw.children.elems + draw.children.count);
+    node.children.insert(node.children.begin(), draw.children.begin(), draw.children.end());
     GetDrawcallStack().back()->children.push_back(node);
   }
   else
@@ -1262,10 +1260,10 @@ void D3D12CommandData::InsertDrawsAndRefreshIDs(ResourceId cmd,
     n.draw.eventID += m_RootEventID;
     n.draw.drawcallID += m_RootDrawcallID;
 
-    for(int32_t e = 0; e < n.draw.events.count; e++)
+    for(APIEvent &ev : n.draw.events)
     {
-      n.draw.events[e].eventID += m_RootEventID;
-      m_Events.push_back(n.draw.events[e]);
+      ev.eventID += m_RootEventID;
+      m_Events.push_back(ev);
     }
 
     DrawcallUse use(m_Events.back().fileOffset, n.draw.eventID, cmd, cmdBufNodes[i].draw.eventID);
diff --git a/renderdoc/driver/d3d12/d3d12_commands.h b/renderdoc/driver/d3d12/d3d12_commands.h
index b8ae20779..e4690ce97 100644
--- a/renderdoc/driver/d3d12/d3d12_commands.h
+++ b/renderdoc/driver/d3d12/d3d12_commands.h
@@ -61,8 +61,8 @@ struct D3D12DrawcallTreeNode
       children.back().draw.eventID += baseEventID;
       children.back().draw.drawcallID += baseDrawID;
 
-      for(int32_t e = 0; e < children.back().draw.events.count; e++)
-        children.back().draw.events[e].eventID += baseEventID;
+      for(APIEvent &ev : children.back().draw.events)
+        ev.eventID += baseEventID;
     }
   }
 
diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp
index 174f5c7ac..bab3d24a9 100644
--- a/renderdoc/driver/d3d12/d3d12_debug.cpp
+++ b/renderdoc/driver/d3d12/d3d12_debug.cpp
@@ -2943,7 +2943,7 @@ void D3D12DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
 
     size_t dataOffset = vec * sizeof(Vec4f) + comp * sizeof(float);
 
-    if(outvars[outIdx].name.count > 0)
+    if(!outvars[outIdx].name.empty())
     {
       RDCASSERT(flatten);
 
@@ -2951,7 +2951,7 @@ void D3D12DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
       RDCASSERT(outvars[vec].columns == comp);
       RDCASSERT(rows == 1);
 
-      string combinedName = outvars[outIdx].name.elems;
+      std::string combinedName = outvars[outIdx].name.c_str();
       combinedName += ", " + basename;
       outvars[outIdx].name = combinedName;
       outvars[outIdx].rows = 1;
@@ -3045,7 +3045,7 @@ void D3D12DebugManager::FillCBufferVariables(const string &prefix, size_t &offse
         uint32_t regLen = cols;
         const char *regName = "row";
 
-        string base = outvars[outIdx].name.elems;
+        std::string base = outvars[outIdx].name.c_str();
 
         if(!flatten)
         {
@@ -3893,16 +3893,14 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID)
 
   if(!dxbcVS->m_OutputSig.empty())
   {
-    for(size_t i = 0; i < dxbcVS->m_OutputSig.size(); i++)
+    for(const SigParameter &sign : dxbcVS->m_OutputSig)
     {
-      SigParameter &sign = dxbcVS->m_OutputSig[i];
-
       D3D12_SO_DECLARATION_ENTRY decl;
 
       decl.Stream = 0;
       decl.OutputSlot = 0;
 
-      decl.SemanticName = sign.semanticName.elems;
+      decl.SemanticName = sign.semanticName.c_str();
       decl.SemanticIndex = sign.semanticIndex;
       decl.StartComponent = 0;
       decl.ComponentCount = sign.compCount & 0xff;
@@ -4399,10 +4397,8 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID)
       lastShader = dxbcDS;
 
     sodecls.clear();
-    for(size_t i = 0; i < lastShader->m_OutputSig.size(); i++)
+    for(const SigParameter &sign : lastShader->m_OutputSig)
     {
-      SigParameter &sign = lastShader->m_OutputSig[i];
-
       D3D12_SO_DECLARATION_ENTRY decl;
 
       // for now, skip streams that aren't stream 0
@@ -4412,7 +4408,7 @@ void D3D12DebugManager::InitPostVSBuffers(uint32_t eventID)
       decl.Stream = 0;
       decl.OutputSlot = 0;
 
-      decl.SemanticName = sign.semanticName.elems;
+      decl.SemanticName = sign.semanticName.c_str();
       decl.SemanticIndex = sign.semanticIndex;
       decl.StartComponent = 0;
       decl.ComponentCount = sign.compCount & 0xff;
diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp
index 1fef3ece8..234f84f57 100644
--- a/renderdoc/driver/d3d12/d3d12_replay.cpp
+++ b/renderdoc/driver/d3d12/d3d12_replay.cpp
@@ -570,7 +570,7 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root
   };
 
   Space *spaces = new Space[sig->sig.numSpaces];
-  create_array_uninit(dstSpaces, sig->sig.numSpaces);
+  dstSpaces.resize(sig->sig.numSpaces);
 
   for(size_t rootEl = 0; rootEl < sig->sig.params.size(); rootEl++)
   {
@@ -591,12 +591,12 @@ void D3D12Replay::FillRegisterSpaces(const D3D12RenderState::RootSignature &root
       {
         const D3D12RenderState::SignatureElement &e = rootSig.sigelems[rootEl];
         if(e.type == eRootConst)
-          create_array_init(cb.RootValues, RDCMIN(e.constants.size(), (size_t)cb.ByteSize),
-                            &e.constants[0]);
+          cb.RootValues.assign(e.constants.data(),
+                               RDCMIN(e.constants.size(), (size_t)p.Constants.Num32BitValues));
       }
 
-      if(cb.RootValues.count == 0)
-        create_array(cb.RootValues, p.Constants.Num32BitValues);
+      if(cb.RootValues.empty())
+        cb.RootValues.resize(p.Constants.Num32BitValues);
     }
     else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV)
     {
@@ -930,7 +930,7 @@ void D3D12Replay::SavePipelineState()
     const D3D12_INPUT_ELEMENT_DESC *inputEl = pipe->graphics->InputLayout.pInputElementDescs;
     UINT numInput = pipe->graphics->InputLayout.NumElements;
 
-    create_array_uninit(state.m_IA.layouts, numInput);
+    state.m_IA.layouts.resize(numInput);
     for(UINT i = 0; i < numInput; i++)
     {
       D3D12Pipe::Layout &l = state.m_IA.layouts[i];
@@ -954,7 +954,7 @@ void D3D12Replay::SavePipelineState()
       default: break;
     }
 
-    create_array_uninit(state.m_IA.vbuffers, rs.vbuffers.size());
+    state.m_IA.vbuffers.resize(rs.vbuffers.size());
     for(size_t i = 0; i < rs.vbuffers.size(); i++)
     {
       D3D12Pipe::VB &vb = state.m_IA.vbuffers[i];
@@ -1028,7 +1028,7 @@ void D3D12Replay::SavePipelineState()
     // Stream Out
     /////////////////////////////////////////////////
 
-    create_array_uninit(state.m_SO.Outputs, rs.streamouts.size());
+    state.m_SO.Outputs.resize(rs.streamouts.size());
     for(size_t s = 0; s < rs.streamouts.size(); s++)
     {
       state.m_SO.Outputs[s].Buffer = rm->GetOriginalID(rs.streamouts[s].buf);
@@ -1072,12 +1072,12 @@ void D3D12Replay::SavePipelineState()
           src.ConservativeRaster == D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON;
     }
 
-    create_array_uninit(state.m_RS.Scissors, rs.scissors.size());
+    state.m_RS.Scissors.resize(rs.scissors.size());
     for(size_t i = 0; i < rs.scissors.size(); i++)
       state.m_RS.Scissors[i] = D3D12Pipe::Scissor(rs.scissors[i].left, rs.scissors[i].top,
                                                   rs.scissors[i].right, rs.scissors[i].bottom);
 
-    create_array_uninit(state.m_RS.Viewports, rs.views.size());
+    state.m_RS.Viewports.resize(rs.views.size());
     for(size_t i = 0; i < rs.views.size(); i++)
       state.m_RS.Viewports[i] =
           D3D12Pipe::Viewport(rs.views[i].TopLeftX, rs.views[i].TopLeftY, rs.views[i].Width,
@@ -1087,7 +1087,7 @@ void D3D12Replay::SavePipelineState()
     // Output Merger
     /////////////////////////////////////////////////
 
-    create_array(state.m_OM.RenderTargets, rs.rts.size());
+    state.m_OM.RenderTargets.resize(rs.rts.size());
     for(size_t i = 0; i < rs.rts.size(); i++)
     {
       D3D12Pipe::View &view = state.m_OM.RenderTargets[i];
@@ -1130,7 +1130,7 @@ void D3D12Replay::SavePipelineState()
       state.m_OM.m_BlendState.AlphaToCoverage = src.AlphaToCoverageEnable == TRUE;
       state.m_OM.m_BlendState.IndependentBlend = src.IndependentBlendEnable == TRUE;
 
-      create_array_uninit(state.m_OM.m_BlendState.Blends, 8);
+      state.m_OM.m_BlendState.Blends.resize(8);
       for(size_t i = 0; i < 8; i++)
       {
         D3D12Pipe::Blend &blend = state.m_OM.m_BlendState.Blends[i];
@@ -1178,8 +1178,8 @@ void D3D12Replay::SavePipelineState()
 
   // resource states
   {
-    const map &states = m_pDevice->GetSubresourceStates();
-    create_array_uninit(state.Resources, states.size());
+    const std::map &states = m_pDevice->GetSubresourceStates();
+    state.Resources.resize(states.size());
     size_t i = 0;
     for(auto it = states.begin(); it != states.end(); ++it)
     {
@@ -1187,7 +1187,7 @@ void D3D12Replay::SavePipelineState()
 
       res.id = rm->GetOriginalID(it->first);
 
-      create_array_uninit(res.states, it->second.size());
+      res.states.resize(it->second.size());
       for(size_t l = 0; l < it->second.size(); l++)
         res.states[l].name = ToStr::Get(it->second[l]);
 
@@ -1392,7 +1392,7 @@ void D3D12Replay::FillCBufferVariables(ResourceId shader, string entryPoint, uin
     idx++;
   }
 
-  if(cb && cbufSlot < (uint32_t)bindMap.ConstantBlocks.count)
+  if(cb && cbufSlot < (uint32_t)bindMap.ConstantBlocks.count())
   {
     // check if the data actually comes from root constants
 
diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp
index d95625663..2540b8b77 100644
--- a/renderdoc/driver/gl/gl_common.cpp
+++ b/renderdoc/driver/gl/gl_common.cpp
@@ -2388,15 +2388,15 @@ void CopyProgramAttribBindings(const GLHookSet &gl, GLuint progsrc, GLuint progd
                                ShaderReflection *refl)
 {
   // copy over attrib bindings
-  for(int32_t i = 0; i < refl->InputSig.count; i++)
+  for(const SigParameter &sig : refl->InputSig)
   {
     // skip built-ins
-    if(refl->InputSig[i].systemValue != ShaderBuiltin::Undefined)
+    if(sig.systemValue != ShaderBuiltin::Undefined)
       continue;
 
-    GLint idx = gl.glGetAttribLocation(progsrc, refl->InputSig[i].varName.elems);
+    GLint idx = gl.glGetAttribLocation(progsrc, sig.varName.c_str());
     if(idx >= 0)
-      gl.glBindAttribLocation(progdst, (GLuint)idx, refl->InputSig[i].varName.elems);
+      gl.glBindAttribLocation(progdst, (GLuint)idx, sig.varName.c_str());
   }
 }
 
@@ -2406,24 +2406,24 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro
   uint64_t used = 0;
 
   // copy over fragdata bindings
-  for(int32_t i = 0; i < refl->OutputSig.count; i++)
+  for(size_t i = 0; i < refl->OutputSig.size(); i++)
   {
     // only look at colour outputs (should be the only outputs from fs)
     if(refl->OutputSig[i].systemValue != ShaderBuiltin::ColorOutput)
       continue;
 
-    if(!strncmp("gl_", refl->OutputSig[i].varName.elems, 3))
+    if(!strncmp("gl_", refl->OutputSig[i].varName.c_str(), 3))
       continue;    // GL_INVALID_OPERATION if name starts with reserved gl_ prefix
 
-    GLint idx = gl.glGetFragDataLocation(progsrc, refl->OutputSig[i].varName.elems);
+    GLint idx = gl.glGetFragDataLocation(progsrc, refl->OutputSig[i].varName.c_str());
     if(idx >= 0)
     {
       uint64_t mask = 1ULL << idx;
 
       if(used & mask)
       {
-        RDCWARN("Multiple signatures bound to output %d, ignoring %s", i,
-                refl->OutputSig[i].varName.elems);
+        RDCWARN("Multiple signatures bound to output %zu, ignoring %s", i,
+                refl->OutputSig[i].varName.c_str());
         continue;
       }
 
@@ -2431,7 +2431,7 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro
 
       if(gl.glBindFragDataLocation)
       {
-        gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.elems);
+        gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.c_str());
       }
       else
       {
diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp
index b3d171547..0adead7c9 100644
--- a/renderdoc/driver/gl/gl_counters.cpp
+++ b/renderdoc/driver/gl/gl_counters.cpp
@@ -217,7 +217,7 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallTreeNode &drawnod
     const DrawcallDescription &d = drawnode.children[i].draw;
     FillTimers(ctx, drawnode.children[i], counters);
 
-    if(d.events.count == 0)
+    if(d.events.empty())
       continue;
 
     GPUQueries *queries = NULL;
diff --git a/renderdoc/driver/gl/gl_debug.cpp b/renderdoc/driver/gl/gl_debug.cpp
index 126c7e985..1d0a1d50a 100644
--- a/renderdoc/driver/gl/gl_debug.cpp
+++ b/renderdoc/driver/gl/gl_debug.cpp
@@ -3434,10 +3434,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID)
   uint32_t stride = 0;
   int32_t posidx = -1;
 
-  for(int32_t i = 0; i < vsRefl->OutputSig.count; i++)
+  for(const SigParameter &sig : vsRefl->OutputSig)
   {
-    const char *name = vsRefl->OutputSig[i].varName.elems;
-    int32_t len = vsRefl->OutputSig[i].varName.count;
+    const char *name = sig.varName.c_str();
+    size_t len = sig.varName.size();
 
     bool include = true;
 
@@ -3461,10 +3461,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID)
     if(include)
       varyings.push_back(name);
 
-    if(vsRefl->OutputSig[i].systemValue == ShaderBuiltin::Position)
+    if(sig.systemValue == ShaderBuiltin::Position)
       posidx = int32_t(varyings.size()) - 1;
 
-    stride += sizeof(float) * vsRefl->OutputSig[i].compCount;
+    stride += sizeof(float) * sig.compCount;
   }
 
   // shift position attribute up to first, keeping order otherwise
@@ -4014,10 +4014,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID)
     stride = 0;
     posidx = -1;
 
-    for(int32_t i = 0; i < lastRefl->OutputSig.count; i++)
+    for(const SigParameter &sig : lastRefl->OutputSig)
     {
-      const char *name = lastRefl->OutputSig[i].varName.elems;
-      int32_t len = lastRefl->OutputSig[i].varName.count;
+      const char *name = sig.varName.c_str();
+      size_t len = sig.varName.size();
 
       bool include = true;
 
@@ -4033,7 +4033,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID)
         }
         else
         {
-          matrixVaryings.push_back(string(name, colon));
+          matrixVaryings.push_back(std::string(name, colon));
           name = matrixVaryings.back().c_str();
         }
       }
@@ -4041,10 +4041,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventID)
       if(include)
         varyings.push_back(name);
 
-      if(lastRefl->OutputSig[i].systemValue == ShaderBuiltin::Position)
+      if(sig.systemValue == ShaderBuiltin::Position)
         posidx = int32_t(varyings.size()) - 1;
 
-      stride += sizeof(float) * lastRefl->OutputSig[i].compCount;
+      stride += sizeof(float) * sig.compCount;
     }
 
     // shift position attribute up to first, keeping order otherwise
diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp
index 9a4d032ca..e86c14879 100644
--- a/renderdoc/driver/gl/gl_driver.cpp
+++ b/renderdoc/driver/gl/gl_driver.cpp
@@ -31,7 +31,6 @@
 #include "jpeg-compressor/jpge.h"
 #include "maths/matrix.h"
 #include "maths/vec.h"
-#include "replay/type_helpers.h"
 #include "serialise/string_utils.h"
 #include "stb/stb_truetype.h"
 
@@ -3270,9 +3269,9 @@ void WrappedOpenGL::Serialise_DebugMessages()
   {
     ScopedContext msgscope(m_pSerialiser, "DebugMessage", "DebugMessage", 0, false);
 
-    string desc;
+    std::string desc;
     if(m_State >= WRITING)
-      desc = debugMessages[i].description.elems;
+      desc = debugMessages[i].description;
 
     SERIALISE_ELEMENT(MessageCategory, Category, debugMessages[i].category);
     SERIALISE_ELEMENT(MessageSeverity, Severity, debugMessages[i].severity);
@@ -4180,39 +4179,37 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d)
     for(size_t i = 0; i < ARRAY_COUNT(refl); i++)
     {
       EventUsage cb = EventUsage(e, CBUsage(i));
-      EventUsage res = EventUsage(e, ResUsage(i));
+      EventUsage ro = EventUsage(e, ResUsage(i));
       EventUsage rw = EventUsage(e, RWResUsage(i));
 
       if(refl[i])
       {
-        for(int32_t c = 0; c < refl[i]->ConstantBlocks.count; c++)
+        for(const ConstantBlock &cblock : refl[i]->ConstantBlocks)
         {
-          if(!refl[i]->ConstantBlocks[c].bufferBacked)
+          if(!cblock.bufferBacked)
             continue;
-          if(refl[i]->ConstantBlocks[c].bindPoint < 0 ||
-             refl[i]->ConstantBlocks[c].bindPoint >= mapping[i].ConstantBlocks.count)
+          if(cblock.bindPoint < 0 || cblock.bindPoint >= mapping[i].ConstantBlocks.count())
             continue;
 
-          int32_t bind = mapping[i].ConstantBlocks[refl[i]->ConstantBlocks[c].bindPoint].bind;
+          int32_t bind = mapping[i].ConstantBlocks[cblock.bindPoint].bind;
 
           if(rs.UniformBinding[bind].name)
             m_ResourceUses[rm->GetID(BufferRes(ctx, rs.UniformBinding[bind].name))].push_back(cb);
         }
 
-        for(int32_t r = 0; r < refl[i]->ReadWriteResources.count; r++)
+        for(const ShaderResource &res : refl[i]->ReadWriteResources)
         {
-          int32_t bind = mapping[i].ReadWriteResources[refl[i]->ReadWriteResources[r].bindPoint].bind;
+          int32_t bind = mapping[i].ReadWriteResources[res.bindPoint].bind;
 
-          if(refl[i]->ReadWriteResources[r].IsTexture)
+          if(res.IsTexture)
           {
             if(rs.Images[bind].name)
               m_ResourceUses[rm->GetID(TextureRes(ctx, rs.Images[bind].name))].push_back(rw);
           }
           else
           {
-            if(refl[i]->ReadWriteResources[r].variableType.descriptor.cols == 1 &&
-               refl[i]->ReadWriteResources[r].variableType.descriptor.rows == 1 &&
-               refl[i]->ReadWriteResources[r].variableType.descriptor.type == VarType::UInt)
+            if(res.variableType.descriptor.cols == 1 && res.variableType.descriptor.rows == 1 &&
+               res.variableType.descriptor.type == VarType::UInt)
             {
               if(rs.AtomicCounter[bind].name)
                 m_ResourceUses[rm->GetID(BufferRes(ctx, rs.AtomicCounter[bind].name))].push_back(rw);
@@ -4225,14 +4222,14 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d)
           }
         }
 
-        for(int32_t r = 0; r < refl[i]->ReadOnlyResources.count; r++)
+        for(const ShaderResource &res : refl[i]->ReadOnlyResources)
         {
-          int32_t bind = mapping[i].ReadOnlyResources[refl[i]->ReadOnlyResources[r].bindPoint].bind;
+          int32_t bind = mapping[i].ReadOnlyResources[res.bindPoint].bind;
 
           uint32_t *texList = NULL;
           int32_t listSize = 0;
 
-          switch(refl[i]->ReadOnlyResources[r].resType)
+          switch(res.resType)
           {
             case TextureDim::Unknown: texList = NULL; break;
             case TextureDim::Buffer:
@@ -4283,7 +4280,7 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d)
           }
 
           if(texList != NULL && bind >= 0 && bind < listSize && texList[bind] != 0)
-            m_ResourceUses[rm->GetID(TextureRes(ctx, texList[bind]))].push_back(res);
+            m_ResourceUses[rm->GetID(TextureRes(ctx, texList[bind]))].push_back(ro);
         }
       }
     }
@@ -4440,8 +4437,7 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d, bool hasEvents)
   if(!context->m_DrawcallStack.empty())
   {
     DrawcallTreeNode node(draw);
-    node.children.insert(node.children.begin(), draw.children.elems,
-                         draw.children.elems + draw.children.count);
+    node.children.insert(node.children.begin(), draw.children.begin(), draw.children.end());
     context->m_DrawcallStack.back()->children.push_back(node);
   }
   else
@@ -4460,8 +4456,7 @@ void WrappedOpenGL::AddEvent(string description)
   Callstack::Stackwalk *stack = m_pSerialiser->GetLastCallstack();
   if(stack)
   {
-    create_array(apievent.callstack, stack->NumLevels());
-    memcpy(apievent.callstack.elems, stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
+    apievent.callstack.assign(stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
   }
 
   m_CurEvents.push_back(apievent);
diff --git a/renderdoc/driver/gl/gl_manager.cpp b/renderdoc/driver/gl/gl_manager.cpp
index fa1c16c23..177853dae 100644
--- a/renderdoc/driver/gl/gl_manager.cpp
+++ b/renderdoc/driver/gl/gl_manager.cpp
@@ -1093,9 +1093,9 @@ bool GLResourceManager::Serialise_InitialState(ResourceId resid, GLResource res)
 
         if(shadDetails.type == eGL_VERTEX_SHADER)
         {
-          for(int s = 0; s < shadDetails.reflection.OutputSig.count; s++)
+          for(const SigParameter &sig : shadDetails.reflection.OutputSig)
           {
-            std::string name = shadDetails.reflection.OutputSig[s].varName.c_str();
+            std::string name = sig.varName;
 
             // look for :row added to split up matrix variables
             size_t colon = name.find(":row");
diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp
index ff7a39775..fea60923c 100644
--- a/renderdoc/driver/gl/gl_replay.cpp
+++ b/renderdoc/driver/gl/gl_replay.cpp
@@ -430,9 +430,9 @@ void GLReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, vec
 
 bool GLReplay::IsRenderOutput(ResourceId id)
 {
-  for(int32_t i = 0; i < m_CurPipelineState.m_FB.m_DrawFBO.Color.count; i++)
+  for(const GLPipe::Attachment &att : m_CurPipelineState.m_FB.m_DrawFBO.Color)
   {
-    if(m_CurPipelineState.m_FB.m_DrawFBO.Color[i].Obj == id)
+    if(att.Obj == id)
       return true;
   }
 
@@ -902,8 +902,8 @@ void GLReplay::SavePipelineState()
   GLint numVAttribBindings = 16;
   gl.glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, &numVAttribBindings);
 
-  create_array_uninit(pipe.m_VtxIn.vbuffers, numVBufferBindings);
-  create_array_uninit(pipe.m_VtxIn.attributes, numVAttribBindings);
+  pipe.m_VtxIn.vbuffers.resize(numVBufferBindings);
+  pipe.m_VtxIn.attributes.resize(numVAttribBindings);
 
   for(GLuint i = 0; i < (GLuint)numVBufferBindings; i++)
   {
@@ -1046,8 +1046,8 @@ void GLReplay::SavePipelineState()
 
   GLint numTexUnits = 8;
   gl.glGetIntegerv(eGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &numTexUnits);
-  create_array_uninit(pipe.Textures, numTexUnits);
-  create_array_uninit(pipe.Samplers, numTexUnits);
+  pipe.Textures.resize(numTexUnits);
+  pipe.Samplers.resize(numTexUnits);
 
   GLenum activeTexture = eGL_TEXTURE0;
   gl.glGetIntegerv(eGL_ACTIVE_TEXTURE, (GLint *)&activeTexture);
@@ -1072,9 +1072,9 @@ void GLReplay::SavePipelineState()
   {
     stages[i]->Object = ResourceId();
     stages[i]->ShaderDetails = NULL;
-    stages[i]->BindpointMapping.ConstantBlocks.Delete();
-    stages[i]->BindpointMapping.ReadOnlyResources.Delete();
-    stages[i]->BindpointMapping.ReadWriteResources.Delete();
+    stages[i]->BindpointMapping.ConstantBlocks.clear();
+    stages[i]->BindpointMapping.ReadOnlyResources.clear();
+    stages[i]->BindpointMapping.ReadWriteResources.clear();
   }
 
   if(curProg == 0)
@@ -1195,8 +1195,8 @@ void GLReplay::SavePipelineState()
     }
     else
     {
-      create_array_uninit(stages[i]->Subroutines, num);
-      memcpy(stages[i]->Subroutines.elems, rs.Subroutines[i].Values, num);
+      stages[i]->Subroutines.resize(num);
+      memcpy(stages[i]->Subroutines.data(), rs.Subroutines[i].Values, num * sizeof(uint32_t));
     }
   }
 
@@ -1228,17 +1228,17 @@ void GLReplay::SavePipelineState()
       if(refls[s] == NULL)
         continue;
 
-      for(int32_t r = 0; r < refls[s]->ReadOnlyResources.count; r++)
+      for(const ShaderResource &res : refls[s]->ReadOnlyResources)
       {
         // bindPoint is the uniform value for this sampler
-        if(mappings[s]->ReadOnlyResources[refls[s]->ReadOnlyResources[r].bindPoint].bind == unit)
+        if(mappings[s]->ReadOnlyResources[res.bindPoint].bind == unit)
         {
           GLenum t = eGL_NONE;
 
-          if(strstr(refls[s]->ReadOnlyResources[r].variableType.descriptor.name.elems, "Shadow"))
+          if(strstr(res.variableType.descriptor.name.c_str(), "Shadow"))
             shadow = true;
 
-          switch(refls[s]->ReadOnlyResources[r].resType)
+          switch(res.resType)
           {
             case TextureDim::Unknown: target = eGL_NONE; break;
             case TextureDim::Buffer: target = eGL_TEXTURE_BUFFER; break;
@@ -1258,7 +1258,7 @@ void GLReplay::SavePipelineState()
           if(target != eGL_NONE)
             t = TextureBinding(target);
 
-          resType = refls[s]->ReadOnlyResources[r].resType;
+          resType = res.resType;
 
           if(binding == eGL_NONE)
           {
@@ -1484,8 +1484,8 @@ void GLReplay::SavePipelineState()
 
   gl.glActiveTexture(activeTexture);
 
-  create_array_uninit(pipe.UniformBuffers, ARRAY_COUNT(rs.UniformBinding));
-  for(int32_t b = 0; b < pipe.UniformBuffers.count; b++)
+  pipe.UniformBuffers.resize(ARRAY_COUNT(rs.UniformBinding));
+  for(size_t b = 0; b < pipe.UniformBuffers.size(); b++)
   {
     if(rs.UniformBinding[b].name == 0)
     {
@@ -1501,8 +1501,8 @@ void GLReplay::SavePipelineState()
     }
   }
 
-  create_array_uninit(pipe.AtomicBuffers, ARRAY_COUNT(rs.AtomicCounter));
-  for(int32_t b = 0; b < pipe.AtomicBuffers.count; b++)
+  pipe.AtomicBuffers.resize(ARRAY_COUNT(rs.AtomicCounter));
+  for(size_t b = 0; b < pipe.AtomicBuffers.size(); b++)
   {
     if(rs.AtomicCounter[b].name == 0)
     {
@@ -1518,8 +1518,8 @@ void GLReplay::SavePipelineState()
     }
   }
 
-  create_array_uninit(pipe.ShaderStorageBuffers, ARRAY_COUNT(rs.ShaderStorage));
-  for(int32_t b = 0; b < pipe.ShaderStorageBuffers.count; b++)
+  pipe.ShaderStorageBuffers.resize(ARRAY_COUNT(rs.ShaderStorage));
+  for(size_t b = 0; b < pipe.ShaderStorageBuffers.size(); b++)
   {
     if(rs.ShaderStorage[b].name == 0)
     {
@@ -1535,8 +1535,8 @@ void GLReplay::SavePipelineState()
     }
   }
 
-  create_array_uninit(pipe.Images, ARRAY_COUNT(rs.Images));
-  for(int32_t i = 0; i < pipe.Images.count; i++)
+  pipe.Images.resize(ARRAY_COUNT(rs.Images));
+  for(size_t i = 0; i < pipe.Images.size(); i++)
   {
     if(rs.Images[i].name == 0)
     {
@@ -1575,8 +1575,8 @@ void GLReplay::SavePipelineState()
 
   RDCCOMPILE_ASSERT(ARRAY_COUNT(rs.Viewports) == ARRAY_COUNT(rs.DepthRanges),
                     "GL Viewport count does not match depth ranges count");
-  create_array_uninit(pipe.m_Rasterizer.Viewports, ARRAY_COUNT(rs.Viewports));
-  for(int32_t v = 0; v < pipe.m_Rasterizer.Viewports.count; ++v)
+  pipe.m_Rasterizer.Viewports.resize(ARRAY_COUNT(rs.Viewports));
+  for(size_t v = 0; v < pipe.m_Rasterizer.Viewports.size(); ++v)
   {
     pipe.m_Rasterizer.Viewports[v].Left = rs.Viewports[v].x;
     pipe.m_Rasterizer.Viewports[v].Bottom = rs.Viewports[v].y;
@@ -1586,8 +1586,8 @@ void GLReplay::SavePipelineState()
     pipe.m_Rasterizer.Viewports[v].MaxDepth = rs.DepthRanges[v].farZ;
   }
 
-  create_array_uninit(pipe.m_Rasterizer.Scissors, ARRAY_COUNT(rs.Scissors));
-  for(int32_t s = 0; s < pipe.m_Rasterizer.Scissors.count; ++s)
+  pipe.m_Rasterizer.Scissors.resize(ARRAY_COUNT(rs.Scissors));
+  for(size_t s = 0; s < pipe.m_Rasterizer.Scissors.size(); ++s)
   {
     pipe.m_Rasterizer.Scissors[s].Left = rs.Scissors[s].x;
     pipe.m_Rasterizer.Scissors[s].Bottom = rs.Scissors[s].y;
@@ -1747,7 +1747,7 @@ void GLReplay::SavePipelineState()
       rbStencil = true;
 
     pipe.m_FB.m_DrawFBO.Obj = rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curDrawFBO)));
-    create_array_uninit(pipe.m_FB.m_DrawFBO.Color, numCols);
+    pipe.m_FB.m_DrawFBO.Color.resize(numCols);
     for(GLint i = 0; i < numCols; i++)
     {
       ResourceId id =
@@ -1799,7 +1799,7 @@ void GLReplay::SavePipelineState()
                                 (GLint *)&pipe.m_FB.m_DrawFBO.Stencil.Mip,
                                 (GLint *)&pipe.m_FB.m_DrawFBO.Stencil.Layer);
 
-    create_array_uninit(pipe.m_FB.m_DrawFBO.DrawBuffers, numCols);
+    pipe.m_FB.m_DrawFBO.DrawBuffers.resize(numCols);
     for(GLint i = 0; i < numCols; i++)
     {
       GLenum b = eGL_NONE;
@@ -1843,7 +1843,7 @@ void GLReplay::SavePipelineState()
       rbStencil = true;
 
     pipe.m_FB.m_ReadFBO.Obj = rm->GetOriginalID(rm->GetID(FramebufferRes(ctx, curReadFBO)));
-    create_array_uninit(pipe.m_FB.m_ReadFBO.Color, numCols);
+    pipe.m_FB.m_ReadFBO.Color.resize(numCols);
     for(GLint i = 0; i < numCols; i++)
     {
       pipe.m_FB.m_ReadFBO.Color[i].Obj = rm->GetOriginalID(
@@ -1871,7 +1871,7 @@ void GLReplay::SavePipelineState()
                                 (GLint *)&pipe.m_FB.m_ReadFBO.Stencil.Mip,
                                 (GLint *)&pipe.m_FB.m_ReadFBO.Stencil.Layer);
 
-    create_array_uninit(pipe.m_FB.m_ReadFBO.DrawBuffers, numCols);
+    pipe.m_FB.m_ReadFBO.DrawBuffers.resize(numCols);
     for(GLint i = 0; i < numCols; i++)
       pipe.m_FB.m_ReadFBO.DrawBuffers[i] = -1;
 
@@ -1890,7 +1890,7 @@ void GLReplay::SavePipelineState()
 
   RDCCOMPILE_ASSERT(ARRAY_COUNT(rs.Blends) == ARRAY_COUNT(rs.ColorMasks),
                     "Color masks and blends mismatched");
-  create_array_uninit(pipe.m_FB.m_Blending.Blends, ARRAY_COUNT(rs.Blends));
+  pipe.m_FB.m_Blending.Blends.resize(ARRAY_COUNT(rs.Blends));
   for(size_t i = 0; i < ARRAY_COUNT(rs.Blends); i++)
   {
     pipe.m_FB.m_Blending.Blends[i].Enabled = rs.Blends[i].Enabled;
@@ -2038,25 +2038,27 @@ void GLReplay::FillCBufferValue(WrappedOpenGL &gl, GLuint prog, bool bufferBacke
 }
 
 void GLReplay::FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferBacked,
-                                    string prefix, const rdctype::array &variables,
-                                    vector &outvars, const vector &data)
+                                    std::string prefix,
+                                    const rdctype::array &variables,
+                                    std::vector &outvars,
+                                    const std::vector &data)
 {
-  for(int32_t i = 0; i < variables.count; i++)
+  for(int32_t i = 0; i < variables.count(); i++)
   {
-    auto desc = variables[i].type.descriptor;
+    const ShaderVariableDescriptor &desc = variables[i].type.descriptor;
 
     ShaderVariable var;
-    var.name = variables[i].name.elems;
+    var.name = variables[i].name;
     var.rows = desc.rows;
     var.columns = desc.cols;
     var.type = desc.type;
 
-    if(variables[i].type.members.count > 0)
+    if(!variables[i].type.members.empty())
     {
       if(desc.elements == 0)
       {
         vector ov;
-        FillCBufferVariables(gl, prog, bufferBacked, prefix + var.name.elems + ".",
+        FillCBufferVariables(gl, prog, bufferBacked, prefix + var.name.c_str() + ".",
                              variables[i].type.members, ov, data);
         var.isStruct = true;
         var.members = ov;
@@ -2067,10 +2069,10 @@ void GLReplay::FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferB
         for(uint32_t a = 0; a < desc.elements; a++)
         {
           ShaderVariable arrEl = var;
-          arrEl.name = StringFormat::Fmt("%s[%u]", var.name.elems, a);
+          arrEl.name = StringFormat::Fmt("%s[%u]", var.name.c_str(), a);
 
           vector ov;
-          FillCBufferVariables(gl, prog, bufferBacked, prefix + arrEl.name.elems + ".",
+          FillCBufferVariables(gl, prog, bufferBacked, prefix + arrEl.name.c_str() + ".",
                                variables[i].type.members, ov, data);
           arrEl.members = ov;
 
@@ -2089,7 +2091,7 @@ void GLReplay::FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferB
 
       // need to query offset and strides as there's no way to know what layout was used
       // (and if it's not an std layout it's implementation defined :( )
-      string fullname = prefix + var.name.elems;
+      std::string fullname = prefix + var.name.c_str();
 
       GLuint idx = gl.glGetProgramResourceIndex(prog, eGL_UNIFORM, fullname.c_str());
 
@@ -2122,7 +2124,7 @@ void GLReplay::FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferB
           for(uint32_t a = 0; a < desc.elements; a++)
           {
             ShaderVariable el = var;
-            el.name = StringFormat::Fmt("%s[%u]", var.name.elems, a);
+            el.name = StringFormat::Fmt("%s[%u]", var.name.c_str(), a);
 
             FillCBufferValue(gl, prog, bufferBacked, desc.rowMajorStorage ? true : false,
                              values[0] + values[2] * a, values[1], data, el);
@@ -2152,7 +2154,7 @@ void GLReplay::FillCBufferVariables(ResourceId shader, string entryPoint, uint32
 
   auto &shaderDetails = m_pDriver->m_Shaders[shader];
 
-  if((int32_t)cbufSlot >= shaderDetails.reflection.ConstantBlocks.count)
+  if((int32_t)cbufSlot >= shaderDetails.reflection.ConstantBlocks.count())
   {
     RDCERR("Requesting invalid constant block");
     return;
@@ -2183,7 +2185,7 @@ void GLReplay::FillCBufferVariables(ResourceId shader, string entryPoint, uint32
     }
   }
 
-  auto cblock = shaderDetails.reflection.ConstantBlocks.elems[cbufSlot];
+  const ConstantBlock &cblock = shaderDetails.reflection.ConstantBlocks[cbufSlot];
 
   FillCBufferVariables(gl, curProg, cblock.bufferBacked ? true : false, "", cblock.variables,
                        outvars, data);
diff --git a/renderdoc/driver/gl/gl_replay.h b/renderdoc/driver/gl/gl_replay.h
index c162ecaf5..1b2d11ddd 100644
--- a/renderdoc/driver/gl/gl_replay.h
+++ b/renderdoc/driver/gl/gl_replay.h
@@ -238,9 +238,9 @@ private:
   void FillCBufferValue(WrappedOpenGL &gl, GLuint prog, bool bufferBacked, bool rowMajor,
                         uint32_t offs, uint32_t matStride, const vector &data,
                         ShaderVariable &outVar);
-  void FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferBacked, string prefix,
+  void FillCBufferVariables(WrappedOpenGL &gl, GLuint prog, bool bufferBacked, std::string prefix,
                             const rdctype::array &variables,
-                            vector &outvars, const vector &data);
+                            std::vector &outvars, const std::vector &data);
 
   void CreateCustomShaderTex(uint32_t w, uint32_t h);
   void SetupOverlayPipeline(GLuint Program, GLuint Pipeline, GLuint fragProgram);
diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp
index e5f07b3c7..8bb096e75 100644
--- a/renderdoc/driver/gl/gl_shader_refl.cpp
+++ b/renderdoc/driver/gl/gl_shader_refl.cpp
@@ -27,45 +27,14 @@
 #include 
 #include "gl_driver.h"
 
-// declare versions of ShaderConstant/ShaderVariableType with vectors
-// to more easily build up the members of nested structures
-struct DynShaderConstant;
-
-struct DynShaderVariableType
-{
-  struct
-  {
-    VarType type;
-    uint32_t rows;
-    uint32_t cols;
-    uint32_t elements;
-    bool rowMajorStorage;
-    uint32_t arrayStride;
-    string name;
-  } descriptor;
-
-  vector members;
-};
-
-struct DynShaderConstant
-{
-  string name;
-  struct
-  {
-    uint32_t vec;
-    uint32_t comp;
-  } reg;
-  DynShaderVariableType type;
-};
-
-void sort(vector &vars)
+void sort(rdctype::array &vars)
 {
   if(vars.empty())
     return;
 
   struct offset_sort
   {
-    bool operator()(const DynShaderConstant &a, const DynShaderConstant &b)
+    bool operator()(const ShaderConstant &a, const ShaderConstant &b)
     {
       if(a.reg.vec == b.reg.vec)
         return a.reg.comp < b.reg.comp;
@@ -80,32 +49,6 @@ void sort(vector &vars)
     sort(vars[i].type.members);
 }
 
-void copy(rdctype::array &outvars, const vector &invars)
-{
-  if(invars.empty())
-  {
-    RDCEraseEl(outvars);
-    return;
-  }
-
-  create_array_uninit(outvars, invars.size());
-  for(size_t i = 0; i < invars.size(); i++)
-  {
-    outvars[i].name = invars[i].name;
-    outvars[i].reg.vec = invars[i].reg.vec;
-    outvars[i].reg.comp = invars[i].reg.comp;
-    outvars[i].defaultValue = 0;
-    outvars[i].type.descriptor.type = invars[i].type.descriptor.type;
-    outvars[i].type.descriptor.rows = (uint8_t)invars[i].type.descriptor.rows;
-    outvars[i].type.descriptor.cols = (uint8_t)invars[i].type.descriptor.cols;
-    outvars[i].type.descriptor.elements = invars[i].type.descriptor.elements;
-    outvars[i].type.descriptor.rowMajorStorage = invars[i].type.descriptor.rowMajorStorage;
-    outvars[i].type.descriptor.arrayStride = invars[i].type.descriptor.arrayStride;
-    outvars[i].type.descriptor.name = invars[i].type.descriptor.name;
-    copy(outvars[i].type.members, invars[i].type.members);
-  }
-}
-
 void CheckVertexOutputUses(const vector &sources, bool &pointSizeUsed, bool &clipDistanceUsed)
 {
   pointSizeUsed = false;
@@ -547,8 +490,8 @@ GLuint MakeSeparableShaderProgram(WrappedOpenGL &gl, GLenum type, vector
 }
 
 void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuint varIdx,
-                        GLint numParentBlocks, vector *parentBlocks,
-                        vector *defaultBlock)
+                        GLint numParentBlocks, rdctype::array *parentBlocks,
+                        rdctype::array *defaultBlock)
 {
   const size_t numProps = 8;
 
@@ -564,7 +507,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin
   GLint values[numProps] = {-1, -1, -1, -1, -1, -1, -1, -1};
   gl.glGetProgramResourceiv(sepProg, query, varIdx, numProps, resProps, numProps, NULL, values);
 
-  DynShaderConstant var;
+  ShaderConstant var;
 
   var.type.descriptor.elements = RDCMAX(1, values[4]);
 
@@ -766,7 +709,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin
     gl.glGetProgramResourceiv(sepProg, query, varIdx, 1, &propName, 1, NULL, &topLevelStride);
   }
 
-  vector *parentmembers = defaultBlock;
+  rdctype::array *parentmembers = defaultBlock;
 
   if(values[3] != -1 && values[3] < numParentBlocks)
   {
@@ -832,7 +775,7 @@ void ReconstructVarTree(const GLHookSet &gl, GLenum query, GLuint sepProg, GLuin
     }
 
     // construct a parent variable
-    DynShaderConstant parentVar;
+    ShaderConstant parentVar;
     parentVar.name = base;
     parentVar.reg.vec = var.reg.vec;
     parentVar.reg.comp = 0;
@@ -904,7 +847,8 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
     RDCEraseEl(refl.DispatchThreadsDimension);
   }
 
-  vector roresources, rwresources;
+  rdctype::array &roresources = refl.ReadOnlyResources;
+  rdctype::array &rwresources = refl.ReadWriteResources;
 
   GLint numUniforms = 0;
   gl.glGetProgramInterfaceiv(sepProg, eGL_UNIFORM, eGL_ACTIVE_RESOURCES, &numUniforms);
@@ -1425,7 +1369,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
 
     res.name = name;
 
-    vector &reslist = (res.IsReadOnly ? roresources : rwresources);
+    rdctype::array &reslist = (res.IsReadOnly ? roresources : rwresources);
 
     res.bindPoint = (int32_t)reslist.size();
     reslist.push_back(res);
@@ -1490,7 +1434,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
   }
 
   {
-    vector *members = new vector[ssbos.size()];
+    rdctype::array *members = new rdctype::array[ssbos.size()];
 
     for(uint32_t i = 0; i < ssboMembers; i++)
     {
@@ -1510,7 +1454,7 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
         // member
         uint32_t desiredStride = members[ssbo][0].type.descriptor.arrayStride;
 
-        DynShaderConstant *last = &members[ssbo][0].type.members.back();
+        ShaderConstant *last = &members[ssbo][0].type.members.back();
         while(!last->type.members.empty())
           last = &last->type.members.back();
 
@@ -1532,13 +1476,13 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
 
           padding /= 4;
 
-          DynShaderConstant paddingVar;
+          ShaderConstant paddingVar;
           paddingVar.name = "__padding";
           paddingVar.reg.vec = last->reg.vec + (size / 16);
           paddingVar.reg.comp = (last->reg.comp + size / 4) % 16;
           paddingVar.type.descriptor.type = VarType::UInt;
           paddingVar.type.descriptor.rows = 1;
-          paddingVar.type.descriptor.cols = padding;
+          paddingVar.type.descriptor.cols = (uint8_t)RDCMIN(padding, 255U);
           paddingVar.type.descriptor.elements = 1;
           paddingVar.type.descriptor.rowMajorStorage = false;
           paddingVar.type.descriptor.arrayStride = 0;
@@ -1548,22 +1492,22 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
         }
       }
 
-      copy(rwresources[ssbos[ssbo]].variableType.members, members[ssbo]);
+      std::swap(rwresources[ssbos[ssbo]].variableType.members, members[ssbo]);
     }
 
     delete[] members;
   }
 
-  vector globalUniforms;
+  rdctype::array globalUniforms;
 
   GLint numUBOs = 0;
   vector uboNames;
-  vector *ubos = NULL;
+  rdctype::array *ubos = NULL;
 
   {
     gl.glGetProgramInterfaceiv(sepProg, eGL_UNIFORM_BLOCK, eGL_ACTIVE_RESOURCES, &numUBOs);
 
-    ubos = new vector[numUBOs];
+    ubos = new rdctype::array[numUBOs];
     uboNames.resize(numUBOs);
 
     for(GLint u = 0; u < numUBOs; u++)
@@ -1584,12 +1528,10 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
     ReconstructVarTree(gl, eGL_UNIFORM, sepProg, u, numUBOs, ubos, &globalUniforms);
   }
 
-  vector cbuffers;
+  refl.ConstantBlocks.reserve(numUBOs + (globalUniforms.empty() ? 0 : 1));
 
   if(ubos)
   {
-    cbuffers.reserve(numUBOs + (globalUniforms.empty() ? 0 : 1));
-
     for(int i = 0; i < numUBOs; i++)
     {
       if(!ubos[i].empty())
@@ -1597,16 +1539,16 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
         ConstantBlock cblock;
         cblock.name = uboNames[i];
         cblock.bufferBacked = true;
-        cblock.bindPoint = (int32_t)cbuffers.size();
+        cblock.bindPoint = (int32_t)refl.ConstantBlocks.size();
 
         GLenum bufSize = eGL_BUFFER_DATA_SIZE;
         gl.glGetProgramResourceiv(sepProg, eGL_UNIFORM_BLOCK, i, 1, &bufSize, 1, NULL,
                                   (GLint *)&cblock.byteSize);
 
         sort(ubos[i]);
-        copy(cblock.variables, ubos[i]);
+        std::swap(cblock.variables, ubos[i]);
 
-        cbuffers.push_back(cblock);
+        refl.ConstantBlocks.push_back(cblock);
       }
     }
   }
@@ -1616,15 +1558,16 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
     ConstantBlock globals;
     globals.name = "$Globals";
     globals.bufferBacked = false;
-    globals.bindPoint = (int32_t)cbuffers.size();
+    globals.bindPoint = (int32_t)refl.ConstantBlocks.size();
 
     sort(globalUniforms);
-    copy(globals.variables, globalUniforms);
+    std::swap(globals.variables, globalUniforms);
 
-    cbuffers.push_back(globals);
+    refl.ConstantBlocks.push_back(globals);
   }
 
   delete[] ubos;
+
   for(int sigType = 0; sigType < 2; sigType++)
   {
     GLenum sigEnum = (sigType == 0 ? eGL_PROGRAM_INPUT : eGL_PROGRAM_OUTPUT);
@@ -1945,10 +1888,6 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
   }
 
   // TODO: fill in Interfaces with shader subroutines?
-
-  refl.ReadOnlyResources = roresources;
-  refl.ReadWriteResources = rwresources;
-  refl.ConstantBlocks = cbuffers;
 }
 
 void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, ShaderReflection *refl,
@@ -1968,16 +1907,14 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
       eGL_REFERENCED_BY_FRAGMENT_SHADER,        eGL_REFERENCED_BY_COMPUTE_SHADER,
   };
 
-  int32_t numReadOnlyResources = refl ? refl->ReadOnlyResources.count : 0;
-
-  create_array_uninit(mapping.ReadOnlyResources, numReadOnlyResources);
-  for(int32_t i = 0; i < numReadOnlyResources; i++)
+  mapping.ReadOnlyResources.resize(refl->ReadOnlyResources.size());
+  for(size_t i = 0; i < refl->ReadOnlyResources.size(); i++)
   {
-    if(refl->ReadOnlyResources.elems[i].IsTexture)
+    if(refl->ReadOnlyResources[i].IsTexture)
     {
       // normal sampler or image load/store
 
-      GLint loc = gl.glGetUniformLocation(curProg, refl->ReadOnlyResources.elems[i].name.elems);
+      GLint loc = gl.glGetUniformLocation(curProg, refl->ReadOnlyResources[i].name.c_str());
       if(loc >= 0)
       {
         gl.glGetUniformiv(curProg, loc, dummyReadback);
@@ -1987,7 +1924,7 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
       }
 
       // handle sampler arrays, use the base name
-      string name = refl->ReadOnlyResources.elems[i].name.elems;
+      std::string name = refl->ReadOnlyResources[i].name.c_str();
       if(name.back() == ']')
       {
         do
@@ -2020,16 +1957,14 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
     }
   }
 
-  int32_t numReadWriteResources = refl ? refl->ReadWriteResources.count : 0;
-
-  create_array_uninit(mapping.ReadWriteResources, numReadWriteResources);
-  for(int32_t i = 0; i < numReadWriteResources; i++)
+  mapping.ReadWriteResources.resize(refl->ReadWriteResources.size());
+  for(size_t i = 0; i < refl->ReadWriteResources.size(); i++)
   {
-    if(refl->ReadWriteResources.elems[i].IsTexture)
+    if(refl->ReadWriteResources[i].IsTexture)
     {
       // image load/store
 
-      GLint loc = gl.glGetUniformLocation(curProg, refl->ReadWriteResources.elems[i].name.elems);
+      GLint loc = gl.glGetUniformLocation(curProg, refl->ReadWriteResources[i].name.c_str());
       if(loc >= 0)
       {
         gl.glGetUniformiv(curProg, loc, dummyReadback);
@@ -2039,7 +1974,7 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
       }
 
       // handle sampler arrays, use the base name
-      string name = refl->ReadWriteResources.elems[i].name.elems;
+      std::string name = refl->ReadWriteResources[i].name.c_str();
       if(name.back() == ']')
       {
         do
@@ -2063,15 +1998,15 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
         mapping.ReadWriteResources[i].used = (used != 0);
       }
     }
-    else if(!refl->ReadWriteResources.elems[i].IsTexture)
+    else if(!refl->ReadWriteResources[i].IsTexture)
     {
-      if(refl->ReadWriteResources.elems[i].variableType.descriptor.cols == 1 &&
-         refl->ReadWriteResources.elems[i].variableType.descriptor.rows == 1 &&
-         refl->ReadWriteResources.elems[i].variableType.descriptor.type == VarType::UInt)
+      if(refl->ReadWriteResources[i].variableType.descriptor.cols == 1 &&
+         refl->ReadWriteResources[i].variableType.descriptor.rows == 1 &&
+         refl->ReadWriteResources[i].variableType.descriptor.type == VarType::UInt)
       {
         // atomic uint
         GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM,
-                                                  refl->ReadWriteResources.elems[i].name.elems);
+                                                  refl->ReadWriteResources[i].name.c_str());
 
         if(idx == GL_INVALID_INDEX)
         {
@@ -2135,7 +2070,7 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
       {
         // shader storage buffer object
         GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_SHADER_STORAGE_BLOCK,
-                                                  refl->ReadWriteResources.elems[i].name.elems);
+                                                  refl->ReadWriteResources[i].name.c_str());
 
         if(idx == GL_INVALID_INDEX)
         {
@@ -2167,14 +2102,12 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
     }
   }
 
-  int32_t numCBlocks = refl ? refl->ConstantBlocks.count : 0;
-
-  create_array_uninit(mapping.ConstantBlocks, numCBlocks);
-  for(int32_t i = 0; i < numCBlocks; i++)
+  mapping.ConstantBlocks.resize(refl->ConstantBlocks.size());
+  for(size_t i = 0; i < refl->ConstantBlocks.size(); i++)
   {
-    if(refl->ConstantBlocks.elems[i].bufferBacked)
+    if(refl->ConstantBlocks[i].bufferBacked)
     {
-      GLint loc = gl.glGetUniformBlockIndex(curProg, refl->ConstantBlocks.elems[i].name.elems);
+      GLint loc = gl.glGetUniformBlockIndex(curProg, refl->ConstantBlocks[i].name.c_str());
       if(loc >= 0)
       {
         gl.glGetActiveUniformBlockiv(curProg, loc, eGL_UNIFORM_BLOCK_BINDING, dummyReadback);
@@ -2190,14 +2123,14 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
       mapping.ConstantBlocks[i].arraySize = 1;
     }
 
-    if(!refl->ConstantBlocks.elems[i].bufferBacked)
+    if(!refl->ConstantBlocks[i].bufferBacked)
     {
       mapping.ConstantBlocks[i].used = true;
     }
     else
     {
       GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM_BLOCK,
-                                                refl->ConstantBlocks.elems[i].name.elems);
+                                                refl->ConstantBlocks[i].name.c_str());
       if(idx == GL_INVALID_INDEX)
       {
         mapping.ConstantBlocks[i].used = false;
@@ -2215,16 +2148,16 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
   GLint numVAttribBindings = 16;
   gl.glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, &numVAttribBindings);
 
-  create_array_uninit(mapping.InputAttributes, numVAttribBindings);
+  mapping.InputAttributes.resize(numVAttribBindings);
   for(int32_t i = 0; i < numVAttribBindings; i++)
     mapping.InputAttributes[i] = -1;
 
   // override identity map with bindings
   if(shadIdx == 0 && refl)
   {
-    for(int32_t i = 0; i < refl->InputSig.count; i++)
+    for(int32_t i = 0; i < refl->InputSig.count(); i++)
     {
-      GLint loc = gl.glGetAttribLocation(curProg, refl->InputSig.elems[i].varName.elems);
+      GLint loc = gl.glGetAttribLocation(curProg, refl->InputSig[i].varName.c_str());
 
       if(loc >= 0 && loc < numVAttribBindings)
       {
@@ -2347,9 +2280,9 @@ void ResortBindings(ShaderReflection *refl, ShaderBindpointMapping *mapping)
     }
   };
 
-  permutation.resize(mapping->ReadOnlyResources.count);
-  for(int i = 0; i < mapping->ReadOnlyResources.count; i++)
-    permutation[i] = std::make_pair((size_t)i, mapping->ReadOnlyResources[i].bind);
+  permutation.resize(mapping->ReadOnlyResources.size());
+  for(size_t i = 0; i < mapping->ReadOnlyResources.size(); i++)
+    permutation[i] = std::make_pair(i, mapping->ReadOnlyResources[i].bind);
 
   std::sort(permutation.begin(), permutation.end(), permutation_sort());
 
@@ -2362,9 +2295,9 @@ void ResortBindings(ShaderReflection *refl, ShaderBindpointMapping *mapping)
   for(size_t i = 0; i < permutation.size(); i++)
     refl->ReadOnlyResources[i].bindPoint = (int)permutation[i].first;
 
-  permutation.resize(mapping->ReadWriteResources.count);
-  for(int i = 0; i < mapping->ReadWriteResources.count; i++)
-    permutation[i] = std::make_pair((size_t)i, mapping->ReadWriteResources[i].bind);
+  permutation.resize(mapping->ReadWriteResources.size());
+  for(size_t i = 0; i < mapping->ReadWriteResources.size(); i++)
+    permutation[i] = std::make_pair(i, mapping->ReadWriteResources[i].bind);
 
   std::sort(permutation.begin(), permutation.end(), permutation_sort());
 
@@ -2375,9 +2308,9 @@ void ResortBindings(ShaderReflection *refl, ShaderBindpointMapping *mapping)
   for(size_t i = 0; i < permutation.size(); i++)
     refl->ReadWriteResources[i].bindPoint = (int)permutation[i].first;
 
-  permutation.resize(mapping->ConstantBlocks.count);
-  for(int i = 0; i < mapping->ConstantBlocks.count; i++)
-    permutation[i] = std::make_pair((size_t)i, mapping->ConstantBlocks[i].bind);
+  permutation.resize(mapping->ConstantBlocks.size());
+  for(size_t i = 0; i < mapping->ConstantBlocks.size(); i++)
+    permutation[i] = std::make_pair(i, mapping->ConstantBlocks[i].bind);
 
   std::sort(permutation.begin(), permutation.end(), permutation_sort());
 
diff --git a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp
index 3fbe2294e..a2c7d57ab 100644
--- a/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp
+++ b/renderdoc/driver/gl/wrappers/gl_shader_funcs.cpp
@@ -53,7 +53,7 @@ void WrappedOpenGL::ShaderData::Compile(WrappedOpenGL &gl, ResourceId id, GLuint
       concatenated += sources[i];
     }
 
-    create_array_init(reflection.RawBytes, concatenated.size(), (byte *)concatenated.c_str());
+    reflection.RawBytes.assign((byte *)concatenated.c_str(), concatenated.size());
   }
 
   GLuint sepProg = prog;
@@ -93,7 +93,7 @@ void WrappedOpenGL::ShaderData::Compile(WrappedOpenGL &gl, ResourceId id, GLuint
     reflection.EntryPoint = "main";
 
     // TODO sort these so that the first file contains the entry point
-    create_array_uninit(reflection.DebugInfo.files, sources.size());
+    reflection.DebugInfo.files.resize(sources.size());
     for(size_t i = 0; i < sources.size(); i++)
     {
       reflection.DebugInfo.files[i].first = StringFormat::Fmt("source%u.glsl", (uint32_t)i);
diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp
index a059a4fa4..02fe9d5be 100644
--- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp
+++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp
@@ -537,7 +537,7 @@ void State::Init()
 
     if(decl.declaration == OPCODE_DCL_TEMPS)
     {
-      create_array_uninit(registers, decl.numTemps);
+      registers.reserve(decl.numTemps);
 
       for(uint32_t t = 0; t < decl.numTemps; t++)
       {
@@ -545,7 +545,7 @@ void State::Init()
 
         StringFormat::snprintf(buf, 63, "r%d", t);
 
-        registers[t] = ShaderVariable(buf, 0l, 0l, 0l, 0l);
+        registers.push_back(ShaderVariable(buf, 0l, 0l, 0l, 0l));
       }
     }
     if(decl.declaration == OPCODE_DCL_INDEXABLE_TEMP)
@@ -561,13 +561,13 @@ void State::Init()
 
   if(indexTempSizes.size())
   {
-    create_array_uninit(indexableTemps, indexTempSizes.size());
+    indexableTemps.resize(indexTempSizes.size());
 
     for(int32_t i = 0; i < (int32_t)indexTempSizes.size(); i++)
     {
       if(indexTempSizes[i] > 0)
       {
-        create_array_uninit(indexableTemps[i], indexTempSizes[i]);
+        indexableTemps[i].resize(indexTempSizes[i]);
         for(uint32_t t = 0; t < indexTempSizes[i]; t++)
         {
           char buf[64] = {0};
@@ -632,8 +632,8 @@ void State::SetDst(const ASMOperand &dstoper, const ASMOperation &op, const Shad
   {
     case TYPE_TEMP:
     {
-      RDCASSERT(indices[0] < (uint32_t)registers.count);
-      if(indices[0] < (uint32_t)registers.count)
+      RDCASSERT(indices[0] < (uint32_t)registers.size());
+      if(indices[0] < (uint32_t)registers.size())
         v = ®isters[(size_t)indices[0]];
       break;
     }
@@ -643,11 +643,11 @@ void State::SetDst(const ASMOperand &dstoper, const ASMOperation &op, const Shad
 
       if(dstoper.indices.size() == 2)
       {
-        RDCASSERT(indices[0] < (uint32_t)indexableTemps.count);
-        if(indices[0] < (uint32_t)indexableTemps.count)
+        RDCASSERT(indices[0] < (uint32_t)indexableTemps.size());
+        if(indices[0] < (uint32_t)indexableTemps.size())
         {
-          RDCASSERT(indices[1] < (uint32_t)indexableTemps[indices[0]].count);
-          if(indices[1] < (uint32_t)indexableTemps[indices[0]].count)
+          RDCASSERT(indices[1] < (uint32_t)indexableTemps[indices[0]].size());
+          if(indices[1] < (uint32_t)indexableTemps[indices[0]].size())
           {
             v = &indexableTemps[indices[0]][indices[1]];
           }
@@ -657,8 +657,8 @@ void State::SetDst(const ASMOperand &dstoper, const ASMOperation &op, const Shad
     }
     case TYPE_OUTPUT:
     {
-      RDCASSERT(indices[0] < (uint32_t)outputs.count);
-      if(indices[0] < (uint32_t)outputs.count)
+      RDCASSERT(indices[0] < (uint32_t)outputs.size());
+      if(indices[0] < (uint32_t)outputs.size())
         v = &outputs[(size_t)indices[0]];
       break;
     }
@@ -680,10 +680,10 @@ void State::SetDst(const ASMOperand &dstoper, const ASMOperation &op, const Shad
     {
       RDCERR("Currently unsupported destination operand type %d!", dstoper.type);
 
-      string name = dstoper.toString(dxbc, ToString::ShowSwizzle);
-      for(int32_t i = 0; i < outputs.count; i++)
+      std::string name = dstoper.toString(dxbc, ToString::ShowSwizzle);
+      for(size_t i = 0; i < outputs.size(); i++)
       {
-        if(outputs[i].name.elems && !strcmp(name.c_str(), outputs[i].name.elems))
+        if(outputs[i].name == name)
         {
           v = &outputs[i];
           break;
@@ -821,9 +821,9 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
     case TYPE_TEMP:
     {
       // we assume we never write to an uninitialised register
-      RDCASSERT(indices[0] < (uint32_t)registers.count);
+      RDCASSERT(indices[0] < (uint32_t)registers.size());
 
-      if(indices[0] < (uint32_t)registers.count)
+      if(indices[0] < (uint32_t)registers.size())
         v = s = registers[indices[0]];
       else
         v = s = ShaderVariable("", indices[0], indices[0], indices[0], indices[0]);
@@ -836,11 +836,11 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
 
       if(oper.indices.size() == 2)
       {
-        RDCASSERT(indices[0] < (uint32_t)indexableTemps.count);
-        if(indices[0] < (uint32_t)indexableTemps.count)
+        RDCASSERT(indices[0] < (uint32_t)indexableTemps.size());
+        if(indices[0] < (uint32_t)indexableTemps.size())
         {
-          RDCASSERT(indices[1] < (uint32_t)indexableTemps[indices[0]].count);
-          if(indices[1] < (uint32_t)indexableTemps[indices[0]].count)
+          RDCASSERT(indices[1] < (uint32_t)indexableTemps[indices[0]].size());
+          if(indices[1] < (uint32_t)indexableTemps[indices[0]].size())
           {
             v = s = indexableTemps[indices[0]][indices[1]];
           }
@@ -850,9 +850,9 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
     }
     case TYPE_INPUT:
     {
-      RDCASSERT(indices[0] < (uint32_t)trace->inputs.count);
+      RDCASSERT(indices[0] < (uint32_t)trace->inputs.size());
 
-      if(indices[0] < (uint32_t)trace->inputs.count)
+      if(indices[0] < (uint32_t)trace->inputs.size())
         v = s = trace->inputs[indices[0]];
       else
         v = s = ShaderVariable("", indices[0], indices[0], indices[0], indices[0]);
@@ -861,9 +861,9 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
     }
     case TYPE_OUTPUT:
     {
-      RDCASSERT(indices[0] < (uint32_t)outputs.count);
+      RDCASSERT(indices[0] < (uint32_t)outputs.size());
 
-      if(indices[0] < (uint32_t)outputs.count)
+      if(indices[0] < (uint32_t)outputs.size())
         v = s = outputs[indices[0]];
       else
         v = s = ShaderVariable("", indices[0], indices[0], indices[0], indices[0]);
@@ -937,15 +937,16 @@ ShaderVariable State::GetSrc(const ASMOperand &oper, const ASMOperation &op) con
         }
       }
 
-      RDCASSERTMSG("Invalid cbuffer lookup", cb != -1 && cb < trace->cbuffers.count, cb,
-                   trace->cbuffers.count);
+      RDCASSERTMSG("Invalid cbuffer lookup", cb != -1 && cb < trace->cbuffers.count(), cb,
+                   trace->cbuffers.count());
 
-      if(cb >= 0 && cb < trace->cbuffers.count)
+      if(cb >= 0 && cb < trace->cbuffers.count())
       {
-        RDCASSERTMSG("Out of bounds cbuffer lookup", indices[1] < (uint32_t)trace->cbuffers[cb].count,
-                     indices[1], trace->cbuffers[cb].count);
+        RDCASSERTMSG("Out of bounds cbuffer lookup",
+                     indices[1] < (uint32_t)trace->cbuffers[cb].count(), indices[1],
+                     trace->cbuffers[cb].count());
 
-        if(indices[1] < (uint32_t)trace->cbuffers[cb].count)
+        if(indices[1] < (uint32_t)trace->cbuffers[cb].size())
           v = s = trace->cbuffers[cb][indices[1]];
         else
           v = s = ShaderVariable("", 0U, 0U, 0U, 0U);
diff --git a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp
index 4e2cfb9d9..78d102df9 100644
--- a/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp
+++ b/renderdoc/driver/shaders/dxbc/dxbc_inspect.cpp
@@ -714,7 +714,7 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
         }
       }
 
-      set cbuffernames;
+      std::set cbuffernames;
 
       for(int32_t i = 0; i < h->cbuffers.count; i++)
       {
@@ -962,53 +962,53 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
         // check system value semantics
         if(desc.systemValue == ShaderBuiltin::Undefined)
         {
-          if(!_stricmp(desc.semanticName.elems, "SV_Position"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_Position"))
             desc.systemValue = ShaderBuiltin::Position;
-          if(!_stricmp(desc.semanticName.elems, "SV_ClipDistance"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_ClipDistance"))
             desc.systemValue = ShaderBuiltin::ClipDistance;
-          if(!_stricmp(desc.semanticName.elems, "SV_CullDistance"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_CullDistance"))
             desc.systemValue = ShaderBuiltin::CullDistance;
-          if(!_stricmp(desc.semanticName.elems, "SV_RenderTargetArrayIndex"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_RenderTargetArrayIndex"))
             desc.systemValue = ShaderBuiltin::RTIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_ViewportArrayIndex"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_ViewportArrayIndex"))
             desc.systemValue = ShaderBuiltin::ViewportIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_VertexID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_VertexID"))
             desc.systemValue = ShaderBuiltin::VertexIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_PrimitiveID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_PrimitiveID"))
             desc.systemValue = ShaderBuiltin::PrimitiveIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_InstanceID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_InstanceID"))
             desc.systemValue = ShaderBuiltin::InstanceIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_DispatchThreadID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_DispatchThreadID"))
             desc.systemValue = ShaderBuiltin::DispatchThreadIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_GroupID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_GroupID"))
             desc.systemValue = ShaderBuiltin::GroupIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_GroupIndex"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_GroupIndex"))
             desc.systemValue = ShaderBuiltin::GroupFlatIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_GroupThreadID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_GroupThreadID"))
             desc.systemValue = ShaderBuiltin::GroupThreadIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_GSInstanceID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_GSInstanceID"))
             desc.systemValue = ShaderBuiltin::GSInstanceIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_OutputControlPointID"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_OutputControlPointID"))
             desc.systemValue = ShaderBuiltin::OutputControlPointIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_DomainLocation"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_DomainLocation"))
             desc.systemValue = ShaderBuiltin::DomainLocation;
-          if(!_stricmp(desc.semanticName.elems, "SV_IsFrontFace"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_IsFrontFace"))
             desc.systemValue = ShaderBuiltin::IsFrontFace;
-          if(!_stricmp(desc.semanticName.elems, "SV_SampleIndex"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_SampleIndex"))
             desc.systemValue = ShaderBuiltin::MSAASampleIndex;
-          if(!_stricmp(desc.semanticName.elems, "SV_TessFactor"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_TessFactor"))
             desc.systemValue = ShaderBuiltin::OuterTessFactor;
-          if(!_stricmp(desc.semanticName.elems, "SV_InsideTessFactor"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_InsideTessFactor"))
             desc.systemValue = ShaderBuiltin::InsideTessFactor;
-          if(!_stricmp(desc.semanticName.elems, "SV_Target"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_Target"))
             desc.systemValue = ShaderBuiltin::ColorOutput;
-          if(!_stricmp(desc.semanticName.elems, "SV_Depth"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_Depth"))
             desc.systemValue = ShaderBuiltin::DepthOutput;
-          if(!_stricmp(desc.semanticName.elems, "SV_Coverage"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_Coverage"))
             desc.systemValue = ShaderBuiltin::MSAACoverage;
-          if(!_stricmp(desc.semanticName.elems, "SV_DepthGreaterEqual"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_DepthGreaterEqual"))
             desc.systemValue = ShaderBuiltin::DepthOutputGreaterEqual;
-          if(!_stricmp(desc.semanticName.elems, "SV_DepthLessEqual"))
+          if(!_stricmp(desc.semanticName.c_str(), "SV_DepthLessEqual"))
             desc.systemValue = ShaderBuiltin::DepthOutputLessEqual;
         }
 
@@ -1028,14 +1028,14 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
         for(uint32_t j = 0; j < sign->numElems; j++)
         {
           SigParameter &b = (*sig)[j];
-          if(i != j && !strcmp(a.semanticName.elems, b.semanticName.elems))
+          if(i != j && a.semanticName == b.semanticName)
           {
             a.needSemanticIndex = true;
             break;
           }
         }
 
-        string semanticIdxName = a.semanticName.elems;
+        std::string semanticIdxName = a.semanticName;
         if(a.needSemanticIndex)
           semanticIdxName += ToStr::Get(a.semanticIndex);
 
@@ -1427,7 +1427,7 @@ uint32_t DecodeFlags(const ShaderCompileFlags &compileFlags)
 {
   uint32_t ret = 0;
 
-  if(compileFlags.flags.count >= 1 && compileFlags.flags[0].first == "compileFlags")
+  if(!compileFlags.flags.empty() && compileFlags.flags[0].first == "compileFlags")
     ret = atoi(compileFlags.flags[0].second.c_str());
 
   return ret;
@@ -1437,7 +1437,6 @@ ShaderCompileFlags EncodeFlags(const uint32_t flags)
 {
   ShaderCompileFlags ret;
 
-  create_array_uninit(ret.flags, 1);
   ret.flags = {{"compileFlags", StringFormat::Fmt("%u", flags)}};
 
   return ret;
diff --git a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp
index b19d7d0e4..00a4db115 100644
--- a/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp
+++ b/renderdoc/driver/shaders/dxbc/dxbc_reflect.cpp
@@ -25,7 +25,6 @@
 #include "dxbc_reflect.h"
 #include "api/replay/renderdoc_replay.h"
 #include "core/core.h"
-#include "replay/type_helpers.h"
 #include "dxbc_inspect.h"
 
 static ShaderConstant MakeConstantBufferVariable(const DXBC::CBufferVariable &var, uint32_t &offset);
@@ -73,14 +72,14 @@ static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type,
 
   uint32_t o = offset;
 
-  create_array_uninit(ret.members, type.members.size());
+  ret.members.reserve(type.members.size());
   for(size_t i = 0; i < type.members.size(); i++)
   {
     offset = o;
-    ret.members[i] = MakeConstantBufferVariable(type.members[i], offset);
+    ret.members.push_back(MakeConstantBufferVariable(type.members[i], offset));
   }
 
-  if(ret.members.count > 0)
+  if(!ret.members.empty())
   {
     ret.descriptor.rows = 0;
     ret.descriptor.cols = 0;
@@ -214,7 +213,7 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
   {
     refl->DebugInfo.compileFlags = DXBC::EncodeFlags(dxbc->m_DebugInfo);
 
-    create_array_uninit(refl->DebugInfo.files, dxbc->m_DebugInfo->Files.size());
+    refl->DebugInfo.files.resize(dxbc->m_DebugInfo->Files.size());
     for(size_t i = 0; i < dxbc->m_DebugInfo->Files.size(); i++)
     {
       refl->DebugInfo.files[i].first = dxbc->m_DebugInfo->Files[i].first;
@@ -229,16 +228,16 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
     // one file.
     // This isn't a perfect search - it will match entry_point() anywhere in the file, even if it's
     // in a comment or disabled preprocessor definition. This is just best-effort
-    if(refl->DebugInfo.files.count > 1)
+    if(refl->DebugInfo.files.count() > 1)
     {
       // search from 0 up. If we find a match, we swap it into [0]. If we don't find a match then
       // we can't rearrange anything. This is a no-op for 0 since it's already in first place, but
       // since our search isn't perfect we might have multiple matches with some being false
       // positives, and so we want to bias towards leaving [0] in place.
-      for(int32_t i = 0; i < refl->DebugInfo.files.count; i++)
+      for(size_t i = 0; i < refl->DebugInfo.files.size(); i++)
       {
-        char *c = strstr(refl->DebugInfo.files[i].first.elems, entry.c_str());
-        char *end = refl->DebugInfo.files[i].first.elems + refl->DebugInfo.files[i].first.count;
+        const char *c = strstr(refl->DebugInfo.files[i].first.c_str(), entry.c_str());
+        const char *end = refl->DebugInfo.files[i].first.end();
 
         // no substring match? continue
         if(c == NULL)
@@ -275,10 +274,7 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
     }
   }
 
-  if(dxbc->m_ShaderBlob.empty())
-    create_array_uninit(refl->RawBytes, 0);
-  else
-    create_array_init(refl->RawBytes, dxbc->m_ShaderBlob.size(), &dxbc->m_ShaderBlob[0]);
+  refl->RawBytes = dxbc->m_ShaderBlob;
 
   refl->DispatchThreadsDimension[0] = dxbc->DispatchThreadsDimension[0];
   refl->DispatchThreadsDimension[1] = dxbc->DispatchThreadsDimension[1];
@@ -287,12 +283,12 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
   refl->InputSig = dxbc->m_InputSig;
   refl->OutputSig = dxbc->m_OutputSig;
 
-  create_array_uninit(mapping->InputAttributes, D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
+  mapping->InputAttributes.resize(D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
   for(int s = 0; s < D3Dx_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; s++)
     mapping->InputAttributes[s] = s;
 
-  create_array_uninit(mapping->ConstantBlocks, dxbc->m_CBuffers.size());
-  create_array_uninit(refl->ConstantBlocks, dxbc->m_CBuffers.size());
+  mapping->ConstantBlocks.resize(dxbc->m_CBuffers.size());
+  refl->ConstantBlocks.resize(dxbc->m_CBuffers.size());
   for(size_t i = 0; i < dxbc->m_CBuffers.size(); i++)
   {
     ConstantBlock &cb = refl->ConstantBlocks[i];
@@ -310,16 +306,16 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
 
     mapping->ConstantBlocks[i] = map;
 
-    create_array_uninit(cb.variables, dxbc->m_CBuffers[i].variables.size());
+    cb.variables.reserve(dxbc->m_CBuffers[i].variables.size());
     for(size_t v = 0; v < dxbc->m_CBuffers[i].variables.size(); v++)
     {
       uint32_t vecOffset = 0;
-      cb.variables[v] = MakeConstantBufferVariable(dxbc->m_CBuffers[i].variables[v], vecOffset);
+      cb.variables.push_back(MakeConstantBufferVariable(dxbc->m_CBuffers[i].variables[v], vecOffset));
     }
   }
 
-  create_array_uninit(mapping->Samplers, dxbc->m_Samplers.size());
-  create_array_uninit(refl->Samplers, dxbc->m_Samplers.size());
+  mapping->Samplers.resize(dxbc->m_Samplers.size());
+  refl->Samplers.resize(dxbc->m_Samplers.size());
   for(size_t i = 0; i < dxbc->m_Samplers.size(); i++)
   {
     ShaderSampler &s = refl->Samplers[i];
@@ -336,19 +332,19 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
     mapping->Samplers[i] = map;
   }
 
-  create_array_uninit(mapping->ReadOnlyResources, dxbc->m_SRVs.size());
-  create_array_uninit(refl->ReadOnlyResources, dxbc->m_SRVs.size());
+  mapping->ReadOnlyResources.resize(dxbc->m_SRVs.size());
+  refl->ReadOnlyResources.resize(dxbc->m_SRVs.size());
   MakeResourceList(true, dxbc, dxbc->m_SRVs, mapping->ReadOnlyResources, refl->ReadOnlyResources);
 
-  create_array_uninit(mapping->ReadWriteResources, dxbc->m_UAVs.size());
-  create_array_uninit(refl->ReadWriteResources, dxbc->m_UAVs.size());
+  mapping->ReadWriteResources.resize(dxbc->m_UAVs.size());
+  refl->ReadWriteResources.resize(dxbc->m_UAVs.size());
   MakeResourceList(true, dxbc, dxbc->m_UAVs, mapping->ReadWriteResources, refl->ReadWriteResources);
 
   uint32_t numInterfaces = 0;
   for(size_t i = 0; i < dxbc->m_Interfaces.variables.size(); i++)
     numInterfaces = RDCMAX(dxbc->m_Interfaces.variables[i].descriptor.offset + 1, numInterfaces);
 
-  create_array(refl->Interfaces, numInterfaces);
+  refl->Interfaces.resize(numInterfaces);
   for(size_t i = 0; i < dxbc->m_Interfaces.variables.size(); i++)
     refl->Interfaces[dxbc->m_Interfaces.variables[i].descriptor.offset] =
         dxbc->m_Interfaces.variables[i].name;
diff --git a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
index e0901d15a..4a07e5130 100644
--- a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
+++ b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
@@ -2380,7 +2380,7 @@ string SPVModule::Disassemble(const string &entryPoint)
       if(b > 0)
         funcops.push_back(block);    // OpLabel
 
-      set ignore_items;
+      std::set ignore_items;
 
       for(size_t i = 0; i < block->block->instructions.size(); i++)
       {
@@ -3574,7 +3574,7 @@ void MakeConstantBlockVariables(SPVTypeData *structType, rdctype::arraychildren.empty())
     return;
 
-  create_array_uninit(cblock, structType->children.size());
+  cblock.resize(structType->children.size());
   for(size_t i = 0; i < structType->children.size(); i++)
     MakeConstantBlockVariable(cblock[i], structType->children[i].first,
                               structType->children[i].second, structType->childDecorations[i]);
@@ -3582,13 +3582,13 @@ void MakeConstantBlockVariables(SPVTypeData *structType, rdctype::array &variables)
 {
-  if(variables.count == 0)
+  if(variables.empty())
   {
     RDCERR("Unexpectedly empty array of shader constants!");
     return 0;
   }
 
-  const ShaderConstant &last = variables[variables.count - 1];
+  const ShaderConstant &last = variables.back();
 
   // find its offset
   uint32_t byteOffset = last.reg.vec * sizeof(Vec4f) + last.reg.comp * sizeof(float);
@@ -3597,7 +3597,7 @@ uint32_t CalculateMinimumByteSize(const rdctype::array &variable
   if(last.type.descriptor.arrayStride > 0)
     return byteOffset + last.type.descriptor.arrayStride * last.type.descriptor.elements;
 
-  if(last.type.members.count == 0)
+  if(last.type.members.empty())
   {
     // this is the last basic member
     // now calculate its size and return offset + size
@@ -3917,7 +3917,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
   // TODO sort these so that the entry point is in the first file
   if(!sourceFiles.empty())
   {
-    create_array_uninit(reflection.DebugInfo.files, sourceFiles.size());
+    reflection.DebugInfo.files.resize(sourceFiles.size());
 
     for(size_t i = 0; i < sourceFiles.size(); i++)
     {
@@ -4345,7 +4345,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
     bindmap.arraySize = 1;
     bindmap.used = true;
 
-    create_array_uninit(cblock.variables, specConstants.size());
+    cblock.variables.resize(specConstants.size());
     for(size_t i = 0; i < specConstants.size(); i++)
     {
       cblock.variables[i].name = specConstants[i]->str;
@@ -4399,7 +4399,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
         if(a.regIndex != b.regIndex)
           return a.regIndex < b.regIndex;
 
-        return strcmp(a.varName.elems, b.varName.elems) < 0;
+        return a.varName < b.varName;
       }
       if(a.systemValue == ShaderBuiltin::Undefined)
         return false;
@@ -4418,9 +4418,9 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
 
     std::sort(indices.begin(), indices.end(), sig_param_sort(inputs));
 
-    create_array_uninit(reflection.InputSig, inputs.size());
+    reflection.InputSig.reserve(inputs.size());
     for(size_t i = 0; i < inputs.size(); i++)
-      reflection.InputSig[i] = inputs[indices[i]];
+      reflection.InputSig.push_back(inputs[indices[i]]);
   }
 
   {
@@ -4430,9 +4430,9 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
 
     std::sort(indices.begin(), indices.end(), sig_param_sort(outputs));
 
-    create_array_uninit(reflection.OutputSig, outputs.size());
+    reflection.OutputSig.reserve(outputs.size());
     for(size_t i = 0; i < outputs.size(); i++)
-      reflection.OutputSig[i] = outputs[indices[i]];
+      reflection.OutputSig.push_back(outputs[indices[i]]);
 
     std::vector outPatch = patchData.outputs;
     for(size_t i = 0; i < outputs.size(); i++)
@@ -4445,7 +4445,7 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
     if(reflection.InputSig[i].systemValue == ShaderBuiltin::Undefined)
       numInputs = RDCMAX(numInputs, (size_t)reflection.InputSig[i].regIndex + 1);
 
-  create_array_uninit(mapping.InputAttributes, numInputs);
+  mapping.InputAttributes.resize(numInputs);
   for(size_t i = 0; i < numInputs; i++)
     mapping.InputAttributes[i] = -1;
 
@@ -4458,17 +4458,17 @@ void SPVModule::MakeReflection(ShaderStage stage, const string &entryPoint,
   std::sort(roresources.begin(), roresources.end());
   std::sort(rwresources.begin(), rwresources.end());
 
-  create_array_uninit(mapping.ConstantBlocks, cblocks.size());
-  create_array_uninit(reflection.ConstantBlocks, cblocks.size());
+  mapping.ConstantBlocks.resize(cblocks.size());
+  reflection.ConstantBlocks.resize(cblocks.size());
 
-  create_array_uninit(mapping.Samplers, samplers.size());
-  create_array_uninit(reflection.Samplers, samplers.size());
+  mapping.Samplers.resize(samplers.size());
+  reflection.Samplers.resize(samplers.size());
 
-  create_array_uninit(mapping.ReadOnlyResources, roresources.size());
-  create_array_uninit(reflection.ReadOnlyResources, roresources.size());
+  mapping.ReadOnlyResources.resize(roresources.size());
+  reflection.ReadOnlyResources.resize(roresources.size());
 
-  create_array_uninit(mapping.ReadWriteResources, rwresources.size());
-  create_array_uninit(reflection.ReadWriteResources, rwresources.size());
+  mapping.ReadWriteResources.resize(rwresources.size());
+  reflection.ReadWriteResources.resize(rwresources.size());
 
   for(size_t i = 0; i < cblocks.size(); i++)
   {
diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp
index 75f939f91..23780d8a1 100644
--- a/renderdoc/driver/vulkan/vk_core.cpp
+++ b/renderdoc/driver/vulkan/vk_core.cpp
@@ -2552,9 +2552,9 @@ void WrappedVulkan::Serialise_DebugMessages(Serialiser *localSerialiser, bool is
   {
     ScopedContext msgscope(m_pSerialiser, "DebugMessage", "DebugMessage", 0, false);
 
-    string desc;
+    std::string desc;
     if(m_State >= WRITING)
-      desc = debugMessages[i].description.elems;
+      desc = debugMessages[i].description;
 
     SERIALISE_ELEMENT(MessageCategory, Category, debugMessages[i].category);
     SERIALISE_ELEMENT(MessageSource, Source, debugMessages[i].source);
@@ -2858,8 +2858,7 @@ void WrappedVulkan::AddDrawcall(const DrawcallDescription &d, bool hasEvents)
     if(m_LastCmdBufferID != ResourceId())
       AddUsage(node, m_BakedCmdBufferInfo[m_LastCmdBufferID].debugMessages);
 
-    node.children.insert(node.children.begin(), draw.children.elems,
-                         draw.children.elems + draw.children.count);
+    node.children.insert(node.children.begin(), draw.children.begin(), draw.children.end());
     GetDrawcallStack().back()->children.push_back(node);
   }
   else
@@ -2929,7 +2928,7 @@ void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, vectorGetLastCallstack();
   if(stack)
   {
-    create_array(apievent.callstack, stack->NumLevels());
-    memcpy(apievent.callstack.elems, stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
+    apievent.callstack.assign(stack->GetAddrs(), sizeof(uint64_t) * stack->NumLevels());
   }
 
   for(size_t i = 0; i < m_EventMessages.size(); i++)
diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h
index 19fab779e..a95c45192 100644
--- a/renderdoc/driver/vulkan/vk_core.h
+++ b/renderdoc/driver/vulkan/vk_core.h
@@ -101,8 +101,8 @@ struct VulkanDrawcallTreeNode
     draw.eventID += baseEventID;
     draw.drawcallID += baseDrawID;
 
-    for(int32_t i = 0; i < draw.events.count; i++)
-      draw.events[i].eventID += baseEventID;
+    for(APIEvent &ev : draw.events)
+      ev.eventID += baseEventID;
 
     for(size_t i = 0; i < resourceUsage.size(); i++)
       resourceUsage[i].second.eventID += baseEventID;
diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp
index 13a8ccd4c..3cf40d225 100644
--- a/renderdoc/driver/vulkan/vk_debug.cpp
+++ b/renderdoc/driver/vulkan/vk_debug.cpp
@@ -7130,7 +7130,7 @@ static void AddOutputDumping(const ShaderReflection &refl, const SPIRVPatchData
   uint32_t *spirv = &modSpirv[0];
   size_t spirvLength = modSpirv.size();
 
-  int numOutputs = refl.OutputSig.count;
+  int numOutputs = refl.OutputSig.count();
 
   RDCASSERT(numOutputs > 0);
 
@@ -7935,7 +7935,7 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID)
 
   // no outputs from this shader? unexpected but theoretically possible (dummy VS before
   // tessellation maybe). Just fill out an empty data set
-  if(refl->OutputSig.count == 0)
+  if(refl->OutputSig.empty())
   {
     // empty vertex output signature
     m_PostVSData[eventID].vsin.topo = pipeInfo.topology;
diff --git a/renderdoc/driver/vulkan/vk_info.cpp b/renderdoc/driver/vulkan/vk_info.cpp
index 5802cd71d..5b256bc98 100644
--- a/renderdoc/driver/vulkan/vk_info.cpp
+++ b/renderdoc/driver/vulkan/vk_info.cpp
@@ -159,9 +159,8 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk
 
       if(!spv.spirv.empty())
       {
-        rdctype::array &bytes = reflData.refl.RawBytes;
-        const vector &spirv = spv.spirv;
-        create_array_init(bytes, spirv.size() * sizeof(uint32_t), (byte *)&spirv[0]);
+        const std::vector &spirv = spv.spirv;
+        reflData.refl.RawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t));
       }
     }
 
@@ -385,9 +384,8 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk
 
       if(!spv.spirv.empty())
       {
-        rdctype::array &bytes = reflData.refl.RawBytes;
         const vector &spirv = spv.spirv;
-        create_array_init(bytes, spirv.size() * sizeof(uint32_t), (byte *)&spirv[0]);
+        reflData.refl.RawBytes.assign((byte *)spirv.data(), spirv.size() * sizeof(uint32_t));
       }
     }
 
diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp
index d36fd07f9..7c665f559 100644
--- a/renderdoc/driver/vulkan/vk_replay.cpp
+++ b/renderdoc/driver/vulkan/vk_replay.cpp
@@ -839,7 +839,7 @@ TextureDescription VulkanReplay::GetTexture(ResourceId id)
 
   ret.customName = true;
   ret.name = m_pDriver->m_CreationInfo.m_Names[id];
-  if(ret.name.count == 0)
+  if(ret.name.empty())
   {
     ret.customName = false;
 
@@ -896,7 +896,7 @@ BufferDescription VulkanReplay::GetBuffer(ResourceId id)
 
   ret.customName = true;
   ret.name = m_pDriver->m_CreationInfo.m_Names[id];
-  if(ret.name.count == 0)
+  if(ret.name.empty())
   {
     ret.customName = false;
     ret.name = StringFormat::Fmt("Buffer %llu", ret.ID);
@@ -2860,10 +2860,9 @@ void VulkanReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len,
 
 bool VulkanReplay::IsRenderOutput(ResourceId id)
 {
-  for(int32_t i = 0; i < m_VulkanPipelineState.Pass.framebuffer.attachments.count; i++)
+  for(const VKPipe::Attachment &att : m_VulkanPipelineState.Pass.framebuffer.attachments)
   {
-    if(m_VulkanPipelineState.Pass.framebuffer.attachments[i].view == id ||
-       m_VulkanPipelineState.Pass.framebuffer.attachments[i].img == id)
+    if(att.view == id || att.img == id)
       return true;
   }
 
@@ -2903,7 +2902,7 @@ void VulkanReplay::SavePipelineState()
 
         stage.customName = true;
         stage.name = m_pDriver->m_CreationInfo.m_Names[p.shaders[i].module];
-        if(stage.name.count == 0)
+        if(stage.name.empty())
         {
           stage.customName = false;
           stage.name = StringFormat::Fmt("Shader %llu", stage.Object);
@@ -2915,12 +2914,12 @@ void VulkanReplay::SavePipelineState()
         if(p.shaders[i].refl)
           stage.ShaderDetails = p.shaders[i].refl;
 
-        create_array_uninit(stage.specialization, p.shaders[i].specialization.size());
+        stage.specialization.resize(p.shaders[i].specialization.size());
         for(size_t s = 0; s < p.shaders[i].specialization.size(); s++)
         {
           stage.specialization[s].specID = p.shaders[i].specialization[s].specID;
-          create_array_init(stage.specialization[s].data, p.shaders[i].specialization[s].size,
-                            p.shaders[i].specialization[s].data);
+          stage.specialization[s].data.assign(p.shaders[i].specialization[s].data,
+                                              p.shaders[i].specialization[s].size);
         }
       }
     }
@@ -2937,7 +2936,7 @@ void VulkanReplay::SavePipelineState()
       m_VulkanPipelineState.IA.primitiveRestartEnable = p.primitiveRestartEnable;
 
       // Vertex Input
-      create_array_uninit(m_VulkanPipelineState.VI.attrs, p.vertexAttrs.size());
+      m_VulkanPipelineState.VI.attrs.resize(p.vertexAttrs.size());
       for(size_t i = 0; i < p.vertexAttrs.size(); i++)
       {
         m_VulkanPipelineState.VI.attrs[i].location = p.vertexAttrs[i].location;
@@ -2946,7 +2945,7 @@ void VulkanReplay::SavePipelineState()
         m_VulkanPipelineState.VI.attrs[i].format = MakeResourceFormat(p.vertexAttrs[i].format);
       }
 
-      create_array_uninit(m_VulkanPipelineState.VI.binds, p.vertexBindings.size());
+      m_VulkanPipelineState.VI.binds.resize(p.vertexBindings.size());
       for(size_t i = 0; i < p.vertexBindings.size(); i++)
       {
         m_VulkanPipelineState.VI.binds[i].bytestride = p.vertexBindings[i].bytestride;
@@ -2954,7 +2953,7 @@ void VulkanReplay::SavePipelineState()
         m_VulkanPipelineState.VI.binds[i].perInstance = p.vertexBindings[i].perInstance;
       }
 
-      create_array_uninit(m_VulkanPipelineState.VI.vbuffers, state.vbuffers.size());
+      m_VulkanPipelineState.VI.vbuffers.resize(state.vbuffers.size());
       for(size_t i = 0; i < state.vbuffers.size(); i++)
       {
         m_VulkanPipelineState.VI.vbuffers[i].buffer = rm->GetOriginalID(state.vbuffers[i].buf);
@@ -2974,7 +2973,7 @@ void VulkanReplay::SavePipelineState()
 
         stages[i]->customName = true;
         stages[i]->name = m_pDriver->m_CreationInfo.m_Names[p.shaders[i].module];
-        if(stages[i]->name.count == 0)
+        if(stages[i]->name.empty())
         {
           stages[i]->customName = false;
           stages[i]->name = StringFormat::Fmt("Shader %llu", stages[i]->Object);
@@ -2986,12 +2985,12 @@ void VulkanReplay::SavePipelineState()
         if(p.shaders[i].refl)
           stages[i]->ShaderDetails = p.shaders[i].refl;
 
-        create_array_uninit(stages[i]->specialization, p.shaders[i].specialization.size());
+        stages[i]->specialization.resize(p.shaders[i].specialization.size());
         for(size_t s = 0; s < p.shaders[i].specialization.size(); s++)
         {
           stages[i]->specialization[s].specID = p.shaders[i].specialization[s].specID;
-          create_array_init(stages[i]->specialization[s].data, p.shaders[i].specialization[s].size,
-                            p.shaders[i].specialization[s].data);
+          stages[i]->specialization[s].data.assign(p.shaders[i].specialization[s].data,
+                                                   p.shaders[i].specialization[s].size);
         }
       }
 
@@ -3000,7 +2999,7 @@ void VulkanReplay::SavePipelineState()
 
       // Viewport/Scissors
       size_t numViewScissors = p.viewportCount;
-      create_array_uninit(m_VulkanPipelineState.VP.viewportScissors, numViewScissors);
+      m_VulkanPipelineState.VP.viewportScissors.resize(numViewScissors);
       for(size_t i = 0; i < numViewScissors; i++)
       {
         if(i < state.views.size())
@@ -3078,7 +3077,7 @@ void VulkanReplay::SavePipelineState()
       m_VulkanPipelineState.CB.alphaToOneEnable = p.alphaToOneEnable;
       m_VulkanPipelineState.CB.logic = MakeLogicOp(p.logicOp);
 
-      create_array_uninit(m_VulkanPipelineState.CB.attachments, p.attachments.size());
+      m_VulkanPipelineState.CB.attachments.resize(p.attachments.size());
       for(size_t i = 0; i < p.attachments.size(); i++)
       {
         m_VulkanPipelineState.CB.attachments[i].blendEnable = p.attachments[i].blendEnable;
@@ -3155,8 +3154,8 @@ void VulkanReplay::SavePipelineState()
         m_VulkanPipelineState.Pass.framebuffer.height = c.m_Framebuffer[state.framebuffer].height;
         m_VulkanPipelineState.Pass.framebuffer.layers = c.m_Framebuffer[state.framebuffer].layers;
 
-        create_array_uninit(m_VulkanPipelineState.Pass.framebuffer.attachments,
-                            c.m_Framebuffer[state.framebuffer].attachments.size());
+        m_VulkanPipelineState.Pass.framebuffer.attachments.resize(
+            c.m_Framebuffer[state.framebuffer].attachments.size());
         for(size_t i = 0; i < c.m_Framebuffer[state.framebuffer].attachments.size(); i++)
         {
           ResourceId viewid = c.m_Framebuffer[state.framebuffer].attachments[i].view;
@@ -3207,8 +3206,8 @@ void VulkanReplay::SavePipelineState()
     }
 
     // Descriptor sets
-    create_array_uninit(m_VulkanPipelineState.graphics.DescSets, state.graphics.descSets.size());
-    create_array_uninit(m_VulkanPipelineState.compute.DescSets, state.compute.descSets.size());
+    m_VulkanPipelineState.graphics.DescSets.resize(state.graphics.descSets.size());
+    m_VulkanPipelineState.compute.DescSets.resize(state.compute.descSets.size());
 
     {
       rdctype::array *dsts[] = {
@@ -3230,8 +3229,7 @@ void VulkanReplay::SavePipelineState()
 
           dst.descset = rm->GetOriginalID(src);
           dst.layout = rm->GetOriginalID(layoutId);
-          create_array_uninit(dst.bindings,
-                              m_pDriver->m_DescriptorSetState[src].currentBindings.size());
+          dst.bindings.resize(m_pDriver->m_DescriptorSetState[src].currentBindings.size());
           for(size_t b = 0; b < m_pDriver->m_DescriptorSetState[src].currentBindings.size(); b++)
           {
             DescriptorSetSlot *info = m_pDriver->m_DescriptorSetState[src].currentBindings[b];
@@ -3281,7 +3279,7 @@ void VulkanReplay::SavePipelineState()
                 RDCERR("Unexpected descriptor type");
             }
 
-            create_array_uninit(dst.bindings[b].binds, layoutBind.descriptorCount);
+            dst.bindings[b].binds.resize(layoutBind.descriptorCount);
             for(uint32_t a = 0; a < layoutBind.descriptorCount; a++)
             {
               if(layoutBind.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
@@ -3309,7 +3307,7 @@ void VulkanReplay::SavePipelineState()
 
                   el.customName = true;
                   el.name = m_pDriver->m_CreationInfo.m_Names[liveId];
-                  if(el.name.count == 0)
+                  if(el.name.empty())
                   {
                     el.customName = false;
                     el.name = StringFormat::Fmt("Sampler %llu", el.sampler);
@@ -3438,7 +3436,7 @@ void VulkanReplay::SavePipelineState()
 
     // image layouts
     {
-      create_array_uninit(m_VulkanPipelineState.images, m_pDriver->m_ImageLayouts.size());
+      m_VulkanPipelineState.images.resize(m_pDriver->m_ImageLayouts.size());
       size_t i = 0;
       for(auto it = m_pDriver->m_ImageLayouts.begin(); it != m_pDriver->m_ImageLayouts.end(); ++it)
       {
@@ -3446,7 +3444,7 @@ void VulkanReplay::SavePipelineState()
 
         img.image = rm->GetOriginalID(it->first);
 
-        create_array_uninit(img.layouts, it->second.subresourceStates.size());
+        img.layouts.resize(it->second.subresourceStates.size());
         for(size_t l = 0; l < it->second.subresourceStates.size(); l++)
         {
           img.layouts[l].name = ToStr::Get(it->second.subresourceStates[l].newLayout);
@@ -3466,9 +3464,9 @@ void VulkanReplay::FillCBufferVariables(rdctype::array invars,
                                         vector &outvars, const vector &data,
                                         size_t baseOffset)
 {
-  for(int v = 0; v < invars.count; v++)
+  for(size_t v = 0; v < invars.size(); v++)
   {
-    string basename = invars[v].name.elems;
+    std::string basename = invars[v].name;
 
     uint32_t rows = invars[v].type.descriptor.rows;
     uint32_t cols = invars[v].type.descriptor.cols;
@@ -3479,7 +3477,7 @@ void VulkanReplay::FillCBufferVariables(rdctype::array invars,
     size_t dataOffset =
         baseOffset + invars[v].reg.vec * sizeof(Vec4f) + invars[v].reg.comp * sizeof(float);
 
-    if(invars[v].type.members.count > 0 || (rows == 0 && cols == 0))
+    if(!invars[v].type.members.empty() || (rows == 0 && cols == 0))
     {
       ShaderVariable var;
       var.name = basename;
@@ -3593,7 +3591,7 @@ void VulkanReplay::FillCBufferVariables(rdctype::array invars,
         vector varmembers;
         varmembers.resize(elems);
 
-        string base = outvars[outIdx].name.elems;
+        std::string base = outvars[outIdx].name;
 
         // primary is the 'major' direction
         // so we copy secondaryDim number of primaryDim-sized elements
@@ -3671,7 +3669,7 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, string entryPoint, ui
   ShaderReflection &refl = it->second.m_Reflections[entryPoint].refl;
   ShaderBindpointMapping &mapping = it->second.m_Reflections[entryPoint].mapping;
 
-  if(cbufSlot >= (uint32_t)refl.ConstantBlocks.count)
+  if(cbufSlot >= (uint32_t)refl.ConstantBlocks.count())
   {
     RDCERR("Invalid cbuffer slot");
     return;
@@ -3689,12 +3687,12 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, string entryPoint, ui
     // magic constant here matches the one generated in SPVModule::MakeReflection(
     if(mapping.ConstantBlocks[c.bindPoint].bindset == 123456)
     {
-      outvars.resize(c.variables.count);
-      for(int32_t v = 0; v < c.variables.count; v++)
+      outvars.resize(c.variables.size());
+      for(size_t v = 0; v < c.variables.size(); v++)
       {
         outvars[v].rows = c.variables[v].type.descriptor.rows;
         outvars[v].columns = c.variables[v].type.descriptor.cols;
-        outvars[v].isStruct = c.variables[v].type.members.count > 0;
+        outvars[v].isStruct = !c.variables[v].type.members.empty();
         RDCASSERT(!outvars[v].isStruct);
         outvars[v].name = c.variables[v].name;
         outvars[v].type = c.variables[v].type.descriptor.type;
@@ -3716,7 +3714,7 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, string entryPoint, ui
           // find any actual values specified
           for(size_t i = 0; i < specInfo.size(); i++)
           {
-            for(int32_t v = 0; v < c.variables.count; v++)
+            for(size_t v = 0; v < c.variables.size(); v++)
             {
               if(specInfo[i].specID == c.variables[v].reg.vec)
               {
diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp
index 6fc09bf04..cd73c5606 100644
--- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp
+++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp
@@ -487,7 +487,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(Serialiser *localSerialiser,
 
       multi.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect;
 
-      AddEvent(multi.name.elems);
+      AddEvent(multi.name);
       AddDrawcall(multi, true);
 
       m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
@@ -784,7 +784,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(Serialiser *localSerialis
       multi.flags |=
           DrawFlags::Drawcall | DrawFlags::UseIBuffer | DrawFlags::Instanced | DrawFlags::Indirect;
 
-      AddEvent(multi.name.elems);
+      AddEvent(multi.name);
       AddDrawcall(multi, true);
 
       m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
diff --git a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp
index 5e1c2d2a9..fcd32d711 100644
--- a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp
+++ b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp
@@ -468,10 +468,10 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(vector &cmd
     n.draw.eventID += m_RootEventID;
     n.draw.drawcallID += m_RootDrawcallID;
 
-    for(int32_t e = 0; e < n.draw.events.count; e++)
+    for(APIEvent &ev : n.draw.events)
     {
-      n.draw.events[e].eventID += m_RootEventID;
-      m_Events.push_back(n.draw.events[e]);
+      ev.eventID += m_RootEventID;
+      m_Events.push_back(ev);
     }
 
     DrawcallUse use(m_Events.back().fileOffset, n.draw.eventID);
diff --git a/renderdoc/renderdoc.natvis b/renderdoc/renderdoc.natvis
index d2615c8b2..60f341a6a 100644
--- a/renderdoc/renderdoc.natvis
+++ b/renderdoc/renderdoc.natvis
@@ -1,23 +1,37 @@
  
 
   
+    ""
     {elems,s}
     
-      count
+     usedCount
+     allocatedCount
       
-        count
+        usedCount
         elems
       
     
   
   
-    {{ size={count} }}
+    {{ size={usedCount} }}
     
-      count
+      usedCount
+      allocatedCount
       
-        count
+        usedCount
         elems
       
     
   
+ 
+  {{ {first}, {second} }}
+  
+   first
+   second
+   
+    usedCount
+    elems
+   
+  
+ 
 
\ No newline at end of file
diff --git a/renderdoc/renderdoc.vcxproj b/renderdoc/renderdoc.vcxproj
index 9124319e6..545ff037f 100644
--- a/renderdoc/renderdoc.vcxproj
+++ b/renderdoc/renderdoc.vcxproj
@@ -188,7 +188,6 @@
     
     
     
-    
     
     
   
@@ -385,13 +384,13 @@
     
     
     
+    
     
     
     
     
     
     
-    
     
     
     
diff --git a/renderdoc/renderdoc.vcxproj.filters b/renderdoc/renderdoc.vcxproj.filters
index 5dd91dc4d..06b259c2f 100644
--- a/renderdoc/renderdoc.vcxproj.filters
+++ b/renderdoc/renderdoc.vcxproj.filters
@@ -153,9 +153,6 @@
     
       Core
     
-    
-      Replay
-    
     
       Replay
     
@@ -389,9 +386,6 @@
     
       Core\networking
     
-    
-      Replay
-    
     
       Replay
     
@@ -542,6 +536,9 @@
     
       Replay
     
+    
+      Replay
+    
     
       3rdparty\zstd
     
diff --git a/renderdoc/replay/basic_types_tests.cpp b/renderdoc/replay/basic_types_tests.cpp
new file mode 100644
index 000000000..ed19bcb0e
--- /dev/null
+++ b/renderdoc/replay/basic_types_tests.cpp
@@ -0,0 +1,517 @@
+/******************************************************************************
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2017 Baldur Karlsson
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ ******************************************************************************/
+
+#include "api/replay/renderdoc_replay.h"
+#include "common/globalconfig.h"
+#include "os/os_specific.h"
+
+#if ENABLED(ENABLE_UNIT_TESTS)
+
+#include "3rdparty/catch/catch.hpp"
+
+static volatile int32_t constructor = 0;
+static volatile int32_t valueConstructor = 0;
+static volatile int32_t copyConstructor = 0;
+static volatile int32_t destructor = 0;
+
+struct ConstructorCounter
+{
+  int value;
+
+  ConstructorCounter()
+  {
+    value = 0;
+    Atomic::Inc32(&constructor);
+  }
+  ConstructorCounter(int v)
+  {
+    value = v;
+    Atomic::Inc32(&valueConstructor);
+  }
+  ConstructorCounter(const ConstructorCounter &other)
+  {
+    value = other.value;
+    Atomic::Inc32(©Constructor);
+  }
+  ~ConstructorCounter() { Atomic::Inc32(&destructor); }
+};
+
+TEST_CASE("Test array type", "[basictypes]")
+{
+  SECTION("Basic test")
+  {
+    rdctype::array test;
+
+    CHECK(test.size() == 0);
+    CHECK(test.capacity() == 0);
+    CHECK(test.empty());
+    CHECK(test.isEmpty());
+    CHECK(test.begin() == test.end());
+
+    test.clear();
+
+    CHECK(test.size() == 0);
+    CHECK(test.capacity() == 0);
+    CHECK(test.empty());
+    CHECK(test.isEmpty());
+    CHECK(test.begin() == test.end());
+
+    test.push_back(5);
+
+    CHECK(test.size() == 1);
+    CHECK(test.capacity() >= 1);
+    CHECK_FALSE(test.empty());
+    CHECK_FALSE(test.isEmpty());
+    CHECK(test.begin() != test.end());
+    CHECK(test.begin() + 1 == test.end());
+
+    test.push_back(10);
+
+    CHECK(test.size() == 2);
+    CHECK(test.capacity() >= 2);
+    CHECK_FALSE(test.empty());
+    CHECK_FALSE(test.isEmpty());
+    CHECK(test.begin() + 2 == test.end());
+
+    int sum = 0;
+    for(int x : test)
+      sum += x;
+
+    CHECK(sum == 15);
+
+    test.clear();
+
+    CHECK(test.size() == 0);
+    CHECK(test.capacity() >= 2);
+    CHECK(test.empty());
+    CHECK(test.isEmpty());
+    CHECK(test.begin() == test.end());
+
+    sum = 0;
+    for(int x : test)
+      sum += x;
+
+    CHECK(sum == 0);
+
+    test = {4, 1, 77, 0, 0, 8, 20, 934};
+
+    CHECK(test.size() == 8);
+    CHECK(test.capacity() >= 8);
+    CHECK_FALSE(test.empty());
+    CHECK_FALSE(test.isEmpty());
+    CHECK(test.begin() + 8 == test.end());
+
+    sum = 0;
+    for(int x : test)
+      sum += x;
+
+    CHECK(sum == 1044);
+
+    CHECK(test[2] == 77);
+
+    test[2] = 10;
+
+    CHECK(test[2] == 10);
+
+    test.reserve(100);
+
+    CHECK(test.size() == 8);
+    CHECK(test.capacity() >= 100);
+    CHECK_FALSE(test.empty());
+    CHECK_FALSE(test.isEmpty());
+    CHECK(test.begin() + 8 == test.end());
+  };
+
+  SECTION("Test constructing/assigning from other types")
+  {
+    rdctype::array test;
+
+    SECTION("std::vector")
+    {
+      std::vector vec = {2, 3, 4, 5};
+
+      test = vec;
+
+      REQUIRE(test.size() == 4);
+      CHECK(test[0] == 2);
+      CHECK(test[1] == 3);
+      CHECK(test[2] == 4);
+      CHECK(test[3] == 5);
+
+      rdctype::array cc(vec);
+
+      REQUIRE(cc.size() == 4);
+      CHECK(cc[0] == 2);
+      CHECK(cc[1] == 3);
+      CHECK(cc[2] == 4);
+      CHECK(cc[3] == 5);
+
+      rdctype::array ass;
+
+      ass.assign(vec);
+
+      REQUIRE(ass.size() == 4);
+      CHECK(ass[0] == 2);
+      CHECK(ass[1] == 3);
+      CHECK(ass[2] == 4);
+      CHECK(ass[3] == 5);
+    };
+
+    SECTION("std::initializer_list")
+    {
+      test = {2, 3, 4, 5};
+
+      REQUIRE(test.size() == 4);
+      CHECK(test[0] == 2);
+      CHECK(test[1] == 3);
+      CHECK(test[2] == 4);
+      CHECK(test[3] == 5);
+
+      rdctype::array cc({2, 3, 4, 5});
+
+      REQUIRE(cc.size() == 4);
+      CHECK(cc[0] == 2);
+      CHECK(cc[1] == 3);
+      CHECK(cc[2] == 4);
+      CHECK(cc[3] == 5);
+
+      rdctype::array ass;
+
+      ass.assign({2, 3, 4, 5});
+
+      REQUIRE(ass.size() == 4);
+      CHECK(ass[0] == 2);
+      CHECK(ass[1] == 3);
+      CHECK(ass[2] == 4);
+      CHECK(ass[3] == 5);
+    };
+
+    SECTION("other array")
+    {
+      rdctype::array vec = {2, 3, 4, 5};
+
+      test = vec;
+
+      REQUIRE(test.size() == 4);
+      CHECK(test[0] == 2);
+      CHECK(test[1] == 3);
+      CHECK(test[2] == 4);
+      CHECK(test[3] == 5);
+
+      rdctype::array cc(vec);
+
+      REQUIRE(cc.size() == 4);
+      CHECK(cc[0] == 2);
+      CHECK(cc[1] == 3);
+      CHECK(cc[2] == 4);
+      CHECK(cc[3] == 5);
+
+      rdctype::array ass;
+
+      ass.assign(vec);
+
+      REQUIRE(ass.size() == 4);
+      CHECK(ass[0] == 2);
+      CHECK(ass[1] == 3);
+      CHECK(ass[2] == 4);
+      CHECK(ass[3] == 5);
+    };
+  };
+
+  SECTION("Verify insert()")
+  {
+    rdctype::array vec = {6, 3, 13, 5};
+
+    vec.insert(0, 9);
+
+    REQUIRE(vec.size() == 5);
+    CHECK(vec[0] == 9);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 3);
+    CHECK(vec[3] == 13);
+    CHECK(vec[4] == 5);
+
+    vec.insert(3, 8);
+
+    REQUIRE(vec.size() == 6);
+    CHECK(vec[0] == 9);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 3);
+    CHECK(vec[3] == 8);
+    CHECK(vec[4] == 13);
+    CHECK(vec[5] == 5);
+
+    vec.insert(6, 4);
+
+    REQUIRE(vec.size() == 7);
+    CHECK(vec[0] == 9);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 3);
+    CHECK(vec[3] == 8);
+    CHECK(vec[4] == 13);
+    CHECK(vec[5] == 5);
+    CHECK(vec[6] == 4);
+
+    vec.insert(3, {20, 21});
+
+    REQUIRE(vec.size() == 9);
+    CHECK(vec[0] == 9);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 3);
+    CHECK(vec[3] == 20);
+    CHECK(vec[4] == 21);
+    CHECK(vec[5] == 8);
+    CHECK(vec[6] == 13);
+    CHECK(vec[7] == 5);
+    CHECK(vec[8] == 4);
+
+    vec.clear();
+
+    REQUIRE(vec.size() == 0);
+
+    vec.insert(0, {6, 8, 10, 14, 16});
+
+    REQUIRE(vec.size() == 5);
+    CHECK(vec[0] == 6);
+    CHECK(vec[1] == 8);
+    CHECK(vec[2] == 10);
+    CHECK(vec[3] == 14);
+    CHECK(vec[4] == 16);
+
+    vec.insert(4, {20, 9, 9, 14, 7, 13, 10, 1, 1, 45});
+
+    REQUIRE(vec.size() == 15);
+    CHECK(vec[0] == 6);
+    CHECK(vec[1] == 8);
+    CHECK(vec[2] == 10);
+    CHECK(vec[3] == 14);
+    CHECK(vec[4] == 20);
+    CHECK(vec[5] == 9);
+    CHECK(vec[6] == 9);
+    CHECK(vec[7] == 14);
+    CHECK(vec[8] == 7);
+    CHECK(vec[9] == 13);
+    CHECK(vec[10] == 10);
+    CHECK(vec[11] == 1);
+    CHECK(vec[12] == 1);
+    CHECK(vec[13] == 45);
+    CHECK(vec[14] == 16);
+  };
+
+  SECTION("Verify erase()")
+  {
+    rdctype::array vec = {6, 3, 13, 5};
+
+    vec.erase(2);
+
+    REQUIRE(vec.size() == 3);
+    REQUIRE(vec.capacity() >= 4);
+    CHECK(vec[0] == 6);
+    CHECK(vec[1] == 3);
+    CHECK(vec[2] == 5);
+
+    vec.insert(2, {0, 1});
+
+    REQUIRE(vec.size() == 5);
+    CHECK(vec[0] == 6);
+    CHECK(vec[1] == 3);
+    CHECK(vec[2] == 0);
+    CHECK(vec[3] == 1);
+    CHECK(vec[4] == 5);
+
+    vec.erase(0);
+
+    REQUIRE(vec.size() == 4);
+    CHECK(vec[0] == 3);
+    CHECK(vec[1] == 0);
+    CHECK(vec[2] == 1);
+    CHECK(vec[3] == 5);
+
+    vec.erase(vec.size() - 1);
+
+    REQUIRE(vec.size() == 3);
+    CHECK(vec[0] == 3);
+    CHECK(vec[1] == 0);
+    CHECK(vec[2] == 1);
+
+    vec.erase(0, 3);
+
+    REQUIRE(vec.size() == 0);
+
+    vec = {5, 6, 3, 9, 1, 0};
+
+    vec.erase(2, 3);
+    REQUIRE(vec.size() == 3);
+    CHECK(vec[0] == 5);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 0);
+
+    vec = {5, 6, 3, 9, 1, 0};
+
+    vec.erase(3, 3);
+    REQUIRE(vec.size() == 3);
+    CHECK(vec[0] == 5);
+    CHECK(vec[1] == 6);
+    CHECK(vec[2] == 3);
+  };
+
+  SECTION("Check construction")
+  {
+    rdctype::array test;
+
+    CHECK(constructor == 0);
+    CHECK(valueConstructor == 0);
+    CHECK(copyConstructor == 0);
+    CHECK(destructor == 0);
+
+    ConstructorCounter tmp;
+    tmp.value = 9;
+
+    test.push_back(tmp);
+
+    // 1 for the temporary
+    CHECK(constructor == 1);
+    // 1 for the element inside array
+    CHECK(copyConstructor == 1);
+
+    // previous values
+    CHECK(valueConstructor == 0);
+    CHECK(destructor == 0);
+
+    CHECK(test[0].value == 9);
+    CHECK(tmp.value == 9);
+
+    test.clear();
+
+    // destroyed item inside array
+    CHECK(destructor == 1);
+
+    // previous values
+    CHECK(constructor == 1);
+    CHECK(copyConstructor == 1);
+    CHECK(valueConstructor == 0);
+
+    test.push_back(ConstructorCounter(10));
+
+    CHECK(test[0].value == 10);
+
+    // for the temporary going into push_back
+    CHECK(valueConstructor == 1);
+    // for the temporary going out of scope
+    CHECK(destructor == 2);
+    // for the temporary being copied into the new element
+    CHECK(copyConstructor == 2);
+
+    // previous value
+    CHECK(constructor == 1);
+
+    test.reserve(1000);
+
+    // single element in test was moved to new backing storage
+    CHECK(destructor == 3);
+    CHECK(copyConstructor == 3);
+
+    // previous values
+    CHECK(valueConstructor == 1);
+    CHECK(constructor == 1);
+
+    test.resize(50);
+
+    // 49 default initialisations
+    CHECK(constructor == 50);
+
+    // previous values
+    CHECK(valueConstructor == 1);
+    CHECK(destructor == 3);
+    CHECK(copyConstructor == 3);
+
+    test.clear();
+
+    // 50 destructions
+    CHECK(destructor == 53);
+
+    // previous values
+    CHECK(constructor == 50);
+    CHECK(valueConstructor == 1);
+    CHECK(copyConstructor == 3);
+  };
+};
+
+#define CHECK_NULL_TERM(str) CHECK(str.c_str()[str.size()] == '\0');
+
+TEST_CASE("Test string type", "[basictypes][string]")
+{
+  rdctype::str test;
+
+  // should not have any data in it
+  CHECK(test.size() == 0);
+  CHECK(test.capacity() == 0);
+  CHECK(test.empty());
+  CHECK(test.isEmpty());
+  CHECK(test.begin() == test.end());
+
+  CHECK(test.c_str() != NULL);
+  CHECK_NULL_TERM(test);
+
+  test = "Test string type";
+
+  CHECK(test.size() == 16);
+  CHECK(test.capacity() >= 16);
+  CHECK_FALSE(test.empty());
+  CHECK_FALSE(test.isEmpty());
+  CHECK(test.begin() + 16 == test.end());
+
+  CHECK(strlen(test.c_str()) == 16);
+  CHECK(test.c_str() != NULL);
+  CHECK(test == "Test string type");
+  CHECK(test == std::string("Test string type"));
+  CHECK(test == rdctype::str("Test string type"));
+  CHECK_NULL_TERM(test);
+
+  test[4] = '!';
+
+  CHECK(test.size() == 16);
+  CHECK(test.capacity() >= 16);
+  CHECK_FALSE(test.empty());
+  CHECK_FALSE(test.isEmpty());
+  CHECK(test.begin() + 16 == test.end());
+
+  CHECK(strlen(test.c_str()) == 16);
+  CHECK(test.c_str() != NULL);
+  CHECK(test == "Test!string type");
+  CHECK(test == std::string("Test!string type"));
+  CHECK(test == rdctype::str("Test!string type"));
+  CHECK_NULL_TERM(test);
+
+  test.clear();
+
+  CHECK(test.size() == 0);
+  CHECK(test.capacity() >= 16);
+  CHECK(test.empty());
+  CHECK(test.isEmpty());
+  CHECK(test.begin() == test.end());
+  CHECK_NULL_TERM(test);
+};
+
+#endif    // ENABLED(ENABLE_UNIT_TESTS)
\ No newline at end of file
diff --git a/renderdoc/replay/capture_file.cpp b/renderdoc/replay/capture_file.cpp
index cf0273ef7..5fc6e6061 100644
--- a/renderdoc/replay/capture_file.cpp
+++ b/renderdoc/replay/capture_file.cpp
@@ -150,7 +150,7 @@ rdctype::array CaptureFile::GetThumbnail(FileType type, uint32_t maxsize)
   // return the data directly
   if(type == FileType::JPG && (maxsize == 0 || (maxsize > thumbwidth && maxsize > thumbheight)))
   {
-    create_array_init(buf, thumblen, jpgbuf);
+    buf.assign(jpgbuf, thumblen);
   }
   else
   {
diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp
index c1718e4c5..5bb7105d8 100644
--- a/renderdoc/replay/entry_points.cpp
+++ b/renderdoc/replay/entry_points.cpp
@@ -31,7 +31,6 @@
 #include "core/core.h"
 #include "maths/camera.h"
 #include "maths/formatpacking.h"
-#include "replay/type_helpers.h"
 #include "serialise/string_utils.h"
 
 // these entry points are for the replay/analysis side - not for the application.
@@ -366,12 +365,12 @@ extern "C" RENDERDOC_API bool RENDERDOC_CC RENDERDOC_GetThumbnail(const char *fi
 
 extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_FreeArrayMem(const void *mem)
 {
-  rdctype::array::deallocate(mem);
+  free((void *)mem);
 }
 
 extern "C" RENDERDOC_API void *RENDERDOC_CC RENDERDOC_AllocArrayMem(uint64_t sz)
 {
-  return rdctype::array::allocate((size_t)sz);
+  return malloc((size_t)sz);
 }
 
 extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EnumerateRemoteTargets(const char *host,
@@ -504,14 +503,14 @@ extern "C" RENDERDOC_API bool RENDERDOC_CC RENDERDOC_NeedVulkanLayerRegistration
 
   if(myJSONsPtr)
   {
-    create_array(*myJSONsPtr, myJSONs.size());
+    myJSONsPtr->resize(myJSONs.size());
     for(size_t i = 0; i < myJSONs.size(); i++)
       (*myJSONsPtr)[i] = myJSONs[i];
   }
 
   if(otherJSONsPtr)
   {
-    create_array(*otherJSONsPtr, otherJSONs.size());
+    otherJSONsPtr->resize(otherJSONs.size());
     for(size_t i = 0; i < otherJSONs.size(); i++)
       (*otherJSONsPtr)[i] = otherJSONs[i];
   }
diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp
index 35811c259..d5fc0365c 100644
--- a/renderdoc/replay/replay_controller.cpp
+++ b/renderdoc/replay/replay_controller.cpp
@@ -239,9 +239,9 @@ rdctype::array ReplayController::GetDisassemblyTargets()
 
   vector targets = m_pDevice->GetDisassemblyTargets();
 
-  create_array_uninit(ret, targets.size());
-  for(int32_t i = 0; i < ret.count; i++)
-    ret[i] = targets[i];
+  ret.reserve(targets.size());
+  for(const std::string &t : targets)
+    ret.push_back(t);
 
   return ret;
 }
@@ -272,10 +272,7 @@ rdctype::array ReplayController::GetDrawcalls()
 
 rdctype::array ReplayController::FetchCounters(const rdctype::array &counters)
 {
-  vector counterArray;
-  counterArray.reserve(counters.count);
-  for(int32_t i = 0; i < counters.count; i++)
-    counterArray.push_back(counters[i]);
+  std::vector counterArray(counters.begin(), counters.end());
 
   return m_pDevice->FetchCounters(counterArray);
 }
@@ -335,16 +332,15 @@ rdctype::array ReplayController::GetResolve(const rdctype::arrayGetAddr(callstack[i]);
-    ret[i] = info.formattedString();
+    Callstack::AddressDetails info = resolv->GetAddr(frame);
+    ret.push_back(info.formattedString());
   }
 
   return ret;
@@ -377,25 +373,21 @@ MeshFormat ReplayController::GetPostVSData(uint32_t instID, MeshDataStage stage)
 
 rdctype::array ReplayController::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len)
 {
-  rdctype::array ret;
-
   if(buff == ResourceId())
-    return ret;
+    return rdctype::array();
 
   ResourceId liveId = m_pDevice->GetLiveID(buff);
 
   if(liveId == ResourceId())
   {
     RDCERR("Couldn't get Live ID for %llu getting buffer data", buff);
-    return ret;
+    return rdctype::array();
   }
 
   vector retData;
   m_pDevice->GetBufferData(liveId, offset, len, retData);
 
-  create_array_init(ret, retData.size(), !retData.empty() ? &retData[0] : NULL);
-
-  return ret;
+  return retData;
 }
 
 rdctype::array ReplayController::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip)
@@ -413,10 +405,8 @@ rdctype::array ReplayController::GetTextureData(ResourceId tex, uint32_t a
   size_t sz = 0;
   byte *bytes = m_pDevice->GetTextureData(liveId, arrayIdx, mip, GetTextureDataParams(), sz);
 
-  if(sz == 0 || bytes == NULL)
-    create_array_uninit(ret, 0);
-  else
-    create_array_init(ret, sz, bytes);
+  if(sz != 0 && bytes != NULL)
+    ret.assign(bytes, sz);
 
   SAFE_DELETE_ARRAY(bytes);
 
diff --git a/renderdoc/replay/replay_controller.h b/renderdoc/replay/replay_controller.h
index 3668b0d5e..a7ba44619 100644
--- a/renderdoc/replay/replay_controller.h
+++ b/renderdoc/replay/replay_controller.h
@@ -31,7 +31,6 @@
 #include "common/common.h"
 #include "core/core.h"
 #include "replay/replay_driver.h"
-#include "type_helpers.h"
 
 struct ReplayController;
 
diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp
index 925afeafd..1c5cee479 100644
--- a/renderdoc/replay/replay_driver.cpp
+++ b/renderdoc/replay/replay_driver.cpp
@@ -38,7 +38,7 @@ DrawcallDescription *SetupDrawcallPointers(vector *drawca
 
     draw->parent = parent ? parent->eventID : 0;
 
-    if(draw->children.count > 0)
+    if(!draw->children.empty())
     {
       if(drawcallTable)
       {
diff --git a/renderdoc/replay/type_helpers.cpp b/renderdoc/replay/type_helpers.cpp
deleted file mode 100644
index 09a7d2624..000000000
--- a/renderdoc/replay/type_helpers.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/******************************************************************************
- * The MIT License (MIT)
- *
- * Copyright (c) 2015-2017 Baldur Karlsson
- * Copyright (c) 2014 Crytek
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- ******************************************************************************/
-
-#include "type_helpers.h"
-#include 
-#include 
-#include "api/replay/renderdoc_replay.h"
-#include "serialise/serialiser.h"
-#include "serialise/string_utils.h"
-
-template <>
-string ToStrHelper::Get(const rdctype::str &el)
-{
-  return string(el.elems, el.elems + el.count);
-}
-
-template <>
-string ToStrHelper::Get(const ResourceId &el)
-{
-  char tostrBuf[256] = {0};
-
-  RDCCOMPILE_ASSERT(sizeof(el) == sizeof(uint64_t), "ResourceId is no longer 1:1 with uint64_t");
-
-  StringFormat::snprintf(tostrBuf, 255, "ResID_%llu", (uint64_t &)el);
-
-  return tostrBuf;
-}
diff --git a/renderdoc/replay/type_helpers.h b/renderdoc/replay/type_helpers.h
deleted file mode 100644
index d9cee3730..000000000
--- a/renderdoc/replay/type_helpers.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/******************************************************************************
- * The MIT License (MIT)
- *
- * Copyright (c) 2015-2017 Baldur Karlsson
- * Copyright (c) 2014 Crytek
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- ******************************************************************************/
-
-#pragma once
-
-#include 
-#include "api/replay/basic_types.h"
-
-namespace rdctype
-{
-#pragma warning(push)
-#pragma warning(disable : 4345)    // behavior change: an object of POD type constructed with an
-                                   // initializer of the form () will be default-initialized
-
-template 
-void create_array(array &ret, size_t count)
-{
-  ret.Delete();
-  ret.count = (int32_t)count;
-  if(ret.count == 0)
-  {
-    ret.elems = 0;
-  }
-  else
-  {
-    ret.elems = (T *)ret.allocate(sizeof(T) * count);
-    for(int32_t i = 0; i < ret.count; i++)
-      new(ret.elems + i) T();
-  }
-}
-
-#pragma warning(pop)
-
-template 
-void create_array_uninit(array &ret, size_t count)
-{
-  ret.Delete();
-  ret.count = (int32_t)count;
-  if(ret.count == 0)
-  {
-    ret.elems = 0;
-  }
-  else
-  {
-    ret.elems = (T *)ret.allocate(sizeof(T) * count);
-    memset(ret.elems, 0, sizeof(T) * count);
-  }
-}
-
-template 
-void create_array_init(array &ret, size_t count, const T *src)
-{
-  ret.Delete();
-  ret.count = (int32_t)count;
-  if(ret.count == 0)
-  {
-    ret.elems = 0;
-  }
-  else
-  {
-    ret.elems = (T *)ret.allocate(sizeof(T) * count);
-    memcpy(ret.elems, src, sizeof(T) * count);
-  }
-}
-
-};    // namespace rdctype
diff --git a/renderdoc/serialise/serialiser.h b/renderdoc/serialise/serialiser.h
index b1a135755..80e18d130 100644
--- a/renderdoc/serialise/serialiser.h
+++ b/renderdoc/serialise/serialiser.h
@@ -35,7 +35,6 @@
 #include "api/replay/basic_types.h"
 #include "common/common.h"
 #include "os/os_specific.h"
-#include "replay/type_helpers.h"
 
 using std::set;
 using std::string;
@@ -480,35 +479,35 @@ public:
   template 
   void Serialise(const char *name, rdctype::array &el)
   {
-    int32_t sz = el.count;
+    int32_t sz = el.count();
     Serialise(name, sz);
     if(m_Mode == WRITING)
     {
       for(int32_t i = 0; i < sz; i++)
-        Serialise("[]", el.elems[i]);
+        Serialise("[]", el[i]);
     }
     else
     {
-      create_array_uninit(el, sz);
+      el.resize(sz);
       for(int32_t i = 0; i < sz; i++)
-        Serialise("", el.elems[i]);
+        Serialise("", el[i]);
     }
   }
 
   void Serialise(const char *name, rdctype::str &el)
   {
-    int32_t sz = el.count;
+    int32_t sz = el.count();
     Serialise(name, sz);
     if(m_Mode == WRITING)
     {
       for(int32_t i = 0; i < sz; i++)
-        Serialise("[]", el.elems[i]);
+        Serialise("[]", el[i]);
     }
     else
     {
       el.assign(NULL, sz);
       for(int32_t i = 0; i < sz; i++)
-        Serialise("", el.elems[i]);
+        Serialise("", el[i]);
     }
   }
 
diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp
index 30e338736..4d9e98749 100644
--- a/renderdoccmd/renderdoccmd.cpp
+++ b/renderdoccmd/renderdoccmd.cpp
@@ -37,9 +37,9 @@ volatile bool killSignal = false;
 rdctype::array convertArgs(const std::vector &args)
 {
   rdctype::array ret;
-  ret.create((int)args.size());
+  ret.reserve(args.size());
   for(size_t i = 0; i < args.size(); i++)
-    ret[i] = args[i];
+    ret.push_back(args[i]);
   return ret;
 }
 
@@ -80,20 +80,20 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_
   d.Red = d.Green = d.Blue = true;
   d.Alpha = false;
 
-  for(int32_t i = 0; i < texs.count; i++)
+  for(const TextureDescription &desc : texs)
   {
-    if(texs[i].creationFlags & TextureCategory::SwapBuffer)
+    if(desc.creationFlags & TextureCategory::SwapBuffer)
     {
-      d.texid = texs[i].ID;
+      d.texid = desc.ID;
       break;
     }
   }
 
   rdctype::array draws = renderer->GetDrawcalls();
 
-  if(draws.count > 0 && draws[draws.count - 1].flags & DrawFlags::Present)
+  if(!draws.empty() && draws.back().flags & DrawFlags::Present)
   {
-    ResourceId id = draws[draws.count - 1].copyDestination;
+    ResourceId id = draws.back().copyDestination;
     if(id != ResourceId())
       d.texid = id;
   }
@@ -304,7 +304,7 @@ struct ThumbCommand : public Command
       }
       else
       {
-        fwrite(buf.elems, 1, buf.count, f);
+        fwrite(buf.data(), 1, buf.size(), f);
         fclose(f);
 
         std::cout << "Wrote thumbnail from '" << filename << "' to '" << outfile << "'." << std::endl;
@@ -552,7 +552,7 @@ struct ReplayCommand : public Command
       rdctype::str remotePath = remote->CopyCaptureToRemote(filename.c_str(), NULL);
 
       IReplayController *renderer = NULL;
-      std::tie(status, renderer) = remote->OpenCapture(~0U, remotePath.elems, NULL);
+      std::tie(status, renderer) = remote->OpenCapture(~0U, remotePath.c_str(), NULL);
 
       if(status == ReplayStatus::Succeeded)
       {
@@ -659,7 +659,7 @@ struct CapAltBitCommand : public Command
     int numEnvs = int(rest.size() / 3);
 
     rdctype::array env;
-    env.create(numEnvs);
+    env.reserve(numEnvs);
 
     for(int i = 0; i < numEnvs; i++)
     {
@@ -719,7 +719,8 @@ struct CapAltBitCommand : public Command
         return 0;
       }
 
-      env[i] = EnvironmentModification(type, sep, rest[i * 3 + 1].c_str(), rest[i * 3 + 2].c_str());
+      env.push_back(
+          EnvironmentModification(type, sep, rest[i * 3 + 1].c_str(), rest[i * 3 + 2].c_str()));
     }
 
     string debuglog = parser.get("debuglog");
diff --git a/renderdoccmd/renderdoccmd_linux.cpp b/renderdoccmd/renderdoccmd_linux.cpp
index a077479d5..580187c13 100644
--- a/renderdoccmd/renderdoccmd_linux.cpp
+++ b/renderdoccmd/renderdoccmd_linux.cpp
@@ -269,7 +269,7 @@ void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &display
 
   bool xcb = false, xlib = false;
 
-  for(int32_t i = 0; i < systems.count; i++)
+  for(size_t i = 0; i < systems.size(); i++)
   {
     if(systems[i] == WindowingSystem::Xlib)
       xlib = true;
@@ -300,7 +300,7 @@ void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &display
   {
     std::cerr << "Neither XCB nor XLib are supported, can't create window." << std::endl;
     std::cerr << "Supported systems: ";
-    for(int32_t i = 0; i < systems.count; i++)
+    for(size_t i = 0; i < systems.size(); i++)
       std::cerr << (uint32_t)systems[i] << std::endl;
     std::cerr << std::endl;
     return;