Commit 75da1974 by Cooper Partin Committed by Jamie Madill

Changed d3d11 desktop renderer to use d3d9 debug annotation interfaces.

The D3D11 renderer must choose the D3D9 debug annotator because the D3D11 interface method ID3DUserDefinedAnnotation::GetStatus on desktop builds doesn't work with the Graphics Diagnostics tools in Visual Studio 2013. The D3D9 annotator works properly for both D3D11 and D3D9. Incorrect status reporting can cause ANGLE to log unnecessary debug events. Change-Id: I9a31c63cbc506904eb39577826fc4df8d503f03a Reviewed-on: https://chromium-review.googlesource.com/278162Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCooper Partin <coopp@microsoft.com> Tested-by: 's avatarCooper Partin <coopp@microsoft.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 03786d77
...@@ -114,11 +114,21 @@ config("translator_static_config") { ...@@ -114,11 +114,21 @@ config("translator_static_config") {
defines = [ "ANGLE_TRANSLATOR_STATIC" ] defines = [ "ANGLE_TRANSLATOR_STATIC" ]
} }
config("debug_annotations_config") {
if (is_debug) {
defines = [
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
]
}
}
static_library("angle_common") { static_library("angle_common") {
sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src") sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src")
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ configs += [
":internal_config", ":internal_config",
":debug_annotations_config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
} }
...@@ -260,13 +270,13 @@ static_library("libANGLE") { ...@@ -260,13 +270,13 @@ static_library("libANGLE") {
if (is_debug) { if (is_debug) {
defines += [ defines += [
"ANGLE_GENERATE_SHADER_DEBUG_INFO", "ANGLE_GENERATE_SHADER_DEBUG_INFO",
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
] ]
} }
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ configs += [
":commit_id_config", ":commit_id_config",
":debug_annotations_config",
":libANGLE_config", ":libANGLE_config",
":internal_config", ":internal_config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
...@@ -296,6 +306,7 @@ shared_library("libGLESv2") { ...@@ -296,6 +306,7 @@ shared_library("libGLESv2") {
configs += [ configs += [
":internal_config", ":internal_config",
":commit_id_config", ":commit_id_config",
":debug_annotations_config",
":libANGLE_config", ":libANGLE_config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
......
...@@ -61,6 +61,22 @@ ...@@ -61,6 +61,22 @@
'<(angle_path)/src', '<(angle_path)/src',
'<(angle_path)/include', '<(angle_path)/include',
], ],
'conditions':
[
['OS=="win"',
{
'configurations':
{
'Debug_Base':
{
'defines':
[
'ANGLE_ENABLE_DEBUG_ANNOTATIONS'
],
},
},
}],
],
}, },
'conditions': 'conditions':
[ [
...@@ -73,6 +89,19 @@ ...@@ -73,6 +89,19 @@
{ {
'msvs_enable_winphone' : '1', 'msvs_enable_winphone' : '1',
}], }],
['OS=="win"',
{
'configurations':
{
'Debug_Base':
{
'defines':
[
'ANGLE_ENABLE_DEBUG_ANNOTATIONS'
],
},
},
}],
], ],
}, },
......
...@@ -648,15 +648,15 @@ void RendererD3D::popGroupMarker() ...@@ -648,15 +648,15 @@ void RendererD3D::popGroupMarker()
getAnnotator()->endEvent(); getAnnotator()->endEvent();
} }
gl::DebugAnnotator *RendererD3D::getAnnotator() void RendererD3D::initializeDebugAnnotator()
{ {
if (mAnnotator == nullptr) createAnnotator();
{ ASSERT(mAnnotator);
createAnnotator(); gl::InitializeDebugAnnotations(mAnnotator);
ASSERT(mAnnotator); }
gl::InitializeDebugAnnotations(mAnnotator);
}
gl::DebugAnnotator *RendererD3D::getAnnotator()
{
ASSERT(mAnnotator); ASSERT(mAnnotator);
return mAnnotator; return mAnnotator;
} }
......
...@@ -224,6 +224,7 @@ class RendererD3D : public Renderer, public BufferFactoryD3D ...@@ -224,6 +224,7 @@ class RendererD3D : public Renderer, public BufferFactoryD3D
egl::Display *mDisplay; egl::Display *mDisplay;
bool mDeviceLost; bool mDeviceLost;
void initializeDebugAnnotator();
gl::DebugAnnotator *mAnnotator; gl::DebugAnnotator *mAnnotator;
std::vector<TranslatedAttribute> mTranslatedAttribCache; std::vector<TranslatedAttribute> mTranslatedAttribCache;
......
...@@ -51,6 +51,14 @@ ...@@ -51,6 +51,14 @@
#include "libANGLE/renderer/d3d/d3d11/dxgi_support_table.h" #include "libANGLE/renderer/d3d/d3d11/dxgi_support_table.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h" #include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" #include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
// Include the D3D9 debug annotator header for use by the desktop D3D11 renderer
// because the D3D11 interface method ID3DUserDefinedAnnotation::GetStatus
// doesn't work with the Graphics Diagnostics tools in Visual Studio 2013.
#ifdef ANGLE_ENABLE_D3D9
#include "libANGLE/renderer/d3d/d3d9/DebugAnnotator9.h"
#endif
#include "third_party/trace_event/trace_event.h" #include "third_party/trace_event/trace_event.h"
// Enable ANGLE_SKIP_DXGI_1_2_CHECK if there is not a possibility of using cross-process // Enable ANGLE_SKIP_DXGI_1_2_CHECK if there is not a possibility of using cross-process
...@@ -328,6 +336,8 @@ Renderer11::Renderer11(egl::Display *display) ...@@ -328,6 +336,8 @@ Renderer11::Renderer11(egl::Display *display)
default: default:
UNREACHABLE(); UNREACHABLE();
} }
initializeDebugAnnotator();
} }
Renderer11::~Renderer11() Renderer11::~Renderer11()
...@@ -3772,7 +3782,16 @@ void Renderer11::setShaderResource(gl::SamplerType shaderType, UINT resourceSlot ...@@ -3772,7 +3782,16 @@ void Renderer11::setShaderResource(gl::SamplerType shaderType, UINT resourceSlot
void Renderer11::createAnnotator() void Renderer11::createAnnotator()
{ {
// The D3D11 renderer must choose the D3D9 debug annotator because the D3D11 interface
// method ID3DUserDefinedAnnotation::GetStatus on desktop builds doesn't work with the Graphics
// Diagnostics tools in Visual Studio 2013.
// The D3D9 annotator works properly for both D3D11 and D3D9.
// Incorrect status reporting can cause ANGLE to log unnecessary debug events.
#ifdef ANGLE_ENABLE_D3D9
mAnnotator = new DebugAnnotator9();
#else
mAnnotator = new DebugAnnotator11(); mAnnotator = new DebugAnnotator11();
#endif
} }
gl::Error Renderer11::clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd) gl::Error Renderer11::clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd)
......
...@@ -131,6 +131,8 @@ Renderer9::Renderer9(egl::Display *display) ...@@ -131,6 +131,8 @@ Renderer9::Renderer9(egl::Display *display)
mAppliedVertexShader = NULL; mAppliedVertexShader = NULL;
mAppliedPixelShader = NULL; mAppliedPixelShader = NULL;
mAppliedProgramSerial = 0; mAppliedProgramSerial = 0;
initializeDebugAnnotator();
} }
Renderer9::~Renderer9() Renderer9::~Renderer9()
......
...@@ -722,27 +722,12 @@ ...@@ -722,27 +722,12 @@
{ {
'msvs_enable_winphone' : '1', 'msvs_enable_winphone' : '1',
}], }],
['OS=="win"',
{
'configurations':
{
'Debug_Base':
{
'abstract': 1,
'defines':
[
'ANGLE_ENABLE_DEBUG_ANNOTATIONS',
'ANGLE_GENERATE_SHADER_DEBUG_INFO'
],
},
},
}],
], ],
}, },
{ {
'target_name': 'libGLESv2', 'target_name': 'libGLESv2',
'type': 'shared_library', 'type': 'shared_library',
'dependencies': [ 'libANGLE' ], 'dependencies': [ 'libANGLE', 'angle_common' ],
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'sources': 'sources':
[ [
......
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