Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
A few DXUT /analyze fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed May 13, 2022
1 parent ed78c71 commit 0551f6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DXUT/Core/DXUT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4476,7 +4476,7 @@ HRESULT DXUTSnapDeviceSettingsToEnumDevice( DXUTDeviceSettings* pDeviceSettings,
}
if (pDeviceSettingsCombo->pOutputInfo)
{
auto bestDisplayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ bestModeIndex ];
const auto& bestDisplayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ bestModeIndex ];
if (!pDeviceSettingsCombo->Windowed)
{
pDeviceSettings->d3d11.sd.BufferDesc.Height = bestDisplayMode.Height;
Expand Down
4 changes: 2 additions & 2 deletions DXUT/Core/DXUTDevice11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ float DXUTRankD3D11DeviceCombo( CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCo
// Match both Resolution & Refresh Rate
for( size_t idm = 0; idm < pDeviceSettingsCombo->pOutputInfo->displayModeList.size() && !bResolutionFound; idm++ )
{
auto displayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ idm ];
const auto& displayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ idm ];

float refreshDiff = fabsf( ( float( displayMode.RefreshRate.Numerator ) / float( displayMode.RefreshRate.Denominator ) ) -
( float( pOptimalDeviceSettings->sd.BufferDesc.RefreshRate.Numerator ) / float( pOptimalDeviceSettings->sd.BufferDesc.RefreshRate.Denominator ) ) );
Expand Down Expand Up @@ -1143,7 +1143,7 @@ float DXUTRankD3D11DeviceCombo( CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCo
// Match just Resolution
for( size_t idm = 0; idm < pDeviceSettingsCombo->pOutputInfo->displayModeList.size() && !bResolutionFound; idm++ )
{
auto displayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ idm ];
const auto& displayMode = pDeviceSettingsCombo->pOutputInfo->displayModeList[ idm ];

if( displayMode.Width == pOptimalDeviceSettings->sd.BufferDesc.Width
&& displayMode.Height == pOptimalDeviceSettings->sd.BufferDesc.Height )
Expand Down
2 changes: 1 addition & 1 deletion DXUT/Optional/DXUTsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ HRESULT CD3DSettingsDlg::UpdateD3D11Resolutions()

for (size_t idm = 0; idm < pOutputInfo->displayModeList.size(); idm++)
{
auto DisplayMode = pOutputInfo->displayModeList[idm];
const auto& DisplayMode = pOutputInfo->displayModeList[idm];
float fAspect = (float) DisplayMode.Width / (float) DisplayMode.Height;

if (DisplayMode.Format == g_DeviceSettings.d3d11.sd.BufferDesc.Format)
Expand Down

0 comments on commit 0551f6f

Please sign in to comment.