2

I am working on a pure 2D project, where the screen is rendered by CPU, and I want to display it as a texture, but I do not want to upload the whole image for each frame. I cannot tell what parts are changed, so I assume the whole image is invalid.

I need to do some post-processing (adding another layer with some blits), and my early tests showed it may be a performance problem doing purely with CPU, that's why I need GPU accel (2D would be much better, but is not common/portable in these days...).

My target platform is an embedded system (ARM) where GPU and CPU shares the memory, so theoretically I could do this without any copy. The chosen platform supports OpenGL 2.1 and OpenGL ES 3.0.

I understand that Buffer Objects can be mapped by glMapBufferRange​(). I have looked after the possibilities below:

  • UNIFORM_BUFFER: too small to store a full-screen image

  • SHADER_STORAGE_BUFFER: supported only from ES 3.1

  • Shader Image Load Store: supported only from ES 3.1

  • Buffer Texture: ES 3.0 does not support (supported from ??)

  • Pixel Buffer Objects: I cannot reach them from shaders, and it seems to me that it does copy when I update a texture from it. I don't know if it is faster than copying from client memory (taking into account that they all reside on the same RAM chip :))

  • plain textures: are not buffer objects, cannot be mapped into client process memory

Do I miss something? There is no way in ES 3.0 to share a buffer with the GPU containing mass amount of data what I can write from CPU and read from fragment shaders?

Ferenc
  • 779
  • 1
  • 6
  • 14

1 Answers1

0

You can change texture partially with GLES20.glTexSubImage2D.

Reaper
  • 747
  • 1
  • 5
  • 15