Commit 6ffeb744 by Jamie Madill

Add more detailed captures to EGL init perf test.

We can use the ANGLE platform to capture more specific information than total number of iterations. We can also capture time spent initializing DLLs, calling D3D11CreateDevice and allocating some default resources. BUG=angleproject:1014 Change-Id: If0f4965e7aac22eb09dfa0d2300ff449e7481f6e Reviewed-on: https://chromium-review.googlesource.com/276631Reviewed-by: 's avatarAustin Kinross <aukinros@microsoft.com> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b76e350f
...@@ -8,14 +8,68 @@ ...@@ -8,14 +8,68 @@
// //
#include "ANGLEPerfTest.h" #include "ANGLEPerfTest.h"
#include "Timer.h"
#include "test_utils/angle_test_configs.h" #include "test_utils/angle_test_configs.h"
#include "test_utils/angle_test_instantiate.h" #include "test_utils/angle_test_instantiate.h"
#include "platform/Platform.h"
using namespace testing; using namespace testing;
namespace namespace
{ {
// Only applies to D3D11
class CapturePlatform : public angle::Platform
{
public:
CapturePlatform()
: mLoadDLLsMS(0),
mCreateDeviceMS(0),
mInitResourcesMS(0),
mTimer(CreateTimer())
{
mTimer->start();
}
double currentTime() override;
void histogramCustomCounts(
const char *name, int sample, int min, int max, int bucketCount) override;
size_t getLoadDLLsMS() const { return mLoadDLLsMS; }
size_t getCreateDeviceMS() const { return mCreateDeviceMS; }
size_t getInitResourcesMS() const { return mInitResourcesMS; }
private:
Timer *mTimer;
size_t mLoadDLLsMS;
size_t mCreateDeviceMS;
size_t mInitResourcesMS;
};
double CapturePlatform::currentTime()
{
return mTimer->getElapsedTime();
}
void CapturePlatform::histogramCustomCounts(
const char *name, int sample, int /*min*/, int /*max*/, int /*bucketCount*/)
{
// These must match the names of the histograms.
if (strcmp(name, "GPU.ANGLE.Renderer11InitializeDLLsMS") == 0)
{
mLoadDLLsMS += static_cast<size_t>(sample);
}
// Note: not captured in debug, due to creating a debug device
else if (strcmp(name, "GPU.ANGLE.D3D11CreateDeviceMS") == 0)
{
mCreateDeviceMS += static_cast<size_t>(sample);
}
else if (strcmp(name, "GPU.ANGLE.Renderer11InitializeDeviceMS") == 0)
{
mInitResourcesMS += static_cast<size_t>(sample);
}
}
class EGLInitializePerfTest : public ANGLEPerfTest, class EGLInitializePerfTest : public ANGLEPerfTest,
public WithParamInterface<angle::PlatformParameters> public WithParamInterface<angle::PlatformParameters>
{ {
...@@ -24,10 +78,12 @@ class EGLInitializePerfTest : public ANGLEPerfTest, ...@@ -24,10 +78,12 @@ class EGLInitializePerfTest : public ANGLEPerfTest,
~EGLInitializePerfTest(); ~EGLInitializePerfTest();
void step(float dt, double totalTime) override; void step(float dt, double totalTime) override;
void TearDown() override;
private: private:
OSWindow *mOSWindow; OSWindow *mOSWindow;
EGLDisplay mDisplay; EGLDisplay mDisplay;
CapturePlatform mCapturePlatform;
}; };
EGLInitializePerfTest::EGLInitializePerfTest() EGLInitializePerfTest::EGLInitializePerfTest()
...@@ -67,6 +123,8 @@ EGLInitializePerfTest::EGLInitializePerfTest() ...@@ -67,6 +123,8 @@ EGLInitializePerfTest::EGLInitializePerfTest()
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,
mOSWindow->getNativeDisplay(), mOSWindow->getNativeDisplay(),
&displayAttributes[0]); &displayAttributes[0]);
ANGLEPlatformInitialize(&mCapturePlatform);
} }
EGLInitializePerfTest::~EGLInitializePerfTest() EGLInitializePerfTest::~EGLInitializePerfTest()
...@@ -88,6 +146,16 @@ void EGLInitializePerfTest::step(float dt, double totalTime) ...@@ -88,6 +146,16 @@ void EGLInitializePerfTest::step(float dt, double totalTime)
} }
} }
void EGLInitializePerfTest::TearDown()
{
ANGLEPerfTest::TearDown();
printResult("LoadDLLs", mCapturePlatform.getLoadDLLsMS(), "ms", true);
printResult("D3D11CreateDevice", mCapturePlatform.getCreateDeviceMS(), "ms", true);
printResult("InitResources", mCapturePlatform.getInitResourcesMS(), "ms", true);
ANGLEPlatformShutdown();
}
TEST_P(EGLInitializePerfTest, Run) TEST_P(EGLInitializePerfTest, Run)
{ {
run(); run();
......
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