vinzf
11-14-2011, 08:39 AM
Hi,
I've an application which receives a list of 32x32 sized unique tiles in BGRA format from a special scientific grabber device. Together with these tiles comes a damage region information which tells me which (rectangular) part of which frame contains valid data. This graphical information will be displayed on a 1080p screen where a FPS of 60 must be achieved.
Currently I'm using mmap to create a mapping of the linux framebuffer device in the programs virtual address space.
This allows me to directly modify the pixels by writing (memcpy the lines of the damaged tiles data) to the correct offsets of that address.
So this gives me extremely fast "memory to screen blitting".
Now I'm trying to achieve the same thing using OpenGL for portability (Windows/X11/MacOSX) with a similar performance.
I've set up a orthogonal projection, disabled depth test and tried the most simple way using glRasterPos/glDrawPixels and a more sophisticated approach by creating 32x32 sized textures, uploading the data using glTexImage2D and "blitting" these by drawing quads according to each tile's damaged region using glTexCoord /glVertex.
The lifetime of each texture is extremely short because it is only used to transfer data from user to video memory and because there is no reuse for the bitmap data in the texture.
However, the performance compared to the mmaped /dev/fbx solution is extremely poor (~30 times slower) and 99,9% of the time is consumed by the glTexImage2D calls.
So what is the fastest way too implement "user memory to screen blitting" with exact 2D-pixelization in OpenGL ?
Thanks for any hints !
Vinz
I've an application which receives a list of 32x32 sized unique tiles in BGRA format from a special scientific grabber device. Together with these tiles comes a damage region information which tells me which (rectangular) part of which frame contains valid data. This graphical information will be displayed on a 1080p screen where a FPS of 60 must be achieved.
Currently I'm using mmap to create a mapping of the linux framebuffer device in the programs virtual address space.
This allows me to directly modify the pixels by writing (memcpy the lines of the damaged tiles data) to the correct offsets of that address.
So this gives me extremely fast "memory to screen blitting".
Now I'm trying to achieve the same thing using OpenGL for portability (Windows/X11/MacOSX) with a similar performance.
I've set up a orthogonal projection, disabled depth test and tried the most simple way using glRasterPos/glDrawPixels and a more sophisticated approach by creating 32x32 sized textures, uploading the data using glTexImage2D and "blitting" these by drawing quads according to each tile's damaged region using glTexCoord /glVertex.
The lifetime of each texture is extremely short because it is only used to transfer data from user to video memory and because there is no reuse for the bitmap data in the texture.
However, the performance compared to the mmaped /dev/fbx solution is extremely poor (~30 times slower) and 99,9% of the time is consumed by the glTexImage2D calls.
So what is the fastest way too implement "user memory to screen blitting" with exact 2D-pixelization in OpenGL ?
Thanks for any hints !
Vinz