- *
- * Another new mechanism designed and crying out for codegen. Before
- * that, it would be very interesting to investigate the merger of
- * these vertices and those built in t_vtx_*.
- */
-
-
-
-#define GET_VERTEX_STATE(ctx) &(TNL_CONTEXT(ctx)->clipspace)
-
-static void insert_4f_viewport( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
-
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[10] * in[2] + vp[14];
- out[3] = in[3];
-}
-
-static void insert_3f_viewport( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
-
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[10] * in[2] + vp[14];
-}
-
-static void insert_2f_viewport( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
-
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
-}
-
-
-static void insert_4f( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = in[3];
-}
-
-static void insert_3f_xyw( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[3];
-}
-
-
-static void insert_3f( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
-}
-
-
-static void insert_2f( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
-}
-
-static void insert_1f( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
-}
-
-static void insert_3f_pad( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = 1;
-}
-
-
-static void insert_2f_pad( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = 0;
- out[3] = 1;
-}
-
-static void insert_1f_pad( const struct tnl_clipspace_attr *a, char *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
-
- out[0] = in[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
-}
-
-static void insert_4chan_4f_rgba( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- GLchan *c = (GLchan *)v;
- UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
- UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
- UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]);
- UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
-}
-
-static void insert_4ub_4f_rgba( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
-}
-
-static void insert_4ub_4f_bgra( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
-}
-
-static void insert_3ub_3f_rgb( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
-}
-
-static void insert_3ub_3f_bgr( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
-}
-
-static void insert_1ub_1f( const struct tnl_clipspace_attr *a, char *v,
- const GLfloat *in )
-{
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
-}
-
-
-/***********************************************************************
- * Functions to perform the reverse operations to the above, for
- * swrast translation and clip-interpolation.
- *
- * Currently always extracts a full 4 floats.