glsl/linker: add DisableTransformFeedbackPacking workaround
[mesa.git] / src / mesa / main / api_loopback.c
index 8a04174c73fb3b1f5b98830f9ae1b0dd5b27af49..c03c33ee33921efc8cf219a96cc8a76c3ab1e394 100644 (file)
@@ -34,7 +34,6 @@
 #include "api_loopback.h"
 #include "mtypes.h"
 #include "glapi/glapi.h"
-#include "glapi/glthread.h"
 #include "main/dispatch.h"
 #include "main/context.h"
 
 
 #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))
+
+#define ATTRIB1_UI64(index, x)     CALL_VertexAttribL1ui64ARB(GET_DISPATCH(), (index, x))
 
 void GLAPIENTRY
 _mesa_Color3b( GLbyte red, GLbyte green, GLbyte blue )
@@ -626,7 +631,10 @@ _mesa_Vertex2sv( const GLshort *v )
 void GLAPIENTRY
 _mesa_Vertex3dv( const GLdouble *v )
 {
-   VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
+   if (v[2] == 0.0)
+      VERTEX2( (GLfloat) v[0], (GLfloat) v[1] );
+   else
+      VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
 }
 
 void GLAPIENTRY
@@ -859,8 +867,9 @@ _mesa_Materialf( GLenum face, GLenum pname, GLfloat param )
 void GLAPIENTRY
 _mesa_Materiali(GLenum face, GLenum pname, GLint param )
 {
-   GLfloat p = (GLfloat) param;
-   MATERIALFV(face, pname, &p);
+   GLfloat p[4];
+   p[0] = (GLfloat) param;
+   MATERIALFV(face, pname, p);
 }
 
 void GLAPIENTRY
@@ -1491,8 +1500,65 @@ _mesa_VertexAttribI4usv(GLuint index, const GLushort *v)
    ATTRIBI_4UI(index, v[0], v[1], v[2], v[3]);
 }
 
+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_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
+_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]);
+}
 
 /*
  * This code never registers handlers for any of the entry points