Can I use GL_RGBA,GL_UNSIGNED_INT_8_8_8_8_REV instead? Or it must be BGRA?
glDrawPixels can be fast if you use the right params. Since you've observed slowness I'm guessing that you're using dear old GL_RGB/GL_UNSIGNED_BYTE, which is a slow path nearly everywhere; you need these parameters to match the native format of your backbuffer otherwise GL is going to send the data through intermediate conversion steps, so try it with GL_BGRA/GL_UNSIGNED_INT_8_8_8_8_REV for starters and you should see a very noticeable performance increase (at the cost of an extra byte per pixel - fair tradeoff) - that just requires GL1.2 support.
How to test if OpenGL support textures of non power of 2?
Can I use GL_RGBA,GL_UNSIGNED_INT_8_8_8_8_REV instead? Or it must be BGRA?
[quote name='mhagain' timestamp='1351076224' post='4993388']
glDrawPixels can be fast if you use the right params. Since you've observed slowness I'm guessing that you're using dear old GL_RGB/GL_UNSIGNED_BYTE, which is a slow path nearly everywhere; you need these parameters to match the native format of your backbuffer otherwise GL is going to send the data through intermediate conversion steps, so try it with GL_BGRA/GL_UNSIGNED_INT_8_8_8_8_REV for starters and you should see a very noticeable performance increase (at the cost of an extra byte per pixel - fair tradeoff) - that just requires GL1.2 support.
[/quote]
It depends on the layout of your underlying framebuffer, and that's going to be decided by your hardware. If your hardware likes data in BGRA order, then BGRA order is what you must use to get the fast path.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement