static void vrend_set_num_vbo_sub(struct vrend_sub_context *sub,
                                  int num_vbo)
{
   int old_num = sub->num_vbos;
   int i;

   sub->num_vbos = num_vbo;
   sub->old_num_vbos = old_num;

   if (old_num != num_vbo)
      sub->vbo_dirty = true;

   for (i = num_vbo; i < old_num; i++) {
      vrend_resource_reference((struct vrend_resource **)&sub->vbo[i].base.buffer, NULL);
      sub->vbo[i].res_id = 0;
   }

}
static void vrend_set_num_vbo_sub(struct vrend_sub_context *sub,
                                  int num_vbo)
{
   int old_num = sub->num_vbos;
   int i;

   sub->num_vbos = num_vbo;
   sub->old_num_vbos = old_num;

   if (old_num != num_vbo)
      sub->vbo_dirty = true;

   for (i = num_vbo; i < old_num; i++) {
      vrend_resource_reference((struct vrend_resource **)&sub->vbo[i].base.buffer, NULL);
      sub->vbo[i].res_id = 0;
   }

}