summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-20 10:45:33 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-22 16:58:55 +0200
commit62ddc85d178e647e8cfbee6da4d173c661b4f1fc (patch)
treeab58cbd56fe8a6251ada92f7b75e002e52e0d430 /video/out/opengl
parent2af2fa7a27586f6938f4db8f45e316212e18e442 (diff)
downloadmpv-62ddc85d178e647e8cfbee6da4d173c661b4f1fc.tar.bz2
mpv-62ddc85d178e647e8cfbee6da4d173c661b4f1fc.tar.xz
vo_gpu: simplify structs / names
Due to the plethora of historical baggage from different eras getting confusing, I decided to simplify and unify the struct organization and naming scheme. Structs that got renamed: 1. fbodst -> ra_fbo (and moved to gpu/context.h) 2. fbotex -> removed (redundant after 2af2fa7a) 3. fbosurface -> surface 4. img_tex -> image In addition to these structs being renamed, all of the names have been made consistent. The new scheme is as follows: struct image img; struct ra_tex *tex; struct ra_fbo fbo; This also affects derived names, e.g. indirect_fbo -> indirect_tex. Notably also, finish_pass_fbo -> finish_pass_tex and finish_pass_direct -> finish_pass_fbo. The new equivalent of fbotex_change() is called ra_tex_resize(). This commit (should) contain no logic changes, just renaming a bunch of crap.
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context.c10
-rw-r--r--video/out/opengl/context.h2
-rw-r--r--video/out/opengl/context_vdpau.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 85be3a0ace..cdaf6320cd 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -155,8 +155,7 @@ bool ra_gl_ctx_init(struct ra_ctx *ctx, GL *gl, struct ra_gl_ctx_params params)
{
struct ra_swapchain *sw = ctx->swapchain = talloc_ptrtype(NULL, sw);
*sw = (struct ra_swapchain) {
- .ctx = ctx,
- .flip_v = !params.flipped, // OpenGL framebuffers are normally inverted
+ .ctx = ctx,
};
struct priv *p = sw->priv = talloc_ptrtype(sw, p);
@@ -266,11 +265,12 @@ struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw)
return screen;
}
-struct ra_tex *ra_gl_ctx_start_frame(struct ra_swapchain *sw)
+bool ra_gl_ctx_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
{
struct priv *p = sw->priv;
-
- return p->wrapped_fb;
+ out_fbo->tex = p->wrapped_fb;
+ out_fbo->flip = !p->params.flipped; // OpenGL FBs are normally flipped
+ return true;
}
bool ra_gl_ctx_submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame)
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index bdf426b9b4..95ed374555 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -51,6 +51,6 @@ void ra_gl_ctx_resize(struct ra_swapchain *sw, int w, int h, int fbo);
// for whatever reason, these can be used to inherit the original behavior.
int ra_gl_ctx_color_depth(struct ra_swapchain *sw);
struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw);
-struct ra_tex *ra_gl_ctx_start_frame(struct ra_swapchain *sw);
+bool ra_gl_ctx_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo);
bool ra_gl_ctx_submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame);
void ra_gl_ctx_swap_buffers(struct ra_swapchain *sw);
diff --git a/video/out/opengl/context_vdpau.c b/video/out/opengl/context_vdpau.c
index a2321f78dd..e9894142ea 100644
--- a/video/out/opengl/context_vdpau.c
+++ b/video/out/opengl/context_vdpau.c
@@ -336,7 +336,7 @@ uninit:
return false;
}
-static struct ra_tex *vdpau_start_frame(struct ra_swapchain *sw)
+static bool vdpau_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
{
struct priv *p = sw->ctx->priv;
struct vo *vo = sw->ctx->vo;
@@ -355,7 +355,7 @@ static struct ra_tex *vdpau_start_frame(struct ra_swapchain *sw)
surf->mapped = true;
ra_gl_ctx_resize(sw, surf->w, surf->h, surf->fbo);
- return ra_gl_ctx_start_frame(sw);
+ return ra_gl_ctx_start_frame(sw, out_fbo);
}
static bool vdpau_submit_frame(struct ra_swapchain *sw,