Пример #1
0
static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) 
{
   if (rmesa->dma.flush == r200FlushElts &&
       rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) {

      GLushort *dest = (GLushort *)(rmesa->store.cmd_buf +
				    rmesa->store.cmd_used);

      rmesa->store.cmd_used += nr*2;

      return dest;
   }
   else {
      if (rmesa->dma.flush)
	 rmesa->dma.flush( rmesa );

      r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
			     rmesa->hw.max_state_size + ELTS_BUFSZ(nr) );

      r200EmitAOS( rmesa,
		   rmesa->tcl.aos_components,
		   rmesa->tcl.nr_aos_components, 0 );

      return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr );
   }
}
Пример #2
0
/* TODO: Try to extend existing primitive if both are identical,
 * discrete and there are no intervening state changes.  (Somewhat
 * duplicates changes to DrawArrays code)
 */
static void r200EmitPrim( struct gl_context *ctx, 
		          GLenum prim, 
		          GLuint hwprim, 
		          GLuint start, 
		          GLuint count)	
{
   r200ContextPtr rmesa = R200_CONTEXT( ctx );
   r200TclPrimitive( ctx, prim, hwprim );
   
   //   fprintf(stderr,"Emit prim %d\n", rmesa->radeon.tcl.aos_count);

   r200EmitAOS( rmesa,
		rmesa->radeon.tcl.aos_count,
		start );
   
   /* Why couldn't this packet have taken an offset param?
    */
   r200EmitVbufPrim( rmesa,
		     rmesa->tcl.hw_primitive,
		     count - start );
}
Пример #3
0
static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) 
{
   if (rmesa->radeon.dma.flush == r200FlushElts &&
       rmesa->tcl.elt_used + nr*2 < R200_ELT_BUF_SZ) {

      GLushort *dest = (GLushort *)(rmesa->radeon.tcl.elt_dma_bo->ptr +
				    rmesa->radeon.tcl.elt_dma_offset + rmesa->tcl.elt_used);

      rmesa->tcl.elt_used += nr*2;

      return dest;
   }
   else {
      if (rmesa->radeon.dma.flush)
	 rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );

      r200EmitAOS( rmesa,
		   rmesa->radeon.tcl.aos_count, 0 );

      r200EmitMaxVtxIndex(rmesa, rmesa->radeon.tcl.aos[0].count);
      return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr );
   }
}
Пример #4
0
/* TODO: Try to extend existing primitive if both are identical,
 * discrete and there are no intervening state changes.  (Somewhat
 * duplicates changes to DrawArrays code)
 */
static void r200EmitPrim( GLcontext *ctx, 
		          GLenum prim, 
		          GLuint hwprim, 
		          GLuint start, 
		          GLuint count)	
{
   r200ContextPtr rmesa = R200_CONTEXT( ctx );
   r200TclPrimitive( ctx, prim, hwprim );
   
   r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) +
			  rmesa->hw.max_state_size + VBUF_BUFSZ );

   r200EmitAOS( rmesa,
		  rmesa->tcl.aos_components,
		  rmesa->tcl.nr_aos_components,
		  start );
   
   /* Why couldn't this packet have taken an offset param?
    */
   r200EmitVbufPrim( rmesa,
		     rmesa->tcl.hw_primitive,
		     count - start );
}