From b8f294445b998eadb9b09e2b91eb462b881eaf2e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 24 Jan 2020 15:06:08 -0500 Subject: Texture Sample available in CUDA (#1176) * WIP: Trying to figure out how texturing will work with CUDA. * WIP: Fixes for CUDA layout. Initial CUDA texture test. * WIP: Outputs something compilable by CUDA for TextureND.Sample * 2d texture working with CUDA. * Fix how binding for SamplerState occurs in CUDA. * Small tidy up of comments. --- source/slang/slang-emit-cuda.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (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 93508813b..26d6eada0 100644 --- a/source/slang/slang-emit-cuda.cpp +++ b/source/slang/slang-emit-cuda.cpp @@ -89,6 +89,9 @@ SlangResult CUDASourceEmitter::_calcCUDATextureTypeName(IRTextureTypeBase* texTy return SLANG_FAIL; } + outName << "CUtexObject"; + +#if 0 outName << "texture<"; outName << _getTypeName(texType->getElementType()); outName << ", "; @@ -124,6 +127,7 @@ SlangResult CUDASourceEmitter::_calcCUDATextureTypeName(IRTextureTypeBase* texTy } outName << ">"; +#endif return SLANG_OK; } @@ -312,6 +316,13 @@ SlangResult CUDASourceEmitter::calcTypeName(IRType* type, CodeGenTarget target, } } + switch (type->op) + { + case kIROp_SamplerStateType: out << "SamplerState"; return SLANG_OK; + case kIROp_SamplerComparisonStateType: out << "SamplerComparisonState"; return SLANG_OK; + default: break; + } + break; } } -- cgit v1.2.3