diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index 2a2cde596..95dcdddac 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -625,7 +625,8 @@ QString BufferFormatter::GetBufferFormatString(const ShaderResource &res, if(i + 1 == members.count()) { - comment = arraySize = QString(); + comment.clear(); + arraySize.clear(); if(members.count() > 1) format += diff --git a/qrenderdoc/Windows/TimelineBar.cpp b/qrenderdoc/Windows/TimelineBar.cpp index 2dbecfed7..6148b39ef 100644 --- a/qrenderdoc/Windows/TimelineBar.cpp +++ b/qrenderdoc/Windows/TimelineBar.cpp @@ -945,7 +945,7 @@ void TimelineBar::paintMarkers(QPainter &p, const QVector &markers, // if everything was elided, just omit the title entirely if(elided == tooshort) - elided = QString(); + elided.clear(); r.setLeft(qRound(r.left() + margin)); diff --git a/renderdoc/common/dds_readwrite.cpp b/renderdoc/common/dds_readwrite.cpp index 08e49852c..2e9636ff8 100644 --- a/renderdoc/common/dds_readwrite.cpp +++ b/renderdoc/common/dds_readwrite.cpp @@ -1189,7 +1189,7 @@ dds_data load_dds_from_file(StreamReader *reader) } if(uint64_t(ret.slices) > fileSize || uint64_t(ret.mips) > fileSize || - uint64_t(ret.slices * ret.mips) > fileSize) + uint64_t(ret.slices) * ret.mips > fileSize) { RDCERR("Invalid slice count %u or mip count %u", ret.slices, ret.mips); return ret; diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 5ffbc114c..a8aa60742 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -3425,6 +3425,8 @@ void D3D12Replay::GetTextureData(ResourceId tex, const Subresource &sub, readbackDesc.Width += subSize; } + UINT rowcount = rowcounts[0]; + D3D12_HEAP_PROPERTIES heapProps; heapProps.Type = D3D12_HEAP_TYPE_READBACK; heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; @@ -3521,9 +3523,9 @@ void D3D12Replay::GetTextureData(ResourceId tex, const Subresource &sub, { for(UINT z = 0; z < layouts[0].Footprint.Depth; z++) { - for(UINT y = 0; y < rowcounts[0]; y++) + for(UINT y = 0; y < rowcount; y++) { - UINT row = y + z * rowcounts[0]; + UINT row = y + z * rowcount; // we can copy the depth from D24 as a 32-bit integer, since the remaining bits are // garbage @@ -3554,9 +3556,9 @@ void D3D12Replay::GetTextureData(ResourceId tex, const Subresource &sub, // copy row by row for(UINT z = 0; z < layouts[0].Footprint.Depth; z++) { - for(UINT y = 0; y < rowcounts[0]; y++) + for(UINT y = 0; y < rowcount; y++) { - UINT row = y + z * rowcounts[0]; + UINT row = y + z * rowcount; byte *src = pData + layouts[0].Footprint.RowPitch * row; byte *dst = data.data() + dstRowPitch * row; @@ -3569,9 +3571,9 @@ void D3D12Replay::GetTextureData(ResourceId tex, const Subresource &sub, if(layouts[0].Footprint.Depth > 1 && slice3DCopy > 0 && (int)slice3DCopy < layouts[0].Footprint.Depth) { - for(UINT y = 0; y < rowcounts[0]; y++) + for(UINT y = 0; y < rowcount; y++) { - UINT srcrow = y + slice3DCopy * rowcounts[0]; + UINT srcrow = y + slice3DCopy * rowcount; UINT dstrow = y; byte *src = pData + layouts[0].Footprint.RowPitch * srcrow; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp index eabf9b2e5..eaa82d492 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp @@ -1910,7 +1910,7 @@ rdcstr GetProfile(const ShaderCompileFlags &compileFlags) prof += 4; - return rdcstr(prof, strstr(prof, " ") - prof); + return rdcstr(prof, strchr(prof, ' ') - prof); } } diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp index 2db22dcc8..c3e57f76e 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp @@ -581,7 +581,7 @@ Program::Program(const byte *bytes, size_t length) default: break; } - g.align = (1U << rootchild.ops[4]) >> 1; + g.align = (1ULL << rootchild.ops[4]) >> 1; g.section = int32_t(rootchild.ops[5]) - 1; @@ -704,14 +704,14 @@ Program::Program(const byte *bytes, size_t length) { case 0: { - group.params |= Attribute(1U << (attrgroup.ops[i + 1])); + group.params |= Attribute(1ULL << (attrgroup.ops[i + 1])); i++; break; } case 1: { uint64_t param = attrgroup.ops[i + 2]; - Attribute attr = Attribute(1U << attrgroup.ops[i + 1]); + Attribute attr = Attribute(1ULL << attrgroup.ops[i + 1]); group.params |= attr; switch(attr) { diff --git a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp index 093147fa7..b63f6faf8 100644 --- a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp @@ -1180,7 +1180,7 @@ void Program::MakeDisassemblyString() } } - if(debugCall) + if(debugCall && inst.funcCall) { size_t varIdx = 0, exprIdx = 0; if(inst.funcCall->name == "llvm.dbg.value") diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index fc6932445..cf08b081a 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -3179,7 +3179,7 @@ void UpdateTestsFailed(const TestsFailedCallback *tfCb, uint32_t eventId, uint32 void FillInColor(ResourceFormat fmt, const PixelHistoryValue &value, ModificationValue &mod) { FloatVector v4 = DecodeFormattedComponents(fmt, value.color); - memcpy(mod.col.floatValue, &v4.x, sizeof(v4)); + memcpy(mod.col.floatValue, &v4, sizeof(v4)); } float GetDepthValue(VkFormat depthFormat, const PixelHistoryValue &value)