Ejemplo n.º 1
0
        public void End()
        {
            var command = new D3D11Command
            {
                Type = CommandType.End
            };

            _commandList.Add(command);
        }
Ejemplo n.º 2
0
        public void SetIndexBuffer(IIndexBuffer indexBuffer)
        {
            var command = new D3D11Command
            {
                Type        = CommandType.SetIndexBuffer,
                IndexBuffer = (D3D11IndexBuffer)indexBuffer
            };

            _commandList.Add(command);
        }
Ejemplo n.º 3
0
        public void SetDepthStencilState(IDepthStencilState depthStencilState)
        {
            var command = new D3D11Command
            {
                Type = CommandType.SetDepthStencilState,
                DepthStencilState = (D3D11DepthStencilState)depthStencilState
            };

            _commandList.Add(command);
        }
Ejemplo n.º 4
0
        public void SetInputLayout(IInputLayout inputLayout)
        {
            var command = new D3D11Command
            {
                Type        = CommandType.SetInputLayout,
                InputLayout = (D3D11InputLayout)inputLayout
            };

            _commandList.Add(command);
        }
Ejemplo n.º 5
0
        public void SetScissorRectangle(Rectangle rectangle)
        {
            var command = new D3D11Command
            {
                Type             = CommandType.SetScissor,
                ScissorRectangle = rectangle.ToSharpDX()
            };

            _commandList.Add(command);
        }
Ejemplo n.º 6
0
        public void SetRasterizerState(IRasterizerState rasterizerState)
        {
            var command = new D3D11Command
            {
                Type            = CommandType.SetRasterizerState,
                RasterizerState = (D3D11RasterizerState)rasterizerState
            };

            _commandList.Add(command);
        }
Ejemplo n.º 7
0
        public void SetPrimitiveTopology(PrimitiveTopology primitiveTopology)
        {
            var command = new D3D11Command
            {
                Type = CommandType.SetPrimitiveTopology,
                PrimitiveTopology = primitiveTopology
            };

            _commandList.Add(command);
        }
Ejemplo n.º 8
0
        public void SetBlendState(IBlendState blendState)
        {
            var command = new D3D11Command
            {
                Type       = CommandType.SetBlendState,
                BlendState = (D3D11BlendState)blendState
            };

            _commandList.Add(command);
        }
Ejemplo n.º 9
0
        public void Draw(int vertexCount)
        {
            var command = new D3D11Command
            {
                Type        = CommandType.Draw,
                VertexCount = vertexCount
            };

            _commandList.Add(command);
        }
Ejemplo n.º 10
0
        public void SetVertexShader(IShader vertexShader)
        {
            var command = new D3D11Command
            {
                Type         = CommandType.SetVertexShader,
                VertexShader = (VertexShader)(D3D11Shader)vertexShader
            };

            _commandList.Add(command);
        }
Ejemplo n.º 11
0
        public void SetViewport(Viewport viewport)
        {
            var command = new D3D11Command
            {
                Type     = CommandType.SetViewport,
                Viewport = viewport.ToSharpDX(),
            };

            _commandList.Add(command);
        }
Ejemplo n.º 12
0
        public void SetPixelShader(IShader pixelShader)
        {
            var command = new D3D11Command
            {
                Type        = CommandType.SetPixelShader,
                PixelShader = (PixelShader)(D3D11Shader)pixelShader
            };

            _commandList.Add(command);
        }
Ejemplo n.º 13
0
        public void SetVertexBuffer(IVertexBuffer vertexBuffer)
        {
            var command = new D3D11Command
            {
                Type = CommandType.SetVertexBuffer,
                VertexBufferBinding = ((D3D11VertexBuffer)vertexBuffer).GetVertexBufferBinding()
            };

            _commandList.Add(command);
        }
Ejemplo n.º 14
0
        public void SetRenderTargets(TextureView[] renderTargets, TextureView depthStencilView)
        {
            var command = new D3D11Command
            {
                Type          = CommandType.SetRenderTargets,
                RenderTargets = renderTargets.Select(rt => (RenderTargetView)(D3D11TextureView)rt).ToArray()
            };

            _commandList.Add(command);
        }
Ejemplo n.º 15
0
        public void ClearRenderTarget(TextureView renderTarget, Vector4 clearColor)
        {
            var command = new D3D11Command
            {
                Type                   = CommandType.ClearRenderTarget,
                RenderTarget           = (D3D11TextureView)renderTarget,
                RenderTargetClearColor = new RawColor4(clearColor.X, clearColor.Y, clearColor.Z, clearColor.W)
            };

            _commandList.Add(command);
        }
Ejemplo n.º 16
0
        public void SetConstantBuffer(IConstantBuffer buffer, BufferScope bufferScope)
        {
            var command = new D3D11Command
            {
                Type = CommandType.SetConstantBuffers,
                ConstantBufferScope = bufferScope,
                ConstantBuffer      = (D3D11ConstantBuffer)buffer
            };

            _commandList.Add(command);
        }
Ejemplo n.º 17
0
        public void SetRenderTarget(TextureView renderTarget, TextureView depthStencilView)
        {
            var command = new D3D11Command
            {
                Type                     = CommandType.SetRenderTarget,
                RenderTarget             = (D3D11TextureView)renderTarget,
                RenderTargetDepthStencil = (D3D11TextureView)depthStencilView
            };

            _commandList.Add(command);
        }
Ejemplo n.º 18
0
        public void DrawIndexed(int indexCount, int indexOffset, int vertexOffset)
        {
            var command = new D3D11Command
            {
                Type         = CommandType.DrawIndexed,
                IndexCount   = indexCount,
                IndexOffset  = indexOffset,
                VertexOffset = vertexOffset
            };

            _commandList.Add(command);
        }
Ejemplo n.º 19
0
        public void ClearDepthStencil(TextureView depthStencilView, float depthClear, byte depthClearStencil)
        {
            var command = new D3D11Command
            {
                Type = CommandType.ClearDepthStencil,
                RenderTargetDepthStencil = (D3D11TextureView)depthStencilView,
                DepthClear        = depthClear,
                DepthClearStencil = depthClearStencil
            };

            _commandList.Add(command);
        }
Ejemplo n.º 20
0
        public void SetTexture(TextureView textureView)
        {
            var command = new D3D11Command
            {
                Type              = CommandType.SetTextures,
                Textures          = new[] { (ShaderResourceView)(D3D11TextureView)textureView },
                TexturesStartSlot = 0,
                TextureCount      = 1
            };

            _commandList.Add(command);
        }
Ejemplo n.º 21
0
        public void SetSampler(ISampler sampler)
        {
            var command = new D3D11Command
            {
                Type              = CommandType.SetSamplers,
                Samplers          = new[] { (SamplerState)(D3D11Sampler)sampler },
                SamplerCount      = 1,
                SamplersStartSlot = 0
            };

            _commandList.Add(command);
        }
Ejemplo n.º 22
0
        public void Begin(string passName, IPipeline pipeline)
        {
            var command = new D3D11Command
            {
                Type     = CommandType.Begin,
                PassName = passName
            };

            _commandList.Add(command);

            if (pipeline != null)
            {
                SetBlendState(pipeline.BlendState);
                SetDepthStencilState(pipeline.DepthStencilState);
                SetRasterizerState(pipeline.RasterizerState);
                SetInputLayout(pipeline.InputLayout);
                SetVertexShader(pipeline.VertexShader);
                SetPixelShader(pipeline.PixelShader);
                SetPrimitiveTopology(pipeline.PrimitiveTopology);
                SetViewport(pipeline.Viewport);
            }
        }