Read-write operations flushing inside batch environment #1735
Closed
cieplypolar
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Read operations are asynchronous, so it naturally suggests to users that there's no way to start and complete a read within the same batch. I would argue it's important to permit write operations to continue working in batch mode, as when writing a piece of code (especially reusable code), we're not sure whether we're running in a batched environment or not, and imo, we shouldn't have to worry about it. function computeFoo() {
// This code can be run inside a tgpu.batch callback
param.write(123);
action.dispatch();
}For more exotic use-cases, like enqueueing a read during a batch and completing it later, I think it's still valid to allow it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As of PR #1684, read-write operations are allowed to immediately flush command encoder during batch invocation. Personally, I lean towards forbidding this.
Outside the batch environment, there is no reason for read-write operations to flush (since everything is flushed immediately anyway).
It feels odd to enter a batch and then have it interrupted by a read-write operation. User should either perform operation right after the batch or start a new batch for it.
Beta Was this translation helpful? Give feedback.
All reactions