summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-cuda.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-02-18 14:14:16 -0500
committerGitHub <noreply@github.com>2020-02-18 14:14:16 -0500
commit8ee39e08c48a315163fe1850dbb12ca292020d4d (patch)
tree5041064a194849399aa587ac13b46db2088bdb05 /source/slang/slang-emit-cuda.cpp
parente109985375712b449d365450b3d3e39416a171ce (diff)
First pass Texture Array support on CUDA/CPU (#1225)
* Add cubemap support. * Add CUDA fence instrinsics. * Added Gather for CUDA. * Use the CUDA driver API as much as possible. * * Support 1D texture on CPU * WIP on 1D texture on CUDA * Added simplified texture test * Fix test. * Improve texture-simple tests. * * Add CPU support for 3d textures * Add support for mip maps to CUDA * Disable warnings in nvrtc * Update CUDA docs * WIP on 3d texture support. * Add support for 3d textures for CPU and CUDA. * CPU and CUDA support for cube maps. * Add CPU support for Texture1DArray. * Support CUDA Layered/Array type in meta library.
Diffstat (limited to 'source/slang/slang-emit-cuda.cpp')
-rw-r--r--source/slang/slang-emit-cuda.cpp44
1 files changed, 8 insertions, 36 deletions
diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp
index 0bbaafa5b..262a67784 100644
--- a/source/slang/slang-emit-cuda.cpp
+++ b/source/slang/slang-emit-cuda.cpp
@@ -81,57 +81,29 @@ static bool _isSingleNameBasicType(IROp op)
SlangResult CUDASourceEmitter::_calcCUDATextureTypeName(IRTextureTypeBase* texType, StringBuilder& outName)
{
- // texture<float, cudaTextureType2D, cudaReadModeElementType> texRef;
-
// Not clear how to do this yet
- if (texType->isMultisample() || texType->isArray())
+ if (texType->isMultisample())
{
return SLANG_FAIL;
}
- outName << "CUtexObject";
-
-#if 0
- outName << "texture<";
- outName << _getTypeName(texType->getElementType());
- outName << ", ";
-
- switch (texType->GetBaseShape())
- {
- case TextureFlavor::Shape::Shape1D: outName << "cudaTextureType1D"; break;
- case TextureFlavor::Shape::Shape2D: outName << "cudaTextureType2D"; break;
- case TextureFlavor::Shape::Shape3D: outName << "cudaTextureType3D"; break;
- case TextureFlavor::Shape::ShapeCube: outName << "cudaTextureTypeCubemap"; break;
- case TextureFlavor::Shape::ShapeBuffer: outName << "Buffer"; break;
- default:
- SLANG_DIAGNOSE_UNEXPECTED(getSink(), SourceLoc(), "unhandled resource shape");
- return SLANG_FAIL;
- }
-
- outName << ", ";
-
switch (texType->getAccess())
{
case SLANG_RESOURCE_ACCESS_READ:
{
- // Other value is cudaReadModeNormalizedFloat
-
- outName << "cudaReadModeElementType";
- break;
+ outName << "CUtexObject";
+ return SLANG_OK;
}
- default:
+ case SLANG_RESOURCE_ACCESS_READ_WRITE:
{
- SLANG_DIAGNOSE_UNEXPECTED(getSink(), SourceLoc(), "unhandled resource access mode");
- return SLANG_FAIL;
+ outName << "CUsurfObject";
+ return SLANG_OK;
}
+ default: break;
}
-
- outName << ">";
-#endif
- return SLANG_OK;
+ return SLANG_FAIL;
}
-
SlangResult CUDASourceEmitter::calcScalarFuncName(HLSLIntrinsic::Op op, IRBasicType* type, StringBuilder& outBuilder)
{
typedef HLSLIntrinsic::Op Op;