You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's because CommandListResourceStateTracker store all resources references in raw pointers without ref counter.
When cmdlists are about to close, they try to iterate over these resources ( keepBufferInitialStates / keepTextureInitialStates) and may trigger a crash because these resources may have been freed.
potential fix
CommandListResourceStateTracker might extend resources lifetime until closed.
The text was updated successfully, but these errors were encountered:
there is another dangling case: CommandList::Set(Permanant)Buffer/TextureState don't record reference in TrackedCommandBuffer.referencedResources;. The resources may have been freed when pipelinebarriers haven't been executed on GPU.
Thank you for reporting the issue. I figured that storing strong references inside the ..StateTracker class is overkill because its methods are called from many CommandList functions, and those functions already keep strong refs to their resources. Also, IResource* type pointers are not passed to the state tracker at all. So, the user-facing set(Texture|Buffer|AccelStruct)State functions now store strong refs explicitly.
Please let me know if I missed anything.
A minimal repoducable example is as following:
It's because
CommandListResourceStateTracker
store all resources references in raw pointers without ref counter.When cmdlists are about to close, they try to iterate over these resources (
keepBufferInitialStates
/keepTextureInitialStates
) and may trigger a crash because these resources may have been freed.potential fix
CommandListResourceStateTracker
might extend resources lifetime until closed.The text was updated successfully, but these errors were encountered: