summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-reflection-api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
-rw-r--r--source/slang/slang-reflection-api.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp
index b9eeccd30..7af3ce0a3 100644
--- a/source/slang/slang-reflection-api.cpp
+++ b/source/slang/slang-reflection-api.cpp
@@ -2811,9 +2811,12 @@ SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize(
auto numThreadsAttribute = entryPointFunc.getDecl()->findModifier<NumThreadsAttribute>();
if (numThreadsAttribute)
{
- sizeAlongAxis[0] = numThreadsAttribute->x;
- sizeAlongAxis[1] = numThreadsAttribute->y;
- sizeAlongAxis[2] = numThreadsAttribute->z;
+ if (auto cint = as<ConstantIntVal>(numThreadsAttribute->x))
+ sizeAlongAxis[0] = (SlangUInt)cint->getValue();
+ if (auto cint = as<ConstantIntVal>(numThreadsAttribute->y))
+ sizeAlongAxis[1] = (SlangUInt)cint->getValue();
+ if (auto cint = as<ConstantIntVal>(numThreadsAttribute->z))
+ sizeAlongAxis[2] = (SlangUInt)cint->getValue();
}
//