[1/8] radv: allocate DCC metadata for each mip

Submitted by Samuel Pitoiset on June 17, 2019, 10:44 a.m.

Details

Message ID 20190617104420.14855-2-samuel.pitoiset@gmail.com
State New
Headers show
Series "radv: preliminary work for DCC and mipmaps" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset June 17, 2019, 10:44 a.m.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_image.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 909145e1e75..d3bbc9e674b 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -921,11 +921,11 @@  radv_image_alloc_dcc(struct radv_image *image)
 	assert(image->plane_count == 1);
 
 	image->dcc_offset = align64(image->size, image->planes[0].surface.dcc_alignment);
-	/* + 16 for storing the clear values + dcc pred */
+	/* + 24 for storing the clear values + fce pred + dcc pred for each mip */
 	image->clear_value_offset = image->dcc_offset + image->planes[0].surface.dcc_size;
-	image->fce_pred_offset = image->clear_value_offset + 8;
-	image->dcc_pred_offset = image->clear_value_offset + 16;
-	image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24;
+	image->fce_pred_offset = image->clear_value_offset + 8 * image->info.levels;
+	image->dcc_pred_offset = image->clear_value_offset + 16 * image->info.levels;
+	image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24 + image->info.levels;
 	image->alignment = MAX2(image->alignment, image->planes[0].surface.dcc_alignment);
 }
 

Comments

On Mon, Jun 17, 2019 at 12:40 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/vulkan/radv_image.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> index 909145e1e75..d3bbc9e674b 100644
> --- a/src/amd/vulkan/radv_image.c
> +++ b/src/amd/vulkan/radv_image.c
> @@ -921,11 +921,11 @@ radv_image_alloc_dcc(struct radv_image *image)
>         assert(image->plane_count == 1);
>
>         image->dcc_offset = align64(image->size, image->planes[0].surface.dcc_alignment);
> -       /* + 16 for storing the clear values + dcc pred */
> +       /* + 24 for storing the clear values + fce pred + dcc pred for each mip */
>         image->clear_value_offset = image->dcc_offset + image->planes[0].surface.dcc_size;
> -       image->fce_pred_offset = image->clear_value_offset + 8;
> -       image->dcc_pred_offset = image->clear_value_offset + 16;
> -       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24;
> +       image->fce_pred_offset = image->clear_value_offset + 8 * image->info.levels;
> +       image->dcc_pred_offset = image->clear_value_offset + 16 * image->info.levels;
> +       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24 + image->info.levels;
24 * image->info.levels?
>         image->alignment = MAX2(image->alignment, image->planes[0].surface.dcc_alignment);
>  }
>
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
On 6/17/19 12:50 PM, Bas Nieuwenhuizen wrote:
> On Mon, Jun 17, 2019 at 12:40 PM Samuel Pitoiset
> <samuel.pitoiset@gmail.com> wrote:
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
>> ---
>>   src/amd/vulkan/radv_image.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
>> index 909145e1e75..d3bbc9e674b 100644
>> --- a/src/amd/vulkan/radv_image.c
>> +++ b/src/amd/vulkan/radv_image.c
>> @@ -921,11 +921,11 @@ radv_image_alloc_dcc(struct radv_image *image)
>>          assert(image->plane_count == 1);
>>
>>          image->dcc_offset = align64(image->size, image->planes[0].surface.dcc_alignment);
>> -       /* + 16 for storing the clear values + dcc pred */
>> +       /* + 24 for storing the clear values + fce pred + dcc pred for each mip */
>>          image->clear_value_offset = image->dcc_offset + image->planes[0].surface.dcc_size;
>> -       image->fce_pred_offset = image->clear_value_offset + 8;
>> -       image->dcc_pred_offset = image->clear_value_offset + 16;
>> -       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24;
>> +       image->fce_pred_offset = image->clear_value_offset + 8 * image->info.levels;
>> +       image->dcc_pred_offset = image->clear_value_offset + 16 * image->info.levels;
>> +       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24 + image->info.levels;
> 24 * image->info.levels?
Oops. Will fix.
>>          image->alignment = MAX2(image->alignment, image->planes[0].surface.dcc_alignment);
>>   }
>>
>> --
>> 2.22.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
with that fixed, r-b

On Mon, Jun 17, 2019 at 12:51 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
>
> On 6/17/19 12:50 PM, Bas Nieuwenhuizen wrote:
> > On Mon, Jun 17, 2019 at 12:40 PM Samuel Pitoiset
> > <samuel.pitoiset@gmail.com> wrote:
> >> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> >> ---
> >>   src/amd/vulkan/radv_image.c | 8 ++++----
> >>   1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> >> index 909145e1e75..d3bbc9e674b 100644
> >> --- a/src/amd/vulkan/radv_image.c
> >> +++ b/src/amd/vulkan/radv_image.c
> >> @@ -921,11 +921,11 @@ radv_image_alloc_dcc(struct radv_image *image)
> >>          assert(image->plane_count == 1);
> >>
> >>          image->dcc_offset = align64(image->size, image->planes[0].surface.dcc_alignment);
> >> -       /* + 16 for storing the clear values + dcc pred */
> >> +       /* + 24 for storing the clear values + fce pred + dcc pred for each mip */
> >>          image->clear_value_offset = image->dcc_offset + image->planes[0].surface.dcc_size;
> >> -       image->fce_pred_offset = image->clear_value_offset + 8;
> >> -       image->dcc_pred_offset = image->clear_value_offset + 16;
> >> -       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24;
> >> +       image->fce_pred_offset = image->clear_value_offset + 8 * image->info.levels;
> >> +       image->dcc_pred_offset = image->clear_value_offset + 16 * image->info.levels;
> >> +       image->size = image->dcc_offset + image->planes[0].surface.dcc_size + 24 + image->info.levels;
> > 24 * image->info.levels?
> Oops. Will fix.
> >>          image->alignment = MAX2(image->alignment, image->planes[0].surface.dcc_alignment);
> >>   }
> >>
> >> --
> >> 2.22.0
> >>
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev