Skip to content

Commit 4dcc652

Browse files
committed
address review comment
1 parent 2bf2d1e commit 4dcc652

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

tools/render-test/render-test-main.cpp

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,35 +1566,33 @@ static SlangResult _innerMain(
15661566
}
15671567
else
15681568
{
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))
15711571
{
15721572
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;
15731592
}
15741593
}
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);
15961595
deviceWrapper = CachedDeviceWrapper(rhiDevice);
1597-
SLANG_ASSERT(deviceWrapper);
15981596
}
15991597

16001598
for (const auto& feature : requiredFeatureList)

tools/render-test/slang-test-device-cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Slang::ComPtr<rhi::IDevice> DeviceCache::acquireDevice(const rhi::DeviceDesc& de
102102
key.deviceType = desc.deviceType;
103103
key.enableValidation = desc.enableValidation;
104104
key.enableRayTracingValidation = desc.enableRayTracingValidation;
105-
key.profileName = desc.slang.targetProfile ? desc.slang.targetProfile : "";
105+
key.profileName = desc.slang.targetProfile ? desc.slang.targetProfile : "Unknown";
106106

107107
// Add required features to key
108108
for (int i = 0; i < desc.requiredFeatureCount; ++i)

tools/slang-test/slang-test-main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4776,6 +4776,11 @@ static bool shouldRunTest(TestContext* context, String filePath)
47764776
{
47774777
if (filePath.startsWith(excludePrefix))
47784778
{
4779+
if (context->options.verbosity == VerbosityLevel::Verbose)
4780+
{
4781+
context->getTestReporter()->messageFormat(
4782+
TestMessageType::Info, "%s file is excluded from the test because it is found from the exclusion list\n", filePath.getBuffer());
4783+
}
47794784
return false;
47804785
}
47814786
}

0 commit comments

Comments
 (0)