summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-cuda.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-01-24 15:06:08 -0500
committerGitHub <noreply@github.com>2020-01-24 15:06:08 -0500
commitb8f294445b998eadb9b09e2b91eb462b881eaf2e (patch)
tree8607e5d2f6c2c2b4b7545a721d6d58e6e557e5c0 /source/slang/slang-emit-cuda.cpp
parent394983d61efa2bf99ba96aa68a47df8927a8a634 (diff)
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.
Diffstat (limited to 'source/slang/slang-emit-cuda.cpp')
-rw-r--r--source/slang/slang-emit-cuda.cpp11
1 files changed, 11 insertions, 0 deletions
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;
}
}