aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpbench
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-07-19 14:47:42 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-19 19:13:25 +0000
commit81e7bf8d6d338d944f3c5075b14c21580398aeb6 (patch)
tree7c9814e6637dbcdf477f35084381b28f1f98e06a /tools/skpbench
parentfc3afa921bc42a357120e1e7856b3c256bfe1a6a (diff)
Update gpu caps for valid sample counts.
Instead of query and maxSampleCount and using that to cap, we now have each config store its supported values and when requested returns either the next highest or equal supported value, or if non the max config supported. Bug: skia: Change-Id: I8802d44c13b3b1703ee54a7e69b82102d4b8dc2d Reviewed-on: https://skia-review.googlesource.com/24302 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/skpbench')
-rw-r--r--tools/skpbench/skpbench.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index 8898da25d5..c0ead46155 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -7,6 +7,8 @@
#include "GpuTimer.h"
#include "GrContextFactory.h"
+#include "SkGr.h"
+
#include "SkCanvas.h"
#include "SkCommonFlagsPathRenderer.h"
#include "SkOSFile.h"
@@ -287,9 +289,13 @@ int main(int argc, char** argv) {
exitf(ExitErr::kUnavailable, "render target size %ix%i not supported by platform (max: %i)",
width, height, ctx->caps()->maxRenderTargetSize());
}
- if (ctx->caps()->maxSampleCount() < config->getSamples()) {
- exitf(ExitErr::kUnavailable, "sample count %i not supported by platform (max: %i)",
- config->getSamples(), ctx->caps()->maxSampleCount());
+ GrPixelConfig grPixConfig = SkImageInfo2GrPixelConfig(config->getColorType(),
+ config->getColorSpace(),
+ *ctx->caps());
+ int supportedSampleCount = ctx->caps()->getSampleCount(config->getSamples(), grPixConfig);
+ if (supportedSampleCount != config->getSamples()) {
+ exitf(ExitErr::kUnavailable, "sample count %i not supported by platform",
+ config->getSamples());
}
sk_gpu_test::TestContext* testCtx = ctxInfo.testContext();
if (!testCtx) {