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

Simplify some type constants #3461

Merged
merged 5 commits into from
Mar 7, 2024
Merged

Simplify some type constants #3461

merged 5 commits into from
Mar 7, 2024

Conversation

dj2
Copy link
Member

@dj2 dj2 commented Mar 7, 2024

This CL adds kAllScalarsAndVec and a
kConvertableToFloatScalarsAndVec helper types which allow removing a couple of the combined type helpers.


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

@dj2 dj2 added the wgsl label Mar 7, 2024
@dj2 dj2 requested a review from zoddicus March 7, 2024 19:02
@dj2 dj2 self-assigned this Mar 7, 2024
Copy link
Contributor

@zoddicus zoddicus left a comment

Choose a reason for hiding this comment

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

overall I like the change, but apparently cannot avoid bikeshedding.

Having now seen the names in situ, how do you feel about changing '*ScalarsAndVec' to '*ScalarsAndVectors' and onlying using the short form when refering to just vectors of a specific dimention? So kAllScalarsAndVec would become kAllScalarsAndVectors, etc.

The existing code is somewhat incosistent on the use of Vec vs Vector(s). I think I would prefer moving to using the full Vectors when talking about vectors in general and the short form, VecN, when talking about a specific size (Since vecN is the syntax in WGSL)

@dj2
Copy link
Member Author

dj2 commented Mar 7, 2024

Done.

@dj2 dj2 requested a review from zoddicus March 7, 2024 19:56
dj2 added 5 commits March 7, 2024 15:23
This CL adds `kAllScalarsAndVec` and a
`kConvertableToFloatScalarsAndVec` helper types which allow removing a
couple of the combined type helpers.
@dj2 dj2 force-pushed the convert_to_float branch from fbcb88c to b9f3bf9 Compare March 7, 2024 20:30
@dj2 dj2 merged commit adaa479 into gpuweb:main Mar 7, 2024
1 check passed
@dj2 dj2 deleted the convert_to_float branch March 7, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants