mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +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:
parent
6a6871ee42
commit
e06300d592
@ -383,6 +383,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion1(
|
void STDMETHODCALLTYPE D3D11DeviceContext::CopySubresourceRegion1(
|
||||||
ID3D11Resource* pDstResource,
|
ID3D11Resource* pDstResource,
|
||||||
UINT DstSubresource,
|
UINT DstSubresource,
|
||||||
@ -396,6 +397,7 @@ namespace dxvk {
|
|||||||
CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
|
CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, pSrcResource, SrcSubresource, pSrcBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::CopyResource(
|
void STDMETHODCALLTYPE D3D11DeviceContext::CopyResource(
|
||||||
ID3D11Resource* pDstResource,
|
ID3D11Resource* pDstResource,
|
||||||
ID3D11Resource* pSrcResource) {
|
ID3D11Resource* pSrcResource) {
|
||||||
|
@ -1866,7 +1866,6 @@ namespace dxvk {
|
|||||||
HRESULT D3D11Device::GetFormatSupportFlags(DXGI_FORMAT Format, UINT* pFlags1, UINT* pFlags2) const {
|
HRESULT D3D11Device::GetFormatSupportFlags(DXGI_FORMAT Format, UINT* pFlags1, UINT* pFlags2) const {
|
||||||
const VkFormat fmt = m_dxgiAdapter->LookupFormat(Format, DxgiFormatMode::Any).format;
|
const VkFormat fmt = m_dxgiAdapter->LookupFormat(Format, DxgiFormatMode::Any).format;
|
||||||
const VkFormatProperties fmtInfo = m_dxvkAdapter->formatProperties(fmt);
|
const VkFormatProperties fmtInfo = m_dxvkAdapter->formatProperties(fmt);
|
||||||
|
|
||||||
if (fmt == VK_FORMAT_UNDEFINED)
|
if (fmt == VK_FORMAT_UNDEFINED)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
@ -1939,13 +1938,17 @@ namespace dxvk {
|
|||||||
|| Format == DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM)
|
|| Format == DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM)
|
||||||
flags1 |= D3D11_FORMAT_SUPPORT_DISPLAY;
|
flags1 |= D3D11_FORMAT_SUPPORT_DISPLAY;
|
||||||
|
|
||||||
// Query multisampling info
|
// Query multisample support info
|
||||||
|
const DxvkFormatInfo* formatInfo = imageFormatInfo(fmt);
|
||||||
|
|
||||||
VkImageFormatProperties imgInfo;
|
VkImageFormatProperties imgInfo;
|
||||||
|
|
||||||
VkResult status = m_dxvkAdapter->imageFormatProperties(fmt,
|
VkResult status = m_dxvkAdapter->imageFormatProperties(fmt,
|
||||||
VK_IMAGE_TYPE_2D,
|
VK_IMAGE_TYPE_2D,
|
||||||
VK_IMAGE_TILING_OPTIMAL,
|
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);
|
0, imgInfo);
|
||||||
|
|
||||||
if (status == VK_SUCCESS && imgInfo.sampleCounts > VK_SAMPLE_COUNT_1_BIT) {
|
if (status == VK_SUCCESS && imgInfo.sampleCounts > VK_SAMPLE_COUNT_1_BIT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user