Search
lxdream.org :: lxdream/src/pvr2/glrender.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/glrender.c
changeset 669:ab344e42bca9
prev666:ea369bcf6def
next677:3ee62740ff8f
author nkeynes
date Mon May 26 10:42:18 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix save states for x86-64, and ensure compatibility between 32-bit and 64-bit versions
file annotate diff log raw
1.1 --- a/src/pvr2/glrender.c Sat Apr 19 02:30:04 2008 +0000
1.2 +++ b/src/pvr2/glrender.c Mon May 26 10:42:18 2008 +0000
1.3 @@ -17,6 +17,7 @@
1.4 */
1.5
1.6 #include <assert.h>
1.7 +#include <sys/time.h>
1.8 #include "display.h"
1.9 #include "pvr2/pvr2.h"
1.10 #include "pvr2/scene.h"
1.11 @@ -153,8 +154,6 @@
1.12
1.13
1.14 if( POLY1_TEXTURED(poly1) ) {
1.15 - int width = POLY2_TEX_WIDTH(poly2);
1.16 - int height = POLY2_TEX_HEIGHT(poly2);
1.17 glEnable(GL_TEXTURE_2D);
1.18 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, pvr2_poly_texblend[POLY2_TEX_BLEND(poly2)] );
1.19 if( POLY2_TEX_CLAMP_U(poly2) ) {
1.20 @@ -271,6 +270,9 @@
1.21 glInterleavedArrays(GL_T2F_C4UB_V3F, sizeof(struct vertex_struct), pvr2_scene.vertex_array);
1.22 glSecondaryColorPointerEXT(3, GL_UNSIGNED_BYTE, sizeof(struct vertex_struct), &pvr2_scene.vertex_array[0].offset_rgba );
1.23
1.24 + /* Turn on the shaders (if available) */
1.25 + glsl_enable_shaders(TRUE);
1.26 +
1.27 uint32_t bgplane_mode = MMIO_READ(PVR2, RENDER_BGPLANE);
1.28 uint32_t *bgplane = pvr2_scene.pvr2_pbuf + (((bgplane_mode & 0x00FFFFFF)) >> 3) ;
1.29 render_backplane( bgplane, pvr2_scene.buffer_width, pvr2_scene.buffer_height, bgplane_mode );
1.30 @@ -283,7 +285,7 @@
1.31 int tilex = SEGMENT_X(segment->control);
1.32 int tiley = SEGMENT_Y(segment->control);
1.33
1.34 - int tile_bounds[4] = { tilex << 5, (tilex+1)<<5, tiley<<5, (tiley+1)<<5 };
1.35 + uint32_t tile_bounds[4] = { tilex << 5, (tilex+1)<<5, tiley<<5, (tiley+1)<<5 };
1.36 if( !clip_tile_bounds(tile_bounds, pvr2_scene.bounds) ) {
1.37 continue; // fully clipped, skip tile
1.38 }
1.39 @@ -310,6 +312,8 @@
1.40 } while( !IS_LAST_SEGMENT(segment++) );
1.41 glDisable( GL_SCISSOR_TEST );
1.42
1.43 + glsl_enable_shaders(FALSE);
1.44 +
1.45 gettimeofday( &end_tv, NULL );
1.46 ms = (end_tv.tv_sec - tex_tv.tv_sec) * 1000 +
1.47 (end_tv.tv_usec - tex_tv.tv_usec)/1000;
.