mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[idd] capture: define immutable texture products
This commit is contained in:
@@ -236,8 +236,11 @@ void CD3D12CommandSlot::Cancel()
|
||||
SetEvent(m_availableEvent.Get());
|
||||
}
|
||||
|
||||
bool CD3D12CommandSlot::Execute()
|
||||
bool CD3D12CommandSlot::Execute(D12Sync * sync)
|
||||
{
|
||||
if (sync)
|
||||
*sync = D12Sync {};
|
||||
|
||||
State expected = STATE_RECORDING;
|
||||
if (!Atomic::CAS(m_state, expected, STATE_SUBMITTED,
|
||||
std::memory_order_acq_rel))
|
||||
@@ -256,7 +259,7 @@ bool CD3D12CommandSlot::Execute()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_queue->Submit(*this))
|
||||
if (m_queue->Submit(*this, sync))
|
||||
return true;
|
||||
|
||||
if (!Atomic::Load(m_submitted, std::memory_order_acquire))
|
||||
@@ -572,7 +575,7 @@ void CD3D12CommandQueue::WaitForIdle()
|
||||
}
|
||||
}
|
||||
|
||||
bool CD3D12CommandQueue::Submit(CD3D12CommandSlot& slot)
|
||||
bool CD3D12CommandQueue::Submit(CD3D12CommandSlot& slot, D12Sync * sync)
|
||||
{
|
||||
bool result = false;
|
||||
CSRWExclusiveLock lock(m_submitLock);
|
||||
@@ -612,6 +615,14 @@ bool CD3D12CommandQueue::Submit(CD3D12CommandSlot& slot)
|
||||
break;
|
||||
}
|
||||
|
||||
// Capture the immutable point while submission is serialized. The slot
|
||||
// may complete and be acquired again as soon as we leave this scope.
|
||||
if (sync)
|
||||
{
|
||||
sync->fence = m_fence;
|
||||
sync->value = fenceTarget;
|
||||
}
|
||||
|
||||
hr = m_fence->SetEventOnCompletion(fenceTarget, slot.m_event.Get());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user