summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-04-03 22:03:10 +0200
committerSamuel Pitoiset <[email protected]>2017-06-14 10:04:35 +0200
commitafb141156f09e7f2f22b88eeefe8e0800c26c1d6 (patch)
tree5fbfd946c4ee5dcd3e29cde519e1986848680fc3 /src/mesa/vbo/vbo_exec_api.c
parent1fe7b1f9724ac38cbddcac6505d3750ef99a2eca (diff)
mesa: add support for unsigned 64-bit vertex attributes
This adds support in the VBO and array code to handle unsigned 64-bit vertex attributes as specified by ARB_bindless_texture. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 4db4eef3b6c..019f986f0bb 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -176,11 +176,16 @@ vbo_exec_copy_to_current(struct vbo_exec_context *exec)
*/
GLfloat *current = (GLfloat *)vbo->currval[i].Ptr;
fi_type tmp[8]; /* space for doubles */
- int dmul = exec->vtx.attrtype[i] == GL_DOUBLE ? 2 : 1;
+ int dmul = 1;
+
+ if (exec->vtx.attrtype[i] == GL_DOUBLE ||
+ exec->vtx.attrtype[i] == GL_UNSIGNED_INT64_ARB)
+ dmul = 2;
assert(exec->vtx.attrsz[i]);
- if (exec->vtx.attrtype[i] == GL_DOUBLE) {
+ if (exec->vtx.attrtype[i] == GL_DOUBLE ||
+ exec->vtx.attrtype[i] == GL_UNSIGNED_INT64_ARB) {
memset(tmp, 0, sizeof(tmp));
memcpy(tmp, exec->vtx.attrptr[i], exec->vtx.attrsz[i] * sizeof(GLfloat));
} else {
@@ -241,7 +246,8 @@ vbo_exec_copy_from_current(struct vbo_exec_context *exec)
GLint i;
for (i = VBO_ATTRIB_POS + 1; i < VBO_ATTRIB_MAX; i++) {
- if (exec->vtx.attrtype[i] == GL_DOUBLE) {
+ if (exec->vtx.attrtype[i] == GL_DOUBLE ||
+ exec->vtx.attrtype[i] == GL_UNSIGNED_INT64_ARB) {
memcpy(exec->vtx.attrptr[i], vbo->currval[i].Ptr,
exec->vtx.attrsz[i] * sizeof(GLfloat));
} else {