Commit 1d09b983 by Alexis Hetu Committed by Commit Bot

Vulkan: Fix memory corruption crash

When VK_EXT_LINE_RASTERIZATION or VK_EXT_PROVOKING_VERTEX is present, createInfo's pNext pointer is set, which caused pEnabledFeatures to not be set, which ended up causing memory corruption issues. This change was made to comply with the Vulkan spec, specifically: "If the pNext chain includes a VkPhysicalDeviceFeatures2 structure, then pEnabledFeatures must be NULL" Since the VkPhysicalDeviceFeatures2 structure is only added to the pNext member of the createInfo structure in the if statement above, restoring the else statement solves this issue. Bug: angleproject:4060 Change-Id: I0688c4297f167fa28e110cd6ee11a11b95282493 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1899731Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 1bae5615
......@@ -1106,8 +1106,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
AppendToPNextChain(reinterpret_cast<vk::CommonStructHeader *>(&createInfo),
&enabledFeatures);
}
if (createInfo.pNext == nullptr)
else
{
// Enable all available features
createInfo.pEnabledFeatures = &enabledFeatures.features;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment