-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support array bindings of buffers #2282
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #2282 +/- ##
=======================================
Coverage 82.19% 82.19%
=======================================
Files 82 82
Lines 44267 44296 +29
=======================================
+ Hits 36384 36410 +26
- Misses 7883 7886 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
faf65b0
to
777f5e5
Compare
a5d2d09
to
7866e97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments so far:
src/valid/type.rs
Outdated
if base >= handle { | ||
return Err(TypeError::UnresolvedBase(base)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need these checks any more, since they're all handled up front in valid/handles.rs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are still doing these checks for Ti::Pointer
and Ti::Array
, so this one is there for consistency. If we want to remove them all, that's fine by me, but should be done separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do want to remove them all, since they're redundant. There's no reason to make more work for the person who has to clean that up. Filed as #2303.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be removed in this PR if you don't want. It's not like we'll be able to miss it when we fix #2303.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI seems to now be failing due to this since we already merged #2308.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see why TypeFlags::DATA
is needed, but I'd also like us to pass this test, in the wgsl-errors.rs
style:
#[test]
fn binding_array_local() {
check_validation! {
"fn f() { var x: binding_array<i32, 4>; }":
Err(_)
}
}
@jimblandy take a look at the new commit. We aren't putting DATA on the binding arrays any more. |
728e41e
to
a067ea5
Compare
How about this one:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that test case I posted above shows that validate_global_var
can't quite treat a binding_array<T>
just like a T
, although there's good reason to think that's usually the right thing.
Is this comment on
Because, we certainly do generate pointers to binding arrays in the IR now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than these issues, and the additional test I mentioned above, this looks good to go.
@jimblandy thanks for suggestions! New validation error is added, tests improved, and documentation patches applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* Support buffer resource arrays in IR, wgsl-in, and spv-out * spv-out: refactor non-uniform indexing semantics to support buffers * Update the doc comment on BindingArray type * Improve TypeInfo restrictions on binding arrays * Strip DATA out of binding arrays * Include suggested documentation, more binding array tests, enforce structs
* Support buffer resource arrays in IR, wgsl-in, and spv-out * spv-out: refactor non-uniform indexing semantics to support buffers * Update the doc comment on BindingArray type * Improve TypeInfo restrictions on binding arrays * Strip DATA out of binding arrays * Include suggested documentation, more binding array tests, enforce structs
Built upon #2256 , which should land first. I can also move this one out (so far just one commit).
Only WGSL -> IR -> SPV path supported right now.
Closes #1864