Beispiel #1
0
static void
update_tep( struct st_context *st )
{
   struct st_tesseval_program *sttep;

   if (!st->ctx->TessEvalProgram._Current) {
      cso_set_tesseval_shader_handle(st->cso_context, NULL);
      st_reference_tesseprog(st, &st->tep, NULL);
      return;
   }

   sttep = st_tesseval_program(st->ctx->TessEvalProgram._Current);
   assert(sttep->Base.Base.Target == GL_TESS_EVALUATION_PROGRAM_NV);

   st->tep_variant = st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL,
                                          &sttep->tgsi, &sttep->variants);

   st_reference_tesseprog(st, &st->tep, sttep);

   cso_set_tesseval_shader_handle(st->cso_context,
                                  st->tep_variant->driver_shader);
}
Beispiel #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);
}