private protected void CreateViews() { // Create or reset the heap if (_viewHeap is null) { _viewHeap = _device.CreateDescriptorHeap(DescriptorHeapType.RenderTargetView, Configuration.BackBufferCount, false); _views = _viewHeap.AllocateHandles(Configuration.BackBufferCount); } else { _viewHeap.ResetHeap(); } for (var i = 0u; i < Configuration.BackBufferCount; i++) { _device.CreateRenderTargetView(_backBuffers[i], _views[i]); } }
/// <summary> /// Allocates a range of descriptor handles in the resource descriptor heap, used for CBVs, SRVs, and UAVs /// </summary> /// <param name="descriptorCount"></param> /// <returns></returns> public DescriptorAllocation AllocateSamplerDescriptors(int descriptorCount) { var handles = _samplers.AllocateHandles(descriptorCount); return(handles); }