[dxvk] Change flushing behaviour of immediate context methods

Should fix some inappropriate flushing, while flushing more
aggressively on render target changes.

We still keep the flush on UpdateSubresource since some games
use it to update large quantities of data.
This commit is contained in:
Philip Rebohle 2019-05-09 13:04:07 +02:00
parent dcd75a4f09
commit af45f810b2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 5 additions and 127 deletions

View File

@ -54,20 +54,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11ImmediateContext::End(
ID3D11Asynchronous* pAsync) {
D3D11DeviceContext::End(pAsync);
if (pAsync) {
D3D11_QUERY_DESC desc;
static_cast<D3D11Query*>(pAsync)->GetDesc(&desc);
if (desc.Query == D3D11_QUERY_EVENT)
FlushImplicit(TRUE);
}
}
HRESULT STDMETHODCALLTYPE D3D11ImmediateContext::GetData(
ID3D11Asynchronous* pAsync,
void* pData,
@ -214,61 +200,6 @@ namespace dxvk {
UnmapImage(GetCommonTexture(pResource), Subresource);
}
}
void STDMETHODCALLTYPE D3D11ImmediateContext::CopySubresourceRegion(
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox) {
FlushImplicit(FALSE);
D3D11DeviceContext::CopySubresourceRegion(
pDstResource, DstSubresource, DstX, DstY, DstZ,
pSrcResource, SrcSubresource, pSrcBox);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::CopySubresourceRegion1(
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox,
UINT CopyFlags) {
FlushImplicit(FALSE);
D3D11DeviceContext::CopySubresourceRegion1(
pDstResource, DstSubresource, DstX, DstY, DstZ,
pSrcResource, SrcSubresource, pSrcBox, CopyFlags);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::CopyResource(
ID3D11Resource* pDstResource,
ID3D11Resource* pSrcResource) {
FlushImplicit(FALSE);
D3D11DeviceContext::CopyResource(
pDstResource, pSrcResource);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::GenerateMips(
ID3D11ShaderResourceView* pShaderResourceView) {
FlushImplicit(FALSE);
D3D11DeviceContext::GenerateMips(
pShaderResourceView);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::UpdateSubresource(
ID3D11Resource* pDstResource,
@ -301,27 +232,12 @@ namespace dxvk {
CopyFlags);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::ResolveSubresource(
ID3D11Resource* pDstResource,
UINT DstSubresource,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
DXGI_FORMAT Format) {
FlushImplicit(FALSE);
D3D11DeviceContext::ResolveSubresource(
pDstResource, DstSubresource,
pSrcResource, SrcSubresource,
Format);
}
void STDMETHODCALLTYPE D3D11ImmediateContext::OMSetRenderTargets(
UINT NumViews,
ID3D11RenderTargetView* const* ppRenderTargetViews,
ID3D11DepthStencilView* pDepthStencilView) {
FlushImplicit(FALSE);
FlushImplicit(TRUE);
D3D11DeviceContext::OMSetRenderTargets(
NumViews, ppRenderTargetViews, pDepthStencilView);
@ -336,7 +252,7 @@ namespace dxvk {
UINT NumUAVs,
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
const UINT* pUAVInitialCounts) {
FlushImplicit(FALSE);
FlushImplicit(TRUE);
D3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews(
NumRTVs, ppRenderTargetViews, pDepthStencilView,

View File

@ -26,9 +26,6 @@ namespace dxvk {
UINT STDMETHODCALLTYPE GetContextFlags();
void STDMETHODCALLTYPE End(
ID3D11Asynchronous* pAsync);
HRESULT STDMETHODCALLTYPE GetData(
ID3D11Asynchronous* pAsync,
void* pData,
@ -55,35 +52,7 @@ namespace dxvk {
void STDMETHODCALLTYPE Unmap(
ID3D11Resource* pResource,
UINT Subresource);
void STDMETHODCALLTYPE CopySubresourceRegion(
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox);
void STDMETHODCALLTYPE CopySubresourceRegion1(
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox,
UINT CopyFlags);
void STDMETHODCALLTYPE CopyResource(
ID3D11Resource* pDstResource,
ID3D11Resource* pSrcResource);
void STDMETHODCALLTYPE GenerateMips(
ID3D11ShaderResourceView* pShaderResourceView);
void STDMETHODCALLTYPE UpdateSubresource(
ID3D11Resource* pDstResource,
UINT DstSubresource,
@ -100,14 +69,7 @@ namespace dxvk {
UINT SrcRowPitch,
UINT SrcDepthPitch,
UINT CopyFlags);
void STDMETHODCALLTYPE ResolveSubresource(
ID3D11Resource* pDstResource,
UINT DstSubresource,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
DXGI_FORMAT Format);
void STDMETHODCALLTYPE OMSetRenderTargets(
UINT NumViews,
ID3D11RenderTargetView* const* ppRenderTargetViews,