From: <bug...@fr...> - 2008-11-02 02:15:20
|
http://bugs.freedesktop.org/show_bug.cgi?id=18347 Summary: intelReadPixels needs to wait for hardware Product: Mesa Version: unspecified Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/i915 AssignedTo: dri...@li... ReportedBy: ot...@re... Created an attachment (id=20001) --> (http://bugs.freedesktop.org/attachment.cgi?id=20001) Patch as described With the current intel driver, small 1x1 pixel reads often (perhaps even usually) give the wrong result. I think the problem is that when the code falls back to _swrast_ReadPixels(), it doesn't wait for the GPU to finish. The patch I'll attach here adds an intelFinish() call before calling _swrast_ReadPixels(). It fixes the problems I'm observing. Comments: - I think the intelFlush() call at the beginning of of intelReadPixels() can be removed. do_blit_readpixels() calls intelFlush() itself, as does intelFinish(). Performance difference for doing so is probably minimal. - intelFinish() does a bit more than is necessary, since it waits for rendering to all color buffers to finish, not just the one we are going to read from. Seems unlikely to matter, since presumably the last thing done before glReadPixels() is to render to the buffer you are going to read from. - I don't see where do_blit_readpixels() waits for the blit it emitted to finish, but I don't have a test case for that code path, and maybe that happens implicitly or in the upper layers. - I don't know the code at all, so please double check for sanity :-) -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |