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

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

Issue 1812223002: added support for glMinSampleShading (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updated for Jim's change Created 4 years, 9 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/GrVkCaps.cpp ('k') | src/views/mac/SkNSView.mm » ('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 9c0fd28424f44d9eb52a0c3af413fae6c53cb7e1..794acb077c1a579a7e5cc9fc6a3185bd10dcab5f 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -203,7 +203,9 @@ void setup_viewport_scissor_state(const GrVkGpu* gpu,
SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount);
}
-void setup_multisample_state(const GrPipeline& pipeline,
+void setup_multisample_state(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrCaps* caps,
VkPipelineMultisampleStateCreateInfo* multisampleInfo) {
memset(multisampleInfo, 0, sizeof(VkPipelineMultisampleStateCreateInfo));
multisampleInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
@@ -212,8 +214,10 @@ void setup_multisample_state(const GrPipeline& pipeline,
int numSamples = pipeline.getRenderTarget()->numColorSamples();
SkAssertResult(GrSampleCountToVkSampleCount(numSamples,
&multisampleInfo->rasterizationSamples));
- multisampleInfo->sampleShadingEnable = VK_FALSE;
- multisampleInfo->minSampleShading = 0;
+ float sampleShading = primProc.getSampleShading();
+ SkASSERT(sampleShading == 0.0f || caps->sampleShadingSupport());
+ multisampleInfo->sampleShadingEnable = sampleShading > 0.0f;
+ multisampleInfo->minSampleShading = sampleShading;
multisampleInfo->pSampleMask = nullptr;
multisampleInfo->alphaToCoverageEnable = VK_FALSE;
multisampleInfo->alphaToOneEnable = VK_FALSE;
@@ -427,7 +431,7 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
setup_viewport_scissor_state(gpu, pipeline, vkRT, &viewportInfo);
VkPipelineMultisampleStateCreateInfo multisampleInfo;
- setup_multisample_state(pipeline, &multisampleInfo);
+ setup_multisample_state(pipeline, primProc, gpu->caps(), &multisampleInfo);
// We will only have one color attachment per pipeline.
VkPipelineColorBlendAttachmentState attachmentStates[1];
« no previous file with comments | « src/gpu/vk/GrVkCaps.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698