From 06d7f17aeea895fd135d1b56dd4e1574e8fae3f7 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 | 4 +++- src/renderer_d3d12.h | 4 +++- 3 files changed, 9 insertions(+), 3 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..438dff26d 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) @@ -2847,7 +2849,7 @@ data.NumQualityLevels = 0; { ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, _size); uint8_t* data; - DX_CHECK(staging->Map(0, nullptr, (void**)&data) ); + DX_CHECK(staging->Map(0, NULL, (void**)&data) ); memcpy(data, _data, _size); staging->Unmap(0, NULL); 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)