1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d11] Normalize render target and depth-stencil view types

Fixes a regression in Kingdom Come: Deliverance that was
introduced in a55bee95548e0c0b2237bb54f6f98ed08f98c112.
This commit is contained in:
Philip Rebohle 2018-05-05 15:53:00 +02:00
parent 5a639797d2
commit f4a92a685f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -787,6 +787,13 @@ namespace dxvk {
return E_INVALIDARG;
}
// Normalize view type so that we won't accidentally
// bind 2D array views and 2D views at the same time
if (viewInfo.numLayers == 1) {
if (viewInfo.type == VK_IMAGE_VIEW_TYPE_1D_ARRAY) viewInfo.type = VK_IMAGE_VIEW_TYPE_1D;
if (viewInfo.type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) viewInfo.type = VK_IMAGE_VIEW_TYPE_2D;
}
// Create the actual image view if requested
if (ppRTView == nullptr)
return S_FALSE;
@ -905,6 +912,13 @@ namespace dxvk {
return E_INVALIDARG;
}
// Normalize view type so that we won't accidentally
// bind 2D array views and 2D views at the same time
if (viewInfo.numLayers == 1) {
if (viewInfo.type == VK_IMAGE_VIEW_TYPE_1D_ARRAY) viewInfo.type = VK_IMAGE_VIEW_TYPE_1D;
if (viewInfo.type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) viewInfo.type = VK_IMAGE_VIEW_TYPE_2D;
}
// Create the actual image view if requested
if (ppDepthStencilView == nullptr)
return S_FALSE;