lavapipe: don't overwrite entire VkFormatProperties3 struct

this clobbers pNext and breaks tooling, as found by Panagiotis Apostolou

Fixes: f72d5a930b ("lavapipe: KHR_format_feature_flags2")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17462>
(cherry picked from commit 276557b9c6)
This commit is contained in:
Mike Blumenkrantz 2022-07-11 10:59:00 -04:00 committed by Dylan Baker
parent 56b7c79ccf
commit 3f76b2a272
2 changed files with 6 additions and 3 deletions

View file

@ -193,7 +193,7 @@
"description": "lavapipe: don't overwrite entire VkFormatProperties3 struct", "description": "lavapipe: don't overwrite entire VkFormatProperties3 struct",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "f72d5a930b17fb287a58b1ecbc4ec1356e36160b" "because_sha": "f72d5a930b17fb287a58b1ecbc4ec1356e36160b"
}, },

View file

@ -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.optimalTilingFeatures = format_props.optimalTilingFeatures & VK_ALL_FORMAT_FEATURE_FLAG_BITS;
pFormatProperties->formatProperties.bufferFeatures = format_props.bufferFeatures & 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); VkFormatProperties3 *prop3 = (void*)vk_find_struct_const(pFormatProperties->pNext, FORMAT_PROPERTIES_3);
if (prop3) if (prop3) {
*prop3 = format_props; 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, static VkResult lvp_get_image_format_properties(struct lvp_physical_device *physical_device,
const VkPhysicalDeviceImageFormatInfo2 *info, const VkPhysicalDeviceImageFormatInfo2 *info,