Branimir Karadžić 11 роки тому
батько
коміт
d35c14164b
2 змінених файлів з 26 додано та 3 видалено
  1. 13 3
      README.md
  2. 13 0
      src/renderer_d3d9.cpp

+ 13 - 3
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.
 ---------------

+ 13 - 0
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;