Hi
It is possible at all to copy descriptors between _two different_ heaps ? The documentation says so:
QuoteMultiple descriptor heaps can be involved in the copy operation, both as source and destination. The use of descriptor handles as parameters means the copy methods don’t care about which heaps any given descriptor lies in – they are all just memory.
First (source) heap is:
D3D12_DESCRIPTOR_HEAP_DESC HeapDesc;
HeapDesc.NumDescriptors = 256;
HeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER;
HeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
HeapDesc.NodeMask = 0;
and SrcHeap->GetCPUDescriptorHandleForHeapStart() ==> Handle.ptr == 4 (strange, value indeed, I'd expected ptr as in case of GPU handles)
Second (destination) heap is:
HeapDesc.NumDescriptors = 128;
HeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER;
HeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
HeapDesc.NodeMask = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
and DstHeap->GetCPUDescriptorHandleForHeapStart() ==> Handle.ptr == 9 (strange, value indeed, I'd expected ptr as in case of GPU handles)
and I want to copy elements 5, 6, and 7 from first one to the second one
auto Increment = Device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER); // Return 32
CD3DX12_CPU_DESCRIPTOR_HANDLE Src = CD3DX12_CPU_DESCRIPTOR_HANDLE(SrcHeap->GetCPUDescriptorHandleForHeapStart(), 5, Increment);
CD3DX12_CPU_DESCRIPTOR_HANDLE Dst = CD3DX12_CPU_DESCRIPTOR_HANDLE(DstHeap->GetCPUDescriptorHandleForHeapStart(), 0, Increment);
Device->CopyDescriptorsSimple(3, Dst, Src, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER);
and debug layers says:
D3D12 ERROR: ID3D12Device::CopyDescriptors: Source ranges and dest ranges overlap, which results in undefined behavior. [ EXECUTION ERROR #653: COPY_DESCRIPTORS_INVALID_RANGES]
and indeed samplers are not copied to the shader visible descriptors heap ... why ?
I have win10 1809 (x64), latest nvidia drivers and 2080RTX (I do not have any other cards, and device is initialized on 2080RTX)
I'v compilled ModelViewer from DXSamples MiniEngine ... and it spills out that same error from within it's DynamicDescriptorHeap implementation :/