From 05c4c2679ae979cfcb61e4c2acdb432c34384ddb Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 17 May 2022 17:27:12 -0400 Subject: 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> --- source/slang/slang-emit-cuda.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/slang/slang-emit-cuda.cpp') 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 -- cgit v1.2.3