Commit 2c7c625a by Jamie Madill

Refactor D3D Debug Annotations code.

This encapsultates the different implementations and allows us to compile debug.cpp in the common libraries without link errors. BUG=angleproject:513 Change-Id: I16dc4c666fb4266ee5146d64d77eb9925c7584a8 Reviewed-on: https://chromium-review.googlesource.com/256450Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b8af723d
......@@ -17,164 +17,9 @@
namespace gl
{
// Wraps the D3D9/D3D11 debug annotation functions.
class DebugAnnotationWrapper
{
public:
DebugAnnotationWrapper() { };
virtual ~DebugAnnotationWrapper() { };
virtual void beginEvent(const std::wstring &eventName) = 0;
virtual void endEvent() = 0;
virtual void setMarker(const std::wstring &markerName) = 0;
virtual bool getStatus() = 0;
};
#if defined(ANGLE_ENABLE_D3D9)
class D3D9DebugAnnotationWrapper : public DebugAnnotationWrapper
{
public:
void beginEvent(const std::wstring &eventName)
{
D3DPERF_BeginEvent(0, eventName.c_str());
}
void endEvent()
{
D3DPERF_EndEvent();
}
void setMarker(const std::wstring &markerName)
{
D3DPERF_SetMarker(0, markerName.c_str());
}
bool getStatus()
{
return !!D3DPERF_GetStatus();
}
};
#endif // ANGLE_ENABLE_D3D9
#if defined(ANGLE_ENABLE_D3D11)
class D3D11DebugAnnotationWrapper : public DebugAnnotationWrapper
{
public:
D3D11DebugAnnotationWrapper()
: mInitialized(false),
mD3d11Module(NULL),
mUserDefinedAnnotation(NULL)
{
// D3D11 devices can't be created during DllMain.
// We defer device creation until the object is actually used.
}
~D3D11DebugAnnotationWrapper()
{
if (mInitialized)
{
SafeRelease(mUserDefinedAnnotation);
FreeLibrary(mD3d11Module);
}
}
virtual void beginEvent(const std::wstring &eventName)
{
initializeDevice();
mUserDefinedAnnotation->BeginEvent(eventName.c_str());
}
virtual void endEvent()
{
initializeDevice();
mUserDefinedAnnotation->EndEvent();
}
virtual void setMarker(const std::wstring &markerName)
{
initializeDevice();
mUserDefinedAnnotation->SetMarker(markerName.c_str());
}
virtual bool getStatus()
{
// ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in Visual Studio 2013.
#if defined(_DEBUG) && defined(ANGLE_ENABLE_WINDOWS_STORE)
// In the Windows Store, we can use IDXGraphicsAnalysis. The call to GetDebugInterface1 only succeeds if the app is under capture.
// 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.
IDXGraphicsAnalysis* graphicsAnalysis;
DXGIGetDebugInterface1(0, IID_PPV_ARGS(&graphicsAnalysis));
bool underCapture = (graphicsAnalysis != NULL);
SafeRelease(graphicsAnalysis);
return underCapture;
#endif
// Otherwise, we have to return true here.
return true;
}
protected:
void initializeDevice()
{
if (!mInitialized)
{
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
mD3d11Module = LoadLibrary(TEXT("d3d11.dll"));
ASSERT(mD3d11Module);
PFN_D3D11_CREATE_DEVICE D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(mD3d11Module, "D3D11CreateDevice");
ASSERT(D3D11CreateDevice != NULL);
#endif // !ANGLE_ENABLE_WINDOWS_STORE
ID3D11Device* device = NULL;
ID3D11DeviceContext* context = NULL;
HRESULT hr = E_FAIL;
// Create a D3D_DRIVER_TYPE_NULL device, which is much cheaper than other types of device.
hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &device, NULL, &context);
ASSERT(SUCCEEDED(hr));
hr = context->QueryInterface(__uuidof(mUserDefinedAnnotation), reinterpret_cast<void**>(&mUserDefinedAnnotation));
ASSERT(SUCCEEDED(hr) && mUserDefinedAnnotation != NULL);
SafeRelease(device);
SafeRelease(context);
mInitialized = true;
}
}
bool mInitialized;
HMODULE mD3d11Module;
ID3DUserDefinedAnnotation* mUserDefinedAnnotation;
};
#endif // ANGLE_ENABLE_D3D11
static DebugAnnotationWrapper *GetDebugAnnotationWrapper()
namespace
{
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
# if defined(ANGLE_ENABLE_D3D9)
static D3D9DebugAnnotationWrapper wrapper;
# elif defined(ANGLE_ENABLE_D3D11)
// If the project uses D3D9 then we can use the D3D9 debug annotations, even with the D3D11 renderer.
// However, if D3D9 is unavailable (e.g. in Windows Store), then we use D3D11 debug annotations.
// The D3D11 debug annotations are methods on ID3DUserDefinedAnnotation, which is implemented by the DeviceContext.
// This doesn't have to be the same DeviceContext that the renderer uses, though.
static D3D11DebugAnnotationWrapper wrapper;
# endif
return &wrapper;
#else
return nullptr;
#endif
}
enum DebugTraceOutputType
{
DebugTraceOutputTypeNone,
......@@ -182,25 +27,27 @@ enum DebugTraceOutputType
DebugTraceOutputTypeBeginEvent
};
static void output(bool traceInDebugOnly, MessageType messageType, DebugTraceOutputType outputType,
const char *format, va_list vararg)
DebugAnnotator *g_debugAnnotator = nullptr;
void output(bool traceInDebugOnly, MessageType messageType, DebugTraceOutputType outputType,
const char *format, va_list vararg)
{
if (perfActive())
if (DebugAnnotationsActive())
{
static std::vector<char> buffer(512);
size_t len = FormatStringIntoVector(format, vararg, buffer);
std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len);
DebugAnnotationWrapper *annotationWrapper = GetDebugAnnotationWrapper();
ASSERT(g_debugAnnotator != nullptr);
switch (outputType)
{
case DebugTraceOutputTypeNone:
break;
case DebugTraceOutputTypeBeginEvent:
annotationWrapper->beginEvent(formattedWideMessage);
g_debugAnnotator->beginEvent(formattedWideMessage);
break;
case DebugTraceOutputTypeSetMarker:
annotationWrapper->setMarker(formattedWideMessage);
g_debugAnnotator->setMarker(formattedWideMessage);
break;
}
}
......@@ -245,53 +92,57 @@ static void output(bool traceInDebugOnly, MessageType messageType, DebugTraceOut
#endif // ANGLE_ENABLE_DEBUG_TRACE
}
void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...)
} // namespace
bool DebugAnnotationsActive()
{
va_list vararg;
va_start(vararg, format);
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
output(traceInDebugOnly, messageType, DebugTraceOutputTypeSetMarker, format, vararg);
return g_debugAnnotator != nullptr && g_debugAnnotator->getStatus();
#else
output(traceInDebugOnly, messageType, DebugTraceOutputTypeNone, format, vararg);
return false;
#endif
va_end(vararg);
}
bool perfActive()
void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator)
{
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
static bool active = GetDebugAnnotationWrapper()->getStatus();
return active;
#else
return false;
#endif
UninitializeDebugAnnotations();
g_debugAnnotator = debugAnnotator;
}
void UninitializeDebugAnnotations()
{
// Pointer is not managed.
g_debugAnnotator = nullptr;
}
void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...)
{
va_list vararg;
va_start(vararg, format);
output(traceInDebugOnly, messageType, DebugTraceOutputTypeSetMarker, format, vararg);
va_end(vararg);
}
ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
{
#if !defined(ANGLE_ENABLE_DEBUG_TRACE)
if (!perfActive())
if (!DebugAnnotationsActive())
{
return;
}
#endif // !ANGLE_ENABLE_DEBUG_TRACE
va_list vararg;
va_start(vararg, format);
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
output(true, MESSAGE_EVENT, DebugTraceOutputTypeBeginEvent, format, vararg);
#else
output(true, MESSAGE_EVENT, DebugTraceOutputTypeNone, format, vararg);
#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
va_end(vararg);
}
ScopedPerfEventHelper::~ScopedPerfEventHelper()
{
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
if (perfActive())
if (DebugAnnotationsActive())
{
GetDebugAnnotationWrapper()->endEvent();
g_debugAnnotator->endEvent();
}
#endif
}
}
......@@ -9,8 +9,9 @@
#ifndef COMMON_DEBUG_H_
#define COMMON_DEBUG_H_
#include <stdio.h>
#include <assert.h>
#include <stdio.h>
#include <string>
#include "common/angleutils.h"
......@@ -20,58 +21,77 @@
namespace gl
{
enum MessageType
{
MESSAGE_TRACE,
MESSAGE_FIXME,
MESSAGE_ERR,
MESSAGE_EVENT,
};
// Outputs text to the debugging log, or the debugging window
void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...);
// Returns whether D3DPERF is active.
bool perfActive();
// Pairs a D3D begin event with an end event.
class ScopedPerfEventHelper
{
public:
ScopedPerfEventHelper(const char* format, ...);
~ScopedPerfEventHelper();
private:
DISALLOW_COPY_AND_ASSIGN(ScopedPerfEventHelper);
};
void InitializeDebugAnnotations();
void UninitializeDebugAnnotations();
enum MessageType
{
MESSAGE_TRACE,
MESSAGE_FIXME,
MESSAGE_ERR,
MESSAGE_EVENT,
};
// Outputs text to the debugging log, or the debugging window
void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...);
// Pairs a D3D begin event with an end event.
class ScopedPerfEventHelper
{
public:
ScopedPerfEventHelper(const char* format, ...);
~ScopedPerfEventHelper();
private:
DISALLOW_COPY_AND_ASSIGN(ScopedPerfEventHelper);
};
// Wraps the D3D9/D3D11 debug annotation functions.
class DebugAnnotator
{
public:
DebugAnnotator() { };
virtual ~DebugAnnotator() { };
virtual void beginEvent(const std::wstring &eventName) = 0;
virtual void endEvent() = 0;
virtual void setMarker(const std::wstring &markerName) = 0;
virtual bool getStatus() = 0;
private:
DISALLOW_COPY_AND_ASSIGN(DebugAnnotator);
};
void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator);
void UninitializeDebugAnnotations();
bool DebugAnnotationsActive();
}
// A macro to output a trace of a function call and its arguments to the debugging log
#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#define ANGLE_TRACE_ENABLED
#endif
// A macro to output a trace of a function call and its arguments to the debugging log
#if defined(ANGLE_TRACE_ENABLED)
#define TRACE(message, ...) gl::trace(true, gl::MESSAGE_TRACE, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define TRACE(message, ...) (void(0))
#endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing.
#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#if defined(ANGLE_TRACE_ENABLED)
#define FIXME(message, ...) gl::trace(false, gl::MESSAGE_FIXME, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define FIXME(message, ...) (void(0))
#endif
// A macro to output a function call and its arguments to the debugging log, in case of error.
#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#if defined(ANGLE_TRACE_ENABLED)
#define ERR(message, ...) gl::trace(false, gl::MESSAGE_ERR, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define ERR(message, ...) (void(0))
#endif
// A macro to log a performance event around a scope.
#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#if defined(ANGLE_TRACE_ENABLED)
#if defined(_MSC_VER)
#define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__("%s" message "\n", __FUNCTION__, __VA_ARGS__);
#else
......@@ -81,6 +101,10 @@ namespace gl
#define EVENT(message, ...) (void(0))
#endif
#if defined(ANGLE_TRACE_ENABLED)
#undef ANGLE_TRACE_ENABLED
#endif
// A macro asserting a condition and outputting failures to the debug log
#if !defined(NDEBUG)
#define ASSERT(expression) do { \
......
......@@ -184,7 +184,7 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
ASSERT(mD3DCompileFunc);
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
if (gl::perfActive())
if (gl::DebugAnnotationsActive())
{
std::string sourcePath = getTempPath();
std::string sourceText = FormatString("#line 2 \"%s\"\n\n%s", sourcePath.c_str(), hlsl.c_str());
......
......@@ -167,7 +167,7 @@ void ShaderD3D::compileToHLSL(ShHandle compiler, const std::string &source)
std::string sourcePath;
#if !defined (ANGLE_ENABLE_WINDOWS_STORE)
if (gl::perfActive())
if (gl::DebugAnnotationsActive())
{
sourcePath = getTempPath();
writeFile(sourcePath.c_str(), source.c_str(), source.length());
......
//
// Copyright 2015 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.
//
// DebugAnnotator11.cpp: D3D11 helpers for adding trace annotations.
//
#include "libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h"
#include "common/debug.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
namespace rx
{
DebugAnnotator11::DebugAnnotator11()
: mInitialized(false),
mD3d11Module(nullptr),
mUserDefinedAnnotation(nullptr)
{
// D3D11 devices can't be created during DllMain.
// We defer device creation until the object is actually used.
}
DebugAnnotator11::~DebugAnnotator11()
{
if (mInitialized)
{
SafeRelease(mUserDefinedAnnotation);
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
FreeLibrary(mD3d11Module);
#endif // !ANGLE_ENABLE_WINDOWS_STORE
}
}
void DebugAnnotator11::beginEvent(const std::wstring &eventName)
{
initializeDevice();
mUserDefinedAnnotation->BeginEvent(eventName.c_str());
}
void DebugAnnotator11::endEvent()
{
initializeDevice();
mUserDefinedAnnotation->EndEvent();
}
void DebugAnnotator11::setMarker(const std::wstring &markerName)
{
initializeDevice();
mUserDefinedAnnotation->SetMarker(markerName.c_str());
}
bool DebugAnnotator11::getStatus()
{
// ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in Visual Studio 2013.
#if defined(_DEBUG) && defined(ANGLE_ENABLE_WINDOWS_STORE)
// In the Windows Store, we can use IDXGraphicsAnalysis. The call to GetDebugInterface1 only succeeds if the app is under capture.
// 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.
IDXGraphicsAnalysis *graphicsAnalysis;
DXGIGetDebugInterface1(0, IID_PPV_ARGS(&graphicsAnalysis));
bool underCapture = (graphicsAnalysis != nullptr);
SafeRelease(graphicsAnalysis);
return underCapture;
#endif // _DEBUG && !ANGLE_ENABLE_WINDOWS_STORE
// Otherwise, we have to return true here.
return true;
}
void DebugAnnotator11::initializeDevice()
{
if (!mInitialized)
{
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
mD3d11Module = LoadLibrary(TEXT("d3d11.dll"));
ASSERT(mD3d11Module);
PFN_D3D11_CREATE_DEVICE D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(mD3d11Module, "D3D11CreateDevice");
ASSERT(D3D11CreateDevice != nullptr);
#endif // !ANGLE_ENABLE_WINDOWS_STORE
ID3D11Device *device = nullptr;
ID3D11DeviceContext *context = nullptr;
HRESULT hr = E_FAIL;
// Create a D3D_DRIVER_TYPE_NULL device, which is much cheaper than other types of device.
hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, &device, nullptr, &context);
ASSERT(SUCCEEDED(hr));
mUserDefinedAnnotation = d3d11::DynamicCastComObject<ID3DUserDefinedAnnotation>(context);
ASSERT(mUserDefinedAnnotation != nullptr);
SafeRelease(device);
SafeRelease(context);
mInitialized = true;
}
}
}
//
// Copyright 2015 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.
//
// DebugAnnotator11.h: D3D11 helpers for adding trace annotations.
//
#ifndef LIBANGLE_RENDERER_D3D_D3D11_DEBUGANNOTATOR11_H_
#define LIBANGLE_RENDERER_D3D_D3D11_DEBUGANNOTATOR11_H_
#include "common/debug.h"
namespace rx
{
class DebugAnnotator11 : public gl::DebugAnnotator
{
public:
DebugAnnotator11();
~DebugAnnotator11() override;
void beginEvent(const std::wstring &eventName) override;
void endEvent() override;
void setMarker(const std::wstring &markerName) override;
bool getStatus() override;
private:
void initializeDevice();
bool mInitialized;
HMODULE mD3d11Module;
ID3DUserDefinedAnnotation *mUserDefinedAnnotation;
DISALLOW_COPY_AND_ASSIGN(DebugAnnotator11);
};
}
#endif // LIBANGLE_RENDERER_D3D_D3D11_DEBUGANNOTATOR11_H_
......@@ -150,6 +150,9 @@ Renderer11::Renderer11(egl::Display *display)
mStateCache(this),
mDebug(nullptr)
{
// Initialize global annotator
gl::InitializeDebugAnnotations(&mAnnotator);
mVertexDataManager = NULL;
mIndexDataManager = NULL;
......@@ -2201,7 +2204,7 @@ bool Renderer11::getShareHandleSupport() const
// chrome needs BGRA. Once chrome fixes this, we should always support them.
// PIX doesn't seem to support using share handles, so disable them.
// Also disable share handles on Feature Level 9_3, since it doesn't support share handles on RGBA8 textures/swapchains.
return getRendererExtensions().textureFormatBGRA8888 && !gl::perfActive() && !(mFeatureLevel <= D3D_FEATURE_LEVEL_9_3);
return getRendererExtensions().textureFormatBGRA8888 && !gl::DebugAnnotationsActive() && !(mFeatureLevel <= D3D_FEATURE_LEVEL_9_3);
}
bool Renderer11::getPostSubBufferSupport() const
......@@ -2775,7 +2778,7 @@ gl::Error Renderer11::compileToExecutable(gl::InfoLog &infoLog, const std::strin
UINT flags = D3DCOMPILE_OPTIMIZATION_LEVEL2;
if (gl::perfActive())
if (gl::DebugAnnotationsActive())
{
#ifndef NDEBUG
flags = D3DCOMPILE_SKIP_OPTIMIZATION;
......
......@@ -10,16 +10,15 @@
#define LIBANGLE_RENDERER_D3D_D3D11_RENDERER11_H_
#include "common/angleutils.h"
#include "libANGLE/angletypes.h"
#include "common/mathutil.h"
#include "libANGLE/renderer/d3d/d3d11/RenderStateCache.h"
#include "libANGLE/renderer/d3d/d3d11/InputLayoutCache.h"
#include "libANGLE/AttributeMap.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/renderer/d3d/HLSLCompiler.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/AttributeMap.h"
#include "libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h"
#include "libANGLE/renderer/d3d/d3d11/InputLayoutCache.h"
#include "libANGLE/renderer/d3d/d3d11/RenderStateCache.h"
namespace gl
{
......@@ -385,6 +384,8 @@ class Renderer11 : public RendererD3D
char mDescription[128];
DXGIFactory *mDxgiFactory;
ID3D11Debug *mDebug;
DebugAnnotator11 mAnnotator;
};
}
......
//
// Copyright 2015 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.
//
// DebugAnnotator9.h: D3D9 helpers for adding trace annotations.
//
#include "libANGLE/renderer/d3d/d3d9/DebugAnnotator9.h"
#include "common/platform.h"
namespace rx
{
void DebugAnnotator9::beginEvent(const std::wstring &eventName)
{
D3DPERF_BeginEvent(0, eventName.c_str());
}
void DebugAnnotator9::endEvent()
{
D3DPERF_EndEvent();
}
void DebugAnnotator9::setMarker(const std::wstring &markerName)
{
D3DPERF_SetMarker(0, markerName.c_str());
}
bool DebugAnnotator9::getStatus()
{
return !!D3DPERF_GetStatus();
}
}
//
// Copyright 2015 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.
//
// DebugAnnotator9.h: D3D9 helpers for adding trace annotations.
//
#ifndef LIBANGLE_RENDERER_D3D_D3D9_DEBUGANNOTATOR9_H_
#define LIBANGLE_RENDERER_D3D_D3D9_DEBUGANNOTATOR9_H_
#include "common/debug.h"
namespace rx
{
class DebugAnnotator9 : public gl::DebugAnnotator
{
public:
DebugAnnotator9() {}
void beginEvent(const std::wstring &eventName) override;
void endEvent() override;
void setMarker(const std::wstring &markerName) override;
bool getStatus() override;
DISALLOW_COPY_AND_ASSIGN(DebugAnnotator9);
};
}
#endif // LIBANGLE_RENDERER_D3D_D3D9_DEBUGANNOTATOR9_H_
......@@ -79,6 +79,9 @@ enum
Renderer9::Renderer9(egl::Display *display)
: RendererD3D(display)
{
// Initialize global annotator
gl::InitializeDebugAnnotations(&mAnnotator);
mD3d9Module = NULL;
mD3d9 = NULL;
......@@ -2479,7 +2482,7 @@ unsigned int Renderer9::getReservedFragmentUniformBuffers() const
bool Renderer9::getShareHandleSupport() const
{
// PIX doesn't seem to support using share handles, so disable them.
return (mD3d9Ex != NULL) && !gl::perfActive();
return (mD3d9Ex != NULL) && !gl::DebugAnnotationsActive();
}
bool Renderer9::getPostSubBufferSupport() const
......@@ -2746,7 +2749,7 @@ gl::Error Renderer9::compileToExecutable(gl::InfoLog &infoLog, const std::string
flags = D3DCOMPILE_OPTIMIZATION_LEVEL3;
}
if (gl::perfActive())
if (gl::DebugAnnotationsActive())
{
#ifndef NDEBUG
flags = D3DCOMPILE_SKIP_OPTIMIZATION;
......
......@@ -11,11 +11,12 @@
#include "common/angleutils.h"
#include "common/mathutil.h"
#include "libANGLE/renderer/d3d/d3d9/ShaderCache.h"
#include "libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h"
#include "libANGLE/renderer/d3d/HLSLCompiler.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/renderer/d3d/d3d9/DebugAnnotator9.h"
#include "libANGLE/renderer/d3d/d3d9/ShaderCache.h"
#include "libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h"
namespace gl
{
......@@ -367,6 +368,7 @@ class Renderer9 : public RendererD3D
} mNullColorbufferCache[NUM_NULL_COLORBUFFER_CACHE_ENTRIES];
UINT mMaxNullColorbufferLRU;
DebugAnnotator9 mAnnotator;
};
}
......
......@@ -212,6 +212,8 @@
'libANGLE/renderer/d3d/d3d9/Blit9.h',
'libANGLE/renderer/d3d/d3d9/Buffer9.cpp',
'libANGLE/renderer/d3d/d3d9/Buffer9.h',
'libANGLE/renderer/d3d/d3d9/DebugAnnotator9.cpp',
'libANGLE/renderer/d3d/d3d9/DebugAnnotator9.h',
'libANGLE/renderer/d3d/d3d9/Fence9.cpp',
'libANGLE/renderer/d3d/d3d9/Fence9.h',
'libANGLE/renderer/d3d/d3d9/formatutils9.cpp',
......@@ -259,6 +261,8 @@
'libANGLE/renderer/d3d/d3d11/Clear11.h',
'libANGLE/renderer/d3d/d3d11/copyvertex.h',
'libANGLE/renderer/d3d/d3d11/copyvertex.inl',
'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp',
'libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h',
'libANGLE/renderer/d3d/d3d11/Fence11.cpp',
'libANGLE/renderer/d3d/d3d11/Fence11.h',
'libANGLE/renderer/d3d/d3d11/formatutils11.cpp',
......@@ -670,16 +674,6 @@
'ANGLE_ENABLE_DEBUG_ANNOTATIONS',
'ANGLE_GENERATE_SHADER_DEBUG_INFO'
],
'msvs_settings':
{
'VCLinkerTool':
{
'AdditionalDependencies':
[
'd3d9.lib',
]
}
},
},
},
}],
......
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