Skip to content

Commit

Permalink
Fix source variables not properly propagating updateID
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Dec 19, 2024
1 parent 65ce7ff commit 5c73842
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qrenderdoc/Windows/ShaderViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,6 @@ void ShaderViewer::combineStructures(RDTreeWidgetItem *root, int skipPrefixLengt

VariableTag tag;
tag.absoluteRefPath = prefix;
parent->setTag(QVariant::fromValue(tag));

// add all the children (stripping the prefix from their name)
for(RDTreeWidgetItem *item : matches)
Expand All @@ -2982,8 +2981,15 @@ void ShaderViewer::combineStructures(RDTreeWidgetItem *root, int skipPrefixLengt
parent->setBackground(item->background());
if(item->foreground().color().isValid())
parent->setForeground(item->foreground());

VariableTag childTag = item->tag().value<VariableTag>();

// take max updateID when combining
tag.updateID = qMax(tag.updateID, childTag.updateID);
}

parent->setTag(QVariant::fromValue(tag));

// recurse and combine members of this object if a struct
if(!isLeafArray)
{
Expand Down Expand Up @@ -4733,7 +4739,8 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const ShaderVariable &var
tag.absoluteRefPath = baseTag.absoluteRefPath + sep + var.name;
tag.expanded = true;
tag.modified = HasChanged(baseTag.absoluteRefPath + sep + var.name);
tag.updateID = CalcUpdateID(tag.updateID, baseTag.absoluteRefPath + sep + var.name);
tag.updateID = CalcUpdateID(tag.updateID, debugVarPath);
tag.updateID = CalcUpdateID(tag.updateID, debugName);

for(const ShaderVariable &child : var.members)
{
Expand Down

0 comments on commit 5c73842

Please sign in to comment.