aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-11-30 11:30:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-30 17:17:28 +0000
commitb4ec10431818200a41a082cfe2e82fe58a9b1ecc (patch)
treefdd7b510659ce0934b0af92fe75e2c2270ca525e
parent61e51012ee150e12f953bc4225fbdbdc1564007d (diff)
Set multitexturing threshold for NVIDIA
Change-Id: Ie992b34b8fdd3bf569241cce7c851880258f05df Reviewed-on: https://skia-review.googlesource.com/78261 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
-rw-r--r--src/gpu/gl/GrGLCaps.cpp11
-rw-r--r--src/gpu/ops/GrTextureOp.cpp7
2 files changed, 17 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index a2bb363648..134692d7ac 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -358,6 +358,17 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
GR_GL_GetIntegerv(gli, GR_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxSamplers);
shaderCaps->fMaxCombinedSamplers = SkTMin<GrGLint>(kMaxSaneSamplers, maxSamplers);
+ // This is all *very* approximate.
+ switch (ctxInfo.vendor()) {
+ case kNVIDIA_GrGLVendor:
+ // We've seen a range from 100 x 100 (TegraK1, GTX660) up to 300 x 300 (GTX 1070)
+ // but it doesn't clearly align with Pascal vs Maxwell vs Kepler.
+ fShaderCaps->fDisableImageMultitexturingDstRectAreaThreshold = 150 * 150;
+ break;
+ default:
+ break;
+ }
+
// SGX and Mali GPUs that are based on a tiled-deferred architecture that have trouble with
// frequently changing VBOs. We've measured a performance increase using non-VBO vertex
// data for dynamic content on these GPUs. Perhaps we should read the renderer string and
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 565eb88c52..1cee63ed43 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -478,6 +478,11 @@ private:
fDraws[i].fTextureIdx = map[fDraws[i].fTextureIdx];
}
} else {
+ // We can get here when one of the ops is already multitextured but the other cannot
+ // be because of the dst rect size.
+ if (fProxyCnt > 1 || that->fProxyCnt > 1) {
+ return false;
+ }
if (fProxy0->uniqueID() != that->fProxy0->uniqueID() || fFilter0 != that->fFilter0) {
return false;
}
@@ -570,13 +575,13 @@ private:
GrTextureProxy* fProxy0;
GrTextureProxy** fProxyArray;
};
+ size_t fMaxApproxDstPixelArea;
// The next four members should pack.
GrSamplerState::Filter fFilter0;
uint8_t fProxyCnt;
// Used to track whether fProxy is ref'ed or has a pending IO after finalize() is called.
uint8_t fFinalized;
uint8_t fAllowSRGBInputs;
- size_t fMaxApproxDstPixelArea;
typedef GrMeshDrawOp INHERITED;
};