As of gfx-rs/naga#2147, the WGSL back end will fail to generate code for modules that use naga::BuiltIn::WorkGroupSize, corresponding to GLSL gl_WorkgroupSize and the SPIR-V WorkgroupSize builtin.
It might make sense to remove Builtin::WorkGroupSize from Naga altogether:
WGSL requires all compute shader entry points to have the a @workgroup_size attribute.
Naga requires the workgroup size to be a static property of the entry point: the size is stored in EntryPoint::workgroup_size.
The SPIR-V spec says that WorkgroupSize builtin is deprecated in favor of the LocalSizeId execution mode, which is a compile-time property of the entry point.
GLSL requires the workgroup size to be specified statically as well via the local_size_x, local_size_y, and local_size_z layout qualifier identifiers; gl_WorkgroupSize is just a reflection of what those identifiers specify.
It might be possible to have the GLSL and SPIR-V front ends just replace uses of gl_WorkgroupSize and WorkgroupSize builtins with the given constants.
If we do keep naga::BuiltIn::WorkGroupSize, then we ought to generate code for it, probably by simply grabbing the value of EntryPoint::workgroup_size.
As of gfx-rs/naga#2147, the WGSL back end will fail to generate code for modules that use
naga::BuiltIn::WorkGroupSize
, corresponding to GLSLgl_WorkgroupSize
and the SPIR-VWorkgroupSize
builtin.It might make sense to remove
Builtin::WorkGroupSize
from Naga altogether:@workgroup_size
attribute.EntryPoint::workgroup_size
.WorkgroupSize
builtin is deprecated in favor of theLocalSizeId
execution mode, which is a compile-time property of the entry point.local_size_x
,local_size_y
, andlocal_size_z
layout qualifier identifiers;gl_WorkgroupSize
is just a reflection of what those identifiers specify.It might be possible to have the GLSL and SPIR-V front ends just replace uses of
gl_WorkgroupSize
andWorkgroupSize
builtins with the given constants.If we do keep
naga::BuiltIn::WorkGroupSize
, then we ought to generate code for it, probably by simply grabbing the value ofEntryPoint::workgroup_size
.