Use enums for trace event categories

Explicit enums are simpler to use in Dawn and allow only specific
categories which the perf tests understand.

Also adds trace events around command recording and validation on
all backends.

Bug: dawn:208
Change-Id: I7859ffd6668b20893780c6081bf2c9019a7115e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12781
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2019-10-28 23:15:40 +00:00
committed by Commit Bot service account
parent 7a7d547381
commit 73d5bb57e6
15 changed files with 121 additions and 72 deletions

View File

@@ -21,11 +21,18 @@
namespace dawn_platform {
enum class TraceCategory {
General, // General trace events
Validation, // Dawn validation
Recording, // Native command recording
GPUWork, // Actual GPU work
};
class DAWN_NATIVE_EXPORT Platform {
public:
virtual ~Platform() {
}
virtual const unsigned char* GetTraceCategoryEnabledFlag(const char* name) = 0;
virtual const unsigned char* GetTraceCategoryEnabledFlag(TraceCategory category) = 0;
virtual double MonotonicallyIncreasingTime() = 0;