Esempio n. 1
0
        public DebugRenderer()
        {
            debugShader = Resources.Instance.Load <Shader>("shaders/Debug.shader");

            pipelineDepthLines   = debugShader.Pass[0].CreateGraphicsPipeline(Graphics.Instance.RenderPass, 0, VertexPosColor.Layout, VkPrimitiveTopology.LineList);
            pipelineNoDepthLines = debugShader.Pass[1].CreateGraphicsPipeline(Graphics.Instance.RenderPass, 0, VertexPosColor.Layout, VkPrimitiveTopology.LineList);

            pipelineDepth   = debugShader.Pass[0].CreateGraphicsPipeline(Graphics.Instance.RenderPass, 0, VertexPosColor.Layout, VkPrimitiveTopology.TriangleList);
            pipelineNoDepth = debugShader.Pass[1].CreateGraphicsPipeline(Graphics.Instance.RenderPass, 0, VertexPosColor.Layout, VkPrimitiveTopology.TriangleList);

            this.Subscribe <EndFrame>(HandleEndFrame);
        }
Esempio n. 2
0
        private unsafe void RenderImDrawData(DrawEvent e)
        {
            CommandBuffer cmdBuffer = e.cmd;
            var           io        = ImGui.GetIO();
            var           graphics  = Graphics.Instance;
            float         width     = io.DisplaySize.X;
            float         height    = io.DisplaySize.Y;
            ImDrawDataPtr draw_data = ImGui.GetDrawData();

            if (draw_data.CmdListsCount == 0)
            {
                return;
            }

            if (pipeline == VkPipeline.Null)
            {
                pipeline = pass.CreateGraphicsPipeline(e.rendrPass, 0, VertexPos2dTexColor.Layout, VkPrimitiveTopology.TriangleList);
            }

            ref Buffer vb = ref vertexBuffer[graphics.WorkContext];
Esempio n. 3
0
        public static VkResult vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, VkComputePipelineCreateInfo createInfo, out VkPipeline pipeline)
        {
            VkPipeline pinPipeline;
            var        result = vkCreateComputePipelines(device, pipelineCache, 1, &createInfo, null, &pinPipeline);

            pipeline = pinPipeline;
            return(result);
        }