summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_loopback.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-02-20 11:41:01 +1000
committerDave Airlie <airlied@redhat.com>2015-05-08 10:21:01 +1000
commitc4254ee526145ce9bab227264226f5d6f741ff0e (patch)
treeeda4ffd85f22cc6eb02026f339a847e0990b8a59 /src/mesa/main/api_loopback.c
parentad208d975a6d3aebe14f7c2c16039ee200d8b30c (diff)
downloadexternal_mesa3d-c4254ee526145ce9bab227264226f5d6f741ff0e.zip
external_mesa3d-c4254ee526145ce9bab227264226f5d6f741ff0e.tar.gz
external_mesa3d-c4254ee526145ce9bab227264226f5d6f741ff0e.tar.bz2
mesa/vbo: add support for 64-bit vertex attributes. (v1)
This adds support in the vbo and array code to handle double vertex attributes. v0.2: merge code to handle doubles in vbo layer. v1: don't use v0, merge api_array elt code. Acked-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/api_loopback.c')
-rw-r--r--src/mesa/main/api_loopback.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index 9a59779..9932a83 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -84,6 +84,10 @@
#define ATTRIBI_4UI(index,x,y,z,w) CALL_VertexAttribI4uiEXT(GET_DISPATCH(), (index,x,y,z,w))
+#define ATTRIB1_D(index,x) CALL_VertexAttribL1d(GET_DISPATCH(), (index,x))
+#define ATTRIB2_D(index,x,y) CALL_VertexAttribL2d(GET_DISPATCH(), (index,x,y))
+#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))
void GLAPIENTRY
_mesa_Color3b( GLbyte red, GLbyte green, GLbyte blue )
@@ -1493,41 +1497,49 @@ _mesa_VertexAttribI4usv(GLuint index, const GLushort *v)
void GLAPIENTRY
_mesa_VertexAttribL1d(GLuint index, GLdouble x)
{
+ ATTRIB1_D(index, x);
}
void GLAPIENTRY
_mesa_VertexAttribL2d(GLuint index, GLdouble x, GLdouble y)
{
+ ATTRIB2_D(index, x, y);
}
void GLAPIENTRY
_mesa_VertexAttribL3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
{
+ ATTRIB3_D(index, x, y, z);
}
void GLAPIENTRY
_mesa_VertexAttribL4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
+ ATTRIB4_D(index, x, y, z, w);
}
void GLAPIENTRY
_mesa_VertexAttribL1dv(GLuint index, const GLdouble *v)
{
+ ATTRIB1_D(index, v[0]);
}
void GLAPIENTRY
_mesa_VertexAttribL2dv(GLuint index, const GLdouble *v)
{
+ ATTRIB2_D(index, v[0], v[1]);
}
void GLAPIENTRY
_mesa_VertexAttribL3dv(GLuint index, const GLdouble *v)
{
+ ATTRIB3_D(index, v[0], v[1], v[2]);
}
void GLAPIENTRY
_mesa_VertexAttribL4dv(GLuint index, const GLdouble *v)
{
+ ATTRIB4_D(index, v[0], v[1], v[2], v[3]);
}
/*
@@ -1760,5 +1772,16 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_VertexAttribI4sv(dest, _mesa_VertexAttribI4sv);
SET_VertexAttribI4ubv(dest, _mesa_VertexAttribI4ubv);
SET_VertexAttribI4usv(dest, _mesa_VertexAttribI4usv);
+
+ /* GL 4.1 / GL_ARB_vertex_attrib_64bit */
+ SET_VertexAttribL1d(dest, _mesa_VertexAttribL1d);
+ SET_VertexAttribL2d(dest, _mesa_VertexAttribL2d);
+ SET_VertexAttribL3d(dest, _mesa_VertexAttribL3d);
+ SET_VertexAttribL4d(dest, _mesa_VertexAttribL4d);
+
+ SET_VertexAttribL1dv(dest, _mesa_VertexAttribL1dv);
+ SET_VertexAttribL2dv(dest, _mesa_VertexAttribL2dv);
+ SET_VertexAttribL3dv(dest, _mesa_VertexAttribL3dv);
+ SET_VertexAttribL4dv(dest, _mesa_VertexAttribL4dv);
}
}