We have a set of textures we redraw using FBOs. We’d like to be sure that the driver doesn’t ghost them.
If we issued a sync object after each read submitted for one of these textures, and then on submitting a write request checked whether the most recently-submitted sync object for that texture was signaled, would that be a valid test for ghost creation?
(This is in absence of a PowerVR driver or emulator that warns on ghost creation, in an attempt to emulate this.)
[blockquote]We have a set of textures we redraw using FBOs. We’d like to be sure that the driver doesn’t ghost them.[/blockquote]
The driver will only ghost textures that are modified by the CPU. Ghosting will not occur for FBOs, as the GPU can ensure that the draw operations for render pass A are completed before render pass B reads pass A’s attachment data.
Make a fence on the render reading/writing the texture on GPU (pipeline) side. Aim to add this fence at swapbuffers stage to avoid unnecessary TA kicks.
Check this fence before modifying the texture on the CPU
Either wait for it to finish (wait on fence + performance cost) or risk the chance of ghosting by modifying it (memory loss).