Greetings, I have a question regarding PBOs:
As you know, calling glTexSubImage2D on a texture that is currently in use may cause the receiving texture to be ghosted - as in, a temporary copy is created to which the changes are applied to until work using the original resource is finished.
Now my question is whether the PowerVR driver avoids ghosting if the source of the glTexSubImage2D is a pixel buffer. My rationale would be that since the driver has full control over who modifies that buffer and when it should be able to just preserve that buffer until it can apply the changes to the original resource.
Regards.
Hi desperado,
In PowerVR drivers, texture upload normally has 2 stages. First one is copying client data into driver’s internal temporary buffer. Second one is to twiddle and compressed this buffer into GPU memory for TPU to sample textures. For using PBO as the texture data, driver can skip first stage and do second stage directly. So, using PBO is not related to probability of ghosting textures.
Please let us know if you need further information about this topic.
Regards,
Melih
Thanks for your answer! Can you tell me if there is a way to copy a small texture to a larger atlas in a way that the transfer is delayed until the receiving texture is not in use anymore so the receiving texture does not ghost and that doesn’t ruin performance?
Hi desperado,
You can insert a fence for a bound context by calling glFenceSync(), then use glGetSync(…GL_SYNC_STATUS,…) to get status for the workload of the context before glFenceSync() is inserted. If the sync is signaled, it means those workloads are finished. Upload texture of the context should not trigger ghosting.
Regards,
Melih