Add a "preferredInternalSampleCount" cap
This new cap tells Ganesh how many samples to use when performing
internal draws with MSAA or mixed samples. The default is always 4x,
but the client can change that with
GrContextOptions::fPreferredInternalMSAASampleCount.
Also adds a command line flag to viewer to control
fPreferredInternalMSAASampleCount.
Bug: skia:
Change-Id: Iba369273e802aa1bee796b576b3c18af347b0494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221156
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index ffacbc5..8f6218d 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -57,6 +57,7 @@
fMaxPreferredRenderTargetSize = 1;
fMaxTextureSize = 1;
fMaxWindowRectangles = 0;
+ fPreferredInternalSampleCount = 0;
fSuppressPrints = options.fSuppressPrints;
#if GR_TEST_UTILS
@@ -110,11 +111,15 @@
fShaderCaps->fGeometryShaderSupport = false;
}
#endif
+
if (fMaxWindowRectangles > GrWindowRectangles::kMaxWindows) {
SkDebugf("WARNING: capping window rectangles at %i. HW advertises support for %i.\n",
GrWindowRectangles::kMaxWindows, fMaxWindowRectangles);
fMaxWindowRectangles = GrWindowRectangles::kMaxWindows;
}
+
+ fPreferredInternalSampleCount = options.fPreferredInternalSampleCount;
+
fAvoidStencilBuffers = options.fAvoidStencilBuffers;
fDriverBugWorkarounds.applyOverrides(options.fDriverBugWorkarounds);
@@ -233,6 +238,8 @@
writer->appendS32("Max Render Target Size", fMaxRenderTargetSize);
writer->appendS32("Max Preferred Render Target Size", fMaxPreferredRenderTargetSize);
writer->appendS32("Max Window Rectangles", fMaxWindowRectangles);
+ writer->appendS32("Preferred Sample Count for Internal MSAA and Mixed Samples",
+ fPreferredInternalSampleCount);
static const char* kBlendEquationSupportNames[] = {
"Basic",