diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gfx/d3d12/d3d12-shader-table.cpp | 2 | ||||
| -rw-r--r-- | tools/slang-unit-test/unit-test-record-replay.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/gfx/d3d12/d3d12-shader-table.cpp b/tools/gfx/d3d12/d3d12-shader-table.cpp index be537c737..66d63bed1 100644 --- a/tools/gfx/d3d12/d3d12-shader-table.cpp +++ b/tools/gfx/d3d12/d3d12-shader-table.cpp @@ -61,6 +61,8 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer( if (name.getLength()) { void* shaderId = stateObjectProperties->GetShaderIdentifier(name.toWString().begin()); + if (nullptr == shaderId) + throw Exception(String("Failed to get shader identifier for '") + name + "'"); memcpy(dest, shaderId, D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES); } if (overwrite.size) diff --git a/tools/slang-unit-test/unit-test-record-replay.cpp b/tools/slang-unit-test/unit-test-record-replay.cpp index b6ed99aa5..efa01a67c 100644 --- a/tools/slang-unit-test/unit-test-record-replay.cpp +++ b/tools/slang-unit-test/unit-test-record-replay.cpp @@ -268,6 +268,11 @@ static SlangResult replayExample(UnitTestContext* context, List<entryHashInfo>& { List<String> fileNames; findRecordFileName(&fileNames); + if (fileNames.getCount() == 0) + { + getTestReporter()->message(TestMessageType::TestFailure, "No record files found\n"); + return SLANG_FAIL; + } List<String> optArgs; String recordFileName = Path::combine("slang-record", fileNames[0]); @@ -406,7 +411,7 @@ static SlangResult runTest(UnitTestContext* context, const char* testName) } error: - res = cleanupRecordFiles(); + cleanupRecordFiles(); return res; } |
