Bug 93216 - Artifacts with DCC when render target also texture
Summary: Artifacts with DCC when render target also texture
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 17:17 UTC by Axel Davy
Modified: 2018-04-05 05:34 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Before a buggy draw call (1.48 MB, text/plain)
2015-12-02 17:17 UTC, Axel Davy
Details
After a buggy draw call (665.86 KB, image/png)
2015-12-02 17:18 UTC, Axel Davy
Details
Before a buggy draw call (1.48 MB, image/png)
2015-12-02 17:20 UTC, Axel Davy
Details

Description Axel Davy 2015-12-02 17:17:55 UTC
Created attachment 120280 [details]
Before a buggy draw call

I noticed a few games had some strange artifacts on my tonga that I had not on verde. Those artifacts are usually along lines.

These artifacts disappear with R600_DEBUG=nodcc.

I managed to determine the bug appears when the render target is also used as input texture.

Attached is the render target content before and after such draw call. The draw call draws two triangles. We can see the artifacts are along the border region of the top right triangle with the bottom left triangle.

My guess is that it is some flush issue. That the bottom left triangle is drawn first, the cache content of the texture cache updated, and the artifacts are at locations where the dcc data was updated.
Comment 1 Axel Davy 2015-12-02 17:18:38 UTC
Created attachment 120281 [details]
After a buggy draw call
Comment 2 Axel Davy 2015-12-02 17:20:51 UTC
Created attachment 120282 [details]
Before a buggy draw call

Repost of the first image, reported as PNG instead of text.
Comment 3 Marek Olšák 2015-12-02 17:37:36 UTC
What happens if you set these flush flags after every draw call?

SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER
SI_CONTEXT_INV_GLOBAL_L2
SI_CONTEXT_INV_VMEM_L1
SI_CONTEXT_PS_PARTIAL_FLUSH
Comment 4 Axel Davy 2015-12-02 18:12:04 UTC
I added these at the end of si_emit_draw_packets.

It doesn't solve the problem.
Comment 5 Bas Nieuwenhuizen 2016-01-20 00:33:03 UTC
I think we have cache coherency issues within a single draw call. One of the situations in which a feedback loop is allowed is if we read and write every texel at most once and we read the texel from the fragment shader invocation that writes that texel.

My guess is that this is the case here, with two triangles. The problem is that while every pixel is written at most once, every block of pixels can be modified multiple times on the edges of a triangle.

This results in garbage if a later invocation for a tile sees modified pixel data but stale DCC compression data, or stale pixel data and modified DCC compression data.


This can be fixed by decompressing the framebuffer and disabling DCC decompression for the framebuffer. I would like to avoid decompressing, but I do not know how.
Comment 6 Bas Nieuwenhuizen 2016-05-31 16:07:46 UTC
Does the series available at

https://patchwork.freedesktop.org/series/8048/

fix this issue?
Comment 7 Timothy Arceri 2018-04-05 00:20:49 UTC
(In reply to Bas Nieuwenhuizen from comment #6)
> Does the series available at
> 
> https://patchwork.freedesktop.org/series/8048/
> 
> fix this issue?

Hi Axel, those patches landed a long time ago. Is this issue still happening or can we close this bug?
Comment 8 Axel Davy 2018-04-05 05:34:38 UTC
The bug seems indeed to have been corrected since.


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.