Commit fe7e9ed4 by Austin Kinross Committed by Jamie Madill

Make DebugAnnotator::getStatus work on Windows 10 (WinRT)

Change-Id: I860a814490ac643eb3d7d1b770c956f0dce3e39e Reviewed-on: https://chromium-review.googlesource.com/305309Tested-by: 's avatarAustin Kinross <aukinros@microsoft.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 27460dfc
...@@ -39,32 +39,53 @@ void DebugAnnotator11::beginEvent(const wchar_t *eventName) ...@@ -39,32 +39,53 @@ void DebugAnnotator11::beginEvent(const wchar_t *eventName)
{ {
initializeDevice(); initializeDevice();
mUserDefinedAnnotation->BeginEvent(eventName); if (mUserDefinedAnnotation != nullptr)
{
mUserDefinedAnnotation->BeginEvent(eventName);
}
} }
void DebugAnnotator11::endEvent() void DebugAnnotator11::endEvent()
{ {
initializeDevice(); initializeDevice();
mUserDefinedAnnotation->EndEvent(); if (mUserDefinedAnnotation != nullptr)
{
mUserDefinedAnnotation->EndEvent();
}
} }
void DebugAnnotator11::setMarker(const wchar_t *markerName) void DebugAnnotator11::setMarker(const wchar_t *markerName)
{ {
initializeDevice(); initializeDevice();
mUserDefinedAnnotation->SetMarker(markerName); if (mUserDefinedAnnotation != nullptr)
{
mUserDefinedAnnotation->SetMarker(markerName);
}
} }
bool DebugAnnotator11::getStatus() bool DebugAnnotator11::getStatus()
{ {
// ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in Visual Studio 2013. #if defined(ANGLE_ENABLE_WINDOWS_STORE)
#if (NTDDI_VERSION == NTDDI_WIN10)
initializeDevice();
if (mUserDefinedAnnotation != nullptr)
{
return !!(mUserDefinedAnnotation->GetStatus());
}
return true; // Default if initializeDevice() failed
#elif defined(_DEBUG)
static bool underCapture = true; static bool underCapture = true;
#if defined(_DEBUG) && defined(ANGLE_ENABLE_WINDOWS_STORE) // ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in
// In the Windows Store, we can use IDXGraphicsAnalysis. The call to GetDebugInterface1 only succeeds if the app is under capture. // Windows 8.1/Visual Studio 2013. We can use IDXGraphicsAnalysis, though.
// The call to GetDebugInterface1 only succeeds if the app is under capture.
// This should only be called in DEBUG mode. // This should only be called in DEBUG mode.
// If an app links against DXGIGetDebugInterface1 in release mode then it will fail Windows Store ingestion checks. // If an app links against DXGIGetDebugInterface1 in release mode then it will fail Windows
// Store ingestion checks.
// Cache the result to reduce the number of calls to DXGIGetDebugInterface1 // Cache the result to reduce the number of calls to DXGIGetDebugInterface1
static bool triedIDXGraphicsAnalysis = false; static bool triedIDXGraphicsAnalysis = false;
...@@ -82,9 +103,16 @@ bool DebugAnnotator11::getStatus() ...@@ -82,9 +103,16 @@ bool DebugAnnotator11::getStatus()
SafeRelease(graphicsAnalysis); SafeRelease(graphicsAnalysis);
triedIDXGraphicsAnalysis = true; triedIDXGraphicsAnalysis = true;
} }
#endif // _DEBUG && !ANGLE_ENABLE_WINDOWS_STORE
return underCapture; return underCapture;
#else
// We can't detect GetStatus() on release WinRT 8.1 builds, so always return true.
return true;
#endif // (NTDDI_VERSION == NTDDI_WIN10) or _DEBUG
#else
// We can't detect GetStatus() on desktop ANGLE builds so always return true.
return true;
#endif // ANGLE_ENABLE_WINDOWS_STORE
} }
void DebugAnnotator11::initializeDevice() void DebugAnnotator11::initializeDevice()
......
...@@ -780,10 +780,6 @@ ...@@ -780,10 +780,6 @@
}], }],
['angle_build_winrt==1', ['angle_build_winrt==1',
{ {
'defines':
[
'NTDDI_VERSION=NTDDI_WINBLUE',
],
'msvs_requires_importlibrary' : 'true', 'msvs_requires_importlibrary' : 'true',
'msvs_settings': 'msvs_settings':
{ {
......
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