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.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.8 * PVR2 renderer core.
1.11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.12 * GNU General Public License for more details.
1.14 +#include <sys/time.h>
1.15 #include "pvr2/pvr2.h"
1.19 * Render a simple (not auto-sorted) tile
1.21 void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode ) {
1.23 + uint32_t poly_bank = MMIO_READ(PVR2,RENDER_POLYBASE);
1.24 uint32_t *tile_list = (uint32_t *)(video_base+tile_entry);
1.26 uint32_t entry = *tile_list++;
1.28 } else if( entry >> 28 == 0x0E ) {
1.29 tile_list = (uint32_t *)(video_base + (entry&0x007FFFFF));
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.38 struct tile_segment *segment = (struct tile_segment *)(video_base + segmentbase);
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.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.61 glDisable( GL_SCISSOR_TEST );
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 );