Commit 859c1d26 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Disallow creating devices without adapters in wined3d_device_create().

These days, we have an adapter even with WINED3D_NO3D. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8f9a2165
...@@ -2438,12 +2438,11 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e ...@@ -2438,12 +2438,11 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e
struct wined3d_device *object; struct wined3d_device *object;
HRESULT hr; HRESULT hr;
TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, surface_alignment %u, device_parent %p, device %p.\n", TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, "
"flags %#x, surface_alignment %u, device_parent %p, device %p.\n",
wined3d, adapter_idx, device_type, focus_window, flags, surface_alignment, device_parent, device); wined3d, adapter_idx, device_type, focus_window, flags, surface_alignment, device_parent, device);
/* Validate the adapter number. If no adapters are available(no GL), ignore the adapter if (adapter_idx >= wined3d->adapter_count)
* number and create a device without a 3D adapter for 2D only operation. */
if (wined3d->adapter_count && adapter_idx >= wined3d->adapter_count)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object)))) if (!(object = heap_alloc_zero(sizeof(*object))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment