-
Notifications
You must be signed in to change notification settings - Fork 286
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
base: main
Are you sure you want to change the base?
Only call surface creation functions on supported drivers #1581
Conversation
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 Vulkan-Loader build queued with queue ID 285711. |
CI Vulkan-Loader build # 2756 running. |
CI Vulkan-Loader build # 2756 passed. |
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 Vulkan-Loader build queued with queue ID 290417. |
CI Vulkan-Loader build # 2763 running. |
a94c46a
to
9d5fea5
Compare
CI Vulkan-Loader build queued with queue ID 290436. |
@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 Vulkan-Loader build # 2764 running. |
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.
9d5fea5
to
d34e392
Compare
CI Vulkan-Loader build queued with queue ID 291041. |
CI Vulkan-Loader build # 2765 running. |
CI Vulkan-Loader build # 2765 passed. |
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.