-
Notifications
You must be signed in to change notification settings - Fork 335
Add size
to setIndexBuffer/setVertexBuffer.
#554
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
Conversation
If `size` is zero, the size of the {{GPUBuffer}} is used. (Binding a subset instead of the whole buffer allows for concurrent use of other parts of the buffer) This potentially includes mapping subsets of otherwise in-use buffers.
If we are to start talking about buffer subrange usage tracking, we'll need a lot more detailed proposal than this. The note in parenthesis has HUGE implications for everything else that deals with buffers. |
I don't think we need an explicit proposal. It's possible today for implementations to do some degree of concurrent use, but this makes it easier even if we never go further at the API level. |
Sounds good, also as @kvark pointed out on chat it makes the API more regular because with this PR all buffer entrypoints taking an offset also take a size. Can we still remove that note in parenthesis? Either the spec explicitly deal with subranges, or it falls under the as-if rule. |
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 like this for making our API consistent: in all the places where a resource is used we specify the exact part of the resource being used.
Also related - #491 (comment) |
Fixed, PTAL! |
Yep, remaining size, updated. PTAL! |
* Add `size` to setIndexBuffer/setVertexBuffer. If `size` is zero, the size of the {{GPUBuffer}} is used. (Binding a subset instead of the whole buffer allows for concurrent use of other parts of the buffer) This potentially opens the door to mapping subsets of otherwise in-use buffers. * Remove in-spec comment speculating on sub-range validation. * `size=0` => remaining size *after offset*.
* Add `size` to setIndexBuffer/setVertexBuffer. If `size` is zero, the size of the {{GPUBuffer}} is used. (Binding a subset instead of the whole buffer allows for concurrent use of other parts of the buffer) This potentially opens the door to mapping subsets of otherwise in-use buffers. * Remove in-spec comment speculating on sub-range validation. * `size=0` => remaining size *after offset*.
- Added descriptions to all tests - Fixed naming where appropriate - Added more test cases to the viewDimensions test. <hr> **Author checklist for test code/plans:** - [x] All outstanding work is tracked with "TODO" in a test/file description or `.unimplemented()` on a test. - [x] New helpers, if any, are documented in `helper_index.md`. - [x] (Optional, sometimes not possible.) Tests pass (or partially pass without unexpected issues) in an implementation. (Add any extra details above.) **[Reviewer sign-off](https://github.com/gpuweb/cts/blob/main/docs/reviews.md) for test code/plans:** (Note: feel free to pull in other reviewers at any time for any reason.) - [x] The test path is reasonable, the [description](https://github.com/gpuweb/cts/blob/main/docs/intro/plans.md) "describes the test, succinctly, but in enough detail that a reader can read only the test plans in a file or directory and evaluate the completeness of the test coverage." - [ ] Tests appear to cover this area completely, except for outstanding TODOs. Validation tests use control cases. (This is critical for coverage. Assume anything without a TODO will be forgotten about forever.) - [x] Existing (or new) test helpers are used where they would reduce complexity. - [x] TypeScript code is readable and understandable (is unobtrusive, has reasonable type-safety/verbosity/dynamicity).
This potentially includes mapping subsets of otherwise in-use buffers.
Preview | Diff