Search
lxdream.org :: lxdream :: r1155:f9aefb4613e5
lxdream 0.9.1
released Jun 29
Download Now
changeset1155:f9aefb4613e5
parent1154:5225c7c059ce
child1156:d124a1c833cb
authornkeynes
dateTue Jan 18 17:48:48 2011 +1000 (8 years ago)
Clear polygon buffer map more efficiently
src/pvr2/scene.c
1.1 --- a/src/pvr2/scene.c Mon Jan 17 21:22:06 2011 +1000
1.2 +++ b/src/pvr2/scene.c Tue Jan 18 17:48:48 2011 +1000
1.3 @@ -28,6 +28,7 @@
1.4 #include "pvr2/scene.h"
1.5
1.6 #define U8TOFLOAT(n) (((float)((n)+1))/256.0)
1.7 +#define POLY_IDX(addr) ( ((uint32_t *)addr) - ((uint32_t *)pvr2_scene.pvr2_pbuf))
1.8
1.9 static void unpack_bgra(uint32_t bgra, float *rgba)
1.10 {
1.11 @@ -103,9 +104,12 @@
1.12 */
1.13 void pvr2_scene_reset()
1.14 {
1.15 + /* Faster to just clear the active entries */
1.16 + for( int i=0; i<pvr2_scene.poly_count; i++ ) {
1.17 + pvr2_scene.buf_to_poly_map[POLY_IDX(pvr2_scene.poly_array[i].context)] = 0;
1.18 + }
1.19 pvr2_scene.poly_count = 0;
1.20 pvr2_scene.vertex_count = 0;
1.21 - memset( pvr2_scene.buf_to_poly_map, 0, BUF_POLY_MAP_SIZE );
1.22 }
1.23
1.24 void pvr2_scene_shutdown()
.