Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Direct access to OpenGL texture memory

7,125 views

Published on

This presentation regards working with graphic applications, and in particular it deals with OpenGL's texture direct memory access.

Presentation by Rostyslav Lesovyi, Software engineer, GlobalLogic. Mobile TechTalk, Lviv, 2014.
More details - www.globallogic.com.ua/press-releases/mobile-techtalk-lviv/

Published in: Software, Technology, Art & Photos
  • ⇒⇒⇒WRITE-MY-PAPER.net ⇐⇐⇐ has really great writers to help you get the grades you need, they are fast and do great research. Support will always contact you if there is any confusion with the requirements of your paper so they can make sure you are getting exactly what you need.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Don't forget another good way of simplifying your writing is using external resources (such as ⇒ www.HelpWriting.net ⇐ ). This will definitely make your life more easier
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If we are speaking about saving time and money this site ⇒ www.WritePaper.info ⇐ is going to be the best option!! I personally used lots of times and remain highly satisfied.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Direct access to OpenGL texture memory

  1. 1. CONFIDENTIAL©2013 GlobalLogic Inc. by Rostyslav Lesovyi OpenGL's texture DMA DMA stands for Direct Memory Access
  2. 2. ©2013 GlobalLogic Inc. CONFIDENTIAL
  3. 3. CONFIDENTIAL • Async texture upload • Rapid updates of texture or its parts • Texture data download Problems
  4. 4. CONFIDENTIAL • Simple download/upload • Shared OpenGL contexts • PBO (Pixel Buffer Objects) • EGLImage and GraphicBuffer Solutions
  5. 5. CONFIDENTIAL Pros: • very easy to use and understand Cons: • super slow!!! • operates in a single thread • glTexImage2D/glTexSubImage2D for upload • glReadPixels for download Simple download/upload
  6. 6. CONFIDENTIAL • create background thread • create shared OpenGL context • attach context to background thread • use glTexImage2D, glTexSubImage2D or glReadPixels What to do Shared OpenGL contexts
  7. 7. CONFIDENTIAL EGLContext context = egl.eglCreateContext(display, config, parentContext, null); EGLSurface surface = egl.eglCreatePbufferSurface(display, config, surfaceAttributes); Shared context creation: Shared OpenGL contexts
  8. 8. CONFIDENTIAL EGLContext context = egl.eglCreateContext(display, config, parentContext, null); EGLSurface surface = egl.eglCreatePbufferSurface(display, config, surfaceAttributes); Shared OpenGL contexts
  9. 9. CONFIDENTIAL Pros: • relatively easy to use • full threading support Cons: • relying on slow functions Shared OpenGL contexts More info: https://github.com/pcwalton/test-async-texture-upload
  10. 10. CONFIDENTIAL Pixel Buffer Objects
  11. 11. CONFIDENTIAL Pixel Buffer Objects Pros: • relatively easy to use • supports asynchronous upload/download Cons: • Android 4.3+ / OpenGL ES 3.0 • hard to use for two-ways texture updates • still copies from PBO to CPU and vice versa More info: http://www.songho.ca/opengl/gl_pbo.html
  12. 12. CONFIDENTIAL EGLImage and GraphicBuffer Regular PC CPU GPU CPU Memory GPU Memory Copy Mobile device, AMD APUs, etc... CPU GPU Shared Memory = Texture image data (actual pixels)
  13. 13. CONFIDENTIAL EGLImage and GraphicBuffer Pros: • direct access to texture’s pixel data • can be accessed by any thread • supported by Android 2.0.1+ Cons: • requires NDK • requires usage of ARM library More info: https://wiki.mozilla.org/Platform/GFX/Gralloc
  14. 14. CONFIDENTIAL©2013 GlobalLogic Inc. Q&A
  15. 15. CONFIDENTIAL©2013 GlobalLogic Inc. Thank you

×