From afb141156f09e7f2f22b88eeefe8e0800c26c1d6 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 3 Apr 2017 22:03:10 +0200 Subject: mesa: add support for unsigned 64-bit vertex attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Nicolai Hähnle --- src/mesa/main/api_loopback.c | 4 ++++ src/mesa/main/varray.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 36e5194b93e..b552d17d6ac 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -89,6 +89,8 @@ #define ATTRIB3_D(index,x,y,z) CALL_VertexAttribL3d(GET_DISPATCH(), (index,x,y,z)) #define ATTRIB4_D(index,x,y,z,w) CALL_VertexAttribL4d(GET_DISPATCH(), (index,x,y,z,w)) +#define ATTRIB1_UI64(index, x) CALL_VertexAttribL1ui64ARB(GET_DISPATCH(), (index, x)) + void GLAPIENTRY _mesa_Color3b( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1531,11 +1533,13 @@ _mesa_VertexAttribL1dv(GLuint index, const GLdouble *v) void GLAPIENTRY _mesa_VertexAttribL1ui64ARB(GLuint index, GLuint64EXT x) { + ATTRIB1_UI64(index, x); } void GLAPIENTRY _mesa_VertexAttribL1ui64vARB(GLuint index, const GLuint64EXT *v) { + ATTRIB1_UI64(index, v[0]); } void GLAPIENTRY diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index aa9bb472c63..0d767ad7fcf 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1356,6 +1356,24 @@ _mesa_GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) void GLAPIENTRY _mesa_GetVertexAttribLui64vARB(GLuint index, GLenum pname, GLuint64EXT *params) { + GET_CURRENT_CONTEXT(ctx); + + if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) { + const GLuint64 *v = + (const GLuint64 *)get_current_attrib(ctx, index, + "glGetVertexAttribLui64vARB"); + if (v != NULL) { + params[0] = v[0]; + params[1] = v[1]; + params[2] = v[2]; + params[3] = v[3]; + } + } + else { + params[0] = (GLuint64) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, + "glGetVertexAttribLui64vARB"); + } } -- cgit v1.2.3