1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[d3d9] Adapter cleanups

This commit is contained in:
Joshua Ashton 2021-07-24 17:19:52 +01:00 committed by Joshie
parent da411c8a48
commit b1b1524737
2 changed files with 16 additions and 19 deletions

View File

@ -34,12 +34,12 @@ namespace dxvk {
Rc<DxvkAdapter> Adapter, Rc<DxvkAdapter> Adapter,
UINT Ordinal, UINT Ordinal,
UINT DisplayIndex) UINT DisplayIndex)
: m_parent (pParent) : m_parent (pParent),
, m_adapter (Adapter) m_adapter (Adapter),
, m_ordinal (Ordinal) m_ordinal (Ordinal),
, m_displayIndex (DisplayIndex) m_displayIndex (DisplayIndex),
, m_modeCacheFormat (D3D9Format::Unknown) m_modeCacheFormat (D3D9Format::Unknown),
, m_d3d9Formats (Adapter, m_parent->GetOptions()) { m_d3d9Formats (Adapter, m_parent->GetOptions()) {
m_adapter->logAdapterInfo(); m_adapter->logAdapterInfo();
} }
@ -138,10 +138,10 @@ namespace dxvk {
if (CheckFormat == D3D9Format::ATOC && surface) if (CheckFormat == D3D9Format::ATOC && surface)
return D3D_OK; return D3D_OK;
if (m_adapter->features().core.features.depthBounds) { if (CheckFormat == D3D9Format::NVDB && surface)
if (CheckFormat == D3D9Format::NVDB && surface) return m_adapter->features().core.features.depthBounds
return D3D_OK; ? D3D_OK
} : D3DERR_NOTAVAILABLE;
// I really don't want to support this... // I really don't want to support this...
if (dmap) if (dmap)
@ -158,7 +158,6 @@ namespace dxvk {
return D3D_OK; return D3D_OK;
// Let's actually ask Vulkan now that we got some quirks out the way! // Let's actually ask Vulkan now that we got some quirks out the way!
return CheckDeviceVkFormat(mapping.FormatColor, Usage, RType); return CheckDeviceVkFormat(mapping.FormatColor, Usage, RType);
} }
@ -200,7 +199,7 @@ namespace dxvk {
if (pQualityLevels != nullptr) { if (pQualityLevels != nullptr) {
if (MultiSampleType == D3DMULTISAMPLE_NONMASKABLE) if (MultiSampleType == D3DMULTISAMPLE_NONMASKABLE)
*pQualityLevels = (32 - bit::lzcnt(availableFlags)); *pQualityLevels = 32 - bit::lzcnt(availableFlags);
else else
*pQualityLevels = 1; *pQualityLevels = 1;
} }
@ -621,7 +620,7 @@ namespace dxvk {
} }
UINT D3D9Adapter::GetAdapterModeCountEx(CONST D3DDISPLAYMODEFILTER* pFilter) { UINT D3D9Adapter::GetAdapterModeCountEx(const D3DDISPLAYMODEFILTER* pFilter) {
if (pFilter == nullptr) if (pFilter == nullptr)
return 0; return 0;
@ -797,7 +796,7 @@ namespace dxvk {
// Sort display modes by width, height and refresh rate, // Sort display modes by width, height and refresh rate,
// in that order. Some games rely on correct ordering. // in that order. Some games rely on correct ordering.
std::sort(m_modes.begin(), m_modes.end(), 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 true;
if (a.Width > b.Width) return false; if (a.Width > b.Width) return false;

View File

@ -62,7 +62,7 @@ namespace dxvk {
HMONITOR GetMonitor(); HMONITOR GetMonitor();
UINT GetAdapterModeCountEx(CONST D3DDISPLAYMODEFILTER* pFilter); UINT GetAdapterModeCountEx(const D3DDISPLAYMODEFILTER* pFilter);
HRESULT EnumAdapterModesEx( HRESULT EnumAdapterModesEx(
const D3DDISPLAYMODEFILTER* pFilter, const D3DDISPLAYMODEFILTER* pFilter,
@ -79,13 +79,11 @@ namespace dxvk {
Rc<DxvkAdapter> GetDXVKAdapter() { return m_adapter; } Rc<DxvkAdapter> GetDXVKAdapter() { return m_adapter; }
D3D9_VK_FORMAT_MAPPING GetFormatMapping( D3D9_VK_FORMAT_MAPPING GetFormatMapping(D3D9Format Format) const {
D3D9Format Format) const {
return m_d3d9Formats.GetFormatMapping(Format); return m_d3d9Formats.GetFormatMapping(Format);
} }
DxvkFormatInfo GetUnsupportedFormatInfo( DxvkFormatInfo GetUnsupportedFormatInfo(D3D9Format Format) const {
D3D9Format Format) const {
return m_d3d9Formats.GetUnsupportedFormatInfo(Format); return m_d3d9Formats.GetUnsupportedFormatInfo(Format);
} }