Enable fence sync support in ES3 test contexts
authorBrian Osman <brianosman@google.com>
Fri, 21 Apr 2017 19:12:30 +0000 (15:12 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 21 Apr 2017 19:39:16 +0000 (19:39 +0000)
This (only?) affects ANGLE. Other ES platforms typically go through
EGLGLTestContext, which manually instantiates an EGLFenceSync.

In general, though, ES3 requires this API, so this is safe. Should give us
more accurate (and much less spammy) output from ES3 ANGLE performance
testing.

Bug: skia:
Change-Id: I10a608d21092aaffa4ab76e4b3d2f6e9c5cf09bb
Reviewed-on: https://skia-review.googlesource.com/14063
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

tools/gpu/gl/GLTestContext.cpp

index f6771934f80d9ee561122d45e59e75925b7854d1..abbb8a618c21e1cec1d5b09bd1458f530fc5cc00 100644 (file)
@@ -51,10 +51,13 @@ std::unique_ptr<GLFenceSync> GLFenceSync::MakeIfSupported(const sk_gpu_test::GLT
         }
         ret.reset(new GLFenceSync(ctx));
     } else {
-        if (!ctx->gl()->hasExtension("GL_APPLE_sync")) {
+        if (ctx->gl()->hasExtension("GL_APPLE_sync")) {
+            ret.reset(new GLFenceSync(ctx, "APPLE"));
+        } else if (GrGLGetVersion(ctx->gl()) >= GR_GL_VER(3, 0)) {
+            ret.reset(new GLFenceSync(ctx));
+        } else {
             return nullptr;
         }
-        ret.reset(new GLFenceSync(ctx, "APPLE"));
     }
     if (!ret->validate()) {
         ret = nullptr;