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

[dxbc] Map 2D MS shader resource views to 2D MS Array views

Works around a game bug in Dragon Age: Inquisition, which binds
an MS image to a non-MS resource slot. Closes
This commit is contained in:
Philip Rebohle 2018-04-22 18:27:01 +02:00
parent cd63ff6d76
commit 2f20a61342
2 changed files with 4 additions and 3 deletions

View File

@ -401,7 +401,7 @@ namespace dxvk {
break;
case D3D11_SRV_DIMENSION_TEXTURE2DMS:
viewInfo.type = VK_IMAGE_VIEW_TYPE_2D;
viewInfo.type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
viewInfo.minLevel = 0;
viewInfo.numLevels = 1;
viewInfo.minLayer = 0;

View File

@ -817,7 +817,7 @@ namespace dxvk {
case DxbcResourceDim::Texture1DArr: return { spv::Dim1D, 1, 0, isUav ? 2u : 1u, 1u };
case DxbcResourceDim::Texture2D: return { spv::Dim2D, 1, 0, isUav ? 2u : 1u, 0u };
case DxbcResourceDim::Texture2DArr: return { spv::Dim2D, 1, 0, isUav ? 2u : 1u, 1u };
case DxbcResourceDim::Texture2DMs: return { spv::Dim2D, 0, 1, isUav ? 2u : 1u, 0u };
case DxbcResourceDim::Texture2DMs: return { spv::Dim2D, 1, 1, isUav ? 2u : 1u, 0u };
case DxbcResourceDim::Texture2DMsArr: return { spv::Dim2D, 1, 1, isUav ? 2u : 1u, 1u };
case DxbcResourceDim::Texture3D: return { spv::Dim3D, 0, 0, isUav ? 2u : 1u, 0u };
case DxbcResourceDim::TextureCube: return { spv::DimCube, 1, 0, isUav ? 2u : 1u, 0u };
@ -833,6 +833,7 @@ namespace dxvk {
case DxbcResourceDim::Texture1DArr: m_module.enableCapability(spv::CapabilityImage1D); break;
case DxbcResourceDim::TextureCube: m_module.enableCapability(spv::CapabilityImageCubeArray); break;
case DxbcResourceDim::TextureCubeArr: m_module.enableCapability(spv::CapabilityImageCubeArray); break;
case DxbcResourceDim::Texture2DMs: m_module.enableCapability(spv::CapabilityImageMSArray); break;
case DxbcResourceDim::Texture2DMsArr: m_module.enableCapability(spv::CapabilityImageMSArray); break;
default: break; // No additional capabilities required
}
@ -6249,7 +6250,7 @@ namespace dxvk {
case DxbcResourceDim::Texture1D: return VK_IMAGE_VIEW_TYPE_1D_ARRAY;
case DxbcResourceDim::Texture1DArr: return VK_IMAGE_VIEW_TYPE_1D_ARRAY;
case DxbcResourceDim::Texture2D: return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
case DxbcResourceDim::Texture2DMs: return VK_IMAGE_VIEW_TYPE_2D;
case DxbcResourceDim::Texture2DMs: return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
case DxbcResourceDim::Texture2DArr: return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
case DxbcResourceDim::Texture2DMsArr: return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
case DxbcResourceDim::TextureCube: return VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;