public ResourceGroupAllocator(GraphicsResourceAllocator allocator, CommandList commandList) { this.allocator = allocator; this.commandList = commandList; this.graphicsDevice = commandList.GraphicsDevice; SetupNextDescriptorPool(); }
internal BufferPool(GraphicsResourceAllocator allocator, GraphicsDevice graphicsDevice, int size) { constantBufferAlignment = graphicsDevice.ConstantBufferDataPlacementAlignment; if (size % constantBufferAlignment != 0) { throw new ArgumentException($"size needs to be a multiple of constant buffer alignment ({constantBufferAlignment})", nameof(size)); } this.allocator = allocator; Size = size; if (!UseBufferOffsets) { Data = Marshal.AllocHGlobal(size); } Reset(); }
public static BufferPool New(GraphicsResourceAllocator allocator, GraphicsDevice graphicsDevice, int size) { return(new BufferPool(allocator, graphicsDevice, size)); }
public GraphicsContext(GraphicsDevice graphicsDevice, GraphicsResourceAllocator allocator = null, CommandList commandList = null) { CommandList = commandList ?? graphicsDevice.InternalMainCommandList ?? CommandList.New(graphicsDevice).DisposeBy(graphicsDevice); Allocator = allocator ?? new GraphicsResourceAllocator(graphicsDevice).DisposeBy(graphicsDevice); ResourceGroupAllocator = new ResourceGroupAllocator(Allocator, CommandList).DisposeBy(graphicsDevice); }