Bug 21608

Summary: [radeon-rewrite] ctx->Stencil._Enabled stale when accessed
Product: Mesa Reporter: Owen Taylor <otaylor>
Component: Drivers/DRI/R100Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch as described

Description Owen Taylor 2009-05-06 19:56:25 UTC
Sequence of events:

 radeon_clear_tris() 
   - calls _mesa_Enable(GL_STENCIL_TEST);
     - Changes ctx->Stencil.Enabled
   - draws 
     - ctx->Stencil._Enabled is updated to 1
   - calls _mesa_PopAttrib();
      - Restores ctx.Stencil.Enabled (but not _Enabled)
      - calls _mesa_DrawBuffer()
         - calls radeon_draw_buffer
            - accesses ctx->Stencil._Enabled, which is not up-to-date
            - Enables stenciling on the hardware

So the hardware is left with stenciling on, and subsequent drawing vanishes.

The patch I'll attach fixes the problem, I'm not sure if it's the best way to handle it.
Comment 1 Owen Taylor 2009-05-06 19:59:00 UTC
Created attachment 25578 [details] [review]
Patch as described
Comment 2 Alex Deucher 2009-05-13 16:46:19 UTC
committed:
34eab5dd9c837769f1259e1f900b4528586d23b2

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.