filename | src/pvr2/glrender.c |
changeset | 1135:68daed8f38af |
prev | 1133:f3da7d810d5c |
next | 1136:078a2202958a |
author | nkeynes |
date | Sun Oct 24 11:50:17 2010 +1000 (13 years ago) |
permissions | -rw-r--r-- |
last change | Set gl texture parameters at texture load time rather than render time. (This does mean that if the texture is used with variant parameters it will be loaded multiple times). 3-4% faster this way |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/glrender.c Wed Oct 20 17:56:59 2010 +10001.2 +++ b/src/pvr2/glrender.c Sun Oct 24 11:50:17 2010 +10001.3 @@ -61,20 +61,16 @@1.4 {1.5 int i;1.7 - texcache_set_config( MMIO_READ( PVR2, RENDER_PALETTE ) & 0x03,1.8 + texcache_begin_scene( MMIO_READ( PVR2, RENDER_PALETTE ) & 0x03,1.9 (MMIO_READ( PVR2, RENDER_TEXSIZE ) & 0x003F) << 5 );1.11 for( i=0; i < pvr2_scene.poly_count; i++ ) {1.12 struct polygon_struct *poly = &pvr2_scene.poly_array[i];1.13 if( POLY1_TEXTURED(poly->context[0]) ) {1.14 - poly->tex_id = texcache_get_texture( poly->context[2],1.15 - POLY2_TEX_WIDTH(poly->context[1]),1.16 - POLY2_TEX_HEIGHT(poly->context[1]) );1.17 + poly->tex_id = texcache_get_texture( poly->context[1], poly->context[2] );1.18 if( poly->mod_vertex_index != -1 ) {1.19 if( pvr2_scene.shadow_mode == SHADOW_FULL ) {1.20 - poly->mod_tex_id = texcache_get_texture( poly->context[4],1.21 - POLY2_TEX_WIDTH(poly->context[3]),1.22 - POLY2_TEX_HEIGHT(poly->context[3]) );1.23 + poly->mod_tex_id = texcache_get_texture( poly->context[3], poly->context[4] );1.24 } else {1.25 poly->mod_tex_id = poly->tex_id;1.26 }1.27 @@ -155,21 +151,6 @@1.28 if( POLY1_TEXTURED(poly1) ) {1.29 glEnable(GL_TEXTURE_2D);1.30 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, pvr2_poly_texblend[POLY2_TEX_BLEND(poly2)] );1.31 -1.32 - if( POLY2_TEX_CLAMP_U(poly2) ) {1.33 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );1.34 - } else if( POLY2_TEX_MIRROR_U(poly2) ) {1.35 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT_ARB );1.36 - } else {1.37 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );1.38 - }1.39 - if( POLY2_TEX_CLAMP_V(poly2) ) {1.40 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );1.41 - } else if( POLY2_TEX_MIRROR_V(poly2) ) {1.42 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT_ARB );1.43 - } else {1.44 - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );1.45 - }1.46 } else {1.47 glDisable( GL_TEXTURE_2D );1.48 }
.