summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/utils.h')
-rw-r--r--video/out/opengl/utils.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/video/out/opengl/utils.h b/video/out/opengl/utils.h
index aaaf4bd12e..8c52680f14 100644
--- a/video/out/opengl/utils.h
+++ b/video/out/opengl/utils.h
@@ -69,6 +69,25 @@ struct fbodst {
void gl_transform_ortho_fbodst(struct gl_transform *t, struct fbodst fbo);
+// A pool of buffers, which can grow as needed
+struct ra_buf_pool {
+ struct ra_buf_params current_params;
+ struct ra_buf **buffers;
+ int num_buffers;
+ int index;
+};
+
+void ra_buf_pool_uninit(struct ra *ra, struct ra_buf_pool *pool);
+
+// Note: params->initial_data is *not* supported
+struct ra_buf *ra_buf_pool_get(struct ra *ra, struct ra_buf_pool *pool,
+ const struct ra_buf_params *params);
+
+// Helper that wraps ra_tex_upload using texture upload buffers to ensure that
+// params->buf is always set. This is intended for RA-internal usage.
+bool ra_tex_upload_pbo(struct ra *ra, struct ra_buf_pool *pbo,
+ const struct ra_tex_upload_params *params);
+
struct fbotex {
struct ra *ra;
struct ra_tex *tex;
@@ -83,21 +102,6 @@ bool fbotex_change(struct fbotex *fbo, struct ra *ra, struct mp_log *log,
#define FBOTEX_FUZZY_H 2
#define FBOTEX_FUZZY (FBOTEX_FUZZY_W | FBOTEX_FUZZY_H)
-#define NUM_PBO_BUFFERS 3
-
-// A wrapper around tex_upload that uses PBOs internally if requested or
-// required
-struct tex_upload {
- size_t buffer_size;
- struct ra_buf *buffers[NUM_PBO_BUFFERS];
- int index;
-};
-
-bool tex_upload(struct ra *ra, struct tex_upload *pbo, bool want_pbo,
- const struct ra_tex_upload_params *params);
-
-void tex_upload_uninit(struct ra *ra, struct tex_upload *pbo);
-
// A wrapper around ra_timer that does result pooling, averaging etc.
struct timer_pool;