diff --git a/README.md b/README.md index a1a01d073..c05141e3e 100644 --- a/README.md +++ b/README.md @@ -411,10 +411,22 @@ build errors. Debugging --------- +### RenderDoc + When using DX11 renderer, you can drop in `renderdoc.dll` into working directory, and it will be automatically loaded during bgfx initialization. This allows frame capture at any time by pressing **F11**. +Download: [RenderDoc](https://renderdoc.org/builds) + +### IntelGPA + +Right click **Intel GPA Monitor** tray icon, choose preferences, check +"Auto-detect launched applications" option. Find `InjectionList.txt` in GPA +directory and add `examples-*` to the list. + +Download: [IntelGPA](https://software.intel.com/en-us/vcsource/tools/intel-gpa) + Other debuggers: | Name | OS | DX9 | DX11 | GL | GLES | Source | @@ -424,11 +436,9 @@ Other debuggers: | IntelGPA | Linux/OSX/Win | x | x | | x | | | RenderDoc | Win | | x | | | x | +Download: [APITrace](https://apitrace.github.io/) [CodeXL](http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/) -[IntelGPA](https://software.intel.com/en-us/vcsource/tools/intel-gpa) -[RenderDoc](http://cryengine.com/renderdoc) - SDL, GLFW, etc. --------------- diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 7ecf1ac88..bfa940170 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -533,6 +533,19 @@ namespace bgfx m_fmtDepth = D3DFMT_D24FS8; #endif // BX_PLATFORM_WINDOWS + { + IDirect3DSwapChain9* swapChain; + DX_CHECK(m_device->GetSwapChain(0, &swapChain) ); + + // GPA increases swapchain ref count. + // + // This causes assert in debug. When debugger is present refcount + // checks are off. + setGraphicsDebuggerPresent(1 != getRefCount(swapChain) ); + + DX_RELEASE(swapChain, 0); + } + postReset(); m_initialized = true;