示例#1
0
void
rbug_shader_destroy(struct rbug_context *rb_context,
                    struct rbug_shader *rb_shader)
{
   struct pipe_context *pipe = rb_context->pipe;

   /* works on context as well since its just a macro */
   rbug_screen_remove_from_list(rb_context, shaders, rb_shader);

   switch(rb_shader->type) {
   case RBUG_SHADER_FRAGMENT:
      if (rb_shader->replaced_shader)
         pipe->delete_fs_state(pipe, rb_shader->replaced_shader);
      pipe->delete_fs_state(pipe, rb_shader->shader);
      break;
   case RBUG_SHADER_VERTEX:
      if (rb_shader->replaced_shader)
         pipe->delete_vs_state(pipe, rb_shader->replaced_shader);
      pipe->delete_vs_state(pipe, rb_shader->shader);
      break;
   case RBUG_SHADER_GEOM:
      if (rb_shader->replaced_shader)
         pipe->delete_gs_state(pipe, rb_shader->replaced_shader);
      pipe->delete_gs_state(pipe, rb_shader->shader);
      break;
   default:
      assert(0);
   }

   FREE(rb_shader->replaced_tokens);
   FREE(rb_shader->tokens);
   FREE(rb_shader);
}
示例#2
0
void
rbug_resource_destroy(struct rbug_resource *rb_resource)
{
   struct rbug_screen *rb_screen = rbug_screen(rb_resource->base.screen);
   rbug_screen_remove_from_list(rb_screen, resources, rb_resource);

   pipe_resource_reference(&rb_resource->resource, NULL);
   FREE(rb_resource);
}
示例#3
0
static void
rbug_destroy(struct pipe_context *_pipe)
{
   struct rbug_screen *rb_screen = rbug_screen(_pipe->screen);
   struct rbug_context *rb_pipe = rbug_context(_pipe);
   struct pipe_context *pipe = rb_pipe->pipe;

   rbug_screen_remove_from_list(rb_screen, contexts, rb_pipe);

   pipe_mutex_lock(rb_pipe->call_mutex);
   pipe->destroy(pipe);
   rb_pipe->pipe = NULL;
   pipe_mutex_unlock(rb_pipe->call_mutex);

   FREE(rb_pipe);
}