cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

qtnext
Journeyman III

AMD pinned memory opengl extension : change pointer each frame

Hi,

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 ?

0 Likes
2 Replies
gsellers
Staff

Hi,

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).

Cheers,

0 Likes

Hi,

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?

Cheers,

Markus

0 Likes