Hash :
c0d806b4
Author :
Date :
2025-02-10T23:01:33
CL: OpenCL support for ANGLE Capture/Replay Implementation of OpenCL Capture/Replay tool in ANGLE. Brief notes about the change: - Most meaningful changes for the capture process are made in src/libANGLE/capture/ - Most meaningful changes for replay are made in util/capture/ and src/tests/perf_tests/ - Many autogenerated files are changed/added to allow the capture of OpenCL objects & calls - The following applications were captured/replayed: benchmark_model, GeekBench Compute, GeekBench ML, AI-Benchmark, various OCL CTS tests - End2end test added to capture_tests. CapturedTestCL.MultiFrameCL/ES3_Vulkan Bug: angleproject:383841335 Change-Id: I55fdaa6cd6c7ba740aaa2351e4d29050059d6d1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6102105 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
//
// Copyright 2023 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// trace_interface:
// Interface shared between trace libraries and the test suite.
//
#ifndef UTIL_CAPTURE_TRACE_INTERFACE_H_
#define UTIL_CAPTURE_TRACE_INTERFACE_H_
#include <string>
#include <vector>
namespace angle
{
static constexpr size_t kTraceInfoMaxNameLen = 128;
enum class ReplayResourceMode
{
Active,
All,
};
struct TraceInfo
{
char name[kTraceInfoMaxNameLen];
bool initialized = false;
uint32_t contextClientMajorVersion;
uint32_t contextClientMinorVersion;
uint32_t frameStart;
uint32_t frameEnd;
uint32_t drawSurfaceWidth;
uint32_t drawSurfaceHeight;
uint32_t drawSurfaceColorSpace;
uint32_t displayPlatformType;
uint32_t displayDeviceType;
int configRedBits;
int configBlueBits;
int configGreenBits;
int configAlphaBits;
int configDepthBits;
int configStencilBits;
bool isBinaryDataCompressed;
bool areClientArraysEnabled;
bool isBindGeneratesResourcesEnabled;
bool isWebGLCompatibilityEnabled;
bool isRobustResourceInitEnabled;
bool isCL;
std::vector<std::string> traceFiles;
int windowSurfaceContextId;
std::vector<std::string> requiredExtensions;
std::vector<int> keyFrames;
};
// Test suite calls into the trace library (fixture).
struct TraceFunctions
{
virtual void SetupReplay() = 0;
virtual void ReplayFrame(uint32_t frameIndex) = 0;
virtual void ResetReplay() = 0;
virtual void FinishReplay() = 0;
virtual void SetupFirstFrame() = 0;
virtual void SetBinaryDataDir(const char *dataDir) = 0;
virtual void SetReplayResourceMode(const ReplayResourceMode resourceMode) = 0;
virtual void SetTraceGzPath(const std::string &traceGzPath) = 0;
virtual void SetTraceInfo(const TraceInfo &traceInfo) = 0;
virtual ~TraceFunctions() {}
};
// Trace library (fixture) calls into the test suite.
struct TraceCallbacks
{
virtual uint8_t *LoadBinaryData(const char *fileName) = 0;
virtual ~TraceCallbacks() {}
};
} // namespace angle
#endif // UTIL_CAPTURE_TRACE_INTERFACE_H_