Should be fixed in ca1aa2061f6bfce83d777e6124028df0511e3749, please confirm.
Given that every single desktop driver supports sparse binding, it's just not something we can test in any sane way whatsoever.
I can confirm that bug #1 is fixed with this patch!
However, commenting out the sparse queue fix in enableQueue (just to validate the segfault fix) still causes a segfault for some reason, I'll keep debugging to see where the actual problem lies there and try to get an actual trace back
Edit: sorry, false alarm, the application I was testing with does not properly handle D3D9InterfaceEx::CreateDeviceEx not returning a D3D_OK status and that's where the NPE was coming from. I've confirmed with another test app that bug #2 has been fixed as well. Thank you for the super prompt fixes!
Nothing extracted yet.
Note: this issue (or 2 issues) is discovered on Android PC emulation, but I believe it's a legitimate regression for any devices without any queues that support VK_QUEUE_SPARSE_BINDING_BIT
There are actually two bugs here, potentially affecting more than just Android drivers (though it seems to crash deterministically on some Android devices)
Bug 1: Regression in sparse queue family capability detection
Prior to https://github.com/doitsujin/dxvk/commit/5a4d89217249780e17451dbf6c7f678a4a0d472d, sparse queue functionality detection is done with a combination of
Notably, sparse queues are conditionally enabled within the createinfo ONLY if the
findQueueFamiliesquery didn't returnVK_QUEUE_FAMILY_IGNOREDHowever, as of https://github.com/doitsujin/dxvk/commit/5a4d89217249780e17451dbf6c7f678a4a0d472d, the logic has changed to be unconditional enablement without the original
VK_QUEUE_FAMILY_IGNOREDcheck:VK_QUEUE_FAMILY_IGNOREDIn our case, from logs.txt you can see that the queue family for sparse is -1:
I also added some debug logs to print out the deviceCreateInfo:
which tries to add a
queueCreateInfowith a family index of -1/VK_QUEUE_FAMILY_IGNORED, causing vkCreateDevice to fail. I was able to confirm that changing the sparse queue enablement tofixes the crash. However, if vkCreateDevice fails, it also shouldn't crash.
There's also a second bug that causes a null pointer exception / SEGFAULT when vkCreateDevice fails, which this bug inadvertently triggers.
Bug 2: SEGFAULT when vkCreateDevice fails due to change in error handling
The semantic of handling failed vkCreateDevice in dxvk::DxvkAdapter::createDevice was changed from throwing an exception (which downstream code still expects) to silently returning a nullptr (which downstream does not expect and does not check):
In the past, an error would've been thrown if vkCreateDevice fails: https://github.com/doitsujin/dxvk/blob/4f47cb21032926b1f136035e696dc286ebd3cdc7/src/dxvk/dxvk_adapter.cpp#L569
Now, a nullptr is returned instead: https://github.com/doitsujin/dxvk/blob/10c9ef05e08ca28af18366c7f163bf838828300c/src/dxvk/dxvk_adapter.cpp#L228
However, it's still being called with the expectation that it throws instead of returning a nullptr, e.g.: https://github.com/doitsujin/dxvk/blob/4f47cb21032926b1f136035e696dc286ebd3cdc7/src/d3d11/d3d11_main.cpp#L103
The
D3D11DXGIDeviceconstructor then triggers:and the m_d3d11Device construction calls:
However, the user won't be able to play the game if vkCreateDevice fails, regardless of how it fails (segfaults vs exit(1))
Software information
TestD3D.exe
System information
Log files
Please attach Proton or Wine logs as a text file:
dxvk logs: logs.txt