diff options
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index d235c8270..d1adfedc0 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -4033,18 +4033,14 @@ SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize( auto numThreadsAttribute = entryPointFunc.getDecl()->findModifier<NumThreadsAttribute>(); if (numThreadsAttribute) { - if (auto cint = entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->x)) - sizeAlongAxis[0] = (SlangUInt)cint->getValue(); - else if (numThreadsAttribute->x) - sizeAlongAxis[0] = 0; - if (auto cint = entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->y)) - sizeAlongAxis[1] = (SlangUInt)cint->getValue(); - 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; + for (int i = 0; i < 3; ++i) + { + if (auto cint = + entryPointLayout->program->tryFoldIntVal(numThreadsAttribute->extents[i])) + sizeAlongAxis[i] = (SlangUInt)cint->getValue(); + else if (numThreadsAttribute->extents[i]) + sizeAlongAxis[i] = 0; + } } // |
