Open bbb651 opened 1 month ago
As there are workarounds for this and this seems fairly specialized of a domain, I wonder if we should leave this to users to take care of.
I think dealing with just the most common ones is worthwhile, e.g. ba
specifically seems to be used a lot (1.4k results with a very conservative query just for shaders), because it's both the second half of rgba
, and it's also used a lot for b - a
with vectors (along with cb
, pa
, oa
).
Sorry for the delay, some conferences and other responsibilities have eaten up my time.
Looking at those search results, I'm seeing it used a lot in conjunction with other two letter words as you pointed out (pa
). If you hadn't brought up pa
in a follow up comment, we could have moved forward with some of these but not all. If someone then suggested a correction for pa
(which I guess they wouldn't as its a word but for illustrative purposes), we'd then run into this again. What I'm wondering is what we should include, how do we determine that set, and where should we draw the line. For example, you highlight ba
over the other combinations of rgba
. If someone comes and creates an issue because rab
starts getting corrected to rad
, should we do so based on the precedence of this issue?
On a related note, #1079 suggests a min-word-length to help with false positives like this. This can currently be done via a regex.
The issue appears in iced with
wgsl
shaders here and here.In general, using any sequence of
r
,g
,b
,a
up to ~4 characters appears commonly in shaders with swizzling.