-void dump_inputs(GLcontext *ctx, int render_inputs)
-{
- int k;
- fprintf(stderr, "inputs:");
- fprintf(stderr, "%08x ", render_inputs);
-
- if(render_inputs & _TNL_BIT_POS)
- fprintf(stderr, "_TNL_BIT_POS ");
- if(render_inputs & _TNL_BIT_NORMAL)
- fprintf(stderr, "_TNL_BIT_NORMAL ");
-
- /* color components */
- if(render_inputs & _TNL_BIT_COLOR0)
- fprintf(stderr, "_TNL_BIT_COLOR0 ");
- if(render_inputs & _TNL_BIT_COLOR1)
- fprintf(stderr, "_TNL_BIT_COLOR1 ");
-
- if(render_inputs & _TNL_BIT_FOG)
- fprintf(stderr, "_TNL_BIT_FOG ");
-
- /* texture coordinates */
- for(k=0;k < ctx->Const.MaxTextureUnits;k++)
- if(render_inputs & (_TNL_BIT_TEX0<<k))
- fprintf(stderr, "_TNL_BIT_TEX%d ", k);
-
- if(render_inputs & _TNL_BIT_INDEX)
- fprintf(stderr, "_TNL_BIT_INDEX ");
- if(render_inputs & _TNL_BIT_POINTSIZE)
- fprintf(stderr, "_TNL_BIT_POINTSIZE ");
-
- fprintf(stderr, "\n");
-}
-
-/* This function compiles GL context into state registers that
- describe data routing inside of R300 pipeline.
-
- In particular, it programs input_route, output_vtx_fmt, texture
- unit configuration and gb_output_vtx_fmt
-
- This function encompasses setup_AOS() from r300_lib.c
-*/
-
-
-
-
-/* Immediate implementation - vertex data is sent via command stream */
-
-static GLfloat default_vector[4]={0.0, 0.0, 0.0, 1.0};
-
-#define output_vector(v, i) \
- { \
- int _i; \
- for(_i=0;_i<v->size;_i++){ \
- efloat(VEC_ELT(v, GLfloat, i)[_i]); \
- } \
- for(_i=v->size;_i<4;_i++){ \
- efloat(default_vector[_i]); \
- } \
- }
-
-/* Immediate implementation - vertex data is sent via command stream */
-
-static void r300_render_immediate_primitive(r300ContextPtr rmesa,
- GLcontext *ctx,
- int start,
- int end,
- int prim)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i, render_inputs;
- int k, type, num_verts;
- LOCAL_VARS
-
- type=r300_get_primitive_type(rmesa, ctx, prim);
- num_verts=r300_get_num_verts(rmesa, ctx, end-start, prim);
-
- #if 0
- fprintf(stderr,"ObjPtr: size=%d stride=%d\n",
- VB->ObjPtr->size, VB->ObjPtr->stride);
- fprintf(stderr,"ColorPtr[0]: size=%d stride=%d\n",
- VB->ColorPtr[0]->size, VB->ColorPtr[0]->stride);
- fprintf(stderr,"TexCoordPtr[0]: size=%d stride=%d\n",
- VB->TexCoordPtr[0]->size, VB->TexCoordPtr[0]->stride);
- #endif
-
- if(type<0 || num_verts <= 0)return;
-
- if(!VB->ObjPtr){
- WARN_ONCE("FIXME: Don't know how to handle GL_ARB_vertex_buffer_object correctly\n");
- return;
- }
- /* A packet cannot have more than 16383 data words.. */
- if((num_verts*4*rmesa->state.aos_count)>16380){
- WARN_ONCE("Too many vertices to paint. Fix me !\n");
- return;
- }
-
- //fprintf(stderr, "aos_count=%d start=%d end=%d\n", rmesa->state.aos_count, start, end);
-
- if(rmesa->state.aos_count==0){
- WARN_ONCE("Aeiee ! aos_count==0, while it shouldn't. Skipping rendering\n");
- return;
- }
-
- render_inputs = rmesa->state.render_inputs;
-
- if(!render_inputs){
- WARN_ONCE("Aeiee ! render_inputs==0. Skipping rendering.\n");
- return;
- }