Neil Roberts wrote:
Murray Cumming <[email protected]> writes:
My superficial reading of OpenGL books suggest that reading rendered
graphics data should be avoided because it must wait for the rendering
to happen, blocking the pipeline. Have I misunderstood?
It's true that generally reading back graphics data should be avoided
but we think for Clutter the cost is worth it because it provides the
most flexible picking method with the simplest interface to
developers. The time needed for the render should be relatively quick
because it is scissored to a 1x1 pixel rectangle and it usually ends up
being batched up to a single call to glDrawArrays.
From our experience the GPU sync involved by the readback is the
performance killer. The issue is not about the time to complete the 1x1
pixel draw and readback, but rather the sync it implies with the
previously _painted_ frame.
The biggest cost is when dragging the finger/mouse, as it involves a
pick for every paint, hence killing the CPU/GPU parallelism.
And dragging happens to be the case where you need the highest
framerate, because of the extra-sensitivity that comes with on-screen
user interaction.
Bottomline, we found it is usually very worthwhile to disable picking
during the press/release scope.
Also with the work in the async-pbo-picking it should be possible to
avoid blocking altogether if the driver implements it correctly.
- Neil
--
Michael Boccara
Graphtech
Herzliya, Israel