From 9a75f75642951dff5e4067a7199136017fb70069 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Sat, 20 Apr 2019 01:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3pipeline=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=89=80=E6=9C=89=E6=9C=AA=E8=AE=BE=E7=BD=AE=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/VKPipeline.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/example/Vulkan/VKPipeline.cpp b/example/Vulkan/VKPipeline.cpp index e9d76c23..d3180226 100644 --- a/example/Vulkan/VKPipeline.cpp +++ b/example/Vulkan/VKPipeline.cpp @@ -30,6 +30,8 @@ PipelineCreater::PipelineCreater(Device *dev) scissor.extent = extent; viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; + viewportState.pNext = nullptr; + viewportState.flags = 0; viewportState.viewportCount = 1; viewportState.pViewports = &viewport; viewportState.scissorCount = 1; @@ -67,6 +69,9 @@ PipelineCreater::PipelineCreater(Device *dev) rasterizer.cullMode = VK_CULL_MODE_BACK_BIT; rasterizer.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE; rasterizer.depthBiasEnable = VK_FALSE; + rasterizer.depthBiasConstantFactor = 0; + rasterizer.depthBiasClamp = 0; + rasterizer.depthBiasSlopeFactor = 0; rasterizer.lineWidth = 1.0f; pipelineInfo.pRasterizationState = &rasterizer; @@ -85,8 +90,16 @@ PipelineCreater::PipelineCreater(Device *dev) colorBlendAttachment.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; colorBlendAttachment.blendEnable = VK_FALSE; + colorBlendAttachment.alphaBlendOp = VK_BLEND_OP_ADD; + colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD; + colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ZERO; + colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO; + colorBlendAttachment.srcAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; + colorBlendAttachment.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; + colorBlending.pNext = nullptr; + colorBlending.flags = 0; colorBlending.logicOpEnable = VK_FALSE; colorBlending.logicOp = VK_LOGIC_OP_COPY; colorBlending.attachmentCount = 1; @@ -106,7 +119,7 @@ PipelineCreater::PipelineCreater(Device *dev) dynamicState.dynamicStateCount = 0; pipelineInfo.pDynamicState=&dynamicState; - + pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; pipelineInfo.basePipelineIndex = 0; } @@ -173,7 +186,7 @@ Pipeline *PipelineCreater::Create() { VkPipeline graphicsPipeline; - if (vkCreateGraphicsPipelines(device, cache, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) + if (vkCreateGraphicsPipelines(device, cache, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) return(nullptr); return(new Pipeline(device,graphicsPipeline));