Hi,
I’m working on a tiled GPU-based map reprojection pipeline in OpenGL (on NVIDIA). The driver frequently reports:
Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
My pipeline streams and processes imagery in tiles. At a high level:
- Upload tile data into a texture (currently PBO + glTexSubImage2D).
- Reproject by rendering a quad into an FBO (color attachment is an GL_RGBA8 texture).
- Read back the FBO result and save it as JPEG.
The tiles that are produced and written to disk are 1024×1024. I use a ring of buffers and glFenceSync/polling so that uploads/readbacks are queued and later harvested without intentional blocking (map/copy + JPEG encode runs on a worker thread).
The warning appears in runs where the time is dominated by pixel transfers: both texture uploads and readbacks. I don’t want to assume it is only a readback issue; it seems plausible that either glTexSubImage2D (upload) or glReadPixels (readback), or their interaction/ordering, can trigger synchronization with 3D rendering. The warning always occurs on one of those calls, or on both. I see ~3,263 warnings for 3,072 output tiles (each output tile may require loading 0 to 64 input tiles). So the warning does not occur every time, and I can observe it either on glTexSubImage2D or on glReadPixels.
I also tried an alternative readback path (compute shader copies the FBO texture into a persistently mapped SSBO, then fence + memcpy + JPEG), but it did not show a clear performance improvement in quick tests (even a slight performance regression).
Question: what is the recommended NVIDIA/OpenGL approach to avoid or minimize these pixel-path synchronizations in a streaming pipeline that performs both frequent texture uploads and readbacks? Are there known best practices for buffer usage, formats/packing, synchronization/barriers, or pipeline structure that typically help prevent the driver from synchronizing pixel transfers with rendering?
Thank you in advance!