summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorNathan V. Morrical <natemorrical@gmail.com>2021-05-04 12:52:58 -0700
committerGitHub <noreply@github.com>2021-05-04 12:52:58 -0700
commita342080a4d58a5a1a3597ac34b0335202ec7c435 (patch)
tree41dca7ad95b99cf4952f1409b0320c5a96af1ff2 /source
parent1c643167a9417e75082b3898425ab9d2d999f583 (diff)
Add support for RaytracingAccelerationStructure type for PTX targets (#1831)
* enabling command line compiler to output PTX with multiple entry points. * adding some simple optix intrinsics to slang * Now handling the kIROp_RaytracingAccelerationStructureType for CUDA. Source seems to generate correctly, but accels are always optimized out of resulting PTX due to no trace calls * fixing unnecessary diff with master * allowing unhandled untyped buffers to fall through to super::calcTypeName Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-cuda.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp
index b0c2cc02b..dbe089723 100644
--- a/source/slang/slang-emit-cuda.cpp
+++ b/source/slang/slang-emit-cuda.cpp
@@ -314,6 +314,20 @@ SlangResult CUDASourceEmitter::calcTypeName(IRType* type, CodeGenTarget target,
}
}
+ if (auto untypedBufferType = as<IRUntypedBufferResourceType>(type)) {
+ switch (untypedBufferType->getOp())
+ {
+ case kIROp_RaytracingAccelerationStructureType:
+ {
+ m_writer->emit("OptixTraversableHandle");
+ return SLANG_OK;
+ break;
+ }
+
+ default: break;
+ }
+ }
+
return Super::calcTypeName(type, target, out);
}