1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 07:24:12 +01:00

Revert "[d3d11] Temporary fix for Presenter <-> CS thread sync issue"

This reverts commit 3118012ada.
This commit is contained in:
Philip Rebohle 2018-01-21 02:57:36 +01:00
parent 3118012ada
commit 70b639784b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 29 additions and 31 deletions

View File

@ -42,13 +42,14 @@ namespace dxvk {
ID3D11Resource* pResource, ID3D11Resource* pResource,
UINT Subresource) final; UINT Subresource) final;
void Synchronize();
void SynchronizeCs();
private: private:
DxvkCsThread m_csThread; DxvkCsThread m_csThread;
void Synchronize();
void SynchronizeCs();
void EmitCsChunk(); void EmitCsChunk();
}; };

View File

@ -1,4 +1,3 @@
#include "d3d11_context_imm.h"
#include "d3d11_device.h" #include "d3d11_device.h"
#include "d3d11_present.h" #include "d3d11_present.h"
@ -55,12 +54,10 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::FlushRenderingCommands() { HRESULT STDMETHODCALLTYPE D3D11PresentDevice::FlushRenderingCommands() {
Com<ID3D11DeviceContext> ctx = nullptr; Com<ID3D11DeviceContext> deviceContext = nullptr;
m_device->GetImmediateContext(&ctx); m_device->GetImmediateContext(&deviceContext);
auto immediateContext = static_cast<D3D11ImmediateContext*>(ctx.ptr()); deviceContext->Flush();
immediateContext->Flush();
immediateContext->SynchronizeCs();
return S_OK; return S_OK;
} }

View File

@ -23,33 +23,33 @@ namespace dxvk {
DxvkPhysicalBufferSlice DxvkBuffer::allocPhysicalSlice() { DxvkPhysicalBufferSlice DxvkBuffer::allocPhysicalSlice() {
// if (m_physSliceId >= m_physBuffers[m_physBufferId]->sliceCount()) { if (m_physSliceId >= m_physBuffers[m_physBufferId]->sliceCount()) {
// m_physBufferId = (m_physBufferId + 1) % m_physBuffers.size(); m_physBufferId = (m_physBufferId + 1) % m_physBuffers.size();
// m_physSliceId = 0; m_physSliceId = 0;
//
// if ((m_physBuffers[m_physBufferId] == nullptr) if ((m_physBuffers[m_physBufferId] == nullptr)
// || (m_physBuffers[m_physBufferId]->sliceCount() < m_physSliceCount)) { || (m_physBuffers[m_physBufferId]->sliceCount() < m_physSliceCount)) {
// // Make sure that all buffers have the same size. If we don't do this, // Make sure that all buffers have the same size. If we don't do this,
// // one of the physical buffers may grow indefinitely while the others // one of the physical buffers may grow indefinitely while the others
// // remain small, depending on the usage pattern of the application. // remain small, depending on the usage pattern of the application.
// m_physBuffers[m_physBufferId] = this->allocPhysicalBuffer(m_physSliceCount); m_physBuffers[m_physBufferId] = this->allocPhysicalBuffer(m_physSliceCount);
// } else if (m_physBuffers[m_physBufferId]->isInUse()) { } else if (m_physBuffers[m_physBufferId]->isInUse()) {
// // Allocate a new physical buffer if the current one is still in use. // Allocate a new physical buffer if the current one is still in use.
// // This also indicates that the buffer gets updated frequently, so we // This also indicates that the buffer gets updated frequently, so we
// // will double the size of the physical buffers to accomodate for it. // will double the size of the physical buffers to accomodate for it.
// if (m_physBufferId == 0) if (m_physBufferId == 0)
// m_physSliceCount *= 2; m_physSliceCount *= 2;
//
// m_physBuffers[m_physBufferId] = this->allocPhysicalBuffer(m_physSliceCount); m_physBuffers[m_physBufferId] = this->allocPhysicalBuffer(m_physSliceCount);
// } }
// } }
//
// return m_physBuffers[m_physBufferId]->slice(m_physSliceId++); return m_physBuffers[m_physBufferId]->slice(m_physSliceId++);
return allocPhysicalBuffer(1)->slice(0);
} }
Rc<DxvkPhysicalBuffer> DxvkBuffer::allocPhysicalBuffer(VkDeviceSize sliceCount) const { Rc<DxvkPhysicalBuffer> DxvkBuffer::allocPhysicalBuffer(VkDeviceSize sliceCount) const {
TRACE(this, sliceCount);
return m_device->allocPhysicalBuffer(m_info, sliceCount, m_memFlags); return m_device->allocPhysicalBuffer(m_info, sliceCount, m_memFlags);
} }