Skip to content

Replaced float4 .w with more appropriate and functionally identical .a#206

Merged
stackotter merged 2 commits intostackotter:mainfrom
WilliamIsMe1:patch-1
Apr 15, 2026
Merged

Replaced float4 .w with more appropriate and functionally identical .a#206
stackotter merged 2 commits intostackotter:mainfrom
WilliamIsMe1:patch-1

Conversation

@WilliamIsMe1
Copy link
Copy Markdown
Contributor

float4.rgba is the same as float4.xyzw

Description

The use of the .w accessor (or whatever) for a variable named color, especially when it is clear that the alpha value is being checked, can confuse code readers. So I just replaced .w with .a, and in this case, it is functionally identical. All color float4s in metal shaders always use RGBA format.

Type of change

Consistency change

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation comments
  • My changes generate no new warnings

@stackotter
Copy link
Copy Markdown
Owner

Thanks for that, no clue why I used w there given that it’s quite literally an alpha check hahah

@stackotter
Copy link
Copy Markdown
Owner

Damn, the Linux workflows are failing cause it’s been so long. I may have to quickly update those before merging this to avoid getting stuck with failing CI on main

@stackotter
Copy link
Copy Markdown
Owner

I've fixed the CI in #207. I'll merge that first and then you can update this branch (rebase or merge; whichever you prefer) and then the CI should work again. #207 also merges in a ton of other changes that have been sitting on the inventory branch for ages, but I don't believe that any of them should clash with your change.

@stackotter stackotter merged commit 70cd0ed into stackotter:main Apr 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants