2 Replies Latest reply on Feb 14, 2013 8:23 PM by degasus

    AMD pinned memory opengl extension : change pointer each frame




      I am trying to use amd pinned memory opengl extension to optimize video decoding. I have a ring of n buffer containing 4K aligned memory and containing the updated movie frame. what is the best options to minimize  upload time :


      1)- create n pixel buffer object pinned to GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD of each frame ...

      2)- create one pixel buffer object and change each frame the current pointer with glbufferdata and GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD

      3)- create two or Three pixel buffer object and do the same turning around with the two or three buffers ?

        • Re: AMD pinned memory opengl extension : change pointer each frame



          Of these, option 1 is probably the best.


          However, there is another option:


          Create 1 buffer, use it a single, large PBO, and on each frame, simply adjust the offset into the buffer in whichever calls you are using (glTexSubImage, glReadPixels, or whatever).



            • Re: AMD pinned memory opengl extension : change pointer each frame



              I also upload much of vertices in small batches in this way, but my vertices aren't aligned at all. I always memcpy the new vertices into the vbo, call glDraw and adjust the offset for the next memcpy. It works really fast, but I'm not sure, if it's safe:

              The specs doesn't say anything about cache or readahead of the gpu, only the programmer have to take care of syncing. I do glFenceSync and glClientWaitSync bytewise, so here are maybe the same issues.


              Do I have to skip some bytes or align to the next cache item? Or will the gpu cache get invalidated by writing into the pinned memory?


              If the cache gets invalidated, would it be faster to skip some bytes? How many bytes  are useful?