summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-06-28 09:44:33 -0400
committerGitHub <noreply@github.com>2024-06-28 09:44:33 -0400
commit0b5190226b3061597f0fd88ca6b1f304f2c6af38 (patch)
tree3efc2c495b6d5c7eb95a02137c650b51fe054b9f /source
parente49419b0637a357d2e713a0435f0c5ad0c102487 (diff)
fix `WorkgroupSize()` compiler failiure (#4505)
in some cases was not destroying the hoisted to global `WorkgroupSize()` function removed capability requirement on `gl_WorkGroupSize` since no longer appies (kIROp of `WorkgroupSize` is implemented for all targets) change when destroying inst
Diffstat (limited to 'source')
-rw-r--r--source/slang/glsl.meta.slang2
-rw-r--r--source/slang/slang-ir-translate-glsl-global-var.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/glsl.meta.slang b/source/slang/glsl.meta.slang
index 85d39493b..cf314fcdc 100644
--- a/source/slang/glsl.meta.slang
+++ b/source/slang/glsl.meta.slang
@@ -126,7 +126,7 @@ public property uint3 gl_NumWorkGroups {
public property uint3 gl_WorkGroupSize
{
[__unsafeForceInlineEarly]
- [require(glsl_spirv, GLSL_430_SPIRV_1_0_compute)]
+ [require(compute)]
get
{
return WorkgroupSize();
diff --git a/source/slang/slang-ir-translate-glsl-global-var.cpp b/source/slang/slang-ir-translate-glsl-global-var.cpp
index 42e70ac78..8cb7fa8e9 100644
--- a/source/slang/slang-ir-translate-glsl-global-var.cpp
+++ b/source/slang/slang-ir-translate-glsl-global-var.cpp
@@ -262,7 +262,10 @@ namespace Slang
// We need to introduce a global variable and assign value to it in each entry point.
if (!workgroupSizeInst->hasUses())
+ {
+ workgroupSizeInst->removeAndDeallocate();
return;
+ }
builder.setInsertBefore(workgroupSizeInst);
auto globalVar = builder.createGlobalVar(workgroupSizeInst->getFullType());