Exemplo n.º 1
0
/* Cope with EvalCoord/CallList called within a begin/end object:
 *     -- Flush current buffer
 *     -- Fallback to opcodes for the rest of the begin/end object.
 */
static void DO_FALLBACK( struct gl_context *ctx )
{
   struct vbo_save_context *save = &vbo_context(ctx)->save;

   if (save->vert_count || save->prim_count) {
      if (save->prim_count > 0) {
         /* Close off in-progress primitive. */
         GLint i = save->prim_count - 1;
         save->prim[i].count = save->vert_count - save->prim[i].start;
      }

      /* Need to replay this display list with loopback,
       * unfortunately, otherwise this primitive won't be handled
       * properly:
       */
      save->dangling_attr_ref = 1;
      
      _save_compile_vertex_list( ctx );
   }

   _save_copy_to_current( ctx );
   _save_reset_vertex( ctx );
   _save_reset_counters( ctx );
   _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
   ctx->Driver.SaveNeedFlush = 0;
}
Exemplo n.º 2
0
void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
{
   TNLcontext *tnl = TNL_CONTEXT(ctx);

   (void) list; (void) mode;

   if (!tnl->save.prim_store)
      tnl->save.prim_store = alloc_prim_store( ctx );

   if (!tnl->save.vertex_store) {
      tnl->save.vertex_store = alloc_vertex_store( ctx );
      tnl->save.vbptr = tnl->save.vertex_store->buffer;
   }
   
   _save_reset_vertex( ctx );
   ctx->Driver.SaveNeedFlush = 0;
}
void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
{
   struct vbo_save_context *save = &vbo_context(ctx)->save;

   (void) list; (void) mode;

   if (!save->prim_store)
      save->prim_store = alloc_prim_store( ctx );

   if (!save->vertex_store) 
      save->vertex_store = alloc_vertex_store( ctx );
      
   save->vbptr = map_vertex_store( ctx, save->vertex_store );
   
   _save_reset_vertex( ctx );
   _save_reset_counters( ctx );  
   ctx->Driver.SaveNeedFlush = 0;
}
Exemplo n.º 4
0
void _tnl_SaveFlushVertices( GLcontext *ctx )
{
   TNLcontext *tnl = TNL_CONTEXT(ctx);

   /* Noop when we are actually active:
    */
   if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
       ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
      return;

   if (tnl->save.initial_counter != tnl->save.counter ||
       tnl->save.prim_count) 
      _save_compile_vertex_list( ctx );
   
   _save_copy_to_current( ctx );
   _save_reset_vertex( ctx );
   ctx->Driver.SaveNeedFlush = 0;
}
Exemplo n.º 5
0
void
vbo_save_SaveFlushVertices(struct gl_context *ctx)
{
   struct vbo_save_context *save = &vbo_context(ctx)->save;

   /* Noop when we are actually active:
    */
   if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX)
      return;

   if (save->vert_count || save->prim_count)
      _save_compile_vertex_list(ctx);

   _save_copy_to_current(ctx);
   _save_reset_vertex(ctx);
   _save_reset_counters(ctx);
   ctx->Driver.SaveNeedFlush = GL_FALSE;
}
void vbo_save_SaveFlushVertices( GLcontext *ctx )
{
   struct vbo_save_context *save = &vbo_context(ctx)->save;

   /* Noop when we are actually active:
    */
   if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
       ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
      return;

   if (save->vert_count ||
       save->prim_count) 
      _save_compile_vertex_list( ctx );
   
   _save_copy_to_current( ctx );
   _save_reset_vertex( ctx );
   _save_reset_counters( ctx );  
   ctx->Driver.SaveNeedFlush = 0;
}