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

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Jul 25 15:56:37 UTC 2017



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.

> 
> 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
>>
> 
> 


More information about the mesa-dev mailing list