Bug 21608 - [radeon-rewrite] ctx->Stencil._Enabled stale when accessed
Summary: [radeon-rewrite] ctx->Stencil._Enabled stale when accessed
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R100 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-06 19:56 UTC by Owen Taylor
Modified: 2009-05-13 16:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch as described (1.21 KB, patch)
2009-05-06 19:59 UTC, Owen Taylor
Details | Splinter Review

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.