Merge pull request #1063 from Areloch/CICD_GFXDevice_Fix

This implements a fix to an issue with the CICD that causes a segfault.
This commit is contained in:
Brian Roberts 2023-07-23 07:50:14 -05:00 committed by GitHub
commit 8a23392c97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -252,6 +252,10 @@ DXGI_SWAP_CHAIN_DESC GFXD3D11Device::setupPresentParams(const GFXVideoMode &mode
void GFXD3D11Device::enumerateAdapters(Vector<GFXAdapter*> &adapterList)
{
S32 monitorCount = PlatformWindowManager::get()->getMonitorCount();
if (monitorCount < 1)
return;
IDXGIAdapter1* EnumAdapter;
IDXGIFactory1* DXGIFactory;

View file

@ -77,6 +77,10 @@ void EnumerateVideoModes(Vector<GFXVideoMode>& outModes)
void GFXGLDevice::enumerateAdapters( Vector<GFXAdapter*> &adapterList )
{
S32 monitorCount = PlatformWindowManager::get()->getMonitorCount();
if (monitorCount < 1)
return;
AssertFatal( SDL_WasInit(SDL_INIT_VIDEO), "");
PlatformGL::init(); // for hints about context creation

View file

@ -28,9 +28,16 @@
TEST(WinMgr, BasicAPI)
{
PlatformWindowManager *pwm = CreatePlatformWindowManager();
EXPECT_TRUE(pwm)
<< "CreatePlatformWindowManager creation Failed!";
if (!pwm)
return;
ASSERT_TRUE(pwm)
S32 monitorCount = PlatformWindowManager::get()->getMonitorCount();
EXPECT_GT(monitorCount, 0)
<< "no monitor to test against!";
if (monitorCount == 0)
return;
// Check out the primary desktop area...
RectI primary = pwm->getPrimaryDesktopArea();