-
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
Autodesk: Avoid evicting graphics pipelines in use in resource garbage collection #3229
base: dev
Are you sure you want to change the base?
Autodesk: Avoid evicting graphics pipelines in use in resource garbage collection #3229
Conversation
Filed as internal issue #USD-9981 |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@erikaharrison-adsk Would it be possible to get more context on the issue and the fix? When are you seeing the issue? When I run usdview with a simple asset using your change, upon exiting the program I get several Vulkan validation errors that lead me to think the graphics pipeline object isn't getting destroyed properly. Are you seeing anything like this?
|
@clach We have a SceneIndex-based HLOD system that updates the scene depending on the view. This issue caused continuous recreation of graphics pipelines and was a performance bottleneck. However, I could also recreate this with light USD editing; no graphics pipeline would survive garbage collection. I tested it on macOS/Metal, but we were also seeing this on webGPU. OpenGL does not have this problem due to indirect draw being different. I have not tried it on Vulkan. |
Description of Change(s)
Removing use of GC_Threshold for the graphics pipeline registry. Replaced by use of recycle count (see.GarbageCollect call) to hold pipelines in use in the cache and prevent eviction by garbage collection.
This change will improve performance of USD editing as well. Without it, all graphics pipelines are evicted from the cache whenever garbage collection is called.
Graphics pipelines are bound at draw time and will always be evicted here by the GarbageCollector (for Metal, Vulkan). Using a recycle count of one prevents pipelines in use from being evicted from the registry. I removed the previous fix based on GC_Threshold. I did not encounter any issues with other resources in the registry and garbage collection so I this only applies to graphics pipelines.
Fixes Issue(s)