Exemple #1
0
/** Free the pp queue. Called on context termination. */
void
pp_free(struct pp_queue_t *ppq)
{

   unsigned int i, j;

   pp_free_fbos(ppq);

   util_destroy_blit(ppq->p->blitctx);

   for (i = 0; i < ppq->n_filters; i++) {
      for (j = 0; j < PP_MAX_PASSES && ppq->shaders[i][j]; j++) {
         if (j >= ppq->verts[i]) {
            ppq->p->pipe->delete_fs_state(ppq->p->pipe, ppq->shaders[i][j]);
            ppq->shaders[i][j] = NULL;
         }
         else if (ppq->shaders[i][j] != ppq->p->passvs) {
            ppq->p->pipe->delete_vs_state(ppq->p->pipe, ppq->shaders[i][j]);
            ppq->shaders[i][j] = NULL;
         }
      }
   }

   FREE(ppq->p);
   FREE(ppq->pp_queue);
   FREE(ppq);

   pp_debug("Queue taken down.\n");
}
Exemple #2
0
void vg_destroy_context(struct vg_context *ctx)
{
   struct pipe_resource **cbuf = &ctx->mask.cbuf;

   util_destroy_blit(ctx->blit);
   renderer_destroy(ctx->renderer);
   shaders_cache_destroy(ctx->sc);
   shader_destroy(ctx->shader);
   paint_destroy(ctx->default_paint);

   if (*cbuf)
      pipe_resource_reference(cbuf, NULL);

   if (ctx->mask.union_fs)
      vg_shader_destroy(ctx, ctx->mask.union_fs);
   if (ctx->mask.intersect_fs)
      vg_shader_destroy(ctx, ctx->mask.intersect_fs);
   if (ctx->mask.subtract_fs)
      vg_shader_destroy(ctx, ctx->mask.subtract_fs);
   if (ctx->mask.set_fs)
      vg_shader_destroy(ctx, ctx->mask.set_fs);

   cso_release_all(ctx->cso_context);
   cso_destroy_context(ctx->cso_context);

   cso_hash_delete(ctx->owned_objects[VG_OBJECT_PAINT]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_IMAGE]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_MASK]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_FONT]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_PATH]);

   api_destroy_dispatch(ctx->dispatch);

   FREE(ctx);
}
void vg_destroy_context(struct vg_context *ctx)
{
   struct pipe_resource **cbuf = &ctx->mask.cbuf;
   struct pipe_resource **vsbuf = &ctx->vs_const_buffer;

   util_destroy_blit(ctx->blit);
   renderer_destroy(ctx->renderer);
   shaders_cache_destroy(ctx->sc);
   shader_destroy(ctx->shader);
   paint_destroy(ctx->default_paint);

   if (*cbuf)
      pipe_resource_reference(cbuf, NULL);

   if (*vsbuf)
      pipe_resource_reference(vsbuf, NULL);

   if (ctx->clear.fs) {
      cso_delete_fragment_shader(ctx->cso_context, ctx->clear.fs);
      ctx->clear.fs = NULL;
   }

   if (ctx->plain_vs) {
      vg_shader_destroy(ctx, ctx->plain_vs);
      ctx->plain_vs = NULL;
   }
   if (ctx->clear_vs) {
      vg_shader_destroy(ctx, ctx->clear_vs);
      ctx->clear_vs = NULL;
   }
   if (ctx->texture_vs) {
      vg_shader_destroy(ctx, ctx->texture_vs);
      ctx->texture_vs = NULL;
   }

   if (ctx->pass_through_depth_fs)
      vg_shader_destroy(ctx, ctx->pass_through_depth_fs);
   if (ctx->mask.union_fs)
      vg_shader_destroy(ctx, ctx->mask.union_fs);
   if (ctx->mask.intersect_fs)
      vg_shader_destroy(ctx, ctx->mask.intersect_fs);
   if (ctx->mask.subtract_fs)
      vg_shader_destroy(ctx, ctx->mask.subtract_fs);
   if (ctx->mask.set_fs)
      vg_shader_destroy(ctx, ctx->mask.set_fs);

   cso_release_all(ctx->cso_context);
   cso_destroy_context(ctx->cso_context);

   cso_hash_delete(ctx->owned_objects[VG_OBJECT_PAINT]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_IMAGE]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_MASK]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_FONT]);
   cso_hash_delete(ctx->owned_objects[VG_OBJECT_PATH]);

   api_destroy_dispatch(ctx->dispatch);

   FREE(ctx);
}
void
st_destroy_blit(struct st_context *st)
{
   util_destroy_blit(st->blit);
   st->blit = NULL;
}