@@ -1566,35 +1566,33 @@ static SlangResult _innerMain(
1566
1566
}
1567
1567
else
1568
1568
{
1569
- auto result = rhi::getRHI ()->createDevice (desc, rhiDevice.writeRef ());
1570
- if (SLANG_FAILED (result ))
1569
+ auto res = rhi::getRHI ()->createDevice (desc, rhiDevice.writeRef ());
1570
+ if (SLANG_FAILED (res ))
1571
1571
{
1572
1572
rhiDevice = nullptr ;
1573
+ // We need to be careful here about SLANG_E_NOT_AVAILABLE. This return value means
1574
+ // that the renderer couldn't be created because it required *features* that were
1575
+ // *not available*. It does not mean the renderer in general couldn't be
1576
+ // constructed.
1577
+ //
1578
+ // Returning SLANG_E_NOT_AVAILABLE will lead to the test infrastructure ignoring
1579
+ // this test.
1580
+ //
1581
+ // We also don't want to output the 'Unable to create renderer' error, as this isn't
1582
+ // an error.
1583
+ if (res == SLANG_E_NOT_AVAILABLE)
1584
+ {
1585
+ return res;
1586
+ }
1587
+ if (!options.onlyStartup )
1588
+ {
1589
+ fprintf (stderr, " Unable to create renderer %s\n " , rendererName.getBuffer ());
1590
+ }
1591
+ return res;
1573
1592
}
1574
1593
}
1575
- if (!rhiDevice)
1576
- {
1577
- // We need to be careful here about SLANG_E_NOT_AVAILABLE. This return value means
1578
- // that the renderer couldn't be created because it required *features* that were
1579
- // *not available*. It does not mean the renderer in general couldn't be
1580
- // constructed.
1581
- //
1582
- // Returning SLANG_E_NOT_AVAILABLE will lead to the test infrastructure ignoring
1583
- // this test.
1584
- //
1585
- // We also don't want to output the 'Unable to create renderer' error, as this isn't
1586
- // an error.
1587
- SlangResult res =
1588
- SLANG_E_NOT_AVAILABLE; // Default to not available if device creation fails
1589
- if (!options.onlyStartup )
1590
- {
1591
- fprintf (stderr, " Unable to create renderer %s\n " , rendererName.getBuffer ());
1592
- }
1593
-
1594
- return res;
1595
- }
1594
+ SLANG_ASSERT (rhiDevice);
1596
1595
deviceWrapper = CachedDeviceWrapper (rhiDevice);
1597
- SLANG_ASSERT (deviceWrapper);
1598
1596
}
1599
1597
1600
1598
for (const auto & feature : requiredFeatureList)
0 commit comments