mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 07:54:15 +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:
parent
15aabcb878
commit
5dfe0d077d
@ -46,15 +46,19 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VkImageLayout GetRenderLayout() const {
|
VkImageLayout GetRenderLayout() const {
|
||||||
switch (m_desc.Flags & (D3D11_DSV_READ_ONLY_DEPTH | D3D11_DSV_READ_ONLY_STENCIL)) {
|
if (m_view->imageInfo().tiling == VK_IMAGE_TILING_OPTIMAL) {
|
||||||
default: // case 0
|
switch (m_desc.Flags & (D3D11_DSV_READ_ONLY_DEPTH | D3D11_DSV_READ_ONLY_STENCIL)) {
|
||||||
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
default: // case 0
|
||||||
case D3D11_DSV_READ_ONLY_DEPTH:
|
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
return VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR;
|
case D3D11_DSV_READ_ONLY_DEPTH:
|
||||||
case D3D11_DSV_READ_ONLY_STENCIL:
|
return VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR;
|
||||||
return VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR;
|
case D3D11_DSV_READ_ONLY_STENCIL:
|
||||||
case D3D11_DSV_READ_ONLY_DEPTH | D3D11_DSV_READ_ONLY_STENCIL:
|
return VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR;
|
||||||
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,9 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VkImageLayout GetRenderLayout() const {
|
VkImageLayout GetRenderLayout() const {
|
||||||
// Currently no reason to use anything else
|
return m_view->imageInfo().tiling == VK_IMAGE_TILING_OPTIMAL
|
||||||
return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
||||||
|
: VK_IMAGE_LAYOUT_GENERAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT GetDescFromResource(
|
static HRESULT GetDescFromResource(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user