summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-cpp.cpp
diff options
context:
space:
mode:
authorMukund Keshava <mkeshava@nvidia.com>2025-06-10 10:18:24 +0530
committerGitHub <noreply@github.com>2025-06-10 04:48:24 +0000
commitd70da65a90ccd73439895a43b3958c0ea1441f35 (patch)
treee6f0c1cd8413e3e213a29bf233b5fc3a3fdf2eaf /source/slang/slang-emit-cpp.cpp
parentab6b5f28d332f201fd96b7e05070116684d02899 (diff)
Add optix support for coopvec (#7286)
* WiP: Add coopvec support for Optix * format code * fix minor issues * Fix review comments --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit-cpp.cpp')
-rw-r--r--source/slang/slang-emit-cpp.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp
index 6f97a11da..8e95cebfb 100644
--- a/source/slang/slang-emit-cpp.cpp
+++ b/source/slang/slang-emit-cpp.cpp
@@ -1152,8 +1152,16 @@ void CPPSourceEmitter::_emitType(IRType* type, DeclaratorInfo* declarator)
auto arrayType = static_cast<IRArrayType*>(type);
auto elementType = arrayType->getElementType();
int elementCount = int(getIntVal(arrayType->getElementCount()));
-
- m_writer->emit("FixedArray<");
+ auto nameHint = arrayType->findDecoration<IRNameHintDecoration>();
+ bool isCoopVec = nameHint && (nameHint->getName() == UnownedStringSlice("CoopVec"));
+ if (isCoopVec && isOptixCoopVec)
+ {
+ m_writer->emit("OptixCoopVec<");
+ }
+ else
+ {
+ m_writer->emit("FixedArray<");
+ }
_emitType(elementType, nullptr);
m_writer->emit(", ");
m_writer->emit(elementCount);