diff options
| author | Mukund Keshava <mkeshava@nvidia.com> | 2025-06-10 10:18:24 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-10 04:48:24 +0000 |
| commit | d70da65a90ccd73439895a43b3958c0ea1441f35 (patch) | |
| tree | e6f0c1cd8413e3e213a29bf233b5fc3a3fdf2eaf /source/slang/slang-emit-cpp.cpp | |
| parent | ab6b5f28d332f201fd96b7e05070116684d02899 (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.cpp | 12 |
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); |
