Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a simpler clearValue #414

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Conversation

greggman
Copy link
Collaborator

@greggman greggman commented Apr 3, 2024

This is obviously a personal preference but, ... I feel like the { r: ?, g: ?, b: ?, a: ? } format is left over from before the time when an array of numbers was allowed?

The array of numbers is arguably more useful since all kinds of things can easily provide an array of numbers. So, it seems like it would be good for the samples to show the more useful usage. That way devs are not mislead into thinking they need to take some array of numbers and convert it into the more verbose format.

wdyt?

This is obviously a personal preference but, ... I feel like
the `{ r: ?, g: ?, b: ?, a: ? }` format is left over from before
the time when an array of numbers was allowed?

The array of numbers is arguably more useful since all kinds of things
can easily provide an array of numbers. So, it seems like it would be good
for the samples to show the more useful usage. That way devs are not
mislead into thinking they need to take some array of numbers and
convert it into the more verbose format.
@greggman greggman force-pushed the simpler-clearValue branch from 6ea25c3 to 6f48359 Compare April 3, 2024 21:00
Copy link
Collaborator

@austinEng austinEng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is cleaner

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I prefer using the [0,0,0,0] syntax always. I actually tried to remove the alternate syntax for everything other than colors before 1.0, but there wasn't appetite to do it. I'd probably have been happy to remove it for colors too, but it was not as easy of a sell because for BGRA formats it's still [r,g,b,a] and that's can be a tiny bit confusing.

@greggman greggman merged commit c653759 into webgpu:main Apr 3, 2024
1 check passed
@greggman greggman deleted the simpler-clearValue branch April 3, 2024 23:42
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.

3 participants