RE: [info-performer] depth buffer write is slow.

New Message Reply Date view Thread view Subject view Author view

From: Luc Renambot (renambot++at++cs.vu.nl)
Date: 08/15/2002 04:03:01


] -----Original Message-----
] From: w.price++at++electronic-alchemy.co.uk
] [mailto:w.price++at++electronic-alchemy.co.uk]
] Sent: Wednesday, August 14, 2002 16:47
] To: info-performer++at++sgi.com
] Cc: Performer Newsgroup
] Subject: Re: [info-performer] depth buffer write is slow.
]
]
]
] Another possible speedup which I have found across using
] glDrawPixels() on Linux is to NOT send the entire chunk of data
] in one go. i.e. instead of using
]
] glDrawPixels(1024, 768, ....)
]
] use
]
] glRasterPos2i(0, 0);
] glDrawPixels(128, 128, ...., buffer);
] glRasterPos2i(128, 0);
] glDrawPixels(128, 128, ...., buffer + offset);
] .....
] .....
] (most likely this will be in a loop)

Must dependend on the driver and the memory bandwidth of the
system, but on Dual-athlon with GeForce4 under Linux (latest driver),
I don't get any speedup with tiling. The max is always with one
glReadPixels call, with around 90Mpixels/sec. Or I have a bug
im my code (GL_UNPACK_SKIP_PIXELS seems killing the perf,
but otherwise you need a memcopy, no ?).
I tried to swap the indices, or doing by block of rows, it's
not better.

#if 0
         glDrawPixels( width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels );
#else
    block = 128;
    stepi = width / block;
    stepj = height / block;
    
    glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, height);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
    
   for (j=0;j<stepj;j++)
       for (i=0;i<stepi;i++)
       {
           glRasterPos2i(i*block,j*block);
           glPixelStorei(GL_UNPACK_SKIP_PIXELS, i*block);
           glDrawPixels( block, block, GL_RGB, GL_UNSIGNED_BYTE,
                         pixels + width*j*block*3);
       }
#endif

Luc.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 04:00:50 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.