From 276557b9c6261a26fb11932c8e51faf23893f482 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Jul 2022 10:59:00 -0400 Subject: [PATCH] lavapipe: don't overwrite entire VkFormatProperties3 struct this clobbers pNext and breaks tooling, as found by Panagiotis Apostolou Fixes: f72d5a930b1 ("lavapipe: KHR_format_feature_flags2") Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_formats.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_formats.c b/src/gallium/frontends/lavapipe/lvp_formats.c index f294d67357c..7b31d5eef5e 100644 --- a/src/gallium/frontends/lavapipe/lvp_formats.c +++ b/src/gallium/frontends/lavapipe/lvp_formats.c @@ -187,8 +187,11 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFormatProperties2( pFormatProperties->formatProperties.optimalTilingFeatures = format_props.optimalTilingFeatures & VK_ALL_FORMAT_FEATURE_FLAG_BITS; pFormatProperties->formatProperties.bufferFeatures = format_props.bufferFeatures & VK_ALL_FORMAT_FEATURE_FLAG_BITS; VkFormatProperties3 *prop3 = (void*)vk_find_struct_const(pFormatProperties->pNext, FORMAT_PROPERTIES_3); - if (prop3) - *prop3 = format_props; + if (prop3) { + prop3->linearTilingFeatures = format_props.linearTilingFeatures; + prop3->optimalTilingFeatures = format_props.optimalTilingFeatures; + prop3->bufferFeatures = format_props.bufferFeatures; + } } static VkResult lvp_get_image_format_properties(struct lvp_physical_device *physical_device, const VkPhysicalDeviceImageFormatInfo2 *info,