1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +01:00

[d3d11] Fix multisample format support query for depth images

Fixes a crash in World of Warships when reflections are enabled.
This commit is contained in:
Philip Rebohle 2018-04-04 11:24:16 +02:00
parent 6a6871ee42
commit e06300d592
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 9 additions and 4 deletions

View File

@ -383,6 +383,7 @@ namespace dxvk {
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion1(
ID3D11Resource* pDstResource,
UINT DstSubresource,
@ -393,9 +394,10 @@ namespace dxvk {
UINT SrcSubresource,
const D3D11_BOX* pSrcBox,
UINT CopyFlags) {
CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
}
void STDMETHODCALLTYPE D3D11DeviceContext::CopyResource(
ID3D11Resource* pDstResource,
ID3D11Resource* pSrcResource) {

View File

@ -1866,7 +1866,6 @@ namespace dxvk {
HRESULT D3D11Device::GetFormatSupportFlags(DXGI_FORMAT Format, UINT* pFlags1, UINT* pFlags2) const {
const VkFormat fmt = m_dxgiAdapter->LookupFormat(Format, DxgiFormatMode::Any).format;
const VkFormatProperties fmtInfo = m_dxvkAdapter->formatProperties(fmt);
if (fmt == VK_FORMAT_UNDEFINED)
return E_FAIL;
@ -1939,13 +1938,17 @@ namespace dxvk {
|| Format == DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM)
flags1 |= D3D11_FORMAT_SUPPORT_DISPLAY;
// Query multisampling info
// Query multisample support info
const DxvkFormatInfo* formatInfo = imageFormatInfo(fmt);
VkImageFormatProperties imgInfo;
VkResult status = m_dxvkAdapter->imageFormatProperties(fmt,
VK_IMAGE_TYPE_2D,
VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
(formatInfo->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT)
? VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
: VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
0, imgInfo);
if (status == VK_SUCCESS && imgInfo.sampleCounts > VK_SAMPLE_COUNT_1_BIT) {