| Summary: | glReadPixels() fails to read offscreen pixels | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Andrew Church <achurch+sdl> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | KarlFakeMail |
| Version: | 2.0.2 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Sample code demonstrating bug | ||
For reference, on my system (FVWM 2.6.5 with a 31-pixel top border and 7-pixel left border on windows, screen size 1920x1440), the test program fails with the following output when built against SDL2: Pixel 0,0 not read Pixel 1,0 not read [...] Pixel 1918,30 not read Pixel 1919,30 not read Pixel 1913,31 not read Pixel 1914,31 not read Pixel 1915,31 not read Pixel 1916,31 not read Pixel 1917,31 not read Pixel 1918,31 not read Pixel 1919,31 not read Pixel 1913,32 not read Pixel 1914,32 not read [...] Pixel 1918,1439 not read Pixel 1919,1439 not read When built against SDL 1.2.15, the test program reports no errors. Hey Pierre-Loup, do you know what's going on here, and whether this is expected? Wrong Pierre here, and I don't see a Pierre-Loup in the completions? Whoops, sorry about that! For OpenGL pixels that are off-screen or obscured by other windows have undefined contents, see https://www.opengl.org/wiki/Pixel_Ownership_Test#Pixel_ownership_test for more info. If this worked before it probably was by accident and it is outside of the control for SDL to do anything about it. Agreed, I found the same problem with a native GLX test so it's probably a GL driver issue (NVIDIA in my case). SDL 1.2 uses the old XVisualInfo method rather than GLXFBConfig so maybe the GL driver does different things in the two cases. |
Created attachment 1590 [details] Sample code demonstrating bug In SDL 2.0.1 and 2.0.2 on Linux, if an OpenGL window is positioned such that part of its content area is offscreen, glReadPixels() will fail to read pixels from the offscreen parts of the window. This is a regression from SDL 1.2.15.