From f40717a66430c238fbe3fa28fc39a88d804bdc9c Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 26 Aug 2017 05:29:34 +0200 Subject: 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 --- video/out/opengl/gl_utils.c | 2 +- video/out/opengl/ra.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'video') 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 -- cgit v1.2.3