Bug 96872 - glReadPixels returns black pixels on first display in software mode
Summary: glReadPixels returns black pixels on first display in software mode
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 10.5
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-09 17:11 UTC by Ruslan Kabatsayev
Modified: 2017-01-30 07:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test program (936 bytes, text/x-csrc)
2016-07-09 17:11 UTC, Ruslan Kabatsayev
Details

Description Ruslan Kabatsayev 2016-07-09 17:11:29 UTC
Created attachment 124967 [details]
Test program

The attached program uses glReadPixels after glClear and glFinish. On normal HW-accelerated Mesa, this gives the expected result: the data defined by glClearColor are received (the program just prints "Test passed"). This also works normally if e.g. NVIDIA proprietary driver is in use, but Mesa libGL is used to draw things. Similarly for Xephyr, where software rendering is the only possible option.

But if I use e.g. intel driver but set LIBGL_ALWAYS_SOFTWARE=1 environment variable for the test program, I get the following output:

Wrong data received from glReadPixels(): expected ff ff ff ff, got 00 00 00 00
Test passed

I.e. on first call to runTest() (which is a GLUT display function) glReadPixels() returns black transparent pixels, and only on the second it works as expected.

Was testing this on Intel Atom N550. The same result is observable on i915G graphics.
The OS I tested this on is Kubuntu 14.04 with LTS enablement stack (packages with "-vivid" suffix in names).
Comment 1 Ruslan Kabatsayev 2016-07-09 18:16:50 UTC
I can also reproduce this with FBDEV driver being in use and default renderer.
Comment 2 Tapani Pälli 2017-01-30 07:36:42 UTC
test passes with Mesa 17.1.0-devel (git-2f7a7ae), resolving as fixed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.