-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a sublayer in hydra scene index mode causes a crash when rendering AOV buffers #3471
Comments
Filed as internal issue #USD-10523 (This is an automated message. See here for more information.) |
Eep! It's too late to get a fix for this in 25.02 but we'll look at it right away. There might be a fix we can do in the merging scene index, or some sequencing change in HdxTaskController. |
Are you sure the problem is with the render buffer and not with the tasks? Render buffer go through emulation, but the tasks do not quite. |
I'm quite sure the crash is because the render buffer is getting destroyed while the task controller still holds a pointer to the deleted object. I have no opinion on whether this indicates a problem with the render buffer handling or with the task handling. I also think (just an opinion) that regardless of the root cause of the crash, it is wrong to delete the render buffers and recreate them just because there is a change to the "/" prim. You could argue that this is a separate bug, but I didn't want to presume what the solution to the crash would be, so I left it as part of this issue. |
…ly, the emulated scene index driven by legacy scene delegates. This fixes the crash reported in #3471 caused by change 2351061. The problem was that the HdxTaskController added a task without going through emulation. But when we received a removed notice (in this case UsdImagingStageSceneIndex removing /), we removed the task without re-adding it. That is, the merging scene index is removing and re-adding prims. But because the task was not properly emulated, it was never re-added when the merging scene index send the prims added notice. Fixes #3471 (Internal change: 2353415)
Description of Issue
When in scene index mode, adding a non-empty sublayer causes hydra to invalidate and resync every prim on the stage. This is done by HdSceneIndexAdapterSceneDelegate::PrimsRemoved, which gets called with "/". This triggers a call to HdRenderIndex::_Clear, which clears all prims. Critically this include the HdRenderBuffer bprims. But HdxTaskController is responsible for creating and destroying HdRendreBuffer brpims, normally. So at this point HdxTaskController is holding onto pointers to deleted HdRenderBuffers. Future viewport updates inevitably call functions on these deleted objects and usdview crashes.
Note that the HdRenderBuffers do get recreated as part of the SyncAll call. While this means it might be possible to update the HdxTaskController to point to these new objects (or for HdxTaskController to not hold these pointers in the first place and instead always go to the render index to find the current incarnation of the HdRenderBuffer for each AOV), I think it would be better if the HdRenderBuffers are never deleted, as there's no way to know how expensive this deletion/creation may be.
When not in scene index mode, there is no code path with calls HdPrimIndex::_Clear, and the only place HdRenderBuffers get deleted is from HdxTaskController, so legacy hydra mode never crashes in this situation.
Steps to Reproduce
usdview --renderer Embree cube.usda
:cube.zip
System Information (OS, Hardware)
Tested on Windows and Linux
Package Versions
Verified on dev branch as of Dec 18, 2024 (270278a)
Build Flags
Build with Embree and usdview. Though any renderer that creates HdRenderBuffers for AOVs will crash.
The text was updated successfully, but these errors were encountered: