[vulkan] Wait on device idle before deleting models

This fixes the textures (and presumably mesh data) being deleted while
still in use. Oddly, the wait was needed in both brush and alias models
(I expected brush to always come first).
This commit is contained in:
Bill Currie 2021-04-03 01:14:44 +09:00
parent 7e6928d7d5
commit e2f545eb23
2 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,8 @@ vulkan_alias_clear (model_t *m, void *data)
aliashdr_t *hdr;
qfv_alias_mesh_t *mesh;
QFV_DeviceWaitIdle (device);
m->needload = true; //FIXME is this right?
if (!(hdr = m->aliashdr)) {
hdr = Cache_Get (&m->cache);

View File

@ -71,6 +71,8 @@ static void vulkan_brush_clear (model_t *mod, void *data)
qfv_devfuncs_t *dfunc = device->funcs;
mod_brush_t *brush = &mod->brush;
QFV_DeviceWaitIdle (device);
for (int i = 0; i < brush->numtextures; i++) {
texture_t *tx = brush->textures[i];
if (!tx) {