summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-modifier.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-10 12:39:17 -0700
committerGitHub <noreply@github.com>2024-04-10 12:39:17 -0700
commita6d59d0e102e2d21d411a7ca1f8acaf3bf1f867c (patch)
tree03c28a604f1b5dc0b47aa24542d4dfd61b813aba /source/slang/slang-check-modifier.cpp
parentc85dd531d31e5a241d220f20686a9c047432f1c6 (diff)
Properly compile `gl_WorkgroupSize`. (#3925)
* Properly compile `gl_WorkgroupSize`. * Update source/slang/slang-ir-translate-glsl-global-var.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
-rw-r--r--source/slang/slang-check-modifier.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp
index af47eaedb..6d39f977c 100644
--- a/source/slang/slang-check-modifier.cpp
+++ b/source/slang/slang-check-modifier.cpp
@@ -348,8 +348,15 @@ namespace Slang
getSink()->diagnose(attr, Diagnostics::nonPositiveNumThreads, constIntVal->getValue());
return false;
}
+ if (intValue->getType() != m_astBuilder->getIntType())
+ {
+ intValue = m_astBuilder->getIntVal(m_astBuilder->getIntType(), constIntVal->getValue());
+ }
}
+ // Make sure we always canonicalize the type to int.
value = intValue;
+ if (value->getType() != m_astBuilder->getIntType())
+ value = m_astBuilder->getTypeCastIntVal(m_astBuilder->getIntType(), value);
}
else
{