Ejemplo n.º 1
0
        public GraphicsCommandList GetObject(PipelineState initialState = null, bool startFrame = true)
        {
            // TODO: Return to stack?

            GraphicsCommandList item;

            // Try to take object
            if (spareObjects.TryTake(out item))
            {
                // Reset the object
                item.Reset(allocator, initialState);
            }
            else
            {
                // Create new object
                this.Add(item = CreateNew(initialState));
            }

            if (startFrame)
            {
                graphicsHost.BeginFrame(item);
            }

            return(item);
        }
Ejemplo n.º 2
0
        public GraphicsCommandList GetObject(PipelineState initialState = null)
        {
            GraphicsCommandList item;

            // Try to take object
            if (spareObjects.TryTake(out item))
            {
                // Reset the object
                item.Reset(allocator, initialState);
                graphicsHost.BeginFrame(item);
                return(item);
            }

            // Create new object
            this.Add(item = CreateNew(initialState));
            return(item);
        }