I wrote simple program to test TCL and NO-TCL on my r200 and DRI CVS.
It draws board with BoardSize*BoardSize textured tiles.

framerates:
                                TCL     NO-TCL

#define Far       1000.0        137     160
#define BoardSize 100.0

#define Far       1000.0        44      51
#define BoardSize 200.0

#define Far       100.0         44      79
#define BoardSize 200.0

#define Far       50.0          44      85
#define BoardSize 200.0

#define Far       50.0          20      40
#define BoardSize 300.0

Looks like TCL driver calculates things even, when they should be clipped out.
Maybe that's the reason for worse performance in TCL mode?


And now fun with textures:

max texture size:2048


#define TextureSize 1024        - texture is visible

#define TextureSize 2048        - texture is sometimes visible, sometimes not
                                  (single color)

-- 
Free Software - find interesting programs and change them
NetHack - meet interesting creatures, kill them and eat their bodies
Usenet - meet interesting people from all over the world and flame them
Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL.h>
#include <cmath>
#include <iostream>

#define ScreenX 800
#define ScreenY 600
#define ScreenBPP 24
#define ViewAngle 45.0
#define Near 0.1
#define Height -15.0
#define Distance -40.0

#define TextureSize 1024

#define Far       1000.0
#define BoardSize 100.0

int main()
{
        GLfloat *picture;
        int i,j,k;
        GLfloat color[4];
        GLuint id; // texture
        int t,t0; // times
        int fps; 
        int max;
        
        SDL_SetVideoMode (ScreenX, ScreenY, ScreenBPP, SDL_OPENGL);
        glViewport (0, 0, ScreenX, ScreenY);
        glMatrixMode (GL_PROJECTION);
        glLoadIdentity ();
        gluPerspective(ViewAngle,(float)ScreenX/ScreenY,Near,Far);
        glMatrixMode (GL_MODELVIEW);
        glEnable(GL_DEPTH_TEST);
        glEnable(GL_TEXTURE_2D);

        glGetIntegerv(GL_MAX_TEXTURE_SIZE,&max);
        cout <<"max texture size:"<<max<<"\n";

        picture=new GLfloat[4*TextureSize*TextureSize];
        for (i=0;i<TextureSize;i++)
                for (j=0;j<TextureSize;j++)
                {
                        color[0]=(float)i/TextureSize;
                        color[1]=(float)j/TextureSize;
                        color[2]=0;
                        color[3]=1.0;
                        for (k=0;k<4;k++)
                                picture[(TextureSize*j+i)*4+k]=color[k];
                }       

        glGenTextures(1,&id);
        glBindTexture(GL_TEXTURE_2D,id);
        
gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,TextureSize,TextureSize,GL_RGBA,GL_FLOAT,picture);
        delete [] picture;

        fps=0;
        t0=SDL_GetTicks();
        do
        {
                SDL_PumpEvents();
                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                glLoadIdentity();
                glTranslatef(-BoardSize/2,Height,Distance-BoardSize);
                glBegin(GL_QUADS);
                for (i=0;i<BoardSize;i++)
                        for (j=0;j<BoardSize;j++)
                        {
                                glTexCoord2f(0,0);
                                glVertex3f(i,0,j);
                                glTexCoord2f(1,0);
                                glVertex3f(i+1,0,j);
                                glTexCoord2f(1,1);
                                glVertex3f(i+1,0,j+1);
                                glTexCoord2f(0,1);
                                glVertex3f(i,0,j+1);
                        }
                glEnd();
                SDL_GL_SwapBuffers();
                fps++;
                t=SDL_GetTicks();
                if (t>t0+1000)
                {
                        t0+=1000;
                        cout <<"fps="<<fps<<"\n";
                        fps=0;
                }
        }
        while (SDL_GetKeyState(NULL)[SDLK_ESCAPE]!=SDL_PRESSED);
}
big_textures: big_textures.cc
        g++ -o big_textures big_textures.cc `sdl-config --cflags --libs` -lm -lGL 
-lGLU 

Reply via email to