[5/6] radv: do not fast clears if one level can't be fast cleared

Submitted by Samuel Pitoiset on June 18, 2019, 2:15 p.m.

Details

Message ID 20190618141532.7438-5-samuel.pitoiset@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset June 18, 2019, 2:15 p.m.
And fallback to slow color clears.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_meta_clear.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 7f8f69e10f6..ed7f19b1dce 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1515,6 +1515,20 @@  radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
 			if (!can_avoid_fast_clear_elim)
 				return false;
 		}
+
+		if (iview->image->info.levels > 1) {
+			for (uint32_t l = 0; l < iview->level_count; l++) {
+				uint32_t level = iview->base_mip + l;
+				struct legacy_surf_level *surf_level =
+					&iview->image->planes[0].surface.u.legacy.level[level];
+
+				/* Do not fast clears if one level can't be
+				 * fast cleared.
+				 */
+				if (!surf_level->dcc_fast_clear_size)
+					return false;
+			}
+		}
 	}
 
 	return true;

Comments

On Tue, Jun 18, 2019 at 4:12 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> And fallback to slow color clears.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/vulkan/radv_meta_clear.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
> index 7f8f69e10f6..ed7f19b1dce 100644
> --- a/src/amd/vulkan/radv_meta_clear.c
> +++ b/src/amd/vulkan/radv_meta_clear.c
> @@ -1515,6 +1515,20 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
>                         if (!can_avoid_fast_clear_elim)
>                                 return false;
>                 }
> +
> +               if (iview->image->info.levels > 1) {
> +                       for (uint32_t l = 0; l < iview->level_count; l++) {
> +                               uint32_t level = iview->base_mip + l;
> +                               struct legacy_surf_level *surf_level =
> +                                       &iview->image->planes[0].surface.u.legacy.level[level];

Same here, not comfortable accessing legacy data on GFX9.
> +
> +                               /* Do not fast clears if one level can't be
> +                                * fast cleared.
> +                                */
> +                               if (!surf_level->dcc_fast_clear_size)
> +                                       return false;
> +                       }
> +               }
>         }
>
>         return true;
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
On 6/19/19 1:38 AM, Bas Nieuwenhuizen wrote:
> On Tue, Jun 18, 2019 at 4:12 PM Samuel Pitoiset
> <samuel.pitoiset@gmail.com> wrote:
>> And fallback to slow color clears.
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
>> ---
>>   src/amd/vulkan/radv_meta_clear.c | 14 ++++++++++++++
>>   1 file changed, 14 insertions(+)
>>
>> diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
>> index 7f8f69e10f6..ed7f19b1dce 100644
>> --- a/src/amd/vulkan/radv_meta_clear.c
>> +++ b/src/amd/vulkan/radv_meta_clear.c
>> @@ -1515,6 +1515,20 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
>>                          if (!can_avoid_fast_clear_elim)
>>                                  return false;
>>                  }
>> +
>> +               if (iview->image->info.levels > 1) {
>> +                       for (uint32_t l = 0; l < iview->level_count; l++) {
>> +                               uint32_t level = iview->base_mip + l;
>> +                               struct legacy_surf_level *surf_level =
>> +                                       &iview->image->planes[0].surface.u.legacy.level[level];
> Same here, not comfortable accessing legacy data on GFX9.

Yeah, I will change that.

Thanks for the reviews Bas!

>> +
>> +                               /* Do not fast clears if one level can't be
>> +                                * fast cleared.
>> +                                */
>> +                               if (!surf_level->dcc_fast_clear_size)
>> +                                       return false;
>> +                       }
>> +               }
>>          }
>>
>>          return true;
>> --
>> 2.22.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev