private DescriptorPool(GraphicsDevice graphicsDevice, DescriptorTypeCount[] counts) : base(graphicsDevice) { // For now, we put everything together so let's compute total count foreach (var count in counts) { if (count.Type == EffectParameterClass.Sampler) SamplerCount += count.Count; else SrvCount += count.Count; } if (SrvCount > 0) { SrvHeap = graphicsDevice.NativeDevice.CreateDescriptorHeap(new DescriptorHeapDescription { DescriptorCount = SrvCount, Flags = DescriptorHeapFlags.None, Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView, }); } if (SamplerCount > 0) { SamplerHeap = graphicsDevice.NativeDevice.CreateDescriptorHeap(new DescriptorHeapDescription { DescriptorCount = SamplerCount, Flags = DescriptorHeapFlags.None, Type = DescriptorHeapType.Sampler, }); } }
private DescriptorPool(GraphicsDevice graphicsDevice, DescriptorTypeCount[] counts) { // For now, we put everything together so let's compute total count var totalCount = 0; foreach (var count in counts) { totalCount += count.Count; } Entries = new DescriptorSetEntry[totalCount]; }
private DescriptorPool(GraphicsDevice graphicsDevice, DescriptorTypeCount[] counts) : base(graphicsDevice) { Recreate(); }
public static DescriptorPool New(GraphicsDevice graphicsDevice, DescriptorTypeCount[] counts) { return new DescriptorPool(graphicsDevice, counts); }