summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-cuda.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-05-17 17:27:12 -0400
committerGitHub <noreply@github.com>2022-05-17 17:27:12 -0400
commit05c4c2679ae979cfcb61e4c2acdb432c34384ddb (patch)
treeda146d2f90a28319a32bcb27ea33acec21537265 /source/slang/slang-emit-cuda.cpp
parent39fb45484996f9d71b6551239dbf55eaaaf8db1f (diff)
Refactor prelude emit (#2236)
* #include an absolute path didn't work - because paths were taken to always be relative. * Refactor how prelude output works in emit. * Small improvement to emit output. * Move around comment on target specific language directives based on review. Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit-cuda.cpp')
-rw-r--r--source/slang/slang-emit-cuda.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp
index f7850179d..eda30b956 100644
--- a/source/slang/slang-emit-cuda.cpp
+++ b/source/slang/slang-emit-cuda.cpp
@@ -840,11 +840,6 @@ void CUDASourceEmitter::handleRequiredCapabilitiesImpl(IRInst* inst)
}
}
-void CUDASourceEmitter::emitLayoutDirectivesImpl(TargetRequest* targetReq)
-{
- SLANG_UNUSED(targetReq);
-}
-
void CUDASourceEmitter::emitVectorTypeNameImpl(IRType* elementType, IRIntegerValue elementCount)
{
m_writer->emit(getVectorPrefix(elementType->getOp()));
@@ -933,10 +928,12 @@ void CUDASourceEmitter::emitMatrixLayoutModifiersImpl(IRVarLayout* layout)
Super::emitMatrixLayoutModifiersImpl(layout);
}
-void CUDASourceEmitter::emitPreprocessorDirectivesImpl()
+void CUDASourceEmitter::emitPreModuleImpl()
{
SourceWriter* writer = getSourceWriter();
+ // Emit generated types/functions
+
writer->emit("\n");
{
@@ -961,6 +958,7 @@ void CUDASourceEmitter::emitPreprocessorDirectivesImpl()
}
}
+
bool CUDASourceEmitter::tryEmitGlobalParamImpl(IRGlobalParam* varDecl, IRType* varType)
{
// A global shader parameter in the IR for CUDA output will