PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.16k stars 1.23k forks source link

Implementing a vectorized version of FromPickHit #3413

Open marktucker opened 2 weeks ago

marktucker commented 2 weeks ago

Description of Change(s)

Implementing a vectorized version of FromPickHit called FromPickHits. This amortizes the high cost of computing instancer information when generating pick hit information for multiple hits with one function call.

@jesschimein @tcauchois this is my stab at vectorizing FromPickHit we discussed. This was easier than I expected. It gets Houdini's selection performance with scene index imaging up to par with UsdImagingDelegate performance using GetScenePrimPaths.

Checklist

[ X ] I have created this PR based on the dev branch

[ X ] I have followed the [coding conventions]

[ ] I have added unit tests that exercise this functionality I did not do this because there is no unit test for FromPickHit, and I suspect a fair bit of infrastructure would be required to unit test this. I have however verified it functioning in an unreleased build of Houdini.

[ X ] I have verified that all unit tests pass with the proposed changes

[ X ] I have submitted a signed Contributor License Agreement (Reference: Contributor License Agreement instructions)

tcauchois commented 2 weeks ago

Amazing, glad it was straightforward and the approach looks great! We've got internal tests for this; some of the usdImaging and Presto picking tests exercise this when we turn hydra 2 on.

jesschimein commented 2 weeks ago

Filed as internal issue #USD-10417

jesschimein commented 2 weeks ago

/AzurePipelines run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).
spitzak commented 4 days ago

Actually std::transform dates back to C++98. But I agree almost all the "algorithms" in std are impossible to read and very difficult to write, and especially with the addition of for (auto a : range) syntax really does not provide much improvement over raw C++ code.