瀏覽代碼

Store the command queue into device in D3D12 renderer

Minmin Gong 5 年之前
父節點
當前提交
ca509c136d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/renderer_d3d12.cpp

+ 3 - 0
src/renderer_d3d12.cpp

@@ -927,6 +927,7 @@ namespace bgfx { namespace d3d12
 			initHeapProperties(m_device);
 			initHeapProperties(m_device);
 
 
 			m_cmd.init(m_device);
 			m_cmd.init(m_device);
+			m_device->SetPrivateDataInterface(IID_ID3D12CommandQueue, m_cmd.m_commandQueue);
 			errorState = ErrorState::CreatedCommandQueue;
 			errorState = ErrorState::CreatedCommandQueue;
 
 
 			if (NULL == g_platformData.backBuffer)
 			if (NULL == g_platformData.backBuffer)
@@ -1360,6 +1361,7 @@ namespace bgfx { namespace d3d12
 			switch (errorState)
 			switch (errorState)
 			{
 			{
 			case ErrorState::CreatedCommandQueue:
 			case ErrorState::CreatedCommandQueue:
+				m_device->SetPrivateDataInterface(IID_ID3D12CommandQueue, NULL);
 				m_cmd.shutdown();
 				m_cmd.shutdown();
 				BX_FALLTHROUGH;
 				BX_FALLTHROUGH;
 
 
@@ -1447,6 +1449,7 @@ namespace bgfx { namespace d3d12
 			DX_RELEASE(m_msaaRt, 0);
 			DX_RELEASE(m_msaaRt, 0);
 			DX_RELEASE(m_swapChain, 0);
 			DX_RELEASE(m_swapChain, 0);
 
 
+			m_device->SetPrivateDataInterface(IID_ID3D12CommandQueue, NULL);
 			m_cmd.shutdown();
 			m_cmd.shutdown();
 
 
 			DX_RELEASE(m_device, 0);
 			DX_RELEASE(m_device, 0);