MCPcopy Create free account
hub / github.com/baldurk/renderdoc / SortRDWidgetItems

Function SortRDWidgetItems

qrenderdoc/Windows/ShaderViewer.cpp:159–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void SortRDWidgetItems(QVector<RDTreeWidgetItem *> &members)
160{
161 // Sort the children by offset, then global source var index, then by text.
162 // Using the global source var index allows resource arrays to be presented in index order
163 // rather than by name, so for example arr[2] comes before arr[10]
164 std::sort(members.begin(), members.end(), [](const RDTreeWidgetItem *a, const RDTreeWidgetItem *b) {
165 VariableTag at = a->tag().value<VariableTag>();
166 VariableTag bt = b->tag().value<VariableTag>();
167 if(at.offset != bt.offset)
168 return at.offset < bt.offset;
169 if(at.globalSourceVar && bt.globalSourceVar)
170 return at.sourceVarIdx < bt.sourceVarIdx;
171 return a->text(0) < b->text(0);
172 });
173}
174
175struct AccessedResourceTag
176{

Callers 2

combineStructuresMethod · 0.85
updateWatchVariableMethod · 0.85

Calls 5

sortFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
tagMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected