Add benchmark for comparing multitexturing to non-multitexturing image draws.
Allows benchmarks to override GrContextOptions.
Removes the ability to use the same GrContext for all benchmarks in a config.
Change-Id: I5ab9f6e81055451ac912a66537843d1a49f3b479
Reviewed-on: https://skia-review.googlesource.com/34080
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrShaderCaps.cpp b/src/gpu/GrShaderCaps.cpp
index 0ee9339..7e44188 100644
--- a/src/gpu/GrShaderCaps.cpp
+++ b/src/gpu/GrShaderCaps.cpp
@@ -96,6 +96,12 @@
fMaxFragmentImageStorages = 0;
fMaxCombinedImageStorages = 0;
fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction;
+
+#if GR_TEST_UTILS
+ fDisableImageMultitexturing = options.fDisableImageMultitexturing;
+#else
+ fDisableImageMultitexturing = false;
+#endif
}
void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const {
@@ -175,6 +181,7 @@
writer->appendS32("Max Combined Image Storages", fMaxFragmentImageStorages);
writer->appendString("Advanced blend equation interaction",
kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]);
+ writer->appendBool("Disable image multitexturing", fDisableImageMultitexturing);
writer->endObject();
}
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index ab82a9c..3606a01 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -54,7 +54,9 @@
static constexpr int kMaxTextures = 8;
#endif
- static int SupportsMultitexture(const GrShaderCaps& caps) { return caps.integerSupport(); }
+ static int SupportsMultitexture(const GrShaderCaps& caps) {
+ return caps.integerSupport() && !caps.disableImageMultitexturingSupport();
+ }
static sk_sp<GrGeometryProcessor> Make(sk_sp<GrTextureProxy> proxies[], int proxyCnt,
sk_sp<GrColorSpaceXform> csxf,