From: Isabelle Lafon (isabelle++at++discreet.com)
Date: 11/22/2001 12:48:12
Hi,
We are working with Performer 2.2 and IRIX 6.5.13.
We have remarked that our software gives better draw times on Octane
than
on Octane2, which is not what we've expected.
I was able to reproduce this behaviour with a simple performer test
program
drawing 500 quads (see source pfPerf.C attached to this email).
* pfPerf drawing 500 red rectangles with a checkboard texture gives a
draw
time of 6.7ms on Octane2 but 4.4ms on Octane.
* pfPerf -noTextures drawing 500 red rectangles gives a draw time of
6.3ms
on Octane2 but only 3.5ms on Octane.
Performer seems to run faster on Octane than on Octane2 even with
GL_VERTEX_PRECLIP disable and GL_ODY_FAST_GLVIEWPORT set to get optimal
performance on Odyssey.
You'll find more data on the Octane2 and Octane platform used below.
Does anyone already encounter this performance problem ?
Can someone explain this behaviour or know a way to boost performance
on Octane2 ?
This is a critical problem for us since we're going in Beta phase with
our
product very soon. So any information will be very appreciate.
Thanks in advance for any input.
Isabelle.
-------------------------------------------------------------------------
Octane2 hinv & gfxinfo:
=======================
2 400 MHZ IP30 Processors
CPU: MIPS R12000 Processor Chip Revision: 3.5
FPU: MIPS R12010 Floating Point Chip Revision: 0.0
Main memory size: 512 Mbytes
Xbow ASIC: Revision 1.4
Instruction cache size: 32 Kbytes
Data cache size: 32 Kbytes
Secondary unified instruction/data cache size: 2 Mbytes
Integral SCSI controller 0: Version QL1040B (rev. 2), single ended
Disk drive: unit 1 on SCSI controller 0
Integral SCSI controller 1: Version QL1040B (rev. 2), single ended
IOC3 serial port: tty1
IOC3 serial port: tty2
IOC3 parallel port: plp1
Graphics board: V12
Integral Fast Ethernet: ef0, version 1, pci 2
Iris Audio Processor: version RAD revision 12.0, number 1
Graphics board 0 is "ODYSSEY" graphics.
Managed (":0.0") 1280x1024
BUZZ version B.1
PB&J version 1
128MB memory
Banks: 4, CAS latency: 3
Monitor 0 type: SGX 512
Channel 0:
Origin = (0,0)
Video Output: 1280 pixels, 1024 lines, 72.24Hz (1280x1024_72)
Octane hinv & gfxinfo:
======================
2 300 MHZ IP30 Processors
CPU: MIPS R12000 Processor Chip Revision: 2.3
FPU: MIPS R12010 Floating Point Chip Revision: 0.0
Main memory size: 512 Mbytes
Xbow ASIC: Revision 1.3
Instruction cache size: 32 Kbytes
Data cache size: 32 Kbytes
Secondary unified instruction/data cache size: 2 Mbytes
Integral SCSI controller 0: Version QL1040B (rev. 2), single ended
Disk drive: unit 1 on SCSI controller 0
Disk drive: unit 2 on SCSI controller 0
Integral SCSI controller 1: Version QL1040B (rev. 2), single ended
IOC3 serial port: tty1
IOC3 serial port: tty2
IOC3 parallel port: plp1
Graphics board: EMXI
Integral Fast Ethernet: ef0, version 1, pci 2
Iris Audio Processor: version RAD revision 12.0, number 1
Graphics board 0 is "IMPACTSR" graphics.
Managed (":0.0") 1280x1024
Product ID 0x3, 2 GEs, 2 REs, 4 TRAMs
MGRAS revision 4, RA revision 0
HQ rev B, GE12 rev A, RE4 rev C, PP1 rev E,
VC3 rev A, CMAP rev F, Heart rev F
unknown, assuming 19" monitor (id 0xf)
Video board present
Channel 0:
Origin = (0,0)
Video Output: 1280 pixels, 1024 lines, 60.00Hz (1280x1024_60)
-- Isabelle Lafon Discreet Logic Tel: (514) 954-7157 10 Duke Fax: (514) 393-0110 Montreal (Quebec) isabelle++at++discreet.com Canada, H3C 2L7
//============================================================================= // // File pfPerf.C // // Description Performance comparison of Octane2 and Octane // on a scene with 500 objects with or without a checkboard texture. // // Usage: // > pfPerf (draw 500 red rectangles with a checkboard texture) // > pfPerf -noTextures (draw 500 red rectangles). // // It appears that this little program run faster on Octane than // Octane2. // // Created 22 November 2001 // // Component sources // // Module pfBugs // // Project Winnipeg // // Author Isabelle Lafon <isabelle++at++discreet.com> // // // Copyright (c) 2001 discreet logic inc. // // These coded instructions, statements, and computer programs contain // unpublished proprietary information written by Discreet Logic and // are protected by Federal copyright law. They may not be disclosed // to third parties or copied or duplicated in any form, in whole or // in part, without the prior written consent of Discreet Logic. // //=============================================================================
// COMPILE with // CC pfPerf.C -L/usr/lib32 -lpf -o pfPerf // // USAGE: // > pfPerf (draws 500 red rectangles with a checkboard texture) // > pfPerf -noTextures (draws 500 red rectangles).
//============================================================================= // I N C L U D E F I L E S
#include <Performer/pf.h> #include <Performer/pf/pfPipeWindow.h> #include <Performer/pf/pfChannel.h> #include <Performer/pf/pfGeode.h> #include <Performer/pf/pfScene.h> #include <Performer/pf/pfLightSource.h> #include <Performer/pr/pfTexture.h> #include <Performer/pf/pfSCS.h>
#include <stdio.h> #include <invent.h> #include <stdlib.h>
//============================================================================= // L O C A L P R O T O T Y P E S
bool isOdyssey(); void makeImage();
pfPipeWindow* windowSetup(char *title); pfScene* sceneSetup(); pfGeode* createObject( pfGeoState* state ); pfChannel* channelSetup( pfScene* scene=0 );
void draw( pfChannel *, void * );
//============================================================================= // L O C A L V A R I A B L E S
int imageWidth = 64; int imageHeight = 64; GLubyte imageBuffer[64][64][3];
int nbObjects = 500; bool withTextures = true;
// Special OpenGL settings required on Odyssey to get optimal performance. static const char oglXFastPathEnvStr[] = "GL_ODY_FAST_GLVIEWPORT=Y"; static const char oglVertexPreclipEnvStr[] = "GL_VERTEX_PRECLIP=DISABLED";
//============================================================================= // P U B L I C F U N C T I O N S C O D E S E C T I O N
int main(int argc, char *argv[]) { // Get texture argument if ( argc == 2 ) { if ( strcmp( argv[1], "-noTextures" ) == 0 ) { withTextures = false; printf("- Without textures \n"); } }
if ( isOdyssey() ) { putenv( oglXFastPathEnvStr ); putenv( oglVertexPreclipEnvStr ); }
if ( withTextures ) { makeImage(); }
// Initialize Performer. pfInit(); pfMultiprocess( PFMP_APPCULL_DRAW | PFMP_CULL_DL_DRAW ); pfConfig();
pfPhase( PFPHASE_LOCK ); pfFrameRate( 60.0f );
// Set up a window, scene graph, and channel pfPipeWindow* pwin = windowSetup( argv[0] ); pfScene* scene = sceneSetup(); pfChannel* chan = channelSetup( scene ); pwin->addChan( chan );
// run for 20 seconds. float t = 0.0f; while( t < 20.0f ) { pfFrame(); t = pfGetTime(); }
pfExit(); }
//============================================================================= // L O C A L / P R I V A T E F U N C T I O N S C O D E S E C T I O N
bool isOdyssey() { inventory_t *info; setinvent(); info = getinvent(); while ( info != NULL ) { if ( info->inv_class == INV_GRAPHICS && info->inv_type == INV_ODSY ) { endinvent(); return true; }
info = getinvent(); }
endinvent(); return false; }
void makeImage() { int c;
for ( int i=0; i<imageHeight; i++) { for ( int j=0; j<imageWidth; j++ ) { c = ((((i&0x8)==0)^((j&0x8))==0))*255; imageBuffer[i][j][0] = c; imageBuffer[i][j][1] = c; imageBuffer[i][j][2] = c; } } }
pfPipeWindow* windowSetup(char *title) { pfPipeWindow *pwin = new pfPipeWindow( pfGetPipe(0) ); pwin->setName( title ); pwin->setSize( 500, 500); pwin->setWinType( PFPWIN_TYPE_X ); pwin->open(); pfFrame();
return pwin; }
pfScene* sceneSetup() { // Scene pfScene* scene = new pfScene();
// Light pfLightSource* light = new pfLightSource(); scene->addChild(light);
// Texture. pfGeoState* state = 0; if ( withTextures ) { pfTexture* tex = new pfTexture(); tex->setFormat(PFTEX_IMAGE_FORMAT, PFTEX_RGB ); tex->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_RGB_8 ); tex->setImage( (unsigned int *)imageBuffer, 3, imageWidth, imageHeight, 1 ); tex->ref();
pfTexEnv* texEnv = new pfTexEnv(); texEnv->setMode(PFTE_MODULATE); texEnv->ref();
// GeoState for the GeoSet state = new pfGeoState(); state->setMode(PFSTATE_ENTEXTURE, PF_ON ); state->setAttr(PFSTATE_TEXTURE, tex ); state->setAttr(PFSTATE_TEXENV, texEnv ); } // Objects pfGeode *geode = 0; pfSCS *scs = 0; pfMatrix mat; int width = 12; int nb = 20;
for ( int i=0; i<nbObjects; i++ ) { mat.makeTrans( (i%nb)*width, 0.0, (i/nb)*width ); scs = new pfSCS( mat );
geode = createObject( state );
scs->addChild( geode ); scene->addChild( scs ); }
return scene; }
pfGeode* createObject( pfGeoState* state ) { // Create a geode containing 1 gset (a quad) with eventually // a geostate with texture attached on it.
pfGeode *geode = new pfGeode();
// GeoSet void *arena = pfGetSharedArena(); pfGeoSet *gset = new(arena) pfGeoSet();
gset->setPrimType( PFGS_QUADS ); gset->setNumPrims(1);
pfVec3* verts = (pfVec3 *)pfMalloc( 4 * sizeof(pfVec3), arena ); verts[0].set( -5.0, 0.0, -5.0); verts[1].set( 5.0, 0.0, -5.0); verts[2].set( 5.0, 0.0, 5.0); verts[3].set( -5.0, 0.0, 5.0);
pfVec4* colors = (pfVec4 *)pfMalloc( 4 * sizeof(pfVec4), arena ); colors[0].set( 1.0, 0.0, 0.0, 1.0); colors[1].set( 1.0, 0.0, 0.0, 1.0); colors[2].set( 1.0, 0.0, 0.0, 1.0); colors[3].set( 1.0, 0.0, 0.0, 1.0);
pfVec2 *texcoords = (pfVec2*)pfMalloc( 4 * sizeof(pfVec2), arena ); texcoords[0].set(0.0f, 0.0f); texcoords[1].set(1.0f, 0.0f); texcoords[2].set(1.0f, 1.0f); texcoords[3].set(0.0f, 1.0f);;
gset->setAttr( PFGS_COORD3, PFGS_PER_VERTEX, verts, NULL); gset->setAttr( PFGS_COLOR4, PFGS_PER_VERTEX, colors, NULL); gset->setAttr(PFGS_TEXCOORD2, PFGS_PER_VERTEX, texcoords, NULL);
// Attach all together. if ( state != 0 ) gset->setGState( state ); geode->addGSet(gset);
return geode; }
pfChannel* channelSetup(pfScene *scene) { pfChannel* chan = new pfChannel( pfGetPipe(0) ); chan->setScene( scene );
// Traversal func and mode chan->setTravFunc( PFTRAV_DRAW, draw ); chan->setTravMode(PFTRAV_CULL, PFCULL_VIEW|PFCULL_GSET|PFCULL_SORT);
// Viewpoint pfSphere bsphere; scene->getBound( &bsphere );
chan->setNearFar( 1.0f, 10.0f * bsphere.radius); chan->setFOV( 60.0f, -1.0f);
pfCoord view; view.xyz.set( bsphere.center[0], -1.5f * bsphere.radius, bsphere.center[2] ); view.hpr.set( 0.0f, 0.0f, 0.0f ); chan->setView( view.xyz, view.hpr );
// Stats pfFrameStats* fsp = chan->getFStats(); fsp->setClass( PFSTATS_ALL, PFSTATS_OFF ); fsp->setClass( PFFSTATS_ENPFTIMES, PFSTATS_ON ); chan->setStatsMode( PFCSTATS_DRAW, 0 );
return chan; }
void draw( pfChannel *channel, void * ) { // Draw. channel->clear(); pfDraw(); channel->drawStats(); pfFlushState(); }
//============================================================================= // N O T E S // //
// end of pfPerf.C
This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 15:15:08 PST