diff --git a/src/d3d9/d3d9_adapter.cpp b/src/d3d9/d3d9_adapter.cpp index a46e46ac..097c1f30 100644 --- a/src/d3d9/d3d9_adapter.cpp +++ b/src/d3d9/d3d9_adapter.cpp @@ -34,12 +34,12 @@ namespace dxvk { Rc Adapter, UINT Ordinal, UINT DisplayIndex) - : m_parent (pParent) - , m_adapter (Adapter) - , m_ordinal (Ordinal) - , m_displayIndex (DisplayIndex) - , m_modeCacheFormat (D3D9Format::Unknown) - , m_d3d9Formats (Adapter, m_parent->GetOptions()) { + : m_parent (pParent), + m_adapter (Adapter), + m_ordinal (Ordinal), + m_displayIndex (DisplayIndex), + m_modeCacheFormat (D3D9Format::Unknown), + m_d3d9Formats (Adapter, m_parent->GetOptions()) { m_adapter->logAdapterInfo(); } @@ -138,10 +138,10 @@ namespace dxvk { if (CheckFormat == D3D9Format::ATOC && surface) return D3D_OK; - if (m_adapter->features().core.features.depthBounds) { - if (CheckFormat == D3D9Format::NVDB && surface) - return D3D_OK; - } + if (CheckFormat == D3D9Format::NVDB && surface) + return m_adapter->features().core.features.depthBounds + ? D3D_OK + : D3DERR_NOTAVAILABLE; // I really don't want to support this... if (dmap) @@ -158,7 +158,6 @@ namespace dxvk { return D3D_OK; // Let's actually ask Vulkan now that we got some quirks out the way! - return CheckDeviceVkFormat(mapping.FormatColor, Usage, RType); } @@ -200,7 +199,7 @@ namespace dxvk { if (pQualityLevels != nullptr) { if (MultiSampleType == D3DMULTISAMPLE_NONMASKABLE) - *pQualityLevels = (32 - bit::lzcnt(availableFlags)); + *pQualityLevels = 32 - bit::lzcnt(availableFlags); else *pQualityLevels = 1; } @@ -621,7 +620,7 @@ namespace dxvk { } - UINT D3D9Adapter::GetAdapterModeCountEx(CONST D3DDISPLAYMODEFILTER* pFilter) { + UINT D3D9Adapter::GetAdapterModeCountEx(const D3DDISPLAYMODEFILTER* pFilter) { if (pFilter == nullptr) return 0; @@ -797,7 +796,7 @@ namespace dxvk { // Sort display modes by width, height and refresh rate, // in that order. Some games rely on correct ordering. std::sort(m_modes.begin(), m_modes.end(), - [](const D3DDISPLAYMODEEX & a, const D3DDISPLAYMODEEX & b) { + [](const D3DDISPLAYMODEEX& a, const D3DDISPLAYMODEEX& b) { if (a.Width < b.Width) return true; if (a.Width > b.Width) return false; diff --git a/src/d3d9/d3d9_adapter.h b/src/d3d9/d3d9_adapter.h index 1ac169d2..854463a7 100644 --- a/src/d3d9/d3d9_adapter.h +++ b/src/d3d9/d3d9_adapter.h @@ -62,7 +62,7 @@ namespace dxvk { HMONITOR GetMonitor(); - UINT GetAdapterModeCountEx(CONST D3DDISPLAYMODEFILTER* pFilter); + UINT GetAdapterModeCountEx(const D3DDISPLAYMODEFILTER* pFilter); HRESULT EnumAdapterModesEx( const D3DDISPLAYMODEFILTER* pFilter, @@ -79,13 +79,11 @@ namespace dxvk { Rc GetDXVKAdapter() { return m_adapter; } - D3D9_VK_FORMAT_MAPPING GetFormatMapping( - D3D9Format Format) const { + D3D9_VK_FORMAT_MAPPING GetFormatMapping(D3D9Format Format) const { return m_d3d9Formats.GetFormatMapping(Format); } - DxvkFormatInfo GetUnsupportedFormatInfo( - D3D9Format Format) const { + DxvkFormatInfo GetUnsupportedFormatInfo(D3D9Format Format) const { return m_d3d9Formats.GetUnsupportedFormatInfo(Format); }