On Wed, 3 Nov 2021 at 00:20, Zebediah Figura zfigura@codeweavers.com wrote:
In order to allow slab allocation from the client thread.
As mentioned in 1/8, this is not necessarily required for the Vulkan backend. It makes sense to move this to the device for GL, but in that case perhaps it also makes sense to move it to struct wined3d_device instead of struct wined3d_device_vk.
@@ -512,6 +524,7 @@ static HRESULT adapter_vk_create_device(struct wined3d *wined3d, const struct wi hr = E_FAIL; goto fail; }
wine_rb_init(&device_vk->bo_slab_available, wined3d_bo_slab_vk_compare);
if (FAILED(hr = wined3d_device_init(&device_vk->d, wined3d, adapter->ordinal, device_type, focus_window, flags, surface_alignment, levels, level_count, vk_info->supported, device_parent)))
This should call wine_rb_destroy() on wined3d_device_init() failure. It turns out not doing that doesn't actually leak anything because wine_rb_init() only does trivial initialisation, but that's an implementation detail and could change.