gfx-rs / portability

Vulkan Portability Implementation
Mozilla Public License 2.0
383 stars 25 forks source link

fixes crash when enumerating on some systems #201

Closed Hugobros3 closed 4 years ago

Hugobros3 commented 4 years ago

Was crashing when calling vulkaninfo. I did some digging:

In gfxEnumeratePhysicalDevices, there is some logic for dealing with the cases where the slots allocated by the caller aren't enough to fit all the adapters the implementation has available. This logic has a flaw though, because it doesn't account for the cases where num_output is greater than the numbers of adapters gfx has to offer, and in that case the output is oversized wrt to the adapters we have to fit inside.

This matches both sides for calling copy_from_slice in that function. Not sure why this happens, I have a proper vulkan-ready device in this computer with a "proper" driver too, which may or may not explain it ? I'm not knowledgeable enough on how the loader and everything works to make a definitive statement.

This made things work on my pc so ¯\(ツ)

bors[bot] commented 4 years ago

Build succeeded