Search
lxdream.org :: lxdream :: r870:8d4deb2bc1ea
lxdream 0.9.1
released Jun 29
Download Now
changeset870:8d4deb2bc1ea
parent869:b6f38c7ee7a3
child871:c0b7e21cb62b
authornkeynes
dateFri Oct 10 00:10:26 2008 +0000 (11 years ago)
Tidy up texcache render-buffer allocation slightly
src/pvr2/texcache.c
1.1 --- a/src/pvr2/texcache.c Fri Oct 10 00:09:37 2008 +0000
1.2 +++ b/src/pvr2/texcache.c Fri Oct 10 00:10:26 2008 +0000
1.3 @@ -653,16 +653,12 @@
1.4 }
1.5
1.6 texcache_entry_t entry = &texcache_active_list[slot];
1.7 - if( entry->width != width || entry->height != height ) {
1.8 - glBindTexture(GL_TEXTURE_2D, entry->texture_id );
1.9 - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
1.10 - if( entry->buffer != NULL ) {
1.11 - texcache_release_render_buffer(entry->buffer);
1.12 - }
1.13 +
1.14 + if( entry->buffer == NULL ) {
1.15 entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.16 - } else {
1.17 - if( entry->buffer == NULL )
1.18 - entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.19 + } else if( entry->buffer->width != width || entry->buffer->height != height ) {
1.20 + texcache_release_render_buffer(entry->buffer);
1.21 + entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.22 }
1.23
1.24 return entry->buffer;
.