Created attachment 134449 [details]
The back buffer of apitrace frame 1017, showing red lines along what looks like primitive edges.
I've been poking "ARK: Survival Evolved", trying to get it playable.
The game is notoriously buggy, particularly under Linux, however the biggest issue I've had seems to be a Mesa/Radeon bug.
Blocky "pixelated" lines are drawn across what look like edges (see attached). These lines are most frequently red, black or cyan in colour, and seem to disappear when the scene complexity is lower (like when looking at the floor or an area with no foliage or rocks).
Setting R600_DEBUG=nohyperz resolves the issue.
I've tested an apitrace of the game on both Mesa git, and 17.2.1 on a desktop with a POLARIS10 (RX580 8GiB), running the latest amd-staging-drm-next kernel, and on a laptop with both Intel integrated graphics and a HAINAN (Sun XT? 8670M), running a stock Archlinux kernel.
Both AMD cards have this rendering issue with HyperZ enabled. The Intel card renders without this particular problem (if slowly), and llvmpipe (eventually) renders without issue too.
Linux 4.13.0-rc5-43dd6fde5df4 #3 SMP PREEMPT Thu Sep 21 19:15:33 BST 2017 x86_64 GNU/Linux
Mesa 17.3.0-devel (git hash #52ed3bca91ff13217378196d6800ca7113641a63)
libdrm 2.4.83, LLVM 5.0.0
Linux 4.12.13-1-ARCH #1 SMP PREEMPT Fri Sep 15 06:36:43 UTC 2017 x86_64 GNU/Linux
libdrm 2.4.83, LLVM 5.0.0
The corruption does look somewhat like that of this bug, but applied to terrain as well. https://bugs.freedesktop.org/show_bug.cgi?id=74784
Created attachment 134450 [details]
Oh, should have probably mentioned X versions and such.
* Xorg 1.19.3
* xf86-video-amdgpu 1.4.0
Added glxinfo output.
I confirm this issue and that R600_DEBUG=nohyperz does fix it.
Thanks to Elliot Thomas for finding a temporary solution.
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 67972a2..dc71742 100644
@@ -903,6 +903,14 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
sctx->db_stencil_clear = true;
+ /* TODO: Find out what's wrong here. Fast depth clear with
+ * a dirty DB cache causes corruption in ARK: Survival Evolved.
+ * https://bugs.freedesktop.org/show_bug.cgi?id=102955
+ * This hack massively decreases back-to-back ClearDepth performance.
+ sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_DB;
I can confirm Marek's workaround works.
For what it's worth, I couldn't really measure a difference in performance between the explicit DB flush/invalidation patch and using R600_DEBUG=nohyperz.
Should be "fixed" with c4d1a199f8379b3982a53fb18fe2b50fafd682df.
The DB metadata flush workaround is broken as of mesa git 69ccb9dae7616038dd54d3833da9e7c68e28067d, "radeonsi: use new VS blit shaders (VS inputs in SGPRs)".
The R600_DEBUG=nohyperz workaround still works.
Should be fixed with dd79aa4ad30df205076be25f6bbf42768abea20a.
Broken again in at latest 19.1.2.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1283.