summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-21 12:22:31 -0800
committerGitHub <noreply@github.com>2024-02-21 12:22:31 -0800
commitb3b6c44cb8b8ebc413d41f9ca3833d8242f3c805 (patch)
treee73edb286c8179f7fc3677b75bfa2468eb811e60 /source
parent70ea0b048970b9d2e00451636c88313093de2337 (diff)
Fix SPIRV lowering issue. (#3608)
* Fix SPIRV pointer lowering issue. Fixes #3605. * Add another pointer test. Fixes #3601. * Fixes #3600. * Fix #3595.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-check-shader.cpp4
-rw-r--r--source/slang/slang-emit-spirv.cpp1
-rw-r--r--source/slang/slang.cpp4
3 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-check-shader.cpp b/source/slang/slang-check-shader.cpp
index 7a39f114b..1aa93d019 100644
--- a/source/slang/slang-check-shader.cpp
+++ b/source/slang/slang-check-shader.cpp
@@ -731,6 +731,10 @@ namespace Slang
// scope.
workList.add(fileDecl);
}
+ else if (auto namespaceDecl = as<NamespaceDecl>(globalDecl))
+ {
+ workList.add(namespaceDecl);
+ }
}
}
}
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 784ded1c9..b9e868b89 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -5287,6 +5287,7 @@ SlangResult emitSPIRVFromIR(
for (auto ptrType : context.m_forwardDeclaredPointers)
{
auto spvPtrType = context.m_mapIRInstToSpvInst[ptrType];
+ context.ensureInst(ptrType->getValueType());
auto parent = spvPtrType->parent;
spvPtrType->removeFromParent();
parent->addInst(spvPtrType);
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index a1627286d..62fb3cbdb 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -5878,7 +5878,7 @@ SlangResult EndToEndCompileRequest::getEntryPointCodeBlob(int entryPointIndex, i
SLANG_RETURN_ON_FAIL(_getEntryPointResult(this, entryPointIndex, targetIndex, artifact));
SLANG_RETURN_ON_FAIL(artifact->loadBlob(ArtifactKeep::Yes, outBlob));
- return SLANG_E_NOT_AVAILABLE;
+ return SLANG_OK;
}
SlangResult EndToEndCompileRequest::getEntryPointHostCallable(int entryPointIndex, int targetIndex, ISlangSharedLibrary** outSharedLibrary)
@@ -5887,7 +5887,7 @@ SlangResult EndToEndCompileRequest::getEntryPointHostCallable(int entryPointInde
ComPtr<IArtifact> artifact;
SLANG_RETURN_ON_FAIL(_getEntryPointResult(this, entryPointIndex, targetIndex, artifact));
SLANG_RETURN_ON_FAIL(artifact->loadSharedLibrary(ArtifactKeep::Yes, outSharedLibrary));
- return SLANG_E_NOT_AVAILABLE;
+ return SLANG_OK;
}
SlangResult EndToEndCompileRequest::getTargetCodeBlob(int targetIndex, ISlangBlob** outBlob)