https://bugs.freedesktop.org/show_bug.cgi?id=37724
Summary: occlusion queries are messed up in ut2004 (regression, bisected) Product: Mesa Version: unspecified Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r300 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: aaalmosss@gmail.com
The majority of the 3d objects disappear periodically since this commit: f76787b3eae3f0b8af839fabfb24b57715a017f6 is the first bad commit commit f76787b3eae3f0b8af839fabfb24b57715a017f6 Author: Marek Olšák maraeo@gmail.com Date: Sun May 29 04:36:36 2011 +0200
r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.
If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.
If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer to silence the CS checker.
This fixes piglit: - occlusion-query-discard - NV_conditional_render/bitmap - NV_conditional_render/drawpixels - NV_conditional_render/vertex_array
:040000 040000 baeff41ffed8952cbb1666d04941c6d5d01ca4fc cdb64f4b684804b818df4b65c04109eaad568e11 M src
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #1 from Marek Olšák maraeo@gmail.com 2011-05-29 10:57:11 PDT --- Created an attachment (id=47288) View: https://bugs.freedesktop.org/attachment.cgi?id=47288 Review: https://bugs.freedesktop.org/review?bug=37724&attachment=47288
possible fix
Can you try this patch?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #2 from almos aaalmosss@gmail.com 2011-05-29 12:41:57 PDT --- (In reply to comment #1)
Created an attachment (id=47288)
View: https://bugs.freedesktop.org/attachment.cgi?id=47288 Review: https://bugs.freedesktop.org/review?bug=37724&attachment=47288
possible fix
Can you try this patch?
More things remain visible with the patch, but it doesn't fix the issue completely.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #47288|0 |1 is obsolete| |
--- Comment #3 from Marek Olšák maraeo@gmail.com 2011-05-30 04:03:13 PDT --- Created an attachment (id=47307) View: https://bugs.freedesktop.org/attachment.cgi?id=47307 Review: https://bugs.freedesktop.org/review?bug=37724&attachment=47307
possible fix 2
Can you try this patch instead?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #4 from almos aaalmosss@gmail.com 2011-05-30 11:31:28 PDT --- (In reply to comment #3)
Created an attachment (id=47307)
View: https://bugs.freedesktop.org/attachment.cgi?id=47307 Review: https://bugs.freedesktop.org/review?bug=37724&attachment=47307
possible fix 2
Can you try this patch instead?
No apparent change compared to the first fix.
Now I see that I haven't mentioned that I use RADEON_HYPERZ=1. Without it there are no rendering errors.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|occlusion queries are |r300g with HyperZ/Z |messed up in ut2004 |compression: occlusion |(regression, bisected) |queries are messed up in | |ut2004 (regression, | |bisected)
--- Comment #5 from Marek Olšák maraeo@gmail.com 2011-05-30 13:59:23 PDT --- Ah ok.
I don't consider Hyper-Z ready yet but thanks for testing it.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #6 from Fabio Pedretti fabio.ped@libero.it 2011-06-09 04:37:34 PDT ---
I don't consider Hyper-Z ready yet but thanks for testing it.
It is enabled by default now, is it by accident?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #7 from Marek Olšák maraeo@gmail.com 2011-06-09 07:21:05 PDT --- (In reply to comment #6)
I don't consider Hyper-Z ready yet but thanks for testing it.
It is enabled by default now, is it by accident?
It's disabled. There are some annoying bugs and I have no clue how to fix them.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #8 from almos aaalmosss@gmail.com 2011-06-09 07:59:43 PDT --- (In reply to comment #6)
I don't consider Hyper-Z ready yet but thanks for testing it.
It is enabled by default now, is it by accident?
Perhaps you mean that it always reports this? r300: AA compression RAM: YES, Z compression RAM: YES, HiZ RAM: NO
It used to mean that those features are enabled, but now it means that those are available in HW. Now if hyperz is enabled, these are printed: radeon: Acquired Hyper-Z. radeon: Released Hyper-Z.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #9 from Fabio Pedretti fabio.ped@libero.it 2011-06-10 00:47:52 PDT --- (In reply to comment #8)
Yes, I see this: r300: DRM version: 2.8.0, Name: ATI RV530, ID: 0x71c5, GB: 1, Z: 2 r300: GART size: 509 MB, VRAM size: 256 MB r300: AA compression RAM: YES, Z compression RAM: YES, HiZ RAM: YES
I didn't noticed the radeon: Acquired Hyper-Z. radeon: Released Hyper-Z. that indeed get printed when RADEON_HYPERZ=1 is set, however I also noticed that with openarena I get the same FPS with or without it.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #13 from Marek Olšák maraeo@gmail.com 2012-01-05 16:03:28 UTC --- I am sure bug 35095 also affects r500.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
Pavel Ondračka pavel.ondracka@email.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pavel.ondracka@email.cz
--- Comment #10 from Pavel Ondračka pavel.ondracka@email.cz 2012-01-05 14:04:19 PST --- This isn't actually limited to ut2004. I did notice almost completely black scenes in Lightsmark, broken lightning and black objects in Cogs and occasional black screen in HoN with RADEON_HYPERZ=1, all broken by f76787b3eae3f0b8af839fabfb24b57715a017f6. (RV530 here)
Any chance a revert can happen?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #11 from Marek Olšák maraeo@gmail.com 2012-01-05 15:14:59 PST --- The problematic commit fixes occlusion queries for some cases, so I'm sorry but I can't revert it just because it breaks an optimization which is not even enabled by default. I can take a look at the issue and see if Z compression is fixable.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #12 from Pavel Ondračka pavel.ondracka@email.cz 2012-01-05 15:54:31 PST --- (In reply to comment #11)
OK, I see revert is not an option. It still would be nice if this could be fixed, but it's not a priority.
BTW I did quick check of r300g bugs and did find only three about HyperZ including this one. This doesn't seems like a large number but it may be only a lack of testing. Is there a possibility to enable just some features on some generations? For example there are no bug reports about hiz on r500 cards... I could do more testing if needed, maybe some piglit runs.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #14 from Marek Olšák maraeo@gmail.com 2012-01-05 16:18:14 PST --- Well maybe not, I am not sure.
I recall there was another bug with HiZ, which could be triggered by changing the depth function. The workaround was to flush the zbuffer cache when the depth function was changed. However flushing the cache is a very costly operation, so it wasn't even an option.
I just gave up after that, because it made no ******* sense. Zbuffer cache should have nothing to with HiZ.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #15 from Marek Olšák maraeo@gmail.com --- I reverted the commit and I also fixed the bug with Lightsmark. So far everything seems to work. Maybe it's time to enable HyperZ by default?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #16 from cosiekvfj@o2.pl --- Is it enabled by default now?
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #17 from Pavel Ondračka pavel.ondracka@email.cz --- (In reply to cosiekvfj from comment #16)
Is it enabled by default now?
IIRC the HyperZ should be enabled by default on r500 but was never enabled on r300 and r400 due to lack of testing.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #18 from cosiekvfj@o2.pl --- Created attachment 129931 --> https://bugs.freedesktop.org/attachment.cgi?id=129931&action=edit piglit w/o hyperz
I'm testing mesa with patch for this bug: https://bugs.freedesktop.org/show_bug.cgi?id=98869 And also dri3 is related to: https://bugs.freedesktop.org/show_bug.cgi?id=99970
Test results: dri3 w/o patch 890 fps dri3 w/o patch 1113 fps hyperz=1 dri3 patch 912 fps dri3 patch 1115 hyperz=1 dri2 w/o patch 1136 dri2 w/o patch 1417 hyperz=1 dri2 patch 1138 dri2 patch 1417 hyperz=1
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #19 from cosiekvfj@o2.pl --- Created attachment 129952 --> https://bugs.freedesktop.org/attachment.cgi?id=129952&action=edit piglit hyperz
Above results are from glxgears.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #20 from cosiekvfj@o2.pl --- Is there anything else needed? If you want more tests or you want me to redo previous tests or if you are unsure about results, I'm happy to help.
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #21 from cosiekvfj@o2.pl --- Created attachment 130162 --> https://bugs.freedesktop.org/attachment.cgi?id=130162&action=edit mesa 17.0.1 kernel 4.10.1
https://bugs.freedesktop.org/show_bug.cgi?id=37724
--- Comment #22 from cosiekvfj@o2.pl --- Created attachment 130163 --> https://bugs.freedesktop.org/attachment.cgi?id=130163&action=edit mesa 17.0.1 kernel 4.10.1 hyperz on
dri-devel@lists.freedesktop.org