It is already tested that adapter_idx >= wined3d->adapter_count before calling device_init, so adapter_count can never be zero.
Signed-off-by: Sven Baars sven.wine@gmail.com --- dlls/wined3d/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d9d6cf2676..67680ac7f1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5336,7 +5336,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->ref = 1; device->wined3d = wined3d; wined3d_incref(device->wined3d); - device->adapter = wined3d->adapter_count ? adapter : NULL; + device->adapter = adapter; device->device_parent = device_parent; list_init(&device->resources); list_init(&device->shaders);
On Wed, 20 Feb 2019 at 21:57, Sven Baars sven.wine@gmail.com wrote:
It is already tested that adapter_idx >= wined3d->adapter_count before calling device_init, so adapter_count can never be zero.
The patch is fine, but the condition in the commit message is wrong.
On 21-02-19 21:00, Henri Verbeet wrote:
On Wed, 20 Feb 2019 at 21:57, Sven Baars sven.wine@gmail.com wrote:
It is already tested that adapter_idx >= wined3d->adapter_count before calling device_init, so adapter_count can never be zero.
The patch is fine, but the condition in the commit message is wrong.
That's bad wording indeed. It is tested that adapter_idx >= wined3d->adapter_count everywhere, but in that case the methods return. I should have put it the other way round. Sorry for that.