示例#1
0
static void
update_cp( struct st_context *st )
{
   struct st_compute_program *stcp;

   if (!st->ctx->ComputeProgram._Current) {
      cso_set_compute_shader_handle(st->cso_context, NULL);
      st_reference_compprog(st, &st->cp, NULL);
      return;
   }

   stcp = st_compute_program(st->ctx->ComputeProgram._Current);
   assert(stcp->Base.Base.Target == GL_COMPUTE_PROGRAM_NV);

   st->cp_variant = st_get_cp_variant(st, &stcp->tgsi, &stcp->variants);

   st_reference_compprog(st, &st->cp, stcp);

   cso_set_compute_shader_handle(st->cso_context,
                                 st->cp_variant->driver_shader);
}
示例#2
0
void st_destroy_context( struct st_context *st )
{
   struct pipe_context *pipe = st->pipe;
   struct gl_context *ctx = st->ctx;
   GLuint i;

   _mesa_HashWalk(ctx->Shared->TexObjects, destroy_tex_sampler_cb, st);

   st_reference_fragprog(st, &st->fp, NULL);
   st_reference_geomprog(st, &st->gp, NULL);
   st_reference_vertprog(st, &st->vp, NULL);
   st_reference_tesscprog(st, &st->tcp, NULL);
   st_reference_tesseprog(st, &st->tep, NULL);
   st_reference_compprog(st, &st->cp, NULL);

   /* release framebuffer surfaces */
   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
      pipe_surface_reference(&st->state.framebuffer.cbufs[i], NULL);
   }
   pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
   pipe_sampler_view_reference(&st->pixel_xfer.pixelmap_sampler_view, NULL);
   pipe_resource_reference(&st->pixel_xfer.pixelmap_texture, NULL);

   _vbo_DestroyContext(ctx);

   st_destroy_program_variants(st);

   _mesa_free_context_data(ctx);

   /* This will free the st_context too, so 'st' must not be accessed
    * afterwards. */
   st_destroy_context_priv(st);
   st = NULL;

   pipe->destroy( pipe );

   free(ctx);
}