1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +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,
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;

View File

@ -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<DxvkAdapter> 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);
}