@@ -34,7 +34,7 @@ namespace EduEngine
34
34
{ m_GPUDescriptorHeaps[0 ], 2048 , " CBV_SRV_UAV_DynSuballocationMgr" },
35
35
{ m_GPUDescriptorHeaps[1 ], 2048 , " SAMPLER_DynSuballocationMgr" }
36
36
},
37
- m_DynUploadHeap { true , this , 2048 }
37
+ m_DynUploadHeap{ true , this , 2048 }
38
38
{
39
39
}
40
40
@@ -114,14 +114,13 @@ namespace EduEngine
114
114
auto numDirectNextCmdLists = m_CommandQueues[0 ].GetNextCmdListNum ();
115
115
auto numComputeNextCmdLists = m_CommandQueues[1 ].GetNextCmdListNum ();
116
116
117
- auto minCompletedCmdList = std::min (numDirectCompletedCmdLists, numComputeCompletedCmdLists);
118
- auto maxNextCmdList = std::max (numDirectNextCmdLists, numComputeNextCmdLists);
117
+ FenceValues completedFences = { numDirectCompletedCmdLists, numComputeCompletedCmdLists };
119
118
120
119
while (!m_ReleaseObjectsQueue.empty ())
121
120
{
122
121
auto & firstObj = m_ReleaseObjectsQueue.front ();
123
122
// GPU must have been idled when ForceRelease == true
124
- if (firstObj.first < minCompletedCmdList || forceRelease)
123
+ if (firstObj.first < completedFences || forceRelease)
125
124
m_ReleaseObjectsQueue.pop_front ();
126
125
else
127
126
break ;
@@ -130,7 +129,7 @@ namespace EduEngine
130
129
for (size_t i = 0 ; i < 2 ; i++)
131
130
m_DynamicSuballocationMgr[i].DiscardAllocations ();
132
131
133
- m_DynUploadHeap.FinishFrame (maxNextCmdList, minCompletedCmdList );
132
+ m_DynUploadHeap.FinishFrame ({ numDirectNextCmdLists, numComputeNextCmdLists }, { numDirectCompletedCmdLists, numComputeCompletedCmdLists } );
134
133
}
135
134
136
135
void RenderDeviceD3D12::FlushQueues ()
@@ -144,8 +143,6 @@ namespace EduEngine
144
143
uint64_t directNum = m_CommandQueues[0 ].GetNextCmdListNum ();
145
144
uint64_t computeNum = m_CommandQueues[1 ].GetNextCmdListNum ();
146
145
147
- uint64_t max = directNum > computeNum ? directNum : computeNum;
148
-
149
- m_ReleaseObjectsQueue.emplace_back (max, std::move (wrapper));
146
+ m_ReleaseObjectsQueue.emplace_back (FenceValues{ directNum, computeNum }, std::move (wrapper));
150
147
}
151
148
}
0 commit comments