vrend_renderer_fini(void)
{
   vrend_state.finishing = true;

   if (vrend_state.eventfd != -1) {
      close(vrend_state.eventfd);
      vrend_state.eventfd = -1;
   }

   vrend_free_fences();
   vrend_blitter_fini();

   vrend_destroy_context(vrend_state.ctx0);

   vrend_state.current_ctx = NULL;
   vrend_state.current_hw_ctx = NULL;

   vrend_state.finishing = false;
}
vrend_renderer_fini(void)
{
   vrend_state.finishing = true;

   if (vrend_state.eventfd != -1) {
      close(vrend_state.eventfd);
      vrend_state.eventfd = -1;
   }

   vrend_free_fences();
   vrend_blitter_fini();

   vrend_destroy_context(vrend_state.ctx0);

   vrend_state.current_ctx = NULL;
   vrend_state.current_hw_ctx = NULL;

   vrend_state.finishing = false;
}