summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/ra.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-05 22:29:48 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-07 12:46:30 +0200
commit9581fbe56926c75e52bc015fa6146b7f11f3d6a3 (patch)
tree252ff1098cd07bc5ae56770eecf0a3c0549435a5 /video/out/opengl/ra.c
parent207458c7a9b682185a82ee23910c1327a70d276b (diff)
downloadmpv-9581fbe56926c75e52bc015fa6146b7f11f3d6a3.tar.bz2
mpv-9581fbe56926c75e52bc015fa6146b7f11f3d6a3.tar.xz
vo_opengl: generalize ra_buf to support other buffer objects
This allows us to integrate PBOs and SSBOs into the same abstraction, with the potential to easily add UBOs if the need arises.
Diffstat (limited to 'video/out/opengl/ra.c')
-rw-r--r--video/out/opengl/ra.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/opengl/ra.c b/video/out/opengl/ra.c
index e67dd6ebdf..31f585fdf9 100644
--- a/video/out/opengl/ra.c
+++ b/video/out/opengl/ra.c
@@ -16,6 +16,18 @@ void ra_tex_free(struct ra *ra, struct ra_tex **tex)
*tex = NULL;
}
+struct ra_buf *ra_buf_create(struct ra *ra, const struct ra_buf_params *params)
+{
+ return ra->fns->buf_create(ra, params);
+}
+
+void ra_buf_free(struct ra *ra, struct ra_buf **buf)
+{
+ if (*buf)
+ ra->fns->buf_destroy(ra, *buf);
+ *buf = NULL;
+}
+
static size_t vartype_size(enum ra_vartype type)
{
switch (type) {