[Mesa-dev] [PATCH] radv: Initialize DCC on transition from preinitialized.

Dave Airlie airlied at gmail.com
Fri Jan 12 03:29:29 UTC 2018


On 11 January 2018 at 22:21, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl> wrote:
> Looks like the decompress does not handle invalid encodings well,
> which happens with random memory. Of course apps should not use it
> with random memory, but they are allowed to ....

Preinitialised does sound like it should already have initialised
values in it, no random memory,

But if this fixes things for now, it doesn't seem like a bad idea.

Reviewed-by: Dave Airlie <airlied at redhat.com>
>
> Fixes: 44fcf58744 "radv: Disable DCC for GENERAL layout and compute transfer dest."
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index fb48691ca1..3f601d1731 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -3989,7 +3989,9 @@ static void radv_handle_dcc_image_transition(struct radv_cmd_buffer *cmd_buffer,
>                                              unsigned dst_queue_mask,
>                                              const VkImageSubresourceRange *range)
>  {
> -       if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
> +       if (src_layout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
> +               radv_initialize_dcc(cmd_buffer, image, 0xffffffffu);
> +       } else if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
>                 radv_initialize_dcc(cmd_buffer, image,
>                                     radv_layout_dcc_compressed(image, dst_layout, dst_queue_mask) ?
>                                          0x20202020u : 0xffffffffu);
> --
> 2.15.1
>
> _______________________________________________
> 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