From 0eed0125fa5e5f425d546efdc2b284b09ffc2785 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Sat, 8 Feb 2020 11:19:31 -0500 Subject: Fixes to make all CPU compute shaders work on CUDA (#1211) * Launch CUDA test taking into account dispatch size. * Enable isCPUOnly hack to work on CUDA. * Rename 'isCPUOnly' hack to 'onlyCPULikeBinding'. * Add $T special type. Support SampleLevel on CUDA. * Fix typo. --- source/slang/slang-emit-c-like.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index a383caecf..2212cf9cc 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -1367,6 +1367,22 @@ void CLikeSourceEmitter::emitIntrinsicCallExprImpl( } break; + case 'T': + // Get the the 'element' type for the type of the param at the index + { + SLANG_RELEASE_ASSERT(*cursor >= '0' && *cursor <= '9'); + Index argIndex = (*cursor++) - '0'; + SLANG_RELEASE_ASSERT(argCount > argIndex); + + IRType* type = args[argIndex].get()->getDataType(); + if (auto baseTextureType = as(type)) + { + type = baseTextureType->getElementType(); + } + emitType(type); + } + break; + case 'S': // Get the scalar type of a generic at specified index { -- cgit v1.2.3