Commit ecbac31c by Jamie Madill Committed by Commit Bot

Perf Tests: Add offscreen mode.

This lets the trace perf tests run configurable number of frames within a single swap. The offscreen config is similar to how gfxbench works. It renders to a user FBO (by overriding calls to BindFramebuffer) and then composits multiple frames into the real backbuffer. This allows us to get a perf measurement with less overhead from composition and display. Adds emulation for some APIs that operate on Framebuffers like BindFramebuffer, Invalidate, DrawBuffers and ReadBuffer. Bug: angleproject:4845 Change-Id: I1044c1d52c82f1c215a68a6c46d74c52ed0f3d2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300207 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent 50348a8a
...@@ -22,6 +22,7 @@ bool gVerboseLogging = false; ...@@ -22,6 +22,7 @@ bool gVerboseLogging = false;
double gTestTimeSeconds = 1.0; double gTestTimeSeconds = 1.0;
int gTestTrials = 3; int gTestTrials = 3;
bool gNoFinish = false; bool gNoFinish = false;
bool gEnableOffscreen = false;
// Default to three warmup loops. There's no science to this. More than two loops was experimentally // Default to three warmup loops. There's no science to this. More than two loops was experimentally
// helpful on a Windows NVIDIA setup when testing with Vulkan and native trace tests. // helpful on a Windows NVIDIA setup when testing with Vulkan and native trace tests.
...@@ -116,6 +117,10 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv) ...@@ -116,6 +117,10 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv)
{ {
gNoFinish = true; gNoFinish = true;
} }
else if (strcmp("--enable-offscreen", argv[argIndex]) == 0)
{
gEnableOffscreen = true;
}
else else
{ {
argv[argcOutCount++] = argv[argIndex]; argv[argcOutCount++] = argv[argIndex];
......
...@@ -24,6 +24,7 @@ extern int gWarmupLoops; ...@@ -24,6 +24,7 @@ extern int gWarmupLoops;
extern double gTestTimeSeconds; extern double gTestTimeSeconds;
extern int gTestTrials; extern int gTestTrials;
extern bool gNoFinish; extern bool gNoFinish;
extern bool gEnableOffscreen;
inline bool OneFrame() inline bool OneFrame()
{ {
......
...@@ -35,6 +35,7 @@ Several command-line arguments control how the tests run: ...@@ -35,6 +35,7 @@ Several command-line arguments control how the tests run:
* `--test-time`: Run each test trial in a fixed time. Defaults to 1 second. * `--test-time`: Run each test trial in a fixed time. Defaults to 1 second.
* `--trials`: Number of times to repeat testing. Defaults to 3. * `--trials`: Number of times to repeat testing. Defaults to 3.
* `--no-finish`: Don't call glFinish after each test trial. * `--no-finish`: Don't call glFinish after each test trial.
* `--enable-offscreen`: Offscreen tests disabled by default to reduce test time.
For example, for an endless run with no warmup, run: For example, for an endless run with no warmup, run:
......
...@@ -347,7 +347,8 @@ static void PrintEvent(const Event &event) ...@@ -347,7 +347,8 @@ static void PrintEvent(const Event &event)
} }
#endif #endif
OSWindow::OSWindow() : mX(0), mY(0), mWidth(0), mHeight(0) {} OSWindow::OSWindow() : mX(0), mY(0), mWidth(0), mHeight(0), mValid(false), mIgnoreSizeEvents(false)
{}
OSWindow::~OSWindow() {} OSWindow::~OSWindow() {}
......
...@@ -68,6 +68,8 @@ class ANGLE_UTIL_EXPORT OSWindow ...@@ -68,6 +68,8 @@ class ANGLE_UTIL_EXPORT OSWindow
// Whether window has been successfully initialized. // Whether window has been successfully initialized.
bool valid() const { return mValid; } bool valid() const { return mValid; }
void ignoreSizeEvents() { mIgnoreSizeEvents = true; }
protected: protected:
OSWindow(); OSWindow();
virtual ~OSWindow(); virtual ~OSWindow();
...@@ -82,6 +84,7 @@ class ANGLE_UTIL_EXPORT OSWindow ...@@ -82,6 +84,7 @@ class ANGLE_UTIL_EXPORT OSWindow
std::list<Event> mEvents; std::list<Event> mEvents;
bool mValid; bool mValid;
bool mIgnoreSizeEvents;
}; };
#endif // UTIL_OSWINDOW_H_ #endif // UTIL_OSWINDOW_H_
...@@ -277,6 +277,9 @@ LRESULT CALLBACK Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam, LP ...@@ -277,6 +277,9 @@ LRESULT CALLBACK Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam, LP
case WM_SIZE: case WM_SIZE:
{ {
if (window->mIgnoreSizeEvents)
break;
RECT winRect; RECT winRect;
GetClientRect(hWnd, &winRect); GetClientRect(hWnd, &winRect);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment