st/nine: Upload managed textures only at draw using them

When a draw call is emited, textures in the
device->update_textures list are uploaded.

This patch removes textures from the list if they
are not bound anymore.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
Axel Davy 2019-04-04 23:01:08 +02:00
parent 394420ebb3
commit 5df96995ef
1 changed files with 4 additions and 1 deletions

View File

@ -144,8 +144,11 @@ NineBindTextureToDevice( struct NineDevice9 *device,
tex->bind_count++;
}
if (old)
if (old) {
old->bind_count--;
if (!old->bind_count)
list_delinit(&old->list);
}
nine_bind(slot, tex);
}