Search
lxdream.org :: lxdream/src/pvr2/rendcore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendcore.c
changeset 215:f432833e8303
prev191:df4441cf3128
next221:cf5c6d326162
author nkeynes
date Fri Aug 18 12:43:24 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Implement pvr banking strategy wrt the polygon buffers
file annotate diff log raw
1.1 --- a/src/pvr2/rendcore.c Wed Aug 02 06:24:08 2006 +0000
1.2 +++ b/src/pvr2/rendcore.c Fri Aug 18 12:43:24 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: rendcore.c,v 1.2 2006-08-02 06:24:08 nkeynes Exp $
1.6 + * $Id: rendcore.c,v 1.3 2006-08-18 12:43:24 nkeynes Exp $
1.7 *
1.8 * PVR2 renderer core.
1.9 *
1.10 @@ -15,6 +15,7 @@
1.11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.12 * GNU General Public License for more details.
1.13 */
1.14 +#include <sys/time.h>
1.15 #include "pvr2/pvr2.h"
1.16 #include "asic.h"
1.17
1.18 @@ -200,7 +201,7 @@
1.19 * Render a simple (not auto-sorted) tile
1.20 */
1.21 void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode ) {
1.22 -
1.23 + uint32_t poly_bank = MMIO_READ(PVR2,RENDER_POLYBASE);
1.24 uint32_t *tile_list = (uint32_t *)(video_base+tile_entry);
1.25 do {
1.26 uint32_t entry = *tile_list++;
1.27 @@ -209,7 +210,7 @@
1.28 } else if( entry >> 28 == 0x0E ) {
1.29 tile_list = (uint32_t *)(video_base + (entry&0x007FFFFF));
1.30 } else {
1.31 - uint32_t *polygon = (uint32_t *)(video_base + ((entry & 0x001FFFFF) << 2));
1.32 + uint32_t *polygon = (uint32_t *)(video_base + poly_bank + ((entry & 0x000FFFFF) << 2));
1.33 int is_modified = entry & 0x01000000;
1.34 int vertex_length = (entry >> 21) & 0x07;
1.35 int context_length = 3;
1.36 @@ -291,6 +292,9 @@
1.37
1.38 struct tile_segment *segment = (struct tile_segment *)(video_base + segmentbase);
1.39
1.40 + struct timeval tv_start, tv_end;
1.41 + gettimeofday(&tv_start, NULL);
1.42 + fprintf( stderr, "Start render at %d.%d\n", tv_start.tv_sec, tv_start.tv_usec );
1.43 glEnable( GL_SCISSOR_TEST );
1.44 while( (segment->control & SEGMENT_END) == 0 ) {
1.45 int tilex = SEGMENT_X(segment->control);
1.46 @@ -306,7 +310,7 @@
1.47 segment++;
1.48 continue;
1.49 }
1.50 -
1.51 +
1.52 /* Set a scissor on the visible part of the tile */
1.53 int w = MIN(x1+32, clipx2) - x1;
1.54 int h = MIN(y1+32, clipy2) - y1;
1.55 @@ -336,6 +340,12 @@
1.56 render_tile( segment->punchout_ptr, RENDER_NORMAL, cheap_shadow );
1.57 }
1.58 segment++;
1.59 +
1.60 }
1.61 glDisable( GL_SCISSOR_TEST );
1.62 +
1.63 + gettimeofday(&tv_end, NULL);
1.64 + timersub(&tv_end,&tv_start, &tv_start);
1.65 + fprintf( stderr, "Frame took %d.%06ds\n", tv_start.tv_sec, tv_start.tv_usec );
1.66 +
1.67 }
.