https://bugs.freedesktop.org/show_bug.cgi?id=59492
Priority: medium Bug ID: 59492 Assignee: dri-devel@lists.freedesktop.org Summary: piglit dlist-color-material test fail Severity: normal Classification: Unclassified OS: All Reporter: smoki00790@gmail.com Hardware: Other Status: NEW Version: git Component: Drivers/DRI/r200 Product: Mesa
Piglit test "dlist-color-material" not passed on rv280. That is essential thing, i even tried 7.5.2. and UMS, and no go. Acctualy it seems to me that never worked on tcl_mode=1. So yeah it works with swtcl, but never on tcl.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #1 from smoki smoki00790@gmail.com ---
So default command like
glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
never worked quite right on tcl.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #2 from Roland Scheidegger sroland@vmware.com --- (In reply to comment #1)
So default command like
glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
never worked quite right on tcl.
How did you arrive at this conclusion? You could try some things (like throwing out the dlist stuff) and see if that improves things. Or figure out if actually all of the subtests don't pass to narrow it down.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #3 from smoki smoki00790@gmail.com --- Created attachment 73222 --> https://bugs.freedesktop.org/attachment.cgi?id=73222&action=edit swtcl
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #4 from smoki smoki00790@gmail.com --- Created attachment 73223 --> https://bugs.freedesktop.org/attachment.cgi?id=73223&action=edit swtcl
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #5 from smoki smoki00790@gmail.com --- Created attachment 73224 --> https://bugs.freedesktop.org/attachment.cgi?id=73224&action=edit tcl
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #6 from smoki smoki00790@gmail.com --- Created attachment 73226 --> https://bugs.freedesktop.org/attachment.cgi?id=73226&action=edit tcl
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #7 from smoki smoki00790@gmail.com ---
Supertuxkart game use irlicht engine and ECM_DIFFUSE_AND_AMBIENT command for the material color, which use vertex color for both diffuse and ambient light. That irlicht command is actualy glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE).
mb->getMaterial().ColorMaterial = video::ECM_DIFFUSE_AND_AMBIENT;
http://sourceforge.net/apps/trac/supertuxkart/browser/main/trunk/src/graphic...
And i get this results (see attached pictures) when i use tcl or tcl_mode=0. It get correct lighting with swtcl and incorrect with tcl.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
smoki smoki00790@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #73223|text/plain |image/png mime type| |
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #8 from smoki smoki00790@gmail.com ---
Fails on ambient light and that check_material hack from r200_state. If i excluded that material check this test passed and supertuxkart get correct colors. But performance is like swtcl without that check... that need to be fixed somehow as comment there says ;).
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #9 from smoki smoki00790@gmail.com ---
Also infinite-spot-light piglit test fails because of this, it also pass if i exclude that material check.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #10 from Roland Scheidegger sroland@vmware.com --- (In reply to comment #8)
Fails on ambient light and that check_material hack from r200_state. If i excluded that material check this test passed and supertuxkart get correct colors. But performance is like swtcl without that check... that need to be fixed somehow as comment there says ;).
When you say you excluded the test did you assume always true or always false? If it works both ways then the fallback itself would cause the trouble (wouldn't be terribly surprising). I think fixing this to not require a fallback would require quite a bit of work, the wiring necessary is probably ugly. I think not many apps actually change materials inside begin/end.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #11 from smoki smoki00790@gmail.com ---
With always true it pass or opside out, with always false or what is now it fails.
I think most if not every racing games fail to render correctly because of this, bugs like missing wheels will be there i guess, or loosed color somewhere, etc. Anyway proper lighting is broken there.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #12 from Roland Scheidegger sroland@vmware.com --- Hmm maybe there are bugs in lighting model state somewhere I dunno. But since for this test case the material doesn't actually matter and the wiring looks ok to me (everything wired to vertex color 0) there must be some error elsewhere.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #13 from smoki smoki00790@gmail.com ---
I agree... will be hard to find what is it, i've now tested 7.5.2, 7.0.3, 6.5.1 mesa - that is oldest i could run, and this never worked :(.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #14 from Marek Olšák maraeo@gmail.com --- (In reply to comment #13)
I agree... will be hard to find what is it, i've now tested 7.5.2, 7.0.3, 6.5.1 mesa - that is oldest i could run, and this never worked :(.
Yes, the test was fixed fairly recently in core Mesa: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1bc16bf98a1b5a4cca0c0ae2a80...
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #15 from smoki smoki00790@gmail.com ---
Thanks Marek, i already run these piglit tests with current (today) mesa master and current piglit, they does work and pass but on swtcl only. On tcl they fail, and supertuxkart gives incorrect colors.
I just go to debian stable to test supertuxkart in hope that with some older UMS mesas somehow i can get correct colors, but nope :(.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #16 from smoki smoki00790@gmail.com ---
OMG, i managed to fix it somehow :). I put in the end of r200UpdateMaterial function r200ColorMaterial( ctx, 0, 0 ); call and removed it from case GL_COLOR_MATERIAL:
That fixed supertuxkart colors and dlist-color-material now passed ;).
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #17 from smoki smoki00790@gmail.com ---
Clean mesa up to git-commit 1ec1b577f726a70dd787227260e61928e97474e5
No regression with piglit quick-driver.tests, just passed dlist-color-material and fix supertuxkart colors;).
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #18 from smoki smoki00790@gmail.com --- Created attachment 73272 --> https://bugs.freedesktop.org/attachment.cgi?id=73272&action=edit proposed patch
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #19 from Roland Scheidegger sroland@vmware.com --- This looks very fishy to me, I can't see how this could be the right fix (you never know though since apparently some tcl regs have ordering requirements).
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #20 from smoki smoki00790@gmail.com --- Honestly i don't beleve it is right solution neither (but at least, we are on the right track). I just know that r200ColorMaterial must also somehow in touch with tnl->Driver.NotifyMaterialChange for this to work.
If i just inited that down in r200InitTnlFuncs that also worked... i know fishies, no way it's proper fix maybe, bla, bla... just idea, but those must be maked in conjuction somehow for this to work;).
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #21 from smoki smoki00790@gmail.com ---
But must say, this patch however worked perfectly here for supertuxkart ;), no issues spotted in any other games i tried these few days.
Maybe someone who use r200 driver can test:
http://supertuxkart.sourceforge.net/Downloads
0.8 version with or without patch, without patch whole olivermath track have broken colors and lights are broken but not always can be easely spoted. Anyway you can immediately broke lights if do one skid/ding on any single track. With a patch all these lighting/color issues should be fixed.
https://bugs.freedesktop.org/show_bug.cgi?id=59492
--- Comment #22 from smoki smoki00790@gmail.com ---
And of course dlist-color-material piglit test should pass ;).
dri-devel@lists.freedesktop.org