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
[[workgroup_size N N N, foo bar]] "comma-delimited list"
[[workgroup_size (N N N), foo bar]] "paren-tuples"
Is [[foo (bar)]] valid?
[[workgroup_size [N N N], foo bar]] "square-bracket-tuples"
[N,N,N] feels like an array, but what if it were [N, cw|ccw]? Paren-tuples are more flexible, even if we don't have them elsewhere in the language yet.
Also [[workgroup_size [N N N]]] is gross, even if we can manage to parse it.
[[workgroup size(N N N), foo bar]] "pseudo-function attribute values"
dneto0:
On the "how to I write many attributes" front, early on we at Google decided that [[attr, attr2]] was better than [[attr]] [[attr2]]. It was less fussy and less typing.
kainino0x:
[[workgroup_size somesyntaxhere]] [[foo bar]] [[workgroup_size(x, y, z), foo(bar)]] @workgroup_size(x, y, z) @foo(bar)
For HLSL, we discussed this and chose [[vk::binding(3, 2)]], where the arguments are required binding followed by optional set.
Really seems worth following precedence here in C++, GLSL, HLSL, probably many others, and saving time as well.
kainino0x:
I'm in favor of using the C++ style (or a similar style from another language) and making it work nicely for what we have already (e.g. [[position]] or [[builtin::position]], but not [[builtin(position)]]).
Too many places referring to the same thing. I've changed to preferring the [[workgroup_size(1, 2, 3), stage(compute)]] format as well after seeing the [[stage compute, workgroup_size 8 1 1]] example in the entry point CL. I find the second harder to read.
I'm fine with function-style syntax, taking the lead from C++.
Basically, I buy the arguments from @johnkslang.
E.g. it leaves an open path for namespaces.
Activity
kainino0x commentedon Sep 11, 2020
jdashg:
dneto0:
kainino0x:
johnkslang:
kainino0x:
kvark commentedon Sep 11, 2020
[[workgroup_size(x, y, z), foo(bar)]]is my preference :)dj2 commentedon Sep 14, 2020
[[workgroup_size N N N, foo bar]] "comma-delimited list"would be my preference.dj2 commentedon Sep 14, 2020
Too many places referring to the same thing. I've changed to preferring the
[[workgroup_size(1, 2, 3), stage(compute)]]format as well after seeing the[[stage compute, workgroup_size 8 1 1]]example in the entry point CL. I find the second harder to read.dneto0 commentedon Sep 15, 2020
I'm fine with function-style syntax, taking the lead from C++.
Basically, I buy the arguments from @johnkslang.
E.g. it leaves an open path for namespaces.
kainino0x commentedon Sep 15, 2020
Resolution: Use the C++ style. Allow both
[[attr(x, y), attr(z)]]and[[attr(x, y)]] [[attr(z)]]. (No namespacing for now.)[wgsl] Change attributes to be c++ style. (#1080)
Convert attribute lists to allow multiple entries. (#1083)