Skip to content

Commit 4b6aed8

Browse files
tcauchoispixar-oss
authored andcommitted
[hdSt] Revert changelist 2384003 (sort textures before upload).
This change was an attempt to optimize texture upload (and reduce variance of upload time) inside the GL driver by sorting textures by size before submission. This showed promise in local & farm testing, but doesn't appear to have moved the needle in continuous integration. It also appears to have regressed behavior in the OpenUSD build when using normal malloc (as opposed to jemalloc). Alas... (Internal change: 2385353)
1 parent b81bdf2 commit 4b6aed8

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

pxr/imaging/hdSt/textureObjectRegistry.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -195,26 +195,14 @@ HdSt_TextureObjectRegistry::Commit()
195195
}
196196
}
197197

198-
std::vector<HdStTextureObjectSharedPtr> toCommit;
199-
{
200-
TRACE_FUNCTION_SCOPE("Sorting textures for commit");
201-
toCommit.assign(result.begin(), result.end());
202-
std::sort(toCommit.begin(), toCommit.end(),
203-
[](HdStTextureObjectSharedPtr const& x,
204-
HdStTextureObjectSharedPtr const& y) {
205-
// Submit textures biggest to smallest.
206-
return x->GetCommittedSize() > y->GetCommittedSize();
207-
});
208-
}
209-
210198
{
211199
TRACE_FUNCTION_SCOPE("Commiting textures");
200+
HF_TRACE_FUNCTION_SCOPE("Committing textures");
212201

213202
// Commit loaded files to GPU.
214203
size_t i = 1;
215-
for (const HdStTextureObjectSharedPtr &texture : toCommit) {
216-
TF_DESCRIBE_SCOPE("Comitting texture %zu / %zu",
217-
i++, toCommit.size());
204+
for (const HdStTextureObjectSharedPtr &texture : result) {
205+
TF_DESCRIBE_SCOPE("Comitting texture %zu / %zu", i++, result.size());
218206
texture->_Commit();
219207
}
220208
}

0 commit comments

Comments
 (0)