Skip to content

win32u/vulkan: Move 'features' to function scope in vkCreateDevice.#328

Open
nanomatters wants to merge 1 commit into
ValveSoftware:proton_11.0from
nanomatters:fix/win32u-vulkan-features-lifetime
Open

win32u/vulkan: Move 'features' to function scope in vkCreateDevice.#328
nanomatters wants to merge 1 commit into
ValveSoftware:proton_11.0from
nanomatters:fix/win32u-vulkan-features-lifetime

Conversation

@nanomatters
Copy link
Copy Markdown

VkPhysicalDeviceFeatures features is declared inside an inner {} block
in win32u_vkCreateDevice, but its address is stashed into
create_info->pEnabledFeatures and then dereferenced after the block ends
by convert_device_create_info() and the host vkCreateDevice call. This
was exposed when compiled using gcc16 and caused game crashes.

Originated in c67d194 ("fshack: win32u: Support vulkan scaling
according to fake resolution.").

VkPhysicalDeviceFeatures features is declared inside an inner {} block
in win32u_vkCreateDevice, but its address is stashed into
create_info->pEnabledFeatures and then dereferenced after the block ends
by convert_device_create_info() and the host vkCreateDevice call. This
was exposed when compiled using gcc16 and caused game crashes.

Originated in c67d194 ("fshack: win32u: Support vulkan scaling
according to fake resolution.").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant