Reputation: 302
According to Descriptor Heaps Overview - Synchronization, changing the descriptors referenced in execution(by ID3D12GraphicsCommandList::SetGraphicsRootDescriptorTable) may invoke a race condition.
But can I safely change the descriptors that are not referenced in current execution ? Both refenced descriptors and non-referenced descriptors are in the same DescriptorHeap and the heap is set to CommandList by calling ID3D12GraphicsCommandList::SetDescriptorHeaps.
Upvotes: 0
Views: 83
Reputation: 8963
In case you can guarantee that the location in your descriptor heap will not be used during command list execution, yes it is totally possible to overwrite that location.
So for example it is possible to track if a resource is not needed anymore, and then mark the descriptor locations using that resource as free (once commandList has been processed, using a fence), then use those previous location to assign new resources (you can do that while running a newer commandList that does not use that resource anymore).
Upvotes: 1