Commit ad0a486b by Jamie Madill

Add D3D11CreateDevice timing histogram.

This should give us a bound on how much we can improve startup time in ANGLE on D3D11 across all users. BUG=angleproject:944 BUG=436191 Change-Id: Ie9047c0424429aecec5f6d7be8e119ebcc53fbe3 Reviewed-on: https://chromium-review.googlesource.com/266524Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent d41c649a
...@@ -22,6 +22,10 @@ class Platform ...@@ -22,6 +22,10 @@ class Platform
// System -------------------------------------------------------------- // System --------------------------------------------------------------
// Wall clock time in seconds since the epoch.
// TODO(jmadill): investigate using an ANGLE internal time library
virtual double currentTime() { return 0; }
// Monotonically increasing time in seconds from an arbitrary fixed point in the past. // Monotonically increasing time in seconds from an arbitrary fixed point in the past.
// This function is expected to return at least millisecond-precision values. For this reason, // This function is expected to return at least millisecond-precision values. For this reason,
// it is recommended that the fixed point be no further in the past than the epoch. // it is recommended that the fixed point be no further in the past than the epoch.
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "libANGLE/State.h" #include "libANGLE/State.h"
#include "libANGLE/Surface.h" #include "libANGLE/Surface.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/histogram_macros.h"
#include "libANGLE/renderer/d3d/CompilerD3D.h" #include "libANGLE/renderer/d3d/CompilerD3D.h"
#include "libANGLE/renderer/d3d/FramebufferD3D.h" #include "libANGLE/renderer/d3d/FramebufferD3D.h"
#include "libANGLE/renderer/d3d/IndexDataManager.h" #include "libANGLE/renderer/d3d/IndexDataManager.h"
...@@ -337,6 +338,8 @@ egl::Error Renderer11::initialize() ...@@ -337,6 +338,8 @@ egl::Error Renderer11::initialize()
if (!mDevice || FAILED(result)) if (!mDevice || FAILED(result))
#endif #endif
{ {
double createDeviceBegin = ANGLEPlatformCurrent()->currentTime();
TRACE_EVENT0("gpu.angle", "D3D11CreateDevice"); TRACE_EVENT0("gpu.angle", "D3D11CreateDevice");
result = D3D11CreateDevice(NULL, result = D3D11CreateDevice(NULL,
mDriverType, mDriverType,
...@@ -380,6 +383,10 @@ egl::Error Renderer11::initialize() ...@@ -380,6 +383,10 @@ egl::Error Renderer11::initialize()
return GenerateD3D11CreateDeviceErr(D3D11_INIT_CREATEDEVICE_ERROR); return GenerateD3D11CreateDeviceErr(D3D11_INIT_CREATEDEVICE_ERROR);
} }
} }
double createDeviceSec = ANGLEPlatformCurrent()->currentTime() - createDeviceBegin;
int createDeviceMS = static_cast<int>(createDeviceSec * 1000);
ANGLE_HISTOGRAM_TIMES("GPU.ANGLE.D3D11CreateDeviceMS", createDeviceMS);
} }
#if !defined(ANGLE_ENABLE_WINDOWS_STORE) #if !defined(ANGLE_ENABLE_WINDOWS_STORE)
......
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