Skip to content

Commit 09de1e4

Browse files
committed
properly allow for dxlevel 100
fix compressed textures not being enabled due to ordering error
1 parent eaeaa6f commit 09de1e4

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

gameui/OptionsSubVideo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ int g_DirectXLevels[] =
7777
92,
7878
#endif
7979
95,
80+
100
8081
};
8182

8283
//-----------------------------------------------------------------------------

materialsystem/shaderapidx9/shaderdevicedx8.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,14 @@ bool CShaderDeviceMgrDx8::ComputeCapsFromD3D( HardwareCaps_t *pCaps, int nAdapte
743743
pCaps->m_NumSamplers = min( pCaps->m_NumSamplers, (int)MAX_SAMPLERS );
744744
pCaps->m_NumTextureStages = min( pCaps->m_NumTextureStages, (int)MAX_TEXTURE_STAGES );
745745

746-
if ( D3DSupportsCompressedTextures() )
746+
// Determine the adapter format
747+
ShaderDisplayMode_t mode;
748+
g_pShaderDeviceMgrDx8->GetCurrentModeInfo(&mode, nAdapter);
749+
ImageFormat adapterFormat = mode.m_Format;
750+
751+
InitializeColorInformation(nAdapter, DX8_DEVTYPE, adapterFormat);
752+
753+
if (D3DSupportsCompressedTextures())
747754
{
748755
pCaps->m_SupportsCompressedTextures = COMPRESSED_TEXTURES_ON;
749756
}
@@ -1175,6 +1182,12 @@ void CShaderDeviceMgrDx8::ComputeDXSupportLevel( HardwareCaps_t &caps )
11751182

11761183
bool bIsOpenGL = IsOpenGL();
11771184

1185+
if ( caps.m_bDX10Card && !bIsOpenGL )
1186+
{
1187+
caps.m_nMaxDXSupportLevel = 100;
1188+
return;
1189+
}
1190+
11781191
if ( caps.m_SupportsShaderModel_3_0 && !bIsOpenGL ) // Note that we don't tie vertex textures to 30 shaders anymore
11791192
{
11801193
caps.m_nMaxDXSupportLevel = 95;
@@ -2297,13 +2310,9 @@ bool CShaderDeviceDx8::CreateD3DDevice( void* pHWnd, int nAdapter, const ShaderD
22972310

22982311
// Determine the adapter format
22992312
ShaderDisplayMode_t mode;
2300-
g_pShaderDeviceMgrDx8->GetCurrentModeInfo( &mode, nAdapter );
2313+
g_pShaderDeviceMgrDx8->GetCurrentModeInfo(&mode, nAdapter);
23012314
m_AdapterFormat = mode.m_Format;
23022315

2303-
// FIXME: Need to do this prior to SetPresentParameters. Fix.
2304-
// Make it part of HardwareCaps_t
2305-
InitializeColorInformation( nAdapter, DX8_DEVTYPE, m_AdapterFormat );
2306-
23072316
const HardwareCaps_t &adapterCaps = g_ShaderDeviceMgrDx8.GetHardwareCaps( nAdapter );
23082317
DWORD deviceCreationFlags = ComputeDeviceCreationFlags( caps, adapterCaps.m_bSoftwareVertexProcessing );
23092318
SetPresentParameters( hWnd, nAdapter, info );
@@ -2417,7 +2426,6 @@ bool CShaderDeviceDx8::CreateD3DDevice( void* pHWnd, int nAdapter, const ShaderD
24172426
return ( !FAILED( hr ) );
24182427
}
24192428

2420-
24212429
//-----------------------------------------------------------------------------
24222430
// Frame sync
24232431
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)