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

OpenGL context support for vo_gpu_next #9486

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Nov 20, 2021

No description provided.

This case was added in 662c793
for use in vo_gpu_next as a visibility test before rendering a frame.
The OpenGL context doesn't have this so it just returns true.
@haasn
Copy link
Member

haasn commented Nov 20, 2021

Hi, as discussed on IRC, I think this needs to be moved into its own file. I don't want to keep growing vo_gpu_next with context-specific stuff.

I was thinking last night about how to do this and I think the correct way forward would be to come up with a new set of abstractions that are intrinsically libplacebo-centric, basically duplicating some logic from ra_context but without the RA-specific baggage.

The internal implementation for platform specifics should be moved into RA/libplacebo-agnostic neutral helpers, which is mostly already the case. So the only thing that explicitly needs to be duplicated is wrapping code, but I think that's cleaner than trying to hack the ra context into bending over backwards to serve the needs of both.

@sfan5 sfan5 force-pushed the gpunext_gl branch 3 times, most recently from 86ce68a to 095e55c Compare November 20, 2021 20:41
Copy link
Member

@haasn haasn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with the current status of this code, but it still represents an improvement to the status quo overall so I don't see any reason not to merge it.

As discussed on IRC I plan on refactoring this entire mechanism to avoid ra_ctx altogether, but until then, this should go in to enable users to test. It isn't any more of a hack than the existing hack.

DOCS/man/vo.rst Outdated Show resolved Hide resolved
video/out/gpu_next/context.c Outdated Show resolved Hide resolved
video/out/gpu_next/context.c Outdated Show resolved Hide resolved
video/out/gpu_next/context.h Outdated Show resolved Hide resolved
video/out/gpu_next/context.h Outdated Show resolved Hide resolved
video/out/gpu_next/context.c Show resolved Hide resolved
video/out/vo_gpu_next.c Outdated Show resolved Hide resolved
video/out/vo_gpu_next.c Show resolved Hide resolved
This is done to avoid cluttering vo_gpu_next.c with more ifdeffery and context-specific code
when additional backends are added in the near future.
Eventually gpu_ctx is intended to take the place of ra_ctx to further separate gpu and gpu_next.
Wrapping the context is pretty straightforward. This is only complicated
by needing to account for the upside-down framebuffer in a few places.
@sfan5 sfan5 merged commit dc73f1a into mpv-player:master Nov 22, 2021
@sfan5 sfan5 deleted the gpunext_gl branch November 22, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants