Commit 96057765 by Chris Forbes

Support color write mask in pipeline

Bug: b/118386749 Test: dEQP-VK.pipeline.* Change-Id: Ie549802e6ea9ad89760e2439de5776121fae8c58 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29028Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent f993de30
...@@ -332,7 +332,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -332,7 +332,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
UNIMPLEMENTED("pCreateInfo->pRasterizationState settings"); UNIMPLEMENTED("pCreateInfo->pRasterizationState settings");
} }
context.rasterizerDiscard = rasterizationState->rasterizerDiscardEnable; context.rasterizerDiscard = (rasterizationState->rasterizerDiscardEnable == VK_TRUE);
context.cullMode = rasterizationState->cullMode; context.cullMode = rasterizationState->cullMode;
context.frontFacingCCW = rasterizationState->frontFace == VK_FRONT_FACE_COUNTER_CLOCKWISE; context.frontFacingCCW = rasterizationState->frontFace == VK_FRONT_FACE_COUNTER_CLOCKWISE;
context.depthBias = (rasterizationState->depthBiasEnable ? rasterizationState->depthBiasConstantFactor : 0.0f); context.depthBias = (rasterizationState->depthBiasEnable ? rasterizationState->depthBiasConstantFactor : 0.0f);
...@@ -377,12 +377,12 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -377,12 +377,12 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
UNIMPLEMENTED("depthStencilState"); UNIMPLEMENTED("depthStencilState");
} }
context.depthBoundsTestEnable = depthStencilState->depthBoundsTestEnable; context.depthBoundsTestEnable = (depthStencilState->depthBoundsTestEnable == VK_TRUE);
context.depthBufferEnable = depthStencilState->depthTestEnable; context.depthBufferEnable = (depthStencilState->depthTestEnable == VK_TRUE);
context.depthWriteEnable = depthStencilState->depthWriteEnable; context.depthWriteEnable = (depthStencilState->depthWriteEnable == VK_TRUE);
context.depthCompareMode = depthStencilState->depthCompareOp; context.depthCompareMode = depthStencilState->depthCompareOp;
context.stencilEnable = context.twoSidedStencil = depthStencilState->stencilTestEnable; context.stencilEnable = context.twoSidedStencil = (depthStencilState->stencilTestEnable == VK_TRUE);
if(context.stencilEnable) if(context.stencilEnable)
{ {
context.frontStencil = depthStencilState->front; context.frontStencil = depthStencilState->front;
...@@ -411,12 +411,8 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -411,12 +411,8 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
if(colorBlendState->attachmentCount == 1) if(colorBlendState->attachmentCount == 1)
{ {
const VkPipelineColorBlendAttachmentState& attachment = colorBlendState->pAttachments[0]; const VkPipelineColorBlendAttachmentState& attachment = colorBlendState->pAttachments[0];
if(attachment.colorWriteMask != (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT)) context.setColorWriteMask(0, attachment.colorWriteMask);
{ context.alphaBlendEnable = (attachment.blendEnable == VK_TRUE);
UNIMPLEMENTED("colorWriteMask");
}
context.alphaBlendEnable = attachment.blendEnable;
context.separateAlphaBlendEnable = (attachment.alphaBlendOp != attachment.colorBlendOp) || context.separateAlphaBlendEnable = (attachment.alphaBlendOp != attachment.colorBlendOp) ||
(attachment.dstAlphaBlendFactor != attachment.dstColorBlendFactor) || (attachment.dstAlphaBlendFactor != attachment.dstColorBlendFactor) ||
(attachment.srcAlphaBlendFactor != attachment.srcColorBlendFactor); (attachment.srcAlphaBlendFactor != attachment.srcColorBlendFactor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment