summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-26 05:29:34 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-27 14:36:00 +0200
commitf40717a66430c238fbe3fa28fc39a88d804bdc9c (patch)
tree2740d09a57abed666c0c22763eec5388b1918d02
parentd355cb618ce8586e75a87918a8b7d16b3a06edef (diff)
downloadmpv-f40717a66430c238fbe3fa28fc39a88d804bdc9c.tar.bz2
mpv-f40717a66430c238fbe3fa28fc39a88d804bdc9c.tar.xz
vo_opengl: use size_t offset for vertex offsets
I don't like the feeling of "reusing" the int binding for this. It feels... wrong, somehow. I'd prefer to use an explicit "offset" field. (Plus, I might re-use this for uniform buffers or something) YMMV
-rw-r--r--video/out/opengl/gl_utils.c2
-rw-r--r--video/out/opengl/ra.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/gl_utils.c b/video/out/opengl/gl_utils.c
index 9ec9d5d37d..bce2dabe5d 100644
--- a/video/out/opengl/gl_utils.c
+++ b/video/out/opengl/gl_utils.c
@@ -156,7 +156,7 @@ static void gl_vao_enable_attribs(struct gl_vao *vao)
gl->EnableVertexAttribArray(n);
gl->VertexAttribPointer(n, e->dim_v, type, normalized,
- vao->stride, (void *)(intptr_t)e->binding);
+ vao->stride, (void *)(intptr_t)e->offset);
}
}
diff --git a/video/out/opengl/ra.h b/video/out/opengl/ra.h
index 8658a0737c..f2b41256db 100644
--- a/video/out/opengl/ra.h
+++ b/video/out/opengl/ra.h
@@ -182,6 +182,7 @@ struct ra_renderpass_input {
int dim_v; // vector dimension (1 for non-vector and non-matrix)
int dim_m; // additional matrix dimension (dim_v x dim_m)
// Vertex data: byte offset of the attribute into the vertex struct
+ size_t offset;
// RA_VARTYPE_TEX: texture unit
// RA_VARTYPE_IMG_W: image unit
// RA_VARTYPE_BUF_* buffer binding point