Re: [PyOpenGL-Users] Rolling spectrogram with pyopengl
Brought to you by:
mcfletch
From: Timothée L. <tim...@lp...> - 2009-12-09 09:46:33
|
Gijs a écrit : > On 7-12-2009 9:13, Timothée Lecomte wrote: >> >> Le 7 déc. 09 à 00:00, Greg Ewing a écrit : >> >>> Timothée Lecomte wrote: >>>> As far as alternatives to pure glTexSubImage2D, I have considered >>>> and tried to use PBO, but it does not decrease the time needed by >>>> the two glTexSubImage2D calls. >>> >>> This is puzzling, because transferring 1000 pixels of data >>> shouldn't take very long, even if you're not doing it the >>> most efficient way. >>> >>> The only thing I can think of is to try using different >>> pixel formats for the texture data. Fastest CPU->GPU transfers >>> occur when you use a pixel format that matches what the >>> GPU uses, so that no conversions are needed. >>> >> >> That's an advice I've seen very often on opengl pages on the web. Is >> there a way to know at runtime what is the native format ? >> >> Thanks Greg. >> >> Timothée >> > Hello Timothée, > > I don't know of any method to determining at runtime which texture > transfers the fastest, except benchmarking it and see which performs > the best. However, most of the time GL_BGRA with > GL_UNSIGNED_INT_8_8_8_8 is usually the fastest. If you want to check > to make sure, run the code I supplied with this email. It transfers a > whole bunch of different formats and displays which are the fasted > pixel-wise and megabyte-wise. > > Regards, Gijs Hello Gijs, Thanks for your help. I found that on my machine, the best pixel rate is achieved with GL_BGRA and GL_UNSIGNED_INT_8_8_8_8_REV. I get 397.253 Mp/s. Does that look ok (it's NVidia Quadro NVS 290/PCI/SSE2, on ubuntu karmic) ? I have a question now: when glTexSubImage2D is called to update ~1000 pixels on a texture of 1Mpixels, does the whole texture gets transferred again from system memory to video memory ? Best regards, Timothée |