From a810aa31f5f366d69e67be96c169fec7d6041df7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 7 Mar 2024 17:28:19 -0800 Subject: Link-time constant and linkage API improvements. (#3708) * Link-time constant and linkage API improvements. * Fix. * Allow module name to be empty. * Fix. * Fix. * Fix compile error. --- source/slang/slang-reflection-api.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-reflection-api.cpp') 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(); if (numThreadsAttribute) { - sizeAlongAxis[0] = numThreadsAttribute->x; - sizeAlongAxis[1] = numThreadsAttribute->y; - sizeAlongAxis[2] = numThreadsAttribute->z; + if (auto cint = as(numThreadsAttribute->x)) + sizeAlongAxis[0] = (SlangUInt)cint->getValue(); + if (auto cint = as(numThreadsAttribute->y)) + sizeAlongAxis[1] = (SlangUInt)cint->getValue(); + if (auto cint = as(numThreadsAttribute->z)) + sizeAlongAxis[2] = (SlangUInt)cint->getValue(); } // -- cgit v1.2.3