* NDC->Viewport mapping and store the results at 'v'.
*/
-static void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = in[3];
}
-static void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[3] = 1;
}
-static void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[10] * in[2] + vp[14];
}
-static void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[10] * in[2] + vp[14];
}
-static void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[2] = vp[14];
}
-static void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
out[1] = vp[5] * in[1] + vp[13];
}
-static void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
* These functions do the same as above, except for the viewport mapping.
*/
-static void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = in[3];
}
-static void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[3] = 1;
}
-static void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = in[3];
}
-static void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
(void) a; (void) v; (void) in;
abort();
}
-static void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = in[2];
}
-static void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[2] = 0;
}
-static void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
}
-static void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[1] = in[1];
}
-static void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[1] = 0;
}
-static void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
out[0] = in[0];
}
-static void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
}
-static void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
c[3] = CHAN_MAX;
}
-static void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[3] = 0xff;
}
-static void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0xff;
}
-static void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
}
-static void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[2] = 0;
}
-static void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[2] = 0;
}
-static void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
}
-static void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
v[0] = 0;
}
-static void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
}
-static void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
(void) a;
0 }
};
-
-static void emit_viewport3_rgba4( GLcontext *ctx,
- GLuint count,
- GLubyte *v )
+
+
+
+
+/***********************************************************************
+ * Hardwired fastpaths for emitting whole vertices or groups of
+ * vertices
+ */
+
+static void emit_viewport3_rgba4( GLcontext *ctx,
+ GLuint count,
+ GLubyte *v )
{
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLfloat * const vp = a[0].vp;
- GLfloat *in0 = (GLfloat *)a[0].inputptr;
- GLfloat *in1 = (GLfloat *)a[1].inputptr;
- GLuint in0_stride = a[0].inputstride;
- GLuint in1_stride = a[1].inputstride;
+ struct tnl_clipspace_attr *a = vtx->attr;
GLuint i;
if (a[0].emit != insert_3f_viewport_3 ||
return;
}
- for (i = 0 ; i < count ; i++) {
- GLfloat *out = (GLfloat *)v;
- out[0] = vp[0] * in0[0] + vp[12];
- out[1] = vp[5] * in0[1] + vp[13];
- out[2] = vp[10] * in0[2] + vp[14];
- v += 12;
- STRIDE_F(in0, in0_stride);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in1[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in1[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in1[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in1[3]);
- v += 4;
- STRIDE_F(in1, in1_stride);
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_3f_viewport_3( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_rgba_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
}
}
-
+
static void emit_viewport3_bgra4( GLcontext *ctx,
GLuint count,
GLubyte *v )
{
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLfloat * const vp = a[0].vp;
- GLfloat *in0 = (GLfloat *)a[0].inputptr;
- GLfloat *in1 = (GLfloat *)a[1].inputptr;
- GLuint in0_stride = a[0].inputstride;
- GLuint in1_stride = a[1].inputstride;
+ struct tnl_clipspace_attr *a = vtx->attr;
GLuint i;
if (a[0].emit != insert_3f_viewport_3 ||
return;
}
- for (i = 0 ; i < count ; i++) {
- GLfloat *out = (GLfloat *)v;
- out[0] = vp[0] * in0[0] + vp[12];
- out[1] = vp[5] * in0[1] + vp[13];
- out[2] = vp[10] * in0[2] + vp[14];
- v += 12; STRIDE_F(in0, in0_stride);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in1[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in1[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in1[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in1[3]);
- v += 4; STRIDE_F(in1, in1_stride);
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_3f_viewport_3( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_bgra_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
}
}
+static void emit_viewport4_rgba4_st2( GLcontext *ctx,
+ GLuint count,
+ GLubyte *v )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ GLuint i;
+
+ if (a[0].emit != insert_4f_viewport_4 ||
+ a[1].emit != insert_4ub_4f_rgba_4 ||
+ a[2].emit != insert_2f_2) {
+ choose_emit_func( ctx, count, v );
+ return;
+ }
+
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_4f_viewport_4( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_rgba_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
+
+ insert_2f_2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr );
+ a[2].inputptr += a[2].inputstride;
+ }
+}
+
+
+static void emit_viewport4_bgra4_st2( GLcontext *ctx,
+ GLuint count,
+ GLubyte *v )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ GLuint i;
+
+ if (a[0].emit != insert_4f_viewport_4 ||
+ a[1].emit != insert_4ub_4f_bgra_4 ||
+ a[2].emit != insert_2f_2) {
+ choose_emit_func( ctx, count, v );
+ return;
+ }
+
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_4f_viewport_4( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_bgra_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
+
+ insert_2f_2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr );
+ a[2].inputptr += a[2].inputstride;
+ }
+}
+
+
+
+static void emit_viewport4_rgba4_st2_st2( GLcontext *ctx,
+ GLuint count,
+ GLubyte *v )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ GLuint i;
+
+ if (a[0].emit != insert_4f_viewport_4 ||
+ a[1].emit != insert_4ub_4f_rgba_4 ||
+ a[2].emit != insert_2f_2 ||
+ a[3].emit != insert_2f_2) {
+ choose_emit_func( ctx, count, v );
+ return;
+ }
+
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_4f_viewport_4( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_rgba_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
+
+ insert_2f_2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr );
+ a[2].inputptr += a[2].inputstride;
+
+ insert_2f_2( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr );
+ a[3].inputptr += a[3].inputstride;
+ }
+}
+
+
+
+static void emit_viewport4_bgra4_st2_st2( GLcontext *ctx,
+ GLuint count,
+ GLubyte *v )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ GLuint i;
+
+ if (a[0].emit != insert_4f_viewport_4 ||
+ a[1].emit != insert_4ub_4f_bgra_4 ||
+ a[2].emit != insert_2f_2 ||
+ a[3].emit != insert_2f_2) {
+ choose_emit_func( ctx, count, v );
+ return;
+ }
+
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) {
+ insert_4f_viewport_4( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr );
+ a[0].inputptr += a[0].inputstride;
+
+ insert_4ub_4f_bgra_4( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr );
+ a[1].inputptr += a[1].inputstride;
+
+ insert_2f_2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr );
+ a[2].inputptr += a[2].inputstride;
+
+ insert_2f_2( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr );
+ a[3].inputptr += a[3].inputstride;
+ }
+}
+
+
+
+
+
+
+
/***********************************************************************
/* Does it fit a hardwired fastpath?
*/
- if (attr_count == 2) {
+ switch (attr_count) {
+ case 2:
if (a[0].emit == insert_3f_viewport_3) {
if (a[1].emit == insert_4ub_4f_bgra_4)
vtx->emit = emit_viewport3_bgra4;
else if (a[1].emit == insert_4ub_4f_rgba_4)
vtx->emit = emit_viewport3_rgba4;
}
+ break;
+ case 3:
+ if (a[0].emit == insert_4f_viewport_4 &&
+ a[2].emit == insert_2f_2) {
+ if (a[1].emit == insert_4ub_4f_bgra_4)
+ vtx->emit = emit_viewport4_bgra4_st2;
+ else if (a[1].emit == insert_4ub_4f_rgba_4)
+ vtx->emit = emit_viewport4_rgba4_st2;
+ }
+ break;
+ case 4:
+ if (a[0].emit == insert_4f_viewport_4 &&
+ a[2].emit == insert_2f_2 &&
+ a[3].emit == insert_2f_2) {
+ if (a[1].emit == insert_4ub_4f_bgra_4)
+ vtx->emit = emit_viewport4_bgra4_st2_st2;
+ else if (a[1].emit == insert_4ub_4f_rgba_4)
+ vtx->emit = emit_viewport4_rgba4_st2_st2;
+ }
}
/* Otherwise use the generic version: