mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[d3d9] Wait for submission when calling ReturnUnderlyingResource
This commit is contained in:
parent
ef4428ab8c
commit
0beb18ef73
@ -5672,10 +5672,13 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <bool Synchronize9On12>
|
||||||
void D3D9DeviceEx::Flush() {
|
void D3D9DeviceEx::ExecuteFlush() {
|
||||||
D3D9DeviceLock lock = LockDevice();
|
D3D9DeviceLock lock = LockDevice();
|
||||||
|
|
||||||
|
if constexpr (Synchronize9On12)
|
||||||
|
m_submitStatus.result = VK_NOT_READY;
|
||||||
|
|
||||||
m_initializer->Flush();
|
m_initializer->Flush();
|
||||||
m_converter->Flush();
|
m_converter->Flush();
|
||||||
|
|
||||||
@ -5687,16 +5690,32 @@ namespace dxvk {
|
|||||||
|
|
||||||
EmitCs<false>([
|
EmitCs<false>([
|
||||||
cSubmissionFence = m_submissionFence,
|
cSubmissionFence = m_submissionFence,
|
||||||
cSubmissionId = submissionId
|
cSubmissionId = submissionId,
|
||||||
|
cSubmissionStatus = Synchronize9On12 ? &m_submitStatus : nullptr
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
ctx->signal(cSubmissionFence, cSubmissionId);
|
ctx->signal(cSubmissionFence, cSubmissionId);
|
||||||
ctx->flushCommandList(nullptr);
|
ctx->flushCommandList(cSubmissionStatus);
|
||||||
});
|
});
|
||||||
|
|
||||||
FlushCsChunk();
|
FlushCsChunk();
|
||||||
|
|
||||||
m_flushSeqNum = m_csSeqNum;
|
m_flushSeqNum = m_csSeqNum;
|
||||||
m_flushTracker.notifyFlush(m_flushSeqNum, submissionId);
|
m_flushTracker.notifyFlush(m_flushSeqNum, submissionId);
|
||||||
|
|
||||||
|
// If necessary, block calling thread until the
|
||||||
|
// Vulkan queue submission is performed.
|
||||||
|
if constexpr (Synchronize9On12)
|
||||||
|
m_dxvkDevice->waitForSubmission(&m_submitStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D9DeviceEx::Flush() {
|
||||||
|
ExecuteFlush<false>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D9DeviceEx::FlushAndSync9On12() {
|
||||||
|
ExecuteFlush<true>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -793,6 +793,7 @@ namespace dxvk {
|
|||||||
void SynchronizeCsThread(uint64_t SequenceNumber);
|
void SynchronizeCsThread(uint64_t SequenceNumber);
|
||||||
|
|
||||||
void Flush();
|
void Flush();
|
||||||
|
void FlushAndSync9On12();
|
||||||
|
|
||||||
void EndFrame();
|
void EndFrame();
|
||||||
|
|
||||||
@ -1059,6 +1060,9 @@ namespace dxvk {
|
|||||||
return std::exchange(m_deviceHasBeenReset, false);
|
return std::exchange(m_deviceHasBeenReset, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <bool Synchronize9On12>
|
||||||
|
void ExecuteFlush();
|
||||||
|
|
||||||
void DetermineConstantLayouts(bool canSWVP);
|
void DetermineConstantLayouts(bool canSWVP);
|
||||||
|
|
||||||
D3D9BufferSlice AllocUPBuffer(VkDeviceSize size);
|
D3D9BufferSlice AllocUPBuffer(VkDeviceSize size);
|
||||||
@ -1421,6 +1425,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
Rc<sync::Fence> m_submissionFence;
|
Rc<sync::Fence> m_submissionFence;
|
||||||
uint64_t m_submissionId = 0ull;
|
uint64_t m_submissionId = 0ull;
|
||||||
|
DxvkSubmitStatus m_submitStatus;
|
||||||
|
|
||||||
uint64_t m_flushSeqNum = 0ull;
|
uint64_t m_flushSeqNum = 0ull;
|
||||||
GpuFlushTracker m_flushTracker;
|
GpuFlushTracker m_flushTracker;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace dxvk {
|
|||||||
if (num_sync)
|
if (num_sync)
|
||||||
Logger::err("D3D9On12::GetD3D12Device: ReturnUnderlyingResource: Stub");
|
Logger::err("D3D9On12::GetD3D12Device: ReturnUnderlyingResource: Stub");
|
||||||
|
|
||||||
m_device->Flush();
|
m_device->FlushAndSync9On12();
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user