diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-09 00:39:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-09 00:39:38 -0700 |
| commit | bea1394ad35680940a0b69b9c67efc43764cc194 (patch) | |
| tree | 903eb3befc070a257a85f6522dbd9d5a48950dcb /tools | |
| parent | 132111ab0582493e09898222b275d512719a92b0 (diff) | |
Fix bug related to findAndCheckEntrypoint. (#5241)
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-unit-test/unit-test-find-check-entrypoint.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp b/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp index 423b83b65..122f26ddd 100644 --- a/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp +++ b/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp @@ -19,7 +19,7 @@ SLANG_UNIT_TEST(findAndCheckEntryPoint) { // Source for a module that contains an undecorated entrypoint. const char* userSourceBody = R"( - float4 fragMain(float4 pos:SV_Position) : SV_Position + float4 fragMain(float4 pos:SV_Position) : SV_Target { return pos; } @@ -30,8 +30,8 @@ SLANG_UNIT_TEST(findAndCheckEntryPoint) ComPtr<slang::IGlobalSession> globalSession; SLANG_CHECK(slang_createGlobalSession(SLANG_API_VERSION, globalSession.writeRef()) == SLANG_OK); slang::TargetDesc targetDesc = {}; - targetDesc.format = SLANG_HLSL; - targetDesc.profile = globalSession->findProfile("sm_5_0"); + targetDesc.format = SLANG_SPIRV; + targetDesc.profile = globalSession->findProfile("spirv_1_5"); slang::SessionDesc sessionDesc = {}; sessionDesc.targetCount = 1; sessionDesc.targets = &targetDesc; @@ -58,8 +58,6 @@ SLANG_UNIT_TEST(findAndCheckEntryPoint) ComPtr<slang::IBlob> code; linkedProgram->getEntryPointCode(0, 0, code.writeRef(), diagnosticBlob.writeRef()); SLANG_CHECK(code != nullptr); - - auto codeSrc = UnownedStringSlice((const char*)code->getBufferPointer()); - SLANG_CHECK(codeSrc.indexOf(toSlice("fragMain")) != -1); + SLANG_CHECK(code->getBufferSize() != 0); } |
