From cd85315dcb01388de359063603e7980cbead70e4 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Tue, 14 Jul 2020 00:47:30 +0000 Subject: [PATCH] tu: Fix wrong copies of sampler descriptor. Found this with the following patch but it exists since adding ycbcr sampler to the struct. Fixes: d070a7ba0cfb11f1e01774b9dd3775ab7cd0c4ea Signed-off-by: Hyunjun Ko Part-of: --- src/freedreno/vulkan/tu_descriptor_set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_descriptor_set.c b/src/freedreno/vulkan/tu_descriptor_set.c index ec2a940e858..9dbd85b1646 100644 --- a/src/freedreno/vulkan/tu_descriptor_set.c +++ b/src/freedreno/vulkan/tu_descriptor_set.c @@ -849,7 +849,7 @@ write_combined_image_sampler_descriptor(struct tu_device *device, descriptor_type, image_info); /* copy over sampler state */ if (has_sampler) { - memcpy(dst + A6XX_TEX_CONST_DWORDS, sampler, sizeof(*sampler)); + memcpy(dst + A6XX_TEX_CONST_DWORDS, sampler->descriptor, sizeof(sampler->descriptor)); } } @@ -860,7 +860,7 @@ write_sampler_descriptor(struct tu_device *device, { TU_FROM_HANDLE(tu_sampler, sampler, image_info->sampler); - memcpy(dst, sampler, sizeof(*sampler)); + memcpy(dst, sampler->descriptor, sizeof(sampler->descriptor)); } void -- 2.30.2