summaryrefslogtreecommitdiff
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.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp
index 7af3ce0a3..d91dd5858 100644
--- a/source/slang/slang-reflection-api.cpp
+++ b/source/slang/slang-reflection-api.cpp
@@ -2811,12 +2811,18 @@ SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize(
auto numThreadsAttribute = entryPointFunc.getDecl()->findModifier<NumThreadsAttribute>();
if (numThreadsAttribute)
{
- if (auto cint = as<ConstantIntVal>(numThreadsAttribute->x))
+ if (auto cint = entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->x))
sizeAlongAxis[0] = (SlangUInt)cint->getValue();
- if (auto cint = as<ConstantIntVal>(numThreadsAttribute->y))
+ else if (numThreadsAttribute->x)
+ sizeAlongAxis[0] = 0;
+ if (auto cint = entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->y))
sizeAlongAxis[1] = (SlangUInt)cint->getValue();
- if (auto cint = as<ConstantIntVal>(numThreadsAttribute->z))
+ else if (numThreadsAttribute->y)
+ sizeAlongAxis[1] = 0;
+ if (auto cint = entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->z))
sizeAlongAxis[2] = (SlangUInt)cint->getValue();
+ else if (numThreadsAttribute->z)
+ sizeAlongAxis[2] = 0;
}
//