码迷,mamicode.com
首页 > 其他好文 > 详细

Vulkan SDK 之 Graphics Pipeline

时间:2020-02-07 11:13:37      阅读:96      评论:0      收藏:0      [点我收藏+]

标签:structure   sts   func   change   states   driver   device   dex   code   

A graphics pipeline consists of shader stages, a pipeline layout, a render pass, and fixed-function pipeline stages. 

技术图片

 

Dynamic State

A dynamic pipeline state is a state that can be changed by a command buffer command during the execution of a command buffer. Advance notification of what states are dynamic during command buffer execution may be useful for a driver as it sets up the GPU for command buffer execution.

 

Pipeline Vertex Input State

Pipeline Vertex Input Assembly State

The input assembly state is basically where you declare how your vertices form the geometry you want to draw. 

Pipeline Rasterization State

Pipeline Color Blend State

Pipeline Viewport State

Pipeline Depth Stencil State

Pipeline Multisample State

Pulling It All Together - Create Graphics Pipeline

VkGraphicsPipelineCreateInfo pipeline;
pipeline.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pipeline.pNext = NULL;
pipeline.layout = info.pipeline_layout;
pipeline.basePipelineHandle = VK_NULL_HANDLE;
pipeline.basePipelineIndex = 0;
pipeline.flags = 0;
pipeline.pVertexInputState = &vi;
pipeline.pInputAssemblyState = &ia;
pipeline.pRasterizationState = &rs;
pipeline.pColorBlendState = &cb;
pipeline.pTessellationState = NULL;
pipeline.pMultisampleState = &ms;
pipeline.pDynamicState = &dynamicState;
pipeline.pViewportState = &vp;
pipeline.pDepthStencilState = &ds;
pipeline.pStages = info.shaderStages;
pipeline.stageCount = 2;
pipeline.renderPass = info.render_pass;
pipeline.subpass = 0;

res = vkCreateGraphicsPipelines(info.device, NULL, 1,
                                &pipeline, NULL, &info.pipeline);

 

Vulkan SDK 之 Graphics Pipeline

标签:structure   sts   func   change   states   driver   device   dex   code   

原文地址:https://www.cnblogs.com/khacker/p/12272021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!