GFX now handles non-default adapters

The GFX (DirectX) pipeline did not respect the choice of adapter and
always went for the default one.  Normally this isn't an issue unless
you wish to target a particular adapter and display device combination.
This has been corrected.

The GFX initialize functions now attempt to find the best adapter that
matches a given display device (i.e. monitor) if one has been passed in.
To aid with choosing a display device some new monitor enumeration
methods have been added to the platform window manager.  These methods
have been exposed to the Canvas.
This commit is contained in:
DavidWyand-GG 2013-04-09 12:50:17 -04:00
parent 1ed1a41256
commit 0d77cdc270
18 changed files with 282 additions and 45 deletions

View file

@ -30,9 +30,9 @@
#endif
GFXD3D9CardProfiler::GFXD3D9CardProfiler() : GFXCardProfiler()
GFXD3D9CardProfiler::GFXD3D9CardProfiler(U32 adapterIndex) : GFXCardProfiler()
{
mAdapterOrdinal = adapterIndex;
}
GFXD3D9CardProfiler::~GFXD3D9CardProfiler()
@ -133,7 +133,7 @@ bool GFXD3D9CardProfiler::_queryFormat( const GFXFormat fmt, const GFXTexturePro
if(texFormat == (_D3DFORMAT)GFX_UNSUPPORTED_VAL)
return false;
HRESULT hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
HRESULT hr = pD3D->CheckDeviceFormat( mAdapterOrdinal, D3DDEVTYPE_HAL,
adapterFormat, usage, rType, texFormat );
bool retVal = SUCCEEDED( hr );
@ -145,7 +145,7 @@ bool GFXD3D9CardProfiler::_queryFormat( const GFXFormat fmt, const GFXTexturePro
{
usage ^= D3DUSAGE_AUTOGENMIPMAP;
hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
hr = pD3D->CheckDeviceFormat( mAdapterOrdinal, D3DDEVTYPE_HAL,
adapterFormat, usage, D3DRTYPE_TEXTURE, GFXD3D9TextureFormat[fmt] );
retVal = SUCCEEDED( hr );