private GpuDescriptorHandle CopyDescriptors(DescriptorAllocator descriptorAllocator, CpuDescriptorHandle baseDescriptor, int descriptorCount) { CpuDescriptorHandle destinationDescriptor = descriptorAllocator.Allocate(descriptorCount); GraphicsDevice.NativeDevice.CopyDescriptorsSimple(descriptorCount, destinationDescriptor, baseDescriptor, descriptorAllocator.DescriptorHeap.Description.Type); return(descriptorAllocator.GetGpuDescriptorHandle(destinationDescriptor)); }
public DescriptorSet(GraphicsDevice device, int descriptorCount, DescriptorHeapType descriptorHeapType = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView) { if (descriptorCount < 1) { throw new ArgumentOutOfRangeException(nameof(descriptorCount)); } GraphicsDevice = device; DescriptorHeapType = descriptorHeapType; DescriptorCapacity = descriptorCount; DescriptorAllocator = GetDescriptorAllocator(); StartCpuDescriptorHandle = DescriptorAllocator.Allocate(DescriptorCapacity); }