Mesa (main): lavapipe: don't overwrite entire VkFormatProperties3 struct

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 12 13:42:41 UTC 2022


Module: Mesa
Branch: main
Commit: 276557b9c6261a26fb11932c8e51faf23893f482
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=276557b9c6261a26fb11932c8e51faf23893f482

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jul 11 10:59:00 2022 -0400

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 <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17462>

---

 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,



More information about the mesa-commit mailing list