Implement asynchronous texture transfers
- Dec 16, 2020
-
-
Niklas Haas authored
This can speed up pl_upload_avframe() significantly, approaching zero overhead (direct rendering) under favorable circumstances.
-
Niklas Haas authored
For pl_tex_upload, this allows us to use host pointer imports, due to the relaxed need to ensure `ptr` can be freed after `pl_tex_upload` returns. For pl_tex_download, this allows us to skip the very nasty blocking poll, as long as the user has provided some sort of callback. Also add a test case demonstrating a nice speedup on my system (~40 fps -> ~200 fps upload, ~160 fps -> ~200 fps download). Closes videolan/libplacebo#123
d59a0bad -
Niklas Haas authored
This allows us to not only fix some of the shortcomings of pointer-based transfers, but also make the API easier for users that need to e.g. deref external images once an operation completes. Due to OpenGL restrictions, this is dependent on a new GPU capability flag. Partially implements #123
bac6e4d9 -
Niklas Haas authored
I think the status quo is that creating and destroying pl_buf should be as cheap as possible, so there's really no point in having a separate abstraction for somehow pooling buffers together. This is a left-over from when `pl_buf_destroy` on an in-use buffer was undefined behaviour, which hasn't been the case for some time now. Removed not only because they're unnecessary, but also because the unnecessary boilerplate is getting in the way of a planned refactor.
0bab5830
-