You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot be translated correctly. This "works" in glslang but actually will break as soon as we specialize N_bins to be anything different than 42. The issue is the Offset decoration on struct type members takes a literal, instead of a constant instruction like OpTypeArray does for its length parameter, meaning we can't express the relation with the spec constant.
It's being pointed out to me GLSL mandates specialization constants to not alter struct layouts:
Arrays inside a block may be sized with a specialization constant, but the block will have a static layout. Changing the specialized size will not re-layout the block. In the absence of explicit offsets, the layout will be based on the default size of the array.
This just reads like careful wording around this limitation, in practice I don't see anyone wanting this behavior as the default, let alone the only option. I hope this is reconsidered for future SPIR-V revisions.
Such code:
Cannot be translated correctly. This "works" in glslang but actually will break as soon as we specialize
N_bins
to be anything different than 42. The issue is theOffset
decoration on struct type members takes a literal, instead of a constant instruction likeOpTypeArray
does for its length parameter, meaning we can't express the relation with the spec constant.Generated code for reference:
The text was updated successfully, but these errors were encountered: