Created attachment 17921 [details] Correct selection When selecting faces in K-3D, selections are fine in Mesa 7.0.1, but seem to go "through" the object in 7.0.3 (as obtained from ubuntu 8.04). The problem still appeared in the GIT version obtained a few days ago. The 7.0.1 shows correct behavior, resulting in the front face being selected (red) when it is clicked. Doing the same operation in 7.0.3 (second screenshot) results in the bottom face being selected, even though the front face was clicked. At the moment of the selection click, the bottom face was behind the front face. It appears as though when in GL_SELECT mode, Mesa gets the depth order wrong. THe bug appears both in the VBO and non-VBO code for drawing faces. Selection in K-3D happens in GL_SELECT mode. Hardware is an intel graphics chip: 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller]) Subsystem: Toshiba America Info Systems Unknown device ff50
Created attachment 17922 [details] Incorrect selection 7.0.3 attachment shows what happens when trying to select the front face while it obscures the bottom face: the bottom face gets selected.
Just confirmed with the latest from GIT that this still happens.
Does this still happen with Mesa 7.2? As it seems to happen with 7.0.3 but not with 7.0.1, it should be easy to isolate the change that introduced the problem with git bisect.
Created attachment 19459 [details] [review] Revert change triggering the selection bug Yep, it still happens in git head. Thanks for the bisect tip, it seems the commit that caused the trouble is 1b43babfb126c6318d2f2468ec81b93ee1923774 (fix broken two-sided stencil). Reverting the change in current head solves the problem for me (see attached diff).
Created attachment 28964 [details] [review] This is what I believe to be the solution Further digging in the code shows that probably _swrast_culltriangle was not updated after changes in _swrast_update_polygon. The bug was last seen in Mesa 7.4 on Ubuntu Jaunty, and looking at the git code it is still there. The supplied diff is against the Jaunty packages. Please merge in this patch or comment on what's wrong with it, the described problem is severely affecting K-3D usability.
I tested Mesa vs. NVIDIA's driver. With this patch they work the same now. I'm committing your patch with minor clean-ups to the 7.5 branch. It'll be merged to master too. Thanks. Thanks.
(In reply to comment #6) > I'm committing your patch with minor clean-ups to the 7.5 branch. It'll be > merged to master too. Thanks. OK, thanks! If I want my favorite distro to pick this up (i.e. Ubuntu Jaunty, using Mesa 7.4) what would be the best approach? Do I need to file a separate bug report for the Ubuntu package?
Mesa 7.5 is no longer being maintained. Ubuntu is pretty good about tracking the latest Mesa. I heard that recent 9.10 updates include Mesa 7.6-devel (git master).
Err, I meant Mesa 7.4 in the previous comment. I'm planning a 7.5.1 release soon.
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.