1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 22:54:16 +01:00

[d3d11] Fix render target layouts for linar tiling

There currently doesn't seem to be a game which actually renders
to images with linear tiling, but we should handle this anyway.
Only the GENERAL layout is allowed if the tiling is not OPTIMAL.
This commit is contained in:
Philip Rebohle 2018-06-19 11:28:54 +02:00
parent 15aabcb878
commit 5dfe0d077d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 11 deletions

@ -46,6 +46,7 @@ namespace dxvk {
}
VkImageLayout GetRenderLayout() const {
if (m_view->imageInfo().tiling == VK_IMAGE_TILING_OPTIMAL) {
switch (m_desc.Flags & (D3D11_DSV_READ_ONLY_DEPTH | D3D11_DSV_READ_ONLY_STENCIL)) {
default: // case 0
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
@ -56,6 +57,9 @@ namespace dxvk {
case D3D11_DSV_READ_ONLY_DEPTH | D3D11_DSV_READ_ONLY_STENCIL:
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
}
} else {
return VK_IMAGE_LAYOUT_GENERAL;
}
}
static HRESULT GetDescFromResource(

@ -42,8 +42,9 @@ namespace dxvk {
}
VkImageLayout GetRenderLayout() const {
// Currently no reason to use anything else
return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
return m_view->imageInfo().tiling == VK_IMAGE_TILING_OPTIMAL
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
: VK_IMAGE_LAYOUT_GENERAL;
}
static HRESULT GetDescFromResource(