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

Fences can't leave funclet boundaries #15

Open
od0x0 opened this issue Sep 4, 2022 · 0 comments
Open

Fences can't leave funclet boundaries #15

od0x0 opened this issue Sep 4, 2022 · 0 comments
Labels
core Essential (planned) functionality or maintenance deferred enhancement New feature or request

Comments

@od0x0
Copy link
Collaborator

od0x0 commented Sep 4, 2022

Apart from inline join points, fences can't escape the scope they were created in. This is a problem for interacting with external wgpu code, which must create its own fence after the caiman code has run and sync later than might be necessary. It also means that some very reasonable cpu <-> gpu scheduling patterns will have more aggressive synchronization. Synchronization between frames on only part of a frame's submissions in a renderer won't be possible, for example.

This issue occurs because fences need to be represented as a pinned box in Rust when crossing the function boundary, so they need to be converted from the local impl Trait either at creation time or later. The latest wgpu has a different method of handling synchronization, so that's yet more headache. Theoretically, we could resolve this by creating fences in a cpu buffer handed from the calling context. Another slight wrinkle is that fences, in the caiman core language, are effectively treated as memoryless abstract objects. It's a useful simplification, but predictably a flawed one.

I'm inclined to ignore this for as long as possible because I don't care enough about wgpu to want to build a tailor-made solution. The problem is that it might be necessary depending on what examples we need to write.

@od0x0 od0x0 added bug Something isn't working deferred core Essential (planned) functionality or maintenance enhancement New feature or request and removed bug Something isn't working labels Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Essential (planned) functionality or maintenance deferred enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant