[squeak-dev] Re: Still pounding head against wall over glReadPixels => external buffer

Josh Gargus josh at schwa.ca
Fri Feb 12 03:24:51 UTC 2010


Very cool, nice work!

If it turns out that you need more CPU cycles, you might try using PBOs to asynchronously read the pixels... when you call glReadPixels(), the function does not return until the pixels have been completely read, and while you're waiting for the pixels to cross the PCI-E bus, Squeak isn't doing any processing.  If you're reading back 30fps at 5ms per frame (according to your measurements below), you're sitting idle about 15% of the time.

Search for "Asynchronous glReadPixels:" in the PBO extension spec (http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt).  Google will turn up many more tutorials.

It probably won't be your top priority right now, but I wanted to ensure that you're aware of the option.

Cheers,
Josh



On Feb 11, 2010, at 1:54 PM, Lawson English wrote:

> Lawson English wrote:
>> 
>> 
>> So,  I can now draw using squeak opengl calls and they are now accessible in another process.
>> 
> 
> Benchmark:
> 
> Time millisecondsToRun: [1000 timesRepeat: [
> ogl                     "read pixels into my buffer"
>   glReadPixels: 0
>   with:  0
>   with: 1000
>   with: 1000
>   with: ogl imagePixelFormat32
>   with: ogl imagePixelType32
>   with: xData.
> ]]   => 5930
> 
> 
> :-)
> 
> 
> Lawson
> 




More information about the Squeak-dev mailing list