diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-06-02 14:13:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-02 14:13:35 -0400 |
| commit | b39c99661b3ad482bbd419c24991ed325b5738a9 (patch) | |
| tree | 0f90fecdae10e704b2c1135c48ca5eeafa60b780 /source/slang/slang-type-layout.cpp | |
| parent | bc6bc56db51d06b92dc63ef9c9e0def6c9760c9e (diff) | |
COM interfaces with host callable (#2258)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Use TerminatedUnownedStringSlice for literals in output C++.
* Remove Escape/Unescape functions used in slang-token-reader.cpp
Add target type of 'host-cpp' etc to map to the target types.
* Fix some corner cases around string encoding.
* Added unit test for string escaping.
Fixed some assorted escaping bugs.
* Updated test output.
* Added decode test.
* Stop using hex output, to get around 'greedy' aspect. Use octal instead.
* Added HostHostCallable
Small changes to use ArtifactDesc/Info instead of large switches.
* Fix C++ emit to handle arbitrary function export.
* Add options handling for callable without an output being specified.
* Can compile with COM interface. Added example using com interface.
* Use the IR Ptr type instead of hack in C++ emit for interfaces.
* Fix issue with outputting the COM call when ptr is used.
* Fix crash issue on compilation failure.
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
| -rw-r--r-- | source/slang/slang-type-layout.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp index cd81c6173..09a21fb6f 100644 --- a/source/slang/slang-type-layout.cpp +++ b/source/slang/slang-type-layout.cpp @@ -4,6 +4,8 @@ #include "slang-syntax.h" #include "slang-ir-insts.h" +#include "../compiler-core/slang-artifact-info.h" + #include <assert.h> namespace Slang { @@ -1403,6 +1405,7 @@ LayoutRulesFamilyImpl* getDefaultLayoutRulesFamilyForTarget(TargetRequest* targe case CodeGenTarget::SPIRVAssembly: return &kGLSLLayoutRulesFamilyImpl; + case CodeGenTarget::HostHostCallable: case CodeGenTarget::ShaderHostCallable: case CodeGenTarget::HostExecutable: case CodeGenTarget::ShaderSharedLibrary: @@ -1603,18 +1606,7 @@ bool isKhronosTarget(TargetRequest* targetReq) bool isCPUTarget(TargetRequest* targetReq) { - switch( targetReq->getTarget() ) - { - default: - return false; - - case CodeGenTarget::CPPSource: - case CodeGenTarget::CSource: - case CodeGenTarget::ShaderHostCallable: - case CodeGenTarget::HostExecutable: - case CodeGenTarget::ShaderSharedLibrary: - return true; - } + return ArtifactInfoUtil::isCpuTarget(ArtifactDesc::makeFromCompileTarget(asExternal(targetReq->getTarget()))); } bool isCUDATarget(TargetRequest* targetReq) |
