How to test if OpenGL support textures of non power of 2?

Started by
10 comments, last by 21st Century Moose 11 years, 5 months ago

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.
Can I use GL_RGBA,GL_UNSIGNED_INT_8_8_8_8_REV instead? Or it must be BGRA?

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

Advertisement

[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.
Can I use GL_RGBA,GL_UNSIGNED_INT_8_8_8_8_REV instead? Or it must be BGRA?
[/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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement