Package: libgl1-mesa-dri
Version: 6.5.2-4
Severity: normal

When using blending for transparency, banding occurs in the output and colors 
have a greenish cast.  This can be seen via indirect rendering or with r200 DRI.

Attached is a program to demonstrate this and a makefile.  Two images show the 
banded (buggy) and 50% gray (expected) output.

Here is a breakdown of the behavior for various versions of Mesa curently in 
Debian, and the last two vanilla Mesa versions:

version                indirect rendering    r200 DRI on
----------------       ------------------    ------------
Debian 6.5.1-0.6       banding               50% gray
Debian 6.5.2-4         banding               banding
Debian 6.5.3~rc3-1     banding               banding
released 6.5.2 (DRI)   banding               50% gray
released 6.5.3 (DRI)   banding               50% gray
released 6.5.3 (xlib)  50% gray              n/a

Unless I'm totally making a hash of diagnosing this, it seems that:

- Somehow the Debian-compiled versions of Mesa exhibit a bug which
  vanilla version of Mesa does not exhibit??

- There is an inconsistency between indirect and direct rendering (at
  least for the R200) in Mesa.  I can't speak to cards besides the
  R200.

I'm reporting this against libgl1-mesa-dri, though perhaps it could
as easily be against libgl1-mesa-glx or the mesa source package?

Please excuse me if I am utterly flubbing the testing of this and it
isn't a real bug.  I'd be very excited if it were reproducible on
another computer...or if it turned out to not be reproducible and
was a result of a silly error here.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (800, 'unstable'), (700, 'experimental'), (500, 
'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.20 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgl1-mesa-dri depends on:
ii  libc6                         2.5-2      GNU C Library: Shared libraries
ii  libdrm2                       2.3.0-4    Userspace interface to kernel DRM 
ii  libexpat1                     1.95.8-3.4 XML parsing C library - runtime li
ii  libgl1-mesa-glx               6.5.2-4    A free implementation of the OpenG

libgl1-mesa-dri recommends no packages.

-- no debconf information
// demo of banding in blending display of bitmaps
//
// Should display a 50% gray screen, when buggy displays greenish bands
// depending on mesa version and whether or not DRI.

#include <string.h>
#include <GL/glut.h>

#define WIDTH 512
#define HEIGHT 512

void RenderScene(void)
{
    // make a bitmap of all 1s
    GLubyte bitmap[WIDTH][HEIGHT];
    memset(bitmap, 255, WIDTH*HEIGHT/8);
  
    glClear(GL_COLOR_BUFFER_BIT);
  
    // draw a square of 1s filling the window, using white with 50% alpha
    glColor4f(1,1,1,0.5);
    glRasterPos2f(0, 0);
    glBitmap(WIDTH, HEIGHT, 0, 0, 0, 0, (GLubyte*) bitmap);
}


int main(int argc, char **argv)
{
    glutInit(&argc, argv);
    
    // create test window
    glutInitDisplayMode(GLUT_RGBA);
    glutInitWindowSize(WIDTH,HEIGHT);
    glutCreateWindow("Blend test");

    // use traditional "transparency" blending
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);

    // origin bottom left, spacing by pixels
    gluOrtho2D(0.0f, WIDTH, 0.0f, HEIGHT);

    // define display callback and start up glut
    glutDisplayFunc(RenderScene);
    glutMainLoop();
}
LOADLIBES=-lglut
CFLAGS=-Wall -O2 -std=gnu99
faded:

clean:
        $(RM) faded faded.o

<<attachment: blend-gray.png>>

<<attachment: blend-banding.png>>

Reply via email to