Bug 7444 - glDrawPixels doesn't display grey-images (GL_LUMINANCE) properly
Summary: glDrawPixels doesn't display grey-images (GL_LUMINANCE) properly
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: mesa-dev
QA Contact:
URL: http://vision.eng.shu.ac.uk/mediawiki...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-06 11:42 UTC by Jan Wedekind
Modified: 2009-08-24 12:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Little GLUT app showing the problem (2.06 KB, text/x-csrc)
2006-11-07 10:48 UTC, Cihan
Details

Description Jan Wedekind 2006-07-06 11:42:50 UTC
While displaying images with GL_RGBA still works properly, GL_LUMINANCE does not:

glDrawPixels( get_width(), get_height(),
              GL_LUMINANCE, GL_UNSIGNED_BYTE, img.rawData().data() );

The image appears to be skewed in x-direction as if the pixel-size is not
interpreted properly. The problem persists in 16- as well as 24-bit displays. We
only observed this effect in Xorg 6.9.0 (in Xorg 6.8.2 it still was ok).

In our library, one can observe the effect in the example-program
'mimas/examples/blob/blob'.

Here's an extract from
'http://vision.eng.shu.ac.uk/jan/mimas/mimas-2.0/lib/image_mesaoutput.cc':

    glDisable(GL_DITHER);
    glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
    glRasterPos2i( 0, 0 );
    glPixelZoom( 1, -1 );

    unsigned int retraceCount;
    // Wait for vertical retrace
    // http://www.inb.uni-luebeck.de/~boehme/xvideo_sync.html
    glXGetVideoSyncSGI( &retraceCount );
    glXWaitVideoSyncSGI( 2, ( retraceCount + 1 ) % 2, &retraceCount );

    // Direct access to image-memory!
    glDrawPixels( get_width(), get_height(),
                  GL_LUMINANCE, GL_UNSIGNED_BYTE, img.rawData().data() );
    glEnable(GL_DITHER);
Comment 1 Cihan 2006-11-07 10:48:56 UTC
Created attachment 7698 [details]
Little GLUT app showing the problem

I must have overseen this entry before so I reported the bug in Debian's bug
tracker:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=396415
Comment 2 Cihan 2007-01-20 01:08:19 UTC
Is anybody working on this problem? X.org 7.1 is still affected.
Comment 3 Jerome Glisse 2007-02-15 08:44:54 UTC
Reassigning to mesa.
Comment 4 Brian Paul 2007-02-24 16:10:17 UTC
With Mesa 6.4.2 the upper-left window (named "BUG") there was a black region on the right hand side.  With later version of Mesa the "BUG" window looks identical to the lower windows.  I'm thinking this was fixed a while ago.

If you can concur, please close this bug report.

I tested w/ software rendering (xlib driver).  Which driver are you using?
Comment 5 Cihan 2007-02-25 06:45:21 UTC
The bug is still there on my machine:
X.org 7.1.1
radeon driver 4.2.0
Mesa 6.5.1

I did try with software rendering as well when I first reported the issue and the problem persisted.
Comment 6 Roland Scheidegger 2007-02-26 09:11:16 UTC
(In reply to comment #5)
> The bug is still there on my machine:
> X.org 7.1.1
> radeon driver 4.2.0
> Mesa 6.5.1
I've failed to reproduce this here with a radeon. You probably need to upgrade to X.org 7.2 and Mesa 6.5.2.
Comment 7 Cihan 2007-02-26 10:17:51 UTC
Upgrading to Mesa 6.5.2 (currently only in Debian's experimental repo) indeed helps. Thanks for the help!
Comment 8 Adam Jackson 2009-08-24 12:24:01 UTC
Mass version move, cvs -> git


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.