Bug 42487

Summary: Teapot visual artifact
Product: Mesa Reporter: vincent <vljn>
Component: OtherAssignee: mesa-dev
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: 7.11   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Code that show the bug.
Here is the image showing display artifact

Description vincent 2011-11-01 14:19:19 UTC
Created attachment 53020 [details]
Code that show the bug.

Hi,

when I execute the code in attachment (buildable with scons, freeglut, and glu), I get the image (in attachment as well),
using gallium nvc0 or gallium swrast.
Teapot should not be transparent...
Comment 1 vincent 2011-11-01 14:20:05 UTC
Created attachment 53021 [details]
Here is the image showing display artifact
Comment 2 vincent 2011-11-02 10:17:34 UTC
I've narrowed the bug :
the faulty command is

glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);

Adding an additionnal GLUT_DEPTH param make the code works.

AMD and Nvidia proprietary drivers seem to force GLUT_DEPTH in display mode when depth_test are enabled. I have no idea if there is a spec that tells if such a behavior is legit or not, I'm marking this as NEEDINFO.
Comment 3 Brian Paul 2011-11-02 10:50:55 UTC
(In reply to comment #2)
> I've narrowed the bug :
> the faulty command is
> 
> glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
> 
> Adding an additionnal GLUT_DEPTH param make the code works.
> 
> AMD and Nvidia proprietary drivers seem to force GLUT_DEPTH in display mode
> when depth_test are enabled. I have no idea if there is a spec that tells if
> such a behavior is legit or not, I'm marking this as NEEDINFO.

I think what's really happening is you're getting a GLX visual with a depth buffer just by luck with AMD/NVIDIA.

glxinfo will show you which visuals have a depth buffer.  With the NVIDIA driver, most visuals have a depth buffer.  Probably the same thing with AMD's driver.

If your application uses depth testing you _must_ call glutInitDisplayMode() with GLUT_DEPTH.  Similarly with stencil and accum buffers.

I think we can close this as not-a-bug.

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.