зеркало из https://github.com/AvaloniaUI/angle.git
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/278162 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cooper Partin <coopp@microsoft.com> Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Родитель
03786d77a6
Коммит
75da1974b9
13
BUILD.gn
13
BUILD.gn
|
@ -114,11 +114,21 @@ config("translator_static_config") {
|
|||
defines = [ "ANGLE_TRANSLATOR_STATIC" ]
|
||||
}
|
||||
|
||||
config("debug_annotations_config") {
|
||||
if (is_debug) {
|
||||
defines = [
|
||||
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
static_library("angle_common") {
|
||||
sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src")
|
||||
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [
|
||||
":internal_config",
|
||||
":debug_annotations_config",
|
||||
"//build/config/compiler:no_chromium_code",
|
||||
]
|
||||
}
|
||||
|
@ -260,13 +270,13 @@ static_library("libANGLE") {
|
|||
if (is_debug) {
|
||||
defines += [
|
||||
"ANGLE_GENERATE_SHADER_DEBUG_INFO",
|
||||
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
|
||||
]
|
||||
}
|
||||
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [
|
||||
":commit_id_config",
|
||||
":debug_annotations_config",
|
||||
":libANGLE_config",
|
||||
":internal_config",
|
||||
"//build/config/compiler:no_chromium_code",
|
||||
|
@ -296,6 +306,7 @@ shared_library("libGLESv2") {
|
|||
configs += [
|
||||
":internal_config",
|
||||
":commit_id_config",
|
||||
":debug_annotations_config",
|
||||
":libANGLE_config",
|
||||
"//build/config/compiler:no_chromium_code",
|
||||
]
|
||||
|
|
|
@ -61,6 +61,22 @@
|
|||
'<(angle_path)/src',
|
||||
'<(angle_path)/include',
|
||||
],
|
||||
'conditions':
|
||||
[
|
||||
['OS=="win"',
|
||||
{
|
||||
'configurations':
|
||||
{
|
||||
'Debug_Base':
|
||||
{
|
||||
'defines':
|
||||
[
|
||||
'ANGLE_ENABLE_DEBUG_ANNOTATIONS'
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
},
|
||||
'conditions':
|
||||
[
|
||||
|
@ -73,6 +89,19 @@
|
|||
{
|
||||
'msvs_enable_winphone' : '1',
|
||||
}],
|
||||
['OS=="win"',
|
||||
{
|
||||
'configurations':
|
||||
{
|
||||
'Debug_Base':
|
||||
{
|
||||
'defines':
|
||||
[
|
||||
'ANGLE_ENABLE_DEBUG_ANNOTATIONS'
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
||||
|
|
|
@ -648,15 +648,15 @@ void RendererD3D::popGroupMarker()
|
|||
getAnnotator()->endEvent();
|
||||
}
|
||||
|
||||
void RendererD3D::initializeDebugAnnotator()
|
||||
{
|
||||
createAnnotator();
|
||||
ASSERT(mAnnotator);
|
||||
gl::InitializeDebugAnnotations(mAnnotator);
|
||||
}
|
||||
|
||||
gl::DebugAnnotator *RendererD3D::getAnnotator()
|
||||
{
|
||||
if (mAnnotator == nullptr)
|
||||
{
|
||||
createAnnotator();
|
||||
ASSERT(mAnnotator);
|
||||
gl::InitializeDebugAnnotations(mAnnotator);
|
||||
}
|
||||
|
||||
ASSERT(mAnnotator);
|
||||
return mAnnotator;
|
||||
}
|
||||
|
|
|
@ -224,6 +224,7 @@ class RendererD3D : public Renderer, public BufferFactoryD3D
|
|||
egl::Display *mDisplay;
|
||||
bool mDeviceLost;
|
||||
|
||||
void initializeDebugAnnotator();
|
||||
gl::DebugAnnotator *mAnnotator;
|
||||
|
||||
std::vector<TranslatedAttribute> mTranslatedAttribCache;
|
||||
|
|
|
@ -51,6 +51,14 @@
|
|||
#include "libANGLE/renderer/d3d/d3d11/dxgi_support_table.h"
|
||||
#include "libANGLE/renderer/d3d/d3d11/formatutils11.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"
|
||||
|
||||
// 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)
|
|||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
initializeDebugAnnotator();
|
||||
}
|
||||
|
||||
Renderer11::~Renderer11()
|
||||
|
@ -3772,7 +3782,16 @@ void Renderer11::setShaderResource(gl::SamplerType shaderType, UINT resourceSlot
|
|||
|
||||
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();
|
||||
#endif
|
||||
}
|
||||
|
||||
gl::Error Renderer11::clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd)
|
||||
|
|
|
@ -131,6 +131,8 @@ Renderer9::Renderer9(egl::Display *display)
|
|||
mAppliedVertexShader = NULL;
|
||||
mAppliedPixelShader = NULL;
|
||||
mAppliedProgramSerial = 0;
|
||||
|
||||
initializeDebugAnnotator();
|
||||
}
|
||||
|
||||
Renderer9::~Renderer9()
|
||||
|
|
|
@ -722,27 +722,12 @@
|
|||
{
|
||||
'msvs_enable_winphone' : '1',
|
||||
}],
|
||||
['OS=="win"',
|
||||
{
|
||||
'configurations':
|
||||
{
|
||||
'Debug_Base':
|
||||
{
|
||||
'abstract': 1,
|
||||
'defines':
|
||||
[
|
||||
'ANGLE_ENABLE_DEBUG_ANNOTATIONS',
|
||||
'ANGLE_GENERATE_SHADER_DEBUG_INFO'
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'libGLESv2',
|
||||
'type': 'shared_library',
|
||||
'dependencies': [ 'libANGLE' ],
|
||||
'dependencies': [ 'libANGLE', 'angle_common' ],
|
||||
'includes': [ '../build/common_defines.gypi', ],
|
||||
'sources':
|
||||
[
|
||||
|
|
Загрузка…
Ссылка в новой задаче