mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Silence some PVS warnings
This commit is contained in:
@@ -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 +=
|
||||
|
||||
@@ -945,7 +945,7 @@ void TimelineBar::paintMarkers(QPainter &p, const QVector<Marker> &markers,
|
||||
|
||||
// if everything was elided, just omit the title entirely
|
||||
if(elided == tooshort)
|
||||
elided = QString();
|
||||
elided.clear();
|
||||
|
||||
r.setLeft(qRound(r.left() + margin));
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1910,7 +1910,7 @@ rdcstr GetProfile(const ShaderCompileFlags &compileFlags)
|
||||
|
||||
prof += 4;
|
||||
|
||||
return rdcstr(prof, strstr(prof, " ") - prof);
|
||||
return rdcstr(prof, strchr(prof, ' ') - prof);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user