From d53853dd65aea200300f93248477c605400e3e3e Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 25 Nov 2019 12:54:55 -0700 Subject: [PATCH] Reland "Reland "Enable msaa ccpr on vulkan"" This is a reland of 935a35d972e56e1616393a2361ebf005c1e09bfb Original change's description: > Reland "Enable msaa ccpr on vulkan" > > This is a reland of cb73b6250ec57b2d0e1d778753713140baef4d6d > > Original change's description: > > Enable msaa ccpr on vulkan > > > > TBR=egdaniel@google.com > > > > Bug: skia:9643 > > Change-Id: Ie06891734b700c940b996a63c7b1264ce0f2597c > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254808 > > Reviewed-by: Chris Dalton > > Commit-Queue: Chris Dalton > > Auto-Submit: Chris Dalton > > Bug: skia:9643 > Change-Id: I2537f03fad41ebddabbae94312b3836f7a948639 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255008 > Reviewed-by: Greg Daniel > Commit-Queue: Chris Dalton Bug: skia:9643 Bug: skia:9676 Change-Id: Ibade6deba89282f62af5fc835e1b775bce2bc5a5 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256353 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- src/gpu/ccpr/GrStencilAtlasOp.cpp | 10 ++++++---- src/gpu/vk/GrVkCaps.cpp | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gpu/ccpr/GrStencilAtlasOp.cpp b/src/gpu/ccpr/GrStencilAtlasOp.cpp index a2110dd11d..9c146a8968 100644 --- a/src/gpu/ccpr/GrStencilAtlasOp.cpp +++ b/src/gpu/ccpr/GrStencilAtlasOp.cpp @@ -92,11 +92,13 @@ static constexpr GrUserStencilSettings kIncrDecrStencil( ); // Resolves stencil winding counts to A8 coverage. Leaves stencil values untouched. +// NOTE: For the CCW face we intentionally use "1 == (stencil & 1)" because the contrapositive logic +// (i.e. 0 != ...) causes bugs on Adreno Vulkan. http://skbug.com/9643 static constexpr GrUserStencilSettings kResolveStencilCoverage( GrUserStencilSettings::StaticInitSeparate< - 0x0000, 0x0000, - GrUserStencilTest::kNotEqual, GrUserStencilTest::kNotEqual, - 0xffff, 0x1, + 0x0000, 0x0001, + GrUserStencilTest::kNotEqual, GrUserStencilTest::kEqual, + 0xffff, 0x0001, GrUserStencilOp::kKeep, GrUserStencilOp::kKeep, GrUserStencilOp::kKeep, GrUserStencilOp::kKeep, 0xffff, 0xffff>() @@ -108,7 +110,7 @@ static constexpr GrUserStencilSettings kResolveStencilCoverageAndReset( GrUserStencilSettings::StaticInitSeparate< 0x0000, 0x0000, GrUserStencilTest::kNotEqual, GrUserStencilTest::kNotEqual, - 0xffff, 0x1, + 0xffff, 0x0001, GrUserStencilOp::kZero, GrUserStencilOp::kZero, GrUserStencilOp::kKeep, GrUserStencilOp::kKeep, 0xffff, 0xffff>() diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index aeb9ec78c6..7579c4916f 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -441,9 +441,19 @@ void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDevicePropertie // GrCaps workarounds //////////////////////////////////////////////////////////////////////////// - // Temporarily disable the MSAA implementation of CCPR while we work out a crash on Win10 - // GTX660 and incorrect rendring on Adreno. + // The GTX660 bot experiences crashes and incorrect rendering with MSAA CCPR. Block this path + // renderer on non-mixed-sampled NVIDIA. + // NOTE: We may lose mixed samples support later if the context options suppress dual source + // blending, but that shouldn't be an issue because MSAA CCPR seems to work fine (even without + // mixed samples) on later NVIDIA hardware where mixed samples would be supported. + if ((kNvidia_VkVendor == properties.vendorID) && !fMixedSamplesSupport) { + fDriverBlacklistMSAACCPR = true; + } + +#ifdef SK_BUILD_FOR_ANDROID + // MSAA CCPR is slow on Android. http://skbug.com/9676 fDriverBlacklistMSAACCPR = true; +#endif if (kARM_VkVendor == properties.vendorID) { fInstanceAttribSupport = false;