Ejemplo n.º 1
0
        public unsafe override void Run(Frame frame, CommandBuffer cmd)
        {
            Vk vk = renderer.Vk;

            Pipelines.Pipeline fPipeline = Pipelines.Pipeline.GetPipeline(renderPipeline, renderer);
            fPipeline.Bind(cmd);

            DescriptorSet descriptorSet = frame.DescriptorSetManager.GetDescriptorSet();

            renderer.Shader.SetUniforms(frame, descriptorSet, uniformOffset, image);
            vk.CmdBindDescriptorSets(cmd, PipelineBindPoint.Graphics, renderer.Shader.PipelineLayout, 0, 1, descriptorSet, 0, 0);

            foreach (Path path in paths)
            {
                vk.CmdDraw(cmd, path.FillCount, 1, path.FillOffset, 0);
            }

            if (renderer.EdgeAntiAlias)
            {
                Pipelines.Pipeline aaPipeline = Pipelines.Pipeline.GetPipeline(antiAliasPipeline, renderer);
                aaPipeline.Bind(cmd);

                foreach (Path path in paths)
                {
                    vk.CmdDraw(cmd, path.StrokeCount, 1, path.StrokeOffset, 0);
                }
            }
        }
Ejemplo n.º 2
0
        public override void Run(Frame frame, CommandBuffer cmd)
        {
            Vk vk = renderer.Vk;

            Pipelines.Pipeline pipeline = Pipelines.Pipeline.GetPipeline(renderPipeline, renderer);
            pipeline.Bind(cmd);

            DescriptorSet descriptorSet = frame.DescriptorSetManager.GetDescriptorSet();

            renderer.Shader.SetUniforms(frame, descriptorSet, uniformOffset, image);
            vk.CmdBindDescriptorSets(cmd, PipelineBindPoint.Graphics, renderer.Shader.PipelineLayout, 0, 1, descriptorSet, 0, 0);

            vk.CmdDraw(cmd, triangleCount, 1, triangleOffset, 0);
        }