コード例 #1
0
        public ResourceGroupAllocator(GraphicsResourceAllocator allocator, CommandList commandList)
        {
            this.allocator      = allocator;
            this.commandList    = commandList;
            this.graphicsDevice = commandList.GraphicsDevice;

            SetupNextDescriptorPool();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
 public static BufferPool New(GraphicsResourceAllocator allocator, GraphicsDevice graphicsDevice, int size)
 {
     return(new BufferPool(allocator, graphicsDevice, size));
 }
コード例 #4
0
 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);
 }