Hello fellow developers,
I have quite a peculiar problem which shattered my understanding of how descriptor heaps work. Maybe you can help me.
Recently we are having troubles with CopyDescriptors call in our engine. For some users it returns error:
D3D12 Error: ID3D12Device::CopyDescriptors: Source ranges and dest ranges overlap, which results in undefined behavior.
I have tracked the problem to CPUDescriptorHandles with odd addresses.
I have this piece of code:
The Updated.TotalCount = 9216 and Immediate.TotalCount = 46864.
Calling _updatedHeap.GetCPUDescriptorHandleForHeapStart() results in Ptr = 1 , calling _immediateHeap.GetCPUDescriptorHandleForHeapStart() results in Ptr = 2.
But I would expect immediateHeap.GetCPUDescriptorHandleForHeapStart() to results in 1 + 9216 * SRVDescriptorSize.
How does the CopyDescriptors work if these addresses are its only input, no other refs are passed. Or is only one descriptor heap per type supported?
btw. The code above uses Vortice C# library, but I checked the behavior in native C++ code as well.
btw #2. The results above are returned on NVIDIA cards. AMD returns numbers more resembling real addresses.