From 72a356fe01e88209e459f3e34cb7837e07b18aa9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 16 Sep 2019 12:39:28 +0200 Subject: [PATCH] [d3d11] Implement GetResourceTiling When called on a regular resource, native D3D11 will zero out the return values. We should match this behaviour. --- src/d3d11/d3d11_device.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 5f9bf43b5..48af0047d 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1448,7 +1448,25 @@ namespace dxvk { static bool s_errorShown = false; if (!std::exchange(s_errorShown, true)) - Logger::err("D3D11Device::GetResourceTiling: Not implemented"); + Logger::err("D3D11Device::GetResourceTiling: Tiled resources not supported"); + + if (pNumTilesForEntireResource) + *pNumTilesForEntireResource = 0; + + if (pPackedMipDesc) + *pPackedMipDesc = D3D11_PACKED_MIP_DESC(); + + if (pStandardTileShapeForNonPackedMips) + *pStandardTileShapeForNonPackedMips = D3D11_TILE_SHAPE(); + + if (pNumSubresourceTilings) { + if (pSubresourceTilingsForNonPackedMips) { + for (uint32_t i = 0; i < *pNumSubresourceTilings; i++) + pSubresourceTilingsForNonPackedMips[i] = D3D11_SUBRESOURCE_TILING(); + } + + *pNumSubresourceTilings = 0; + } }