Disable the glTexSubImage optimization, see issue #2222 .

This commit is contained in:
Henrik Rydgard 2013-06-11 23:06:30 +02:00
parent 3c3442878c
commit 052a15b788

View File

@ -1034,13 +1034,16 @@ void TextureCache::SetTexture() {
lastBoundTexture = -1; lastBoundTexture = -1;
} }
if (doDelete) { if (doDelete) {
// TODO: This stuff is missing some check, its causes corruption. See issue #2222 .
/*
if (entry->maxLevel == maxLevel && entry->dim == (gstate.texsize[0] & 0xF0F)) { if (entry->maxLevel == maxLevel && entry->dim == (gstate.texsize[0] & 0xF0F)) {
// Actually, if size and number of levels match, let's try to avoid deleting and recreating. // Actually, if size and number of levels match, let's try to avoid deleting and recreating.
// Instead, let's use glTexSubImage to replace the images. // Instead, let's use glTexSubImage to replace the images.
replaceImages = true; replaceImages = true;
} else { } else {
glDeleteTextures(1, &entry->texture); glDeleteTextures(1, &entry->texture);
} }*/
glDeleteTextures(1, &entry->texture);
} }
if (entry->status == TexCacheEntry::STATUS_RELIABLE) { if (entry->status == TexCacheEntry::STATUS_RELIABLE) {
entry->status = TexCacheEntry::STATUS_HASHING; entry->status = TexCacheEntry::STATUS_HASHING;