-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add support for NV12 buffers #166
Conversation
4b0634e
to
b1cfd2b
Compare
Make it clear the ID refers to a Wayland object.
Make sure we don't overwrite an existing surf->wlr. We don't really care about the Wayland surface ID here.
This allows gamescope-specific Wayland clients to connect to the Wayland server, while preventing regular Wayland clients from doing so.
Try to import multi-planar textures even if we don't have a modifier. This is the case for e.g. DMA-BUFs coming from VA-API.
The colors displayed by Vulkan for NV12 buffers are still incorrect, even though I think the VkFormat is correct. We likely need to setup VK_KHR_sampler_ycbcr_conversion. |
What colours are you seeing? Sampler conversions only do stuff for image views/samplers so if you aren't compositing it shouldn't do anything? (unless I am missing something) |
I'm seeing a red-ish image: https://l.sr.ht/XwZA.png We might need some swizzles as well. I've tried one at random (just switch the |
I'm not well versed into the Vulkan compute things we're doing in gamescope, but I've seen VkSampler usage. |
Looking at where this is used yes there is an image view so we definitely need sampler conversion for that. (Sorry, I was under the assumption that this would bypass composite always) |
You also have to use a combined image sampler and immutable samplers for ycbcr conversion iirc which would be annoying. |
Let me know if you need any help with that or want me to do the rework to move to COMBINED and immutable samplers |
Bypassing composite is the goal, but we'll need Vulkan composite support for dev and as a potential fallback. We should still merge it even with incomplete Vulkan support, as long as it's not going to be crashy, which it doesn't appear to be. |
I guess I didn't strictly answer your question, Josh - feel free to work on the Vulkan stuff, but it shouldn't be blocking this MR and it can be merged as-is, in my opinion (at least as described). |
👍 |
This doesn't yet display correct colors, and tiling artifacts are visible.
Alright, let's merge this then. Proper Vulkan support can be built on top of existing commits. |
The tiling artifacts on the NV12 buffers should be fixed by this patch: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10623 (This doesn't fix the red-ish taint we also have on linear buffers.) |
VA-API test client: https://git.sr.ht/~emersion/vaapi-decoder/tree/gamescope-hack