+#endif
+
+/* Build an SWvertex from a hardware vertex.
+ *
+ * This code is hit only when a mix of accelerated and unaccelerated
+ * primitives are being drawn, and only for the unaccelerated
+ * primitives.
+ */
+static void
+TAG(translate_vertex)( GLcontext *ctx, const radeonVertex *src, SWvertex *dst)
+{
+ HW_CONTEXT;
+ GLfloat *s = ctx->Viewport._WindowMap.m;
+
+ if (USE_TINY_VERT) {
+ if (HAVE_HW_VIEWPORT) {
+ dst->win[0] = s[0] * src->v.x + s[12];
+ dst->win[1] = s[5] * src->v.y + s[13];
+ dst->win[2] = s[10] * src->v.z + s[14];
+ dst->win[3] = 1.0;
+ } else {
+ dst->win[0] = ADJ_X(src->v.x);
+ dst->win[1] = ADJ_Y(src->v.y);
+ dst->win[2] = ADJ_Z(src->v.z);
+ dst->win[3] = 1.0;
+ }
+
+ dst->color[0] = src->tv.color.red;
+ dst->color[1] = src->tv.color.green;
+ dst->color[2] = src->tv.color.blue;
+ dst->color[3] = src->tv.color.alpha;
+ }
+ else {
+ if (HAVE_HW_VIEWPORT) {
+ if (HAVE_HW_DIVIDE) {
+ GLfloat oow = 1.0 / src->v.rhw;
+ dst->win[0] = s[0] * src->v.x * oow + s[12];
+ dst->win[1] = s[5] * src->v.y * oow + s[13];
+ dst->win[2] = s[10] * src->v.z * oow + s[14];
+ dst->win[3] = oow;
+ }
+ else {
+ dst->win[0] = s[0] * src->v.x + s[12];
+ dst->win[1] = s[5] * src->v.y + s[13];
+ dst->win[2] = s[10] * src->v.z + s[14];
+ dst->win[3] = src->v.rhw;
+ }
+ } else {
+ dst->win[0] = ADJ_X(src->v.x);
+ dst->win[1] = ADJ_Y(src->v.y);
+ dst->win[2] = ADJ_Z(src->v.z);
+ dst->win[3] = src->v.rhw;
+ }
+
+ dst->color[0] = src->v.color.red;
+ dst->color[1] = src->v.color.green;
+ dst->color[2] = src->v.color.blue;
+ dst->color[3] = src->v.color.alpha;
+
+ if (DO_SPEC) {
+ dst->specular[0] = src->v.specular.red;
+ dst->specular[1] = src->v.specular.green;
+ dst->specular[2] = src->v.specular.blue;
+ }
+
+ if (DO_FOG) {
+ dst->fog = src->v.color.alpha/255.0;
+ }
+
+ if (DO_PTEX) {
+ if (DO_TEX0) {
+ dst->texcoord[0][0] = src->pv.u0;
+ dst->texcoord[0][1] = src->pv.v0;
+ dst->texcoord[0][3] = src->pv.q0;
+ }
+ if (DO_TEX1) {
+ dst->texcoord[1][0] = src->pv.u1;
+ dst->texcoord[1][1] = src->pv.v1;
+ dst->texcoord[1][3] = src->pv.q1;
+ }
+ } else {
+ if (DO_TEX0) {
+ dst->texcoord[0][0] = src->v.u0;
+ dst->texcoord[0][1] = src->v.v0;
+ dst->texcoord[0][3] = 1.0;
+ }
+ if (DO_TEX1) {
+ dst->texcoord[1][0] = src->v.u1;
+ dst->texcoord[1][1] = src->v.v1;
+ dst->texcoord[1][3] = 1.0;
+ }
+ }
+ }
+
+ dst->pointSize = ctx->Point._Size;
+}
+