Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: src/gpu/vk/GrVkPipeline.cpp

Issue 1755753002: Implement various vulkan stencil clears and fix various stenciling bugs. (Closed) Base URL: https://skia.googlesource.com/skia.git@stencilImage
Patch Set: Review Nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkRenderPass.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipeline.cpp
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index f009eaf5481c69311b5e16975cba4265ee344c89..8c05de5fdc8404b97e7e8fc2e3a9e7a4ff44b144 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -168,8 +168,8 @@ void setup_depth_stencil_state(const GrVkGpu* gpu,
stencilInfo->front.depthFailOp = stencilInfo->front.failOp;
stencilInfo->front.compareOp = stencil_func_to_vk_compare_op(stencilSettings.func(face));
stencilInfo->front.compareMask = stencilSettings.funcMask(face);
- stencilInfo->front.writeMask = 0;
- stencilInfo->front.reference = 0;
+ stencilInfo->front.writeMask = stencilSettings.writeMask(face);
+ stencilInfo->front.reference = stencilSettings.funcRef(face);
// Set back face
face = GrStencilSettings::kBack_Face;
@@ -178,8 +178,8 @@ void setup_depth_stencil_state(const GrVkGpu* gpu,
stencilInfo->back.depthFailOp = stencilInfo->front.failOp;
stencilInfo->back.compareOp = stencil_func_to_vk_compare_op(stencilSettings.func(face));
stencilInfo->back.compareMask = stencilSettings.funcMask(face);
- stencilInfo->back.writeMask = 0;
- stencilInfo->back.reference = 0;
+ stencilInfo->back.writeMask = stencilSettings.writeMask(face);
+ stencilInfo->back.reference = stencilSettings.funcRef(face);
}
stencilInfo->minDepthBounds = 0.0f;
stencilInfo->maxDepthBounds = 1.0f;
@@ -366,8 +366,13 @@ void setup_color_blend_state(const GrVkGpu* gpu,
attachmentState->dstAlphaBlendFactor = blend_coeff_to_vk_blend(dstCoeff);
attachmentState->alphaBlendOp = blend_equation_to_vk_blend_op(equation);
}
- attachmentState->colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
- VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
+
+ if (!blendInfo.fWriteColor) {
+ attachmentState->colorWriteMask = 0;
+ } else {
+ attachmentState->colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
+ VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
+ }
memset(colorBlendInfo, 0, sizeof(VkPipelineColorBlendStateCreateInfo));
colorBlendInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkRenderPass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698