From 5bca3eca85314cf8a67143d8e72f0ff3a6140781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 14 Aug 2015 19:32:36 -0700 Subject: [PATCH] Cleanup. --- src/renderer_d3d.h | 4 +++- src/renderer_d3d12.cpp | 2 ++ src/renderer_d3d12.h | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer_d3d.h b/src/renderer_d3d.h index d281d8c90..99f50babd 100644 --- a/src/renderer_d3d.h +++ b/src/renderer_d3d.h @@ -225,7 +225,9 @@ namespace bgfx HashMap::iterator it = m_hashMap.find(_hash); if (it != m_hashMap.end() ) { - return &m_data[it->second].m_value; + uint16_t handle = it->second; + m_alloc.touch(handle); + return &m_data[handle].m_value; } return NULL; diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 2dd8a1688..701e41bd8 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1467,6 +1467,8 @@ namespace bgfx { namespace d3d12 void postReset() { + memset(m_backBufferColorFence, 0, sizeof(m_backBufferColorFence) ); + uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV); for (uint32_t ii = 0, num = m_scd.BufferCount; ii < num; ++ii) diff --git a/src/renderer_d3d12.h b/src/renderer_d3d12.h index 2162cfc3e..f6922c6ee 100644 --- a/src/renderer_d3d12.h +++ b/src/renderer_d3d12.h @@ -296,6 +296,7 @@ namespace bgfx { namespace d3d12 { CommandQueue() : m_control(BX_COUNTOF(m_commandList) ) + , m_completedFence(0) { BX_STATIC_ASSERT(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) ); } @@ -312,7 +313,8 @@ namespace bgfx { namespace d3d12 , (void**)&m_commandQueue ) ); - m_currentFence = 0; + m_completedFence = 0; + m_currentFence = 0; DX_CHECK(_device->CreateFence(0 , D3D12_FENCE_FLAG_NONE , __uuidof(ID3D12Fence)