[Mesa-dev] [RFC PATCH] radeonsi: flush DB caches when a Z/stencil buffer is attached

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Sep 26 17:11:50 UTC 2017



On 09/26/2017 06:57 PM, Juan A. Suarez Romero wrote:
> On Tue, 2017-07-25 at 17:56 +0200, Samuel Pitoiset wrote:
>>
>> On 07/25/2017 05:51 PM, Nicolai Hähnle wrote:
>>> On 25.07.2017 15:29, Samuel Pitoiset wrote:
>>>> This is a workaround which fixes a rendering issue with Dawn
>>>> Of War III in full bindless mode because a depth texture most
>>>> likely doesn't invoke the decompression pass when it should.
>>>
>>> So do I understand correctly that the previous depth target is used
>>> bindless, and for whatever reason the si_decompress_depth doesn't
>>> properly trigger for bindless? Why doesn't it trigger?
>>
>> Exactly, but I still don't know why it is not triggered correctly.
> 
> Hey, Samuel!
> 
> Are you investigating the issue Nicolai raised?

Hey,

This has been fixed by Marek.

f4d095cc651af005d5760aa9dd06e6ae7007fab6

Thanks.

> 
> Asking because this patch didn't get any R-b, so I'm wondering if this
> work in progress.
> 
> Thanks
> 
> 	J.A.
> 
>>
>>>
>>> Cheers,
>>> Nicolai
>>>
>>>>
>>>> Performance drops by 1% which doesn't really matter.
>>>>
>>>> Fixes: 2263610827 ("radeonsi: flush DB caches only when transitioning
>>>> from DB to texturing")
>>>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>>>> Cc: "17.2" <mesa-stable at lists.freedesktop.org>
>>>> ---
>>>>    src/gallium/drivers/radeonsi/si_state.c | 10 ++++++++++
>>>>    1 file changed, 10 insertions(+)
>>>>
>>>> diff --git a/src/gallium/drivers/radeonsi/si_state.c
>>>> b/src/gallium/drivers/radeonsi/si_state.c
>>>> index 7e3d1a02e0..675b61ad7f 100644
>>>> --- a/src/gallium/drivers/radeonsi/si_state.c
>>>> +++ b/src/gallium/drivers/radeonsi/si_state.c
>>>> @@ -2546,6 +2546,16 @@ static void si_set_framebuffer_state(struct
>>>> pipe_context *ctx,
>>>>        }
>>>>        sctx->b.flags |= SI_CONTEXT_CS_PARTIAL_FLUSH;
>>>> +    /* Flush DB caches when a Z/stencil buffer is attached to the
>>>> +     * framebuffer. This is a workaround which fixes a rendering
>>>> issue with
>>>> +     * Dawn Of War III in full bindless mode because a depth texture
>>>> most
>>>> +     * likely doesn't invoke the decompression pass when it should.
>>>> +     *
>>>> +     * TODO: Figure out a better fix.
>>>> +     */
>>>> +    if (sctx->framebuffer.state.zsbuf)
>>>> +        sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_DB;
>>>> +
>>>>        /* u_blitter doesn't invoke depth decompression when it does
>>>> multiple
>>>>         * blits in a row, but the only case when it matters for DB is when
>>>>         * doing generate_mipmap. So here we flush DB manually between
>>>>
>>>
>>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list