[Mesa-dev] [Bug 31159] swrast: shadow problem in 0ad game

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 8 07:32:15 PST 2011


Brian Paul <brian.e.paul at gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Brian Paul <brian.e.paul at gmail.com> 2011-03-08 07:32:12 PST ---
(In reply to comment #10)
> Created an attachment (id=44230)
 View: https://bugs.freedesktop.org/attachment.cgi?id=44230
 Review: https://bugs.freedesktop.org/review?bug=31159&attachment=44230

> swrast patch
> This adds clamping to swrast's sample_depth_texture, but there's another bug:
> With GL_LEQUAL, shadow_compare correctly returns 1 if coord <= depthSample,
> whereas shadow_compare4 returns 0 if depthXX <= coord (for all XX). Looks like
> compare4 is trying to flip the conditional, but flipping <= gives > not >=, so
> it's wrong when e.g. depthXX == coord == 1. Fixing this (plus the clamping)
> makes the shadows work for me in swrast.
> Also, I noticed the GL_ALWAYS case in shadow_compare4 differs from
> shadow_compare and seems wrong. Also the default case reports the wrong
> function name and the return value differs from shadow_compare. So I've tried
> to fix those as well.
> Mesa/master softpipe and llvmpipe both fix the shadow bug for me too.

Thanks.  The GL_EQUAL and GL_NOTEQUAL cases were wrong too.  I'll fix that bit
in the patch.

I think I'll flip the conditionals in shadow_compare4() so it looks more like
shadow_compare() and the spec language.


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

More information about the mesa-dev mailing list