From b8888ffe6a7d1a4cf95e1ea429bed4b41dc911dd Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 7 Sep 2019 20:16:16 +0200 Subject: [PATCH] [d3d11] Don't create linearly tiled compressed images Quantum Break uses this for texture uploads, which causes unnecessary GPU synchronization and queue submissions when doing texture uploads. --- src/d3d11/d3d11_texture.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index 235d78e60..0e00d13a3 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -408,6 +408,12 @@ namespace dxvk { if (GetPackedDepthStencilFormat(m_desc.Format)) return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER; + // The only way to write to compressed textures on the GPU is by + // using copy commands, so we might as well copy to a buffer to + // prevent accidentally hitting a slow path if games misuse this. + if (imageFormatInfo(pImageInfo->format)->flags.test(DxvkFormatFlag::BlockCompressed)) + return D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER; + // Images that can be read by the host should be mapped directly in // order to avoid expensive synchronization with the GPU. This does // however require linear tiling, which may not be supported for all @@ -493,8 +499,6 @@ namespace dxvk { } - - D3D11DXGISurface::D3D11DXGISurface( ID3D11Resource* pResource, D3D11CommonTexture* pTexture)