Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call surface creation functions on supported drivers #1581

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

charles-lunarg
Copy link
Collaborator

Make sure that the surface extension is supported by a driver and
enabled before calling down on each surface creation function. This
fixes crashes where a driver on the system doesn't support a surface
extension that the application is using but still exposes the function
pointer.

Also in this PR: Loader now generates a struct that contains of bools for each instance
extension and a function to set the bool to true if the extension is in
the list passed in. This consolidates that logic into one place rather
than having it spread out across the codebase. It also enable further
changes that will require each drivers list of supported instance
extensions.

Loader now generates a struct that contains of bools for each instance
extension and a function to set the bool to true if the extension is in
the list passed in. This consolidates that logic into one place rather
than having it spread out across the codebase. It also enable further
changes that will require each drivers list of supported instance
extensions.
Make sure that the surface extension is supported by a driver and
enabled before calling down on each surface creation function. This
fixes crashes where a driver on the system doesn't support a surface
extension that the application is using but still exposes the function
pointer.
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 285711.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2756 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2756 passed.

@MarkY-LunarG
Copy link
Collaborator

Should we have a test for this?

Renames `instanceExtensions` to extensions to reflect that it is all
extensions, not just instance.
Uses self.extensions instead of creating local variables.
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 290417.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2763 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 290436.

@charles-lunarg
Copy link
Collaborator Author

@MarkY-LunarG yes many tests should be written. I have just pushed up an even bigger change which should fix the issue being reported. This is a non-trivial code change and should have extra review done before it can be accepted. Lots of changes for behavior changes that are unexpected which may cause breakages of "existing behavior".

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2764 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2764 failed.

The Vulkan-Loader now doesn't call into drivers if they do not support the
extension that was used to create the VkSurfaceKHR handle. This prevents
crashes from occuring where a driver is called using a surface that it does
not know about, due to the driver not supporting the surface extension.

Because the specification requires that VkSurfaceKHR must be a valid handle,
the loader should not allow calls down into drivers which cannot know about
the surface. Instead it should "emulate" the call as appropriate, returning
0 for counts and setting to 0 any structures that were passed in.
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 291041.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2765 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2765 passed.

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.

Crash when querying surface support for VK_EXT_headless_surface surface with multiple icds
3 participants