From b39c99661b3ad482bbd419c24991ed325b5738a9 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 2 Jun 2022 14:13:35 -0400 Subject: 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. --- source/slang/slang-emit-cpp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-emit-cpp.h') diff --git a/source/slang/slang-emit-cpp.h b/source/slang/slang-emit-cpp.h index 0d9327b9e..f5ba35933 100644 --- a/source/slang/slang-emit-cpp.h +++ b/source/slang/slang-emit-cpp.h @@ -74,7 +74,8 @@ protected: virtual bool tryEmitGlobalParamImpl(IRGlobalParam* varDecl, IRType* varType) SLANG_OVERRIDE; virtual void emitIntrinsicCallExprImpl(IRCall* inst, IRTargetIntrinsicDecoration* targetIntrinsic, EmitOpInfo const& inOuterPrec) SLANG_OVERRIDE; virtual void emitLoopControlDecorationImpl(IRLoopControlDecoration* decl) SLANG_OVERRIDE; - + virtual void emitFuncDecorationsImpl(IRFunc* func) SLANG_OVERRIDE; + virtual const UnownedStringSlice* getVectorElementNames(BaseType elemType, Index elemCount); // Replaceable for classes derived from CPPSourceEmitter @@ -153,6 +154,8 @@ protected: // They must be emitted last, after the entire `Context` class so those member functions defined // in `Context` may be referenced. List pendingWitnessTableDefinitions; + + bool m_hasString = false; }; } -- cgit v1.2.3