http://bugs.freedesktop.org/show_bug.cgi?id=13578

           Summary: incorrect glClear with ati driver
           Product: Mesa
           Version: unspecified
          Platform: x86-64 (AMD64)
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/X11
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AP [Radeon 9600]
mesa 7.0.1
xorg-ati 1:6.7.195
xorg 1:7.2


glClear ignore stencil mask while using xorg-ati driver (works fine with
fglrx).
gl specifically state that:
            "The pixel ownership test, the scissor test,
            dithering, and the buffer writemasks affect the operation of
glClear".


the following example demonstrate the problem. the expected rendering result is
the intersection of the
first two rectangles. with ati driver nothing gets rendered.

void draw(void)
{
    glStencilMask(0xff);
    glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);

    glStencilFunc(GL_ALWAYS, 0x01, 0x01);
    glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
    glBegin(GL_POLYGON);
        glVertex2f(0, 0);
        glVertex2f(0, 100);
        glVertex2f(100, 100);
        glVertex2f(100, 0);
    glEnd();

    glStencilFunc(GL_ALWAYS, 0x01, 0x01);
    glStencilOp(GL_INCR, GL_INCR, GL_INCR);
    glBegin(GL_POLYGON);
        glVertex2f(50, 50);
        glVertex2f(50, 150);
        glVertex2f(150, 150);
        glVertex2f(150, 50);
    glEnd();

    glStencilMask(0x1);
    glClear(GL_STENCIL_BUFFER_BIT);

    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
    glStencilFunc(GL_EQUAL, 0x02, 0x02);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
    glColor3f(1, 0, 0);
    glBegin(GL_POLYGON);
        glVertex2f(0, 0);
        glVertex2f(0, 1000);
        glVertex2f(1000, 1000);
        glVertex2f(1000, 0);
    glEnd();

    glFlush();
}

static void init(int width, int height)
{
    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, width, 0, height, -1, 1);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glClearColor(0, 0, 0, 0);
    glClearStencil(0);
    glEnable(GL_STENCIL_TEST);
    glStencilFunc(GL_ALWAYS, 0, 0);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to