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