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

Can pl_vulkan_hold_ex explicitly sync the imported dmabuf resource? #227

Open
langyuxf opened this issue Dec 7, 2023 · 2 comments
Open

Comments

@langyuxf
Copy link

langyuxf commented Dec 7, 2023

Should the exporter(e.g., vaExportSurfaceHandle) make sure the exported resource is synced?

@haasn
Copy link
Owner

haasn commented Dec 7, 2023

In principle, you can use pl_vulkan_sem_create to export a semaphore which you can then import into foreign APIs (e.g. cuda/nvdec), and use it for non-blocking synchronization. But to my knowledge, there is no way to import semaphores in vaapi, so this path is not possible. In mpv, we use vaSyncSurface to synchronize the surface explicitly before passing it to libplacebo.

@langyuxf
Copy link
Author

langyuxf commented Dec 8, 2023

"In mpv, we use vaSyncSurface to synchronize the surface explicitly before passing it to libplacebo."

Yes, but if the consumer is OpenGL which is implicitly synced, vaSyncSurface will introduce some overheads.

I'm trying to remove vaSyncSurface in mpv, use https://docs.kernel.org/driver-api/dma-buf.html#c.dma_buf_export_sync_file
for Vulkan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants