[Mesa-dev] [PATCH v4 58/63] radeonsi: only decompress resident textures/images when used

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Jun 13 21:21:18 UTC 2017



On 06/13/2017 11:13 PM, Marek Olšák wrote:
> On Mon, Jun 12, 2017 at 2:36 PM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> When the current bound shaders don't use any bindless textures
>> or images, it's useless to decompress the resident resources.
>>
>> v4: - inline si_*_uses_bindless_*()
>> v3: - rebased and updated check for compute
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> Reviewed-by: Marek Olšák <marek.olsak at amd.com> (v2)
>> ---
>>   src/gallium/drivers/radeonsi/si_blit.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
>> index 8b77242759..917319bf7d 100644
>> --- a/src/gallium/drivers/radeonsi/si_blit.c
>> +++ b/src/gallium/drivers/radeonsi/si_blit.c
>> @@ -798,8 +798,14 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
>>                  }
>>          }
>>
>> -       si_decompress_resident_textures(sctx);
>> -       si_decompress_resident_images(sctx);
>> +       if (sctx->uses_bindless_samplers ||
>> +           ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
>> +            sctx->cs_shader_state.program->uses_bindless_samplers)))
>> +               si_decompress_resident_textures(sctx);
>> +       if (sctx->uses_bindless_images ||
>> +           ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
>> +            sctx->cs_shader_state.program->uses_bindless_images)))
>> +               si_decompress_resident_images(sctx);
> 
> The conditionals don't look correct.
> 
> if (shader_mask & u_bit_consecutive(0, SI_NUM_GRAPHICS_SHADERS))
> // just check ctx->uses_bindless_samplers and decompress
> else if (shader_mask & (1 << PIPE_SHADER_COMPUTE))
> // just check cs_shader_state and decompress

Right... It will decompress resident "graphics" textures/images for 
compute when it's unnecessary.

> 
> Marek
> 


More information about the mesa-dev mailing list