skia2/tools/gpu/FenceSync.h
Brian Osman 5fbd18370f Add NV_fence support to get better timing from ANGLE ES2
Previously, we were reporting numbers that were far too low, because
we were getting way ahead of the GPU, and then spending all of our time
in finish (which isn't timed). That led to us picking very high loop
counts, so our wall clock time to run nanobench was very high, and our
reported times were very low. This fixes all of that, and removes all
the spam about not having fence support.

Change-Id: Ib9dfc043da82bf8ee6645b8627cfade66eb9864e
Reviewed-on: https://skia-review.googlesource.com/58001
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-10 21:13:03 +00:00

37 lines
920 B
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef FenceSync_DEFINED
#define FenceSync_DEFINED
#include "SkTypes.h"
namespace sk_gpu_test {
using PlatformFence = uint64_t;
static constexpr PlatformFence kInvalidFence = 0;
/*
* This class provides an interface to interact with fence syncs. A fence sync is an object that the
* client can insert into the GPU command stream, and then at any future time, wait until all
* commands that were issued before the fence have completed.
*/
class FenceSync {
public:
virtual PlatformFence SK_WARN_UNUSED_RESULT insertFence() const = 0;
virtual bool waitFence(PlatformFence) const = 0;
virtual void deleteFence(PlatformFence) const = 0;
virtual bool validate() const { return true; }
virtual ~FenceSync() {}
};
} // namespace sk_gpu_test
#endif