Пример #1
0
        void iCursorRender.render(IDeviceContext context, IBuffer vertexBuffer)
        {
            context.writeBuffer(constantBuffer, ref position);
            context.SetVertexBuffer(0, vertexBuffer, 0);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 4,
                Flags       = DrawFlags.VerifyAll
            };

            context.SetPipelineState(psoInvert);
            context.CommitShaderResources(bindingsInvert);
            context.Draw(ref draw);

            context.SetPipelineState(psoRgb);
            context.CommitShaderResources(bindingsRgb);
            context.Draw(ref draw);
        }
Пример #2
0
        public void draw(IDeviceContext context, ref Matrix4x4 worldView, ref Matrix4x4 projection)
        {
            var constants = new VsConstants(ref worldView, ref projection);

            context.writeBuffer(vsConstants, ref constants);

            // Set the pipeline state
            context.SetPipelineState(pipelineState);
            // Commit shader resources. RESOURCE_STATE_TRANSITION_MODE_TRANSITION mode makes sure that resources are transitioned to required states.
            context.CommitShaderResources(resourceBinding);

            mesh.draw(context);
        }
Пример #3
0
        protected void drawTriangle(IDeviceContext ic, ITextureView textureView)
        {
            ic.SetPipelineState(pipelineState);
            textureVariable.Set(textureView);
            ic.CommitShaderResources(binding);
            ic.setVertexBuffer(vertexBuffer);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            ic.Draw(ref draw);
        }
Пример #4
0
        public void blend(IDeviceContext ic, IShaderResourceBinding source)
        {
            ic.SetPipelineState(pipelineState);
            ic.CommitShaderResources(source);
            ic.SetVertexBuffer(0, null, 0);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            // ConsoleLogger.logDebug( "BlendTextures.blend, rendering" );
            ic.Draw(ref draw);
            // ConsoleLogger.logDebug( "BlendTextures.blend, rendered" );
        }
Пример #5
0
        public void render(IDeviceContext context, ITextureView rtv, CSize outputSize, int index)
        {
            // Setup stuff
            context.SetRenderTarget(rtv, null);
            context.setViewport(outputSize, viewport);
            context.SetPipelineState(pipelineState);
            textureVariable.Set(sourceTextures[index]);
            context.CommitShaderResources(binding);

            // Render a full-screen triangle, no vertex buffer needed
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            context.Draw(ref draw);
        }
Пример #6
0
 public void bind(IDeviceContext ic)
 {
     ensureResourceBindings();
     ic.SetPipelineState(pipelineState);
     ic.CommitShaderResources(resourceBinding);
 }