2004-09-23 06:34:27 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2002-2004 Jason Edmeades
|
|
|
|
* Copyright 2003-2004 Raphael Junqueira
|
|
|
|
* Copyright 2004 Christian Costa
|
2005-06-23 13:05:24 +02:00
|
|
|
* Copyright 2005 Oliver Stieber
|
2008-10-18 19:21:20 +02:00
|
|
|
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
|
2011-08-25 21:05:03 +02:00
|
|
|
* Copyright 2009-2011 Henri Verbeet for CodeWeavers
|
2004-09-23 06:34:27 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-09-23 06:34:27 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2012-06-01 16:56:21 +02:00
|
|
|
#include "wine/port.h"
|
|
|
|
|
2004-09-23 06:34:27 +02:00
|
|
|
#include "wined3d_private.h"
|
2012-07-25 19:59:13 +02:00
|
|
|
#include "winternl.h"
|
2004-09-23 06:34:27 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
2019-04-30 13:06:37 +02:00
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
2004-09-23 06:34:27 +02:00
|
|
|
|
2013-08-30 08:42:46 +02:00
|
|
|
#define DEFAULT_REFRESH_RATE 0
|
2009-03-11 10:15:09 +01:00
|
|
|
|
2011-07-03 22:27:20 +02:00
|
|
|
enum wined3d_driver_model
|
|
|
|
{
|
2016-10-14 00:03:36 +02:00
|
|
|
DRIVER_MODEL_GENERIC,
|
2011-07-03 22:27:20 +02:00
|
|
|
DRIVER_MODEL_WIN9X,
|
|
|
|
DRIVER_MODEL_NT40,
|
|
|
|
DRIVER_MODEL_NT5X,
|
|
|
|
DRIVER_MODEL_NT6X
|
|
|
|
};
|
|
|
|
|
2008-03-13 15:14:00 +01:00
|
|
|
/* The d3d device ID */
|
|
|
|
static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } };
|
|
|
|
|
2004-09-29 23:26:47 +02:00
|
|
|
/**********************************************************
|
|
|
|
* Utility functions follow
|
|
|
|
**********************************************************/
|
|
|
|
|
2009-08-04 08:30:25 +02:00
|
|
|
const struct min_lookup minMipLookup[] =
|
2008-11-26 16:14:40 +01:00
|
|
|
{
|
2009-08-04 08:30:25 +02:00
|
|
|
/* NONE POINT LINEAR */
|
2009-08-06 08:12:18 +02:00
|
|
|
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* NONE */
|
2009-08-04 08:30:25 +02:00
|
|
|
{{GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR}}, /* POINT*/
|
|
|
|
{{GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR}}, /* LINEAR */
|
2008-04-06 00:22:08 +02:00
|
|
|
};
|
2005-08-03 13:00:28 +02:00
|
|
|
|
2009-08-04 08:30:25 +02:00
|
|
|
const GLenum magLookup[] =
|
|
|
|
{
|
2009-08-05 09:01:02 +02:00
|
|
|
/* NONE POINT LINEAR */
|
|
|
|
GL_NEAREST, GL_NEAREST, GL_LINEAR,
|
2009-08-04 08:30:25 +02:00
|
|
|
};
|
|
|
|
|
2019-10-30 15:01:29 +01:00
|
|
|
void CDECL wined3d_output_release_ownership(const struct wined3d_output *output)
|
|
|
|
{
|
|
|
|
D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc = {0};
|
|
|
|
|
|
|
|
TRACE("output %p.\n", output);
|
|
|
|
|
|
|
|
set_owner_desc.hDevice = output->kmt_device;
|
|
|
|
D3DKMTSetVidPnSourceOwner(&set_owner_desc);
|
|
|
|
}
|
|
|
|
|
2019-10-30 15:01:30 +01:00
|
|
|
HRESULT CDECL wined3d_output_take_ownership(const struct wined3d_output *output, BOOL exclusive)
|
|
|
|
{
|
|
|
|
D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc;
|
|
|
|
D3DKMT_VIDPNSOURCEOWNER_TYPE owner_type;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE("output %p, exclusive %#x.\n", output, exclusive);
|
|
|
|
|
|
|
|
owner_type = exclusive ? D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE : D3DKMT_VIDPNSOURCEOWNER_SHARED;
|
|
|
|
set_owner_desc.pType = &owner_type;
|
|
|
|
set_owner_desc.pVidPnSourceId = &output->vidpn_source_id;
|
|
|
|
set_owner_desc.VidPnSourceCount = 1;
|
|
|
|
set_owner_desc.hDevice = output->kmt_device;
|
|
|
|
status = D3DKMTSetVidPnSourceOwner(&set_owner_desc);
|
|
|
|
|
|
|
|
switch (status)
|
|
|
|
{
|
|
|
|
case STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE:
|
|
|
|
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
|
|
|
|
case STATUS_INVALID_PARAMETER:
|
|
|
|
return E_INVALIDARG;
|
|
|
|
case STATUS_PROCEDURE_NOT_FOUND:
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
case STATUS_SUCCESS:
|
|
|
|
return S_OK;
|
|
|
|
default:
|
|
|
|
FIXME("Unhandled error %#x.\n", status);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-30 15:01:29 +01:00
|
|
|
static void wined3d_output_cleanup(const struct wined3d_output *output)
|
|
|
|
{
|
|
|
|
D3DKMT_DESTROYDEVICE destroy_device_desc;
|
|
|
|
D3DKMT_CLOSEADAPTER close_adapter_desc;
|
|
|
|
|
|
|
|
TRACE("output %p.\n", output);
|
|
|
|
|
|
|
|
destroy_device_desc.hDevice = output->kmt_device;
|
|
|
|
D3DKMTDestroyDevice(&destroy_device_desc);
|
|
|
|
close_adapter_desc.hAdapter = output->kmt_adapter;
|
|
|
|
D3DKMTCloseAdapter(&close_adapter_desc);
|
|
|
|
}
|
|
|
|
|
2020-03-19 10:07:46 +01:00
|
|
|
static HRESULT wined3d_output_init(struct wined3d_output *output, unsigned int ordinal,
|
|
|
|
struct wined3d_adapter *adapter, const WCHAR *device_name)
|
2019-10-30 15:01:29 +01:00
|
|
|
{
|
|
|
|
D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME open_adapter_desc;
|
|
|
|
D3DKMT_CREATEDEVICE create_device_desc = {{0}};
|
|
|
|
D3DKMT_CLOSEADAPTER close_adapter_desc;
|
|
|
|
|
|
|
|
TRACE("output %p, device_name %s.\n", output, wine_dbgstr_w(device_name));
|
|
|
|
|
|
|
|
lstrcpyW(open_adapter_desc.DeviceName, device_name);
|
|
|
|
if (D3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_desc))
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
create_device_desc.u.hAdapter = open_adapter_desc.hAdapter;
|
|
|
|
if (D3DKMTCreateDevice(&create_device_desc))
|
|
|
|
{
|
|
|
|
close_adapter_desc.hAdapter = open_adapter_desc.hAdapter;
|
|
|
|
D3DKMTCloseAdapter(&close_adapter_desc);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2020-03-19 10:07:46 +01:00
|
|
|
output->ordinal = ordinal;
|
2020-03-05 16:03:23 +01:00
|
|
|
lstrcpyW(output->device_name, device_name);
|
|
|
|
output->adapter = adapter;
|
2021-01-25 15:22:19 +01:00
|
|
|
output->screen_format = WINED3DFMT_UNKNOWN;
|
2019-10-30 15:01:29 +01:00
|
|
|
output->kmt_adapter = open_adapter_desc.hAdapter;
|
|
|
|
output->kmt_device = create_device_desc.hDevice;
|
|
|
|
output->vidpn_source_id = open_adapter_desc.VidPnSourceId;
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2007-09-23 00:46:21 +02:00
|
|
|
/* Adjust the amount of used texture memory */
|
2014-08-18 08:26:20 +02:00
|
|
|
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
|
2009-10-21 10:33:58 +02:00
|
|
|
{
|
2014-08-18 08:26:20 +02:00
|
|
|
adapter->vram_bytes_used += amount;
|
|
|
|
TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
|
|
|
|
wine_dbgstr_longlong(amount),
|
|
|
|
wine_dbgstr_longlong(adapter->vram_bytes_used));
|
|
|
|
return adapter->vram_bytes_used;
|
2007-09-23 00:46:21 +02:00
|
|
|
}
|
2007-08-07 23:45:00 +02:00
|
|
|
|
2019-03-28 09:53:57 +01:00
|
|
|
void wined3d_adapter_cleanup(struct wined3d_adapter *adapter)
|
2009-10-21 10:33:59 +02:00
|
|
|
{
|
2020-03-03 15:18:14 +01:00
|
|
|
unsigned int output_idx;
|
|
|
|
|
|
|
|
for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
|
|
|
|
wined3d_output_cleanup(&adapter->outputs[output_idx]);
|
|
|
|
heap_free(adapter->outputs);
|
2018-08-30 14:54:49 +02:00
|
|
|
heap_free(adapter->formats);
|
2009-10-21 10:33:59 +02:00
|
|
|
}
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
ULONG CDECL wined3d_incref(struct wined3d *wined3d)
|
2005-03-02 14:44:58 +01:00
|
|
|
{
|
2011-02-01 19:39:53 +01:00
|
|
|
ULONG refcount = InterlockedIncrement(&wined3d->ref);
|
2005-03-02 14:44:58 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
TRACE("%p increasing refcount to %u.\n", wined3d, refcount);
|
2005-03-02 14:44:58 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
return refcount;
|
2005-03-02 14:44:58 +01:00
|
|
|
}
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
ULONG CDECL wined3d_decref(struct wined3d *wined3d)
|
|
|
|
{
|
|
|
|
ULONG refcount = InterlockedDecrement(&wined3d->ref);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u.\n", wined3d, refcount);
|
2010-09-14 13:38:39 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
if (!refcount)
|
2010-09-14 13:38:39 +02:00
|
|
|
{
|
2009-03-11 10:15:10 +01:00
|
|
|
unsigned int i;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
for (i = 0; i < wined3d->adapter_count; ++i)
|
2009-03-11 10:15:10 +01:00
|
|
|
{
|
2019-03-28 09:53:57 +01:00
|
|
|
struct wined3d_adapter *adapter = wined3d->adapters[i];
|
|
|
|
|
|
|
|
adapter->adapter_ops->adapter_destroy(adapter);
|
2009-03-11 10:15:10 +01:00
|
|
|
}
|
2018-02-14 07:39:59 +01:00
|
|
|
heap_free(wined3d);
|
2005-03-02 14:44:58 +01:00
|
|
|
}
|
2005-07-13 16:15:54 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
return refcount;
|
2005-03-02 14:44:58 +01:00
|
|
|
}
|
|
|
|
|
2020-07-14 14:10:32 +02:00
|
|
|
/* Certain applications (e.g. Steam) complain if we report an outdated driver
|
|
|
|
* version.
|
2018-08-17 16:54:09 +02:00
|
|
|
*
|
|
|
|
* The driver version has the form "x.y.z.w".
|
|
|
|
*
|
2020-07-14 14:10:32 +02:00
|
|
|
* "x" is the Windows version / driver model the driver is meant for:
|
2019-06-26 12:36:23 +02:00
|
|
|
* 4 -> 95/98/NT4
|
|
|
|
* 5 -> 2000
|
2020-07-14 14:10:32 +02:00
|
|
|
* 6 -> XP
|
|
|
|
* 7 -> Vista - WDDM 1.0
|
|
|
|
* 8 -> Windows 7 - WDDM 1.1
|
|
|
|
* 9 -> Windows 8 - WDDM 1.2
|
|
|
|
* 10 -> Windows 8.1 - WDDM 1.3
|
|
|
|
* 20 -> Windows 10 - WDDM 2.0
|
|
|
|
* 21 -> Windows 10 Anniversary Update - WDDM 2.1
|
|
|
|
* 22 -> Windows 10 Creators Update - WDDM 2.2
|
|
|
|
* 23 -> Windows 10 Fall Creators Update - WDDM 2.3
|
|
|
|
* 24 -> Windows 10 April 2018 Update - WDDM 2.4
|
|
|
|
* 25 -> Windows 10 October 2018 Update - WDDM 2.5
|
|
|
|
* 26 -> Windows 10 May 2019 Update - WDDM 2.6
|
2018-08-17 16:54:09 +02:00
|
|
|
*
|
2020-07-14 14:10:33 +02:00
|
|
|
* "y" is the maximum Direct3D version / feature level the driver supports.
|
|
|
|
* 11 -> 6
|
|
|
|
* 12 -> 7
|
|
|
|
* 13 -> 8
|
|
|
|
* 14 -> 9
|
|
|
|
* 15 -> 10_0
|
|
|
|
* 16 -> 10_1
|
|
|
|
* 17 -> 11_0
|
|
|
|
* 18 -> 11_1
|
|
|
|
* 19 -> 12_0
|
|
|
|
* 20 -> 12_1
|
|
|
|
* 21 -> 12_x
|
2018-08-17 16:54:09 +02:00
|
|
|
*
|
|
|
|
* "z" is the subversion number.
|
|
|
|
*
|
|
|
|
* "w" is the vendor specific driver build number.
|
2020-07-14 14:10:33 +02:00
|
|
|
*
|
|
|
|
* In practice the reported version is tied to the driver, not the actual
|
|
|
|
* Windows version or feature level. E.g. NVIDIA driver 445.87 advertises the
|
|
|
|
* exact same version 26.21.14.4587 on Windows 7 as it does on Windows 10
|
|
|
|
* (it's in fact the same driver). Similarly for driver 310.90 that advertises
|
|
|
|
* itself as 9.18.13.1090 on Windows Vista with a GeForce 9600M. */
|
2009-07-10 11:28:49 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
struct driver_version_information
|
2009-09-28 12:30:48 +02:00
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
enum wined3d_display_driver driver;
|
|
|
|
enum wined3d_driver_model driver_model;
|
|
|
|
const char *driver_name; /* name of Windows driver */
|
|
|
|
WORD subversion; /* subversion word ('z'), contained in high word of DriverVersion.LowPart */
|
|
|
|
WORD build; /* build number ('w'), contained in low word of DriverVersion.LowPart */
|
|
|
|
};
|
2009-09-28 12:30:48 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* The driver version table contains driver information for different devices on several OS versions. */
|
|
|
|
static const struct driver_version_information driver_version_table[] =
|
2010-03-17 21:59:51 +01:00
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
/* AMD
|
|
|
|
* - Radeon HD2x00 (R600) and up supported by current drivers.
|
|
|
|
* - Radeon 9500 (R300) - X1*00 (R5xx) supported up to Catalyst 9.3 (Linux) and 10.2 (XP/Vista/Win7)
|
|
|
|
* - Radeon 7xxx (R100) - 9250 (RV250) supported up to Catalyst 6.11 (XP)
|
|
|
|
* - Rage 128 supported up to XP, latest official build 6.13.3279 dated October 2001 */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_AMD_RAGE_128PRO, DRIVER_MODEL_NT5X, "ati2dvaa.dll", 3279, 0},
|
|
|
|
{DRIVER_AMD_R100, DRIVER_MODEL_NT5X, "ati2dvag.dll", 10, 6614},
|
|
|
|
{DRIVER_AMD_R300, DRIVER_MODEL_NT5X, "ati2dvag.dll", 10, 6764},
|
|
|
|
{DRIVER_AMD_R600, DRIVER_MODEL_NT5X, "ati2dvag.dll", 10, 1280},
|
|
|
|
{DRIVER_AMD_R300, DRIVER_MODEL_NT6X, "atiumdag.dll", 10, 741 },
|
|
|
|
{DRIVER_AMD_R600, DRIVER_MODEL_NT6X, "atiumdag.dll", 10, 1280},
|
2020-07-14 14:10:34 +02:00
|
|
|
{DRIVER_AMD_RX, DRIVER_MODEL_NT6X, "aticfx32.dll", 15002, 61},
|
2010-03-17 21:59:51 +01:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* Intel
|
|
|
|
* The drivers are unified but not all versions support all GPUs. At some point the 2k/xp
|
|
|
|
* drivers used ialmrnt5.dll for GMA800/GMA900 but at some point the file was renamed to
|
|
|
|
* igxprd32.dll but the GMA800 driver was never updated. */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_INTEL_GMA800, DRIVER_MODEL_NT5X, "ialmrnt5.dll", 10, 3889},
|
|
|
|
{DRIVER_INTEL_GMA900, DRIVER_MODEL_NT5X, "igxprd32.dll", 10, 4764},
|
|
|
|
{DRIVER_INTEL_GMA950, DRIVER_MODEL_NT5X, "igxprd32.dll", 10, 4926},
|
|
|
|
{DRIVER_INTEL_GMA3000, DRIVER_MODEL_NT5X, "igxprd32.dll", 10, 5218},
|
|
|
|
{DRIVER_INTEL_GMA950, DRIVER_MODEL_NT6X, "igdumd32.dll", 10, 1504},
|
|
|
|
{DRIVER_INTEL_GMA3000, DRIVER_MODEL_NT6X, "igdumd32.dll", 10, 1666},
|
|
|
|
{DRIVER_INTEL_HD4000, DRIVER_MODEL_NT6X, "igdumdim32.dll", 15, 4352},
|
2011-07-08 21:11:29 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* Nvidia
|
|
|
|
* - Geforce8 and newer is supported by the current 340.52 driver on XP-Win8
|
|
|
|
* - Geforce6 and 7 support is up to 307.83 on XP-Win8
|
|
|
|
* - GeforceFX support is up to 173.x on <= XP
|
|
|
|
* - Geforce2MX/3/4 up to 96.x on <= XP
|
|
|
|
* - TNT/Geforce1/2 up to 71.x on <= XP
|
|
|
|
* All version numbers used below are from the Linux nvidia drivers. */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_NVIDIA_TNT, DRIVER_MODEL_NT5X, "nv4_disp.dll", 10, 7186},
|
|
|
|
{DRIVER_NVIDIA_GEFORCE2MX, DRIVER_MODEL_NT5X, "nv4_disp.dll", 10, 9371},
|
|
|
|
{DRIVER_NVIDIA_GEFORCEFX, DRIVER_MODEL_NT5X, "nv4_disp.dll", 11, 7516},
|
|
|
|
{DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT5X, "nv4_disp.dll", 13, 783},
|
|
|
|
{DRIVER_NVIDIA_GEFORCE8, DRIVER_MODEL_NT5X, "nv4_disp.dll", 13, 4052},
|
|
|
|
{DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT6X, "nvd3dum.dll", 13, 783},
|
|
|
|
{DRIVER_NVIDIA_GEFORCE8, DRIVER_MODEL_NT6X, "nvd3dum.dll", 13, 4052},
|
2020-07-14 14:10:35 +02:00
|
|
|
{DRIVER_NVIDIA_FERMI, DRIVER_MODEL_NT6X, "nvd3dum.dll", 13, 9135},
|
|
|
|
{DRIVER_NVIDIA_KEPLER, DRIVER_MODEL_NT6X, "nvd3dum.dll", 14, 4587},
|
2011-09-04 22:43:49 +02:00
|
|
|
|
2019-01-04 16:00:02 +01:00
|
|
|
/* Red Hat */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_REDHAT_VIRGL, DRIVER_MODEL_GENERIC, "virgl.dll", 0, 0},
|
2019-01-04 16:00:02 +01:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* VMware */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_VMWARE, DRIVER_MODEL_NT5X, "vm3dum.dll", 1, 1134},
|
2018-09-18 00:31:18 +02:00
|
|
|
|
|
|
|
/* Wine */
|
2020-07-14 14:10:33 +02:00
|
|
|
{DRIVER_WINE, DRIVER_MODEL_GENERIC, "wined3d.dll", 0, 0},
|
2018-08-17 16:54:09 +02:00
|
|
|
};
|
2013-02-08 23:19:47 +01:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* The amount of video memory stored in the gpu description table is the minimum amount of video memory
|
|
|
|
* found on a board containing a specific GPU. */
|
|
|
|
static const struct wined3d_gpu_description gpu_description_table[] =
|
2009-07-06 10:08:42 +02:00
|
|
|
{
|
2010-07-31 03:02:01 +02:00
|
|
|
/* Nvidia cards */
|
2015-05-21 00:24:46 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_128, "NVIDIA RIVA 128", DRIVER_NVIDIA_TNT, 4 },
|
2010-09-11 03:59:47 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_TNT, "NVIDIA RIVA TNT", DRIVER_NVIDIA_TNT, 16 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_TNT2, "NVIDIA RIVA TNT2/TNT2 Pro", DRIVER_NVIDIA_TNT, 32 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE, "NVIDIA GeForce 256", DRIVER_NVIDIA_TNT, 32 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE2, "NVIDIA GeForce2 GTS/GeForce2 Pro", DRIVER_NVIDIA_TNT, 32 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE2_MX, "NVIDIA GeForce2 MX/MX 400", DRIVER_NVIDIA_GEFORCE2MX,32 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE3, "NVIDIA GeForce3", DRIVER_NVIDIA_GEFORCE2MX,64 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE4_MX, "NVIDIA GeForce4 MX 460", DRIVER_NVIDIA_GEFORCE2MX,64 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE4_TI4200, "NVIDIA GeForce4 Ti 4200", DRIVER_NVIDIA_GEFORCE2MX,64, },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5200, "NVIDIA GeForce FX 5200", DRIVER_NVIDIA_GEFORCEFX, 64 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5600, "NVIDIA GeForce FX 5600", DRIVER_NVIDIA_GEFORCEFX, 128 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5800, "NVIDIA GeForce FX 5800", DRIVER_NVIDIA_GEFORCEFX, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_6200, "NVIDIA GeForce 6200", DRIVER_NVIDIA_GEFORCE6, 64 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_6600GT, "NVIDIA GeForce 6600 GT", DRIVER_NVIDIA_GEFORCE6, 128 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_6800, "NVIDIA GeForce 6800", DRIVER_NVIDIA_GEFORCE6, 128 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7300, "NVIDIA GeForce Go 7300", DRIVER_NVIDIA_GEFORCE6, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7400, "NVIDIA GeForce Go 7400", DRIVER_NVIDIA_GEFORCE6, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7600, "NVIDIA GeForce 7600 GT", DRIVER_NVIDIA_GEFORCE6, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7800GT, "NVIDIA GeForce 7800 GT", DRIVER_NVIDIA_GEFORCE6, 256 },
|
2015-03-06 16:49:08 +01:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8200, "NVIDIA GeForce 8200", DRIVER_NVIDIA_GEFORCE8, 512 },
|
2014-10-24 11:28:56 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8300GS, "NVIDIA GeForce 8300 GS", DRIVER_NVIDIA_GEFORCE8, 128 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8400GS, "NVIDIA GeForce 8400 GS", DRIVER_NVIDIA_GEFORCE8, 128 },
|
2015-05-21 00:24:46 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8500GT, "NVIDIA GeForce 8500 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
|
2014-10-24 11:28:56 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600GT, "NVIDIA GeForce 8600 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600MGT, "NVIDIA GeForce 8600M GT", DRIVER_NVIDIA_GEFORCE8, 512 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8800GTS, "NVIDIA GeForce 8800 GTS", DRIVER_NVIDIA_GEFORCE8, 320 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8800GTX, "NVIDIA GeForce 8800 GTX", DRIVER_NVIDIA_GEFORCE8, 768 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9200, "NVIDIA GeForce 9200", DRIVER_NVIDIA_GEFORCE8, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9300, "NVIDIA GeForce 9300", DRIVER_NVIDIA_GEFORCE8, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9400M, "NVIDIA GeForce 9400M", DRIVER_NVIDIA_GEFORCE8, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9400GT, "NVIDIA GeForce 9400 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9500GT, "NVIDIA GeForce 9500 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
|
2016-06-15 09:48:30 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9600GT, "NVIDIA GeForce 9600 GT", DRIVER_NVIDIA_GEFORCE8, 512 },
|
2016-04-19 18:34:10 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9700MGT, "NVIDIA GeForce 9700M GT", DRIVER_NVIDIA_GEFORCE8, 512 },
|
2014-10-24 11:28:56 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9800GT, "NVIDIA GeForce 9800 GT", DRIVER_NVIDIA_GEFORCE8, 512 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_210, "NVIDIA GeForce 210", DRIVER_NVIDIA_GEFORCE8, 512 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT220, "NVIDIA GeForce GT 220", DRIVER_NVIDIA_GEFORCE8, 512 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT240, "NVIDIA GeForce GT 240", DRIVER_NVIDIA_GEFORCE8, 512 },
|
2016-06-08 18:30:23 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS250, "NVIDIA GeForce GTS 250", DRIVER_NVIDIA_GEFORCE8, 1024},
|
2014-10-24 11:28:56 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX260, "NVIDIA GeForce GTX 260", DRIVER_NVIDIA_GEFORCE8, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX275, "NVIDIA GeForce GTX 275", DRIVER_NVIDIA_GEFORCE8, 896 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX280, "NVIDIA GeForce GTX 280", DRIVER_NVIDIA_GEFORCE8, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_315M, "NVIDIA GeForce 315M", DRIVER_NVIDIA_GEFORCE8, 512 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_320M, "NVIDIA GeForce 320M", DRIVER_NVIDIA_GEFORCE8, 256},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT320M, "NVIDIA GeForce GT 320M", DRIVER_NVIDIA_GEFORCE8, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT325M, "NVIDIA GeForce GT 325M", DRIVER_NVIDIA_GEFORCE8, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT330, "NVIDIA GeForce GT 330", DRIVER_NVIDIA_GEFORCE8, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS350M, "NVIDIA GeForce GTS 350M", DRIVER_NVIDIA_GEFORCE8, 1024},
|
2020-07-14 14:10:35 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_410M, "NVIDIA GeForce 410M", DRIVER_NVIDIA_FERMI, 512},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT420, "NVIDIA GeForce GT 420", DRIVER_NVIDIA_FERMI, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT425M, "NVIDIA GeForce GT 425M", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT430, "NVIDIA GeForce GT 430", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT440, "NVIDIA GeForce GT 440", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS450, "NVIDIA GeForce GTS 450", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX460, "NVIDIA GeForce GTX 460", DRIVER_NVIDIA_FERMI, 768 },
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX460M, "NVIDIA GeForce GTX 460M", DRIVER_NVIDIA_FERMI, 1536},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX465, "NVIDIA GeForce GTX 465", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX470, "NVIDIA GeForce GTX 470", DRIVER_NVIDIA_FERMI, 1280},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX480, "NVIDIA GeForce GTX 480", DRIVER_NVIDIA_FERMI, 1536},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT520, "NVIDIA GeForce GT 520", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT525M, "NVIDIA GeForce GT 525M", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT540M, "NVIDIA GeForce GT 540M", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX550, "NVIDIA GeForce GTX 550 Ti", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT555M, "NVIDIA GeForce GT 555M", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560TI, "NVIDIA GeForce GTX 560 Ti", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560M, "NVIDIA GeForce GTX 560M", DRIVER_NVIDIA_FERMI, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560, "NVIDIA GeForce GTX 560", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX570, "NVIDIA GeForce GTX 570", DRIVER_NVIDIA_FERMI, 1280},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX580, "NVIDIA GeForce GTX 580", DRIVER_NVIDIA_FERMI, 1536},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT610, "NVIDIA GeForce GT 610", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT630, "NVIDIA GeForce GT 630", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT630M, "NVIDIA GeForce GT 630M", DRIVER_NVIDIA_FERMI, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT640, "NVIDIA GeForce GT 640", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT640M, "NVIDIA GeForce GT 640M", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT650M, "NVIDIA GeForce GT 650M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX650, "NVIDIA GeForce GTX 650", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX650TI, "NVIDIA GeForce GTX 650 Ti", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660, "NVIDIA GeForce GTX 660", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660M, "NVIDIA GeForce GTX 660M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660TI, "NVIDIA GeForce GTX 660 Ti", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670MX, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX675MX_1, "NVIDIA GeForce GTX 675MX", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX675MX_2, "NVIDIA GeForce GTX 675MX", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX680, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX690, "NVIDIA GeForce GTX 690", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT720, "NVIDIA GeForce GT 720", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730, "NVIDIA GeForce GT 730", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730M, "NVIDIA GeForce GT 730M", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT740M, "NVIDIA GeForce GT 740M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT750M, "NVIDIA GeForce GT 750M", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT755M, "NVIDIA GeForce GT 755M", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_KEPLER, 1024},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750TI, "NVIDIA GeForce GTX 750 Ti", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760, "NVIDIA GeForce GTX 760", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760TI, "NVIDIA GeForce GTX 760 Ti", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX765M, "NVIDIA GeForce GTX 765M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770M, "NVIDIA GeForce GTX 770M", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX775M, "NVIDIA GeForce GTX 775M", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780, "NVIDIA GeForce GTX 780", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780M, "NVIDIA GeForce GTX 780M", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780TI, "NVIDIA GeForce GTX 780 Ti", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITAN, "NVIDIA GeForce GTX TITAN", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANB, "NVIDIA GeForce GTX TITAN Black", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANX, "NVIDIA GeForce GTX TITAN X", DRIVER_NVIDIA_KEPLER, 12288},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANZ, "NVIDIA GeForce GTX TITAN Z", DRIVER_NVIDIA_KEPLER, 12288},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_820M, "NVIDIA GeForce 820M", DRIVER_NVIDIA_FERMI, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_830M, "NVIDIA GeForce 830M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_840M, "NVIDIA GeForce 840M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_845M, "NVIDIA GeForce 845M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX850M, "NVIDIA GeForce GTX 850M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX860M, "NVIDIA GeForce GTX 860M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX870M, "NVIDIA GeForce GTX 870M", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX880M, "NVIDIA GeForce GTX 880M", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_940M, "NVIDIA GeForce 940M", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950, "NVIDIA GeForce GTX 950", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950M, "NVIDIA GeForce GTX 950M", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960, "NVIDIA GeForce GTX 960", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960M, "NVIDIA GeForce GTX 960M", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970, "NVIDIA GeForce GTX 970", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970M, "NVIDIA GeForce GTX 970M", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX980, "NVIDIA GeForce GTX 980", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX980TI, "NVIDIA GeForce GTX 980 Ti", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1050, "NVIDIA GeForce GTX 1050", DRIVER_NVIDIA_KEPLER, 2048},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1050TI, "NVIDIA GeForce GTX 1050 Ti", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1060_3GB,"NVIDIA GeForce GTX 1060 3GB", DRIVER_NVIDIA_KEPLER, 3072},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1060, "NVIDIA GeForce GTX 1060", DRIVER_NVIDIA_KEPLER, 6144},
|
2020-12-02 16:57:53 +01:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1060M, "NVIDIA GeForce GTX 1060M", DRIVER_NVIDIA_KEPLER, 6144},
|
2020-07-14 14:10:35 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1070, "NVIDIA GeForce GTX 1070", DRIVER_NVIDIA_KEPLER, 8192},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1080, "NVIDIA GeForce GTX 1080", DRIVER_NVIDIA_KEPLER, 8192},
|
2020-10-15 00:21:53 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1080M, "NVIDIA GeForce GTX 1080M", DRIVER_NVIDIA_KEPLER, 8192},
|
2020-07-14 14:10:35 +02:00
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1080TI, "NVIDIA GeForce GTX 1080 Ti", DRIVER_NVIDIA_KEPLER, 11264},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_TITANX_PASCAL, "NVIDIA TITAN X (Pascal)", DRIVER_NVIDIA_KEPLER, 12288},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_TITANV, "NVIDIA TITAN V", DRIVER_NVIDIA_KEPLER, 12288},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1650SUPER,"NVIDIA GeForce GTX 1650 SUPER", DRIVER_NVIDIA_KEPLER, 4096},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1660SUPER,"NVIDIA GeForce GTX 1660 SUPER", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1660TI, "NVIDIA GeForce GTX 1660 Ti", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_RTX2060, "NVIDIA GeForce RTX 2060", DRIVER_NVIDIA_KEPLER, 6144},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_RTX2070, "NVIDIA GeForce RTX 2070", DRIVER_NVIDIA_KEPLER, 8192},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_RTX2080, "NVIDIA GeForce RTX 2080", DRIVER_NVIDIA_KEPLER, 8192},
|
|
|
|
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_RTX2080TI, "NVIDIA GeForce RTX 2080 Ti", DRIVER_NVIDIA_KEPLER, 11264},
|
2011-03-16 06:07:40 +01:00
|
|
|
|
2011-03-01 09:47:57 +01:00
|
|
|
/* AMD cards */
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RAGE_128PRO, "ATI Rage Fury", DRIVER_AMD_RAGE_128PRO, 16 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_7200, "ATI RADEON 7200 SERIES", DRIVER_AMD_R100, 32 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_8500, "ATI RADEON 8500 SERIES", DRIVER_AMD_R100, 64 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_9500, "ATI Radeon 9500", DRIVER_AMD_R300, 64 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_XPRESS_200M, "ATI RADEON XPRESS 200M Series", DRIVER_AMD_R300, 64 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_X700, "ATI Radeon X700 SE", DRIVER_AMD_R300, 128 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_X1600, "ATI Radeon X1600 Series", DRIVER_AMD_R300, 128 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD2350, "ATI Mobility Radeon HD 2350", DRIVER_AMD_R600, 256 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD2600, "ATI Mobility Radeon HD 2600", DRIVER_AMD_R600, 256 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD2900, "ATI Radeon HD 2900 XT", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD3200, "ATI Radeon HD 3200 Graphics", DRIVER_AMD_R600, 128 },
|
2015-10-19 14:30:29 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD3850, "ATI Radeon HD 3850 AGP", DRIVER_AMD_R600, 512 },
|
2013-05-30 23:51:10 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD4200M, "ATI Mobility Radeon HD 4200", DRIVER_AMD_R600, 256 },
|
2011-03-01 09:47:57 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD4350, "ATI Radeon HD 4350", DRIVER_AMD_R600, 256 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD4600, "ATI Radeon HD 4600 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD4700, "ATI Radeon HD 4700 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD4800, "ATI Radeon HD 4800 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD5400, "ATI Radeon HD 5400 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD5600, "ATI Radeon HD 5600 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD5700, "ATI Radeon HD 5700 Series", DRIVER_AMD_R600, 512 },
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD5800, "ATI Radeon HD 5800 Series", DRIVER_AMD_R600, 1024},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD5900, "ATI Radeon HD 5900 Series", DRIVER_AMD_R600, 1024},
|
2011-07-28 22:27:52 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6300, "AMD Radeon HD 6300 series Graphics", DRIVER_AMD_R600, 1024},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6400, "AMD Radeon HD 6400 Series", DRIVER_AMD_R600, 1024},
|
2011-10-26 20:04:59 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6410D, "AMD Radeon HD 6410D", DRIVER_AMD_R600, 1024},
|
2016-09-28 03:16:16 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6480G, "AMD Radeon HD 6480G", DRIVER_AMD_R600, 512 },
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6490M, "AMD Radeon HD 6490M", DRIVER_AMD_R600, 1024},
|
2011-10-26 20:04:59 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6550D, "AMD Radeon HD 6550D", DRIVER_AMD_R600, 1024},
|
2011-07-28 22:27:52 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6600, "AMD Radeon HD 6600 Series", DRIVER_AMD_R600, 1024},
|
2011-11-03 15:26:37 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6600M, "AMD Radeon HD 6600M Series", DRIVER_AMD_R600, 512 },
|
2012-07-02 15:36:34 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6700, "AMD Radeon HD 6700 Series", DRIVER_AMD_R600, 1024},
|
2011-03-01 09:47:57 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6800, "AMD Radeon HD 6800 Series", DRIVER_AMD_R600, 1024},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6900, "AMD Radeon HD 6900 Series", DRIVER_AMD_R600, 2048},
|
2014-08-19 09:22:25 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7660D, "AMD Radeon HD 7660D", DRIVER_AMD_R600, 2048},
|
2012-09-07 00:48:00 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7700, "AMD Radeon HD 7700 Series", DRIVER_AMD_R600, 1024},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7800, "AMD Radeon HD 7800 Series", DRIVER_AMD_R600, 2048},
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7870, "AMD Radeon HD 7870 Series", DRIVER_AMD_R600, 2048},
|
2012-07-18 20:33:32 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7900, "AMD Radeon HD 7900 Series", DRIVER_AMD_R600, 2048},
|
2014-08-19 09:22:25 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD8600M, "AMD Radeon HD 8600M Series", DRIVER_AMD_R600, 1024},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD8670, "AMD Radeon HD 8670", DRIVER_AMD_R600, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD8770, "AMD Radeon HD 8770", DRIVER_AMD_R600, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R3, "AMD Radeon HD 8400 / R3 Series", DRIVER_AMD_R600, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R7, "AMD Radeon(TM) R7 Graphics", DRIVER_AMD_R600, 2048},
|
2017-01-18 13:48:35 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_285, "AMD Radeon R9 285", DRIVER_AMD_RX, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_290, "AMD Radeon R9 290", DRIVER_AMD_RX, 4096},
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_290X, "AMD Radeon R9 290X", DRIVER_AMD_RX, 4096},
|
2017-01-21 11:14:32 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_FURY, "AMD Radeon (TM) R9 Fury Series", DRIVER_AMD_RX, 4096},
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_M370X, "AMD Radeon R9 M370X", DRIVER_AMD_RX, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_M380, "AMD Radeon R9 M380", DRIVER_AMD_RX, 2048},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_R9_M395X, "AMD Radeon R9 M395X", DRIVER_AMD_RX, 4096},
|
2016-11-13 23:10:00 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_460, "Radeon(TM) RX 460 Graphics", DRIVER_AMD_RX, 4096},
|
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_480, "Radeon (TM) RX 480 Graphics", DRIVER_AMD_RX, 4096},
|
2019-08-05 15:55:36 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_10, "Radeon RX Vega", DRIVER_AMD_RX, 8192},
|
2019-09-20 15:38:26 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_12, "Radeon Pro Vega 20", DRIVER_AMD_RX, 4096},
|
2020-07-16 18:50:05 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RAVEN, "AMD Radeon(TM) Vega 10 Mobile Graphics", DRIVER_AMD_RX, 1024},
|
2019-08-05 15:55:36 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_20, "Radeon RX Vega 20", DRIVER_AMD_RX, 4096},
|
2019-11-11 08:07:12 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_10, "Radeon RX 5700 / 5700 XT", DRIVER_AMD_RX, 8192},
|
2021-02-03 19:08:44 +01:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_14, "Radeon RX 5500M", DRIVER_AMD_RX, 4096},
|
2021-04-13 04:58:40 +02:00
|
|
|
{HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_21, "Radeon RX 6800/6800 XT / 6900 XT", DRIVER_AMD_RX, 16384},
|
2014-03-05 10:46:39 +01:00
|
|
|
|
2019-01-04 16:00:02 +01:00
|
|
|
/* Red Hat */
|
|
|
|
{HW_VENDOR_REDHAT, CARD_REDHAT_VIRGL, "Red Hat VirtIO GPU", DRIVER_REDHAT_VIRGL, 1024},
|
|
|
|
|
2014-03-05 10:46:39 +01:00
|
|
|
/* VMware */
|
|
|
|
{HW_VENDOR_VMWARE, CARD_VMWARE_SVGA3D, "VMware SVGA 3D (Microsoft Corporation - WDDM)", DRIVER_VMWARE, 1024},
|
|
|
|
|
2010-09-09 04:26:22 +02:00
|
|
|
/* Intel cards */
|
2012-01-02 21:45:27 +01:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_830M, "Intel(R) 82830M Graphics Controller", DRIVER_INTEL_GMA800, 32 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_855GM, "Intel(R) 82852/82855 GM/GME Graphics Controller", DRIVER_INTEL_GMA800, 32 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_845G, "Intel(R) 845G", DRIVER_INTEL_GMA800, 32 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_865G, "Intel(R) 82865G Graphics Controller", DRIVER_INTEL_GMA800, 32 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_915G, "Intel(R) 82915G/GV/910GL Express Chipset Family", DRIVER_INTEL_GMA900, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_E7221G, "Intel(R) E7221G", DRIVER_INTEL_GMA900, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_915GM, "Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family", DRIVER_INTEL_GMA900, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_945G, "Intel(R) 945G", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_945GM, "Mobile Intel(R) 945GM Express Chipset Family", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_945GME, "Intel(R) 945GME", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_Q35, "Intel(R) Q35", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_G33, "Intel(R) G33", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_Q33, "Intel(R) Q33", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_PNVG, "Intel(R) IGD", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_PNVM, "Intel(R) IGD", DRIVER_INTEL_GMA950, 64 },
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_965Q, "Intel(R) 965Q", DRIVER_INTEL_GMA3000, 128},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_965G, "Intel(R) 965G", DRIVER_INTEL_GMA3000, 128},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_946GZ, "Intel(R) 946GZ", DRIVER_INTEL_GMA3000, 128},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_965GM, "Mobile Intel(R) 965 Express Chipset Family", DRIVER_INTEL_GMA3000, 128},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_965GME, "Intel(R) 965GME", DRIVER_INTEL_GMA3000, 128},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_GM45, "Mobile Intel(R) GM45 Express Chipset Family", DRIVER_INTEL_GMA3000, 512},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IGD, "Intel(R) Integrated Graphics Device", DRIVER_INTEL_GMA3000, 512},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_G45, "Intel(R) G45/G43", DRIVER_INTEL_GMA3000, 512},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_Q45, "Intel(R) Q45/Q43", DRIVER_INTEL_GMA3000, 512},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_G41, "Intel(R) G41", DRIVER_INTEL_GMA3000, 512},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_B43, "Intel(R) B43", DRIVER_INTEL_GMA3000, 512},
|
2016-06-04 22:07:00 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_ILKD, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_ILKM, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_SNBD, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_SNBM, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_SNBS, "Intel(R) HD Graphics Family", DRIVER_INTEL_GMA3000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IVBD, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IVBM, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IVBS, "Intel(R) HD Graphics Family", DRIVER_INTEL_HD4000, 1536},
|
2016-06-04 22:07:01 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HWD, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000, 1536},
|
2016-06-04 22:07:00 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HWM, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000, 1536},
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD5000_1, "Intel(R) HD Graphics 5000", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD5000_2, "Intel(R) HD Graphics 5000", DRIVER_INTEL_HD4000, 1536},
|
2017-01-13 14:06:45 +01:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I5100_1, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I5100_2, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I5100_3, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I5100_4, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_1, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_2, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_3, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_4, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_5, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
|
2019-07-29 13:30:51 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP5200_6, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 2048},
|
2016-10-14 00:03:35 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD5300, "Intel(R) HD Graphics 5300", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD5500, "Intel(R) HD Graphics 5500", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD5600, "Intel(R) HD Graphics 5600", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD6000, "Intel(R) HD Graphics 6000", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I6100, "Intel(R) Iris(TM) Graphics 6100", DRIVER_INTEL_HD4000, 2048},
|
2016-06-29 00:59:26 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP6200, "Intel(R) Iris(TM) Pro Graphics 6200", DRIVER_INTEL_HD4000, 2048},
|
2016-09-20 23:23:34 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IPP6300, "Intel(R) Iris(TM) Pro Graphics P6300", DRIVER_INTEL_HD4000, 2048},
|
2016-10-14 00:03:35 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD510_1, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD510_2, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD510_3, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD515, "Intel(R) HD Graphics 515", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD520_1, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD520_2, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000, 2048},
|
2016-06-04 22:07:01 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD530_1, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD530_2, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000, 2048},
|
2016-10-14 00:03:35 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HDP530, "Intel(R) HD Graphics P530", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I540, "Intel(R) Iris(TM) Graphics 540", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I550, "Intel(R) Iris(TM) Graphics 550", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_I555, "Intel(R) Iris(TM) Graphics 555", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP555, "Intel(R) Iris(TM) Graphics P555", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP580_1, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IP580_2, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IPP580_1, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000, 2048},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_IPP580_2, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000, 2048},
|
2019-08-05 15:55:37 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_UHD617, "Intel(R) UHD Graphics 617", DRIVER_INTEL_HD4000, 2048},
|
2019-09-26 15:21:47 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_UHD620, "Intel(R) UHD Graphics 620", DRIVER_INTEL_HD4000, 3072},
|
2019-11-29 18:46:56 +01:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD615, "Intel(R) HD Graphics 615", DRIVER_INTEL_HD4000, 2048},
|
2019-02-27 16:39:42 +01:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD620, "Intel(R) HD Graphics 620", DRIVER_INTEL_HD4000, 3072},
|
2019-08-05 15:55:37 +02:00
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD630_1, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072},
|
|
|
|
{HW_VENDOR_INTEL, CARD_INTEL_HD630_2, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072},
|
2009-07-06 10:08:42 +02:00
|
|
|
};
|
|
|
|
|
2010-07-31 03:02:01 +02:00
|
|
|
static const struct driver_version_information *get_driver_version_info(enum wined3d_display_driver driver,
|
|
|
|
enum wined3d_driver_model driver_model)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
TRACE("Looking up version info for driver %#x, driver_model %#x.\n", driver, driver_model);
|
|
|
|
|
2017-10-19 10:07:29 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(driver_version_table); ++i)
|
2010-07-31 03:02:01 +02:00
|
|
|
{
|
|
|
|
const struct driver_version_information *entry = &driver_version_table[i];
|
|
|
|
|
2016-10-14 00:03:36 +02:00
|
|
|
if (entry->driver == driver && (driver_model == DRIVER_MODEL_GENERIC
|
|
|
|
|| entry->driver_model == driver_model))
|
2010-07-31 03:02:01 +02:00
|
|
|
{
|
2020-07-14 14:10:33 +02:00
|
|
|
TRACE("Found driver \"%s\", subversion %u, build %u.\n",
|
|
|
|
entry->driver_name, entry->subversion, entry->build);
|
2010-07-31 03:02:01 +02:00
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
const struct wined3d_gpu_description *wined3d_get_gpu_description(enum wined3d_pci_vendor vendor,
|
2014-04-22 09:02:16 +02:00
|
|
|
enum wined3d_pci_device device)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
2017-10-19 10:07:29 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(gpu_description_table); ++i)
|
2014-04-22 09:02:16 +02:00
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
if (vendor == gpu_description_table[i].vendor && device == gpu_description_table[i].device)
|
2014-04-22 09:02:16 +02:00
|
|
|
return &gpu_description_table[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-04-30 13:06:37 +02:00
|
|
|
const struct wined3d_gpu_description *wined3d_get_user_override_gpu_description(enum wined3d_pci_vendor vendor,
|
|
|
|
enum wined3d_pci_device device)
|
|
|
|
{
|
|
|
|
const struct wined3d_gpu_description *gpu_desc;
|
|
|
|
static unsigned int once;
|
|
|
|
|
|
|
|
if (wined3d_settings.pci_vendor_id == PCI_VENDOR_NONE && wined3d_settings.pci_device_id == PCI_DEVICE_NONE)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (wined3d_settings.pci_vendor_id != PCI_VENDOR_NONE)
|
|
|
|
{
|
|
|
|
vendor = wined3d_settings.pci_vendor_id;
|
|
|
|
TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor);
|
|
|
|
}
|
|
|
|
if (wined3d_settings.pci_device_id != PCI_DEVICE_NONE)
|
|
|
|
{
|
|
|
|
device = wined3d_settings.pci_device_id;
|
|
|
|
TRACE("Overriding device PCI ID with 0x%04x.\n", device);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(gpu_desc = wined3d_get_gpu_description(vendor, device)) && !once++)
|
|
|
|
ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor, device);
|
|
|
|
|
|
|
|
return gpu_desc;
|
|
|
|
}
|
|
|
|
|
2019-04-30 13:06:38 +02:00
|
|
|
static void wined3d_copy_name(char *dst, const char *src, unsigned int dst_size)
|
|
|
|
{
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
if (dst_size)
|
|
|
|
{
|
|
|
|
len = min(strlen(src), dst_size - 1);
|
|
|
|
memcpy(dst, src, len);
|
|
|
|
memset(&dst[len], 0, dst_size - len);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-22 19:00:55 +02:00
|
|
|
bool wined3d_driver_info_init(struct wined3d_driver_info *driver_info,
|
2020-07-14 14:10:33 +02:00
|
|
|
const struct wined3d_gpu_description *gpu_desc, enum wined3d_feature_level feature_level,
|
|
|
|
UINT64 vram_bytes, UINT64 sysmem_bytes)
|
2016-03-15 16:55:14 +01:00
|
|
|
{
|
2018-11-21 10:13:22 +01:00
|
|
|
const struct driver_version_information *version_info;
|
2020-07-14 14:10:33 +02:00
|
|
|
WORD driver_os_version, driver_feature_level = 10;
|
2018-11-21 10:13:22 +01:00
|
|
|
enum wined3d_driver_model driver_model;
|
|
|
|
enum wined3d_display_driver driver;
|
|
|
|
MEMORYSTATUSEX memory_status;
|
2016-03-15 16:55:14 +01:00
|
|
|
OSVERSIONINFOW os_version;
|
2010-09-11 03:59:47 +02:00
|
|
|
|
2009-11-12 10:26:53 +01:00
|
|
|
memset(&os_version, 0, sizeof(os_version));
|
|
|
|
os_version.dwOSVersionInfoSize = sizeof(os_version);
|
|
|
|
if (!GetVersionExW(&os_version))
|
|
|
|
{
|
|
|
|
ERR("Failed to get OS version, reporting 2000/XP.\n");
|
|
|
|
driver_os_version = 6;
|
2010-07-31 03:02:01 +02:00
|
|
|
driver_model = DRIVER_MODEL_NT5X;
|
2009-11-12 10:26:53 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("OS version %u.%u.\n", os_version.dwMajorVersion, os_version.dwMinorVersion);
|
|
|
|
switch (os_version.dwMajorVersion)
|
|
|
|
{
|
2019-06-27 13:32:10 +02:00
|
|
|
case 2:
|
|
|
|
case 3:
|
2009-11-12 10:26:53 +01:00
|
|
|
case 4:
|
2010-07-31 03:02:01 +02:00
|
|
|
/* If needed we could distinguish between 9x and NT4, but this code won't make
|
|
|
|
* sense for NT4 since it had no way to obtain this info through DirectDraw 3.0.
|
|
|
|
*/
|
2009-11-12 10:26:53 +01:00
|
|
|
driver_os_version = 4;
|
2010-07-31 03:02:01 +02:00
|
|
|
driver_model = DRIVER_MODEL_WIN9X;
|
2009-11-12 10:26:53 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
driver_os_version = 6;
|
2010-07-31 03:02:01 +02:00
|
|
|
driver_model = DRIVER_MODEL_NT5X;
|
2009-11-12 10:26:53 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
if (os_version.dwMinorVersion == 0)
|
|
|
|
{
|
|
|
|
driver_os_version = 7;
|
2010-07-31 03:02:01 +02:00
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
2009-11-12 10:26:53 +01:00
|
|
|
}
|
2013-04-03 22:23:23 +02:00
|
|
|
else if (os_version.dwMinorVersion == 1)
|
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_os_version = 8;
|
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
|
|
|
}
|
2020-07-14 14:10:32 +02:00
|
|
|
else if (os_version.dwMinorVersion == 2)
|
|
|
|
{
|
|
|
|
driver_os_version = 9;
|
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
|
|
|
}
|
2018-08-17 16:54:09 +02:00
|
|
|
else
|
|
|
|
{
|
2019-06-26 12:36:23 +02:00
|
|
|
if (os_version.dwMinorVersion > 3)
|
2018-08-17 16:54:09 +02:00
|
|
|
{
|
2020-07-14 14:10:32 +02:00
|
|
|
FIXME("Unhandled OS version %u.%u, reporting Windows 8.1.\n",
|
2018-08-17 16:54:09 +02:00
|
|
|
os_version.dwMajorVersion, os_version.dwMinorVersion);
|
|
|
|
}
|
2020-07-14 14:10:32 +02:00
|
|
|
driver_os_version = 10;
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
|
|
|
}
|
|
|
|
break;
|
2012-07-17 11:40:38 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
case 10:
|
2020-07-14 14:10:32 +02:00
|
|
|
driver_os_version = 26;
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
|
|
|
break;
|
2012-07-17 11:40:38 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
default:
|
2019-06-27 23:24:28 +02:00
|
|
|
FIXME("Unhandled OS version %u.%u, reporting Windows 7.\n",
|
2018-08-17 16:54:09 +02:00
|
|
|
os_version.dwMajorVersion, os_version.dwMinorVersion);
|
2019-06-27 23:24:28 +02:00
|
|
|
driver_os_version = 8;
|
|
|
|
driver_model = DRIVER_MODEL_NT6X;
|
2018-08-17 16:54:09 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-07-17 11:40:38 +02:00
|
|
|
}
|
|
|
|
|
2020-07-14 14:10:33 +02:00
|
|
|
TRACE("GPU maximum feature level %#x.\n", feature_level);
|
|
|
|
switch (feature_level)
|
|
|
|
{
|
|
|
|
case WINED3D_FEATURE_LEVEL_NONE:
|
|
|
|
case WINED3D_FEATURE_LEVEL_5:
|
|
|
|
if (driver_model == DRIVER_MODEL_WIN9X)
|
|
|
|
driver_feature_level = 5;
|
|
|
|
else
|
|
|
|
driver_feature_level = 10;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_6:
|
|
|
|
driver_feature_level = 11;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_7:
|
|
|
|
driver_feature_level = 12;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_8:
|
|
|
|
driver_feature_level = 13;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_9_1:
|
|
|
|
case WINED3D_FEATURE_LEVEL_9_2:
|
|
|
|
case WINED3D_FEATURE_LEVEL_9_3:
|
|
|
|
driver_feature_level = 14;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_10:
|
|
|
|
driver_feature_level = 15;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_10_1:
|
|
|
|
driver_feature_level = 16;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_11:
|
|
|
|
driver_feature_level = 17;
|
|
|
|
break;
|
|
|
|
case WINED3D_FEATURE_LEVEL_11_1:
|
|
|
|
/* Advertise support for everything up to FL 12_x. */
|
|
|
|
driver_feature_level = 21;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (os_version.dwMajorVersion == 6 && !os_version.dwMinorVersion)
|
|
|
|
driver_feature_level = min(driver_feature_level, 18);
|
|
|
|
else if (os_version.dwMajorVersion < 6)
|
|
|
|
driver_feature_level = min(driver_feature_level, 14);
|
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_info->vendor = gpu_desc->vendor;
|
|
|
|
driver_info->device = gpu_desc->device;
|
2019-04-30 13:06:39 +02:00
|
|
|
wined3d_copy_name(driver_info->description, gpu_desc->description, ARRAY_SIZE(driver_info->description));
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024;
|
|
|
|
driver = gpu_desc->driver;
|
|
|
|
|
2018-09-18 00:31:18 +02:00
|
|
|
if (wined3d_settings.emulated_textureram)
|
|
|
|
{
|
|
|
|
driver_info->vram_bytes = wined3d_settings.emulated_textureram;
|
|
|
|
TRACE("Overriding amount of video memory with 0x%s bytes.\n",
|
|
|
|
wine_dbgstr_longlong(driver_info->vram_bytes));
|
|
|
|
}
|
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/**
|
|
|
|
* Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff.
|
|
|
|
* In order to avoid this application bug we limit the amount of video memory
|
|
|
|
* to LONG_MAX for older Windows versions.
|
|
|
|
*/
|
|
|
|
if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX)
|
2016-05-26 00:08:27 +02:00
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
|
|
|
|
driver_info->vram_bytes = LONG_MAX;
|
2016-05-26 00:08:27 +02:00
|
|
|
}
|
|
|
|
|
2019-05-07 11:03:37 +02:00
|
|
|
if (!(driver_info->sysmem_bytes = sysmem_bytes))
|
|
|
|
{
|
|
|
|
driver_info->sysmem_bytes = 64 * 1024 * 1024;
|
|
|
|
memory_status.dwLength = sizeof(memory_status);
|
|
|
|
if (GlobalMemoryStatusEx(&memory_status))
|
|
|
|
driver_info->sysmem_bytes = max(memory_status.ullTotalPhys / 2, driver_info->sysmem_bytes);
|
|
|
|
else
|
|
|
|
ERR("Failed to get global memory status.\n");
|
|
|
|
}
|
2018-11-21 10:13:22 +01:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
/* Try to obtain driver version information for the current Windows version. This fails in
|
|
|
|
* some cases:
|
|
|
|
* - the gpu is not available on the currently selected OS version:
|
|
|
|
* - Geforce GTX480 on Win98. When running applications in compatibility mode on Windows,
|
|
|
|
* version information for the current Windows version is returned instead of faked info.
|
|
|
|
* We do the same and assume the default Windows version to emulate is WinXP.
|
|
|
|
*
|
|
|
|
* - Videocard is a Riva TNT but winver is set to win7 (there are no drivers for this beast)
|
|
|
|
* For now return the XP driver info. Perhaps later on we should return VESA.
|
|
|
|
*
|
|
|
|
* - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id)
|
|
|
|
* This could be an indication that our database is not up to date, so this should be fixed.
|
|
|
|
*/
|
|
|
|
if ((version_info = get_driver_version_info(driver, driver_model))
|
|
|
|
|| (version_info = get_driver_version_info(driver, DRIVER_MODEL_GENERIC)))
|
2009-09-23 10:05:55 +02:00
|
|
|
{
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_info->name = version_info->driver_name;
|
2020-07-14 14:10:33 +02:00
|
|
|
driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, driver_feature_level);
|
2018-08-17 16:54:09 +02:00
|
|
|
driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build);
|
2020-07-22 19:00:55 +02:00
|
|
|
|
|
|
|
return true;
|
2009-09-23 10:05:55 +02:00
|
|
|
}
|
2020-07-22 19:00:55 +02:00
|
|
|
|
|
|
|
ERR("No driver version info found for device %04x:%04x, driver model %#x.\n",
|
|
|
|
driver_info->vendor, driver_info->device, driver_model);
|
|
|
|
return false;
|
2018-08-17 16:54:09 +02:00
|
|
|
}
|
2006-09-26 20:31:48 +02:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor *vendor,
|
|
|
|
enum wined3d_feature_level feature_level)
|
|
|
|
{
|
2018-09-24 01:09:29 +02:00
|
|
|
static const struct wined3d_fallback_card
|
|
|
|
{
|
|
|
|
enum wined3d_feature_level feature_level;
|
|
|
|
enum wined3d_pci_device device_id;
|
|
|
|
}
|
|
|
|
card_fallback_nvidia[] =
|
2015-07-10 00:06:19 +02:00
|
|
|
{
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_5, CARD_NVIDIA_RIVA_128},
|
|
|
|
{WINED3D_FEATURE_LEVEL_6, CARD_NVIDIA_RIVA_TNT},
|
|
|
|
{WINED3D_FEATURE_LEVEL_7, CARD_NVIDIA_GEFORCE},
|
|
|
|
{WINED3D_FEATURE_LEVEL_8, CARD_NVIDIA_GEFORCE3},
|
2019-05-20 18:49:49 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_9_2, CARD_NVIDIA_GEFORCEFX_5800},
|
|
|
|
{WINED3D_FEATURE_LEVEL_9_3, CARD_NVIDIA_GEFORCE_6800},
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_10, CARD_NVIDIA_GEFORCE_8800GTX},
|
|
|
|
{WINED3D_FEATURE_LEVEL_11, CARD_NVIDIA_GEFORCE_GTX470},
|
|
|
|
{WINED3D_FEATURE_LEVEL_NONE},
|
2018-08-17 16:54:09 +02:00
|
|
|
},
|
|
|
|
card_fallback_amd[] =
|
|
|
|
{
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_5, CARD_AMD_RAGE_128PRO},
|
|
|
|
{WINED3D_FEATURE_LEVEL_7, CARD_AMD_RADEON_7200},
|
|
|
|
{WINED3D_FEATURE_LEVEL_8, CARD_AMD_RADEON_8500},
|
2019-05-20 18:49:49 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_9_1, CARD_AMD_RADEON_9500},
|
|
|
|
{WINED3D_FEATURE_LEVEL_9_3, CARD_AMD_RADEON_X1600},
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_10, CARD_AMD_RADEON_HD2900},
|
|
|
|
{WINED3D_FEATURE_LEVEL_11, CARD_AMD_RADEON_HD5600},
|
|
|
|
{WINED3D_FEATURE_LEVEL_NONE},
|
2018-08-17 16:54:09 +02:00
|
|
|
},
|
|
|
|
card_fallback_intel[] =
|
|
|
|
{
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_5, CARD_INTEL_845G},
|
|
|
|
{WINED3D_FEATURE_LEVEL_8, CARD_INTEL_915G},
|
2019-05-20 18:49:49 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_9_3, CARD_INTEL_945G},
|
2018-09-24 01:09:29 +02:00
|
|
|
{WINED3D_FEATURE_LEVEL_10, CARD_INTEL_G45},
|
|
|
|
{WINED3D_FEATURE_LEVEL_11, CARD_INTEL_IVBD},
|
|
|
|
{WINED3D_FEATURE_LEVEL_NONE},
|
2018-08-17 16:54:09 +02:00
|
|
|
};
|
2016-03-15 16:55:14 +01:00
|
|
|
|
2018-08-17 16:54:09 +02:00
|
|
|
static const struct
|
2016-03-15 16:55:14 +01:00
|
|
|
{
|
|
|
|
enum wined3d_pci_vendor vendor;
|
2018-09-24 01:09:29 +02:00
|
|
|
const struct wined3d_fallback_card *cards;
|
2018-08-17 16:54:09 +02:00
|
|
|
}
|
|
|
|
fallbacks[] =
|
|
|
|
{
|
|
|
|
{HW_VENDOR_AMD, card_fallback_amd},
|
|
|
|
{HW_VENDOR_NVIDIA, card_fallback_nvidia},
|
|
|
|
{HW_VENDOR_VMWARE, card_fallback_amd},
|
|
|
|
{HW_VENDOR_INTEL, card_fallback_intel},
|
|
|
|
};
|
2016-03-15 16:55:14 +01:00
|
|
|
|
2018-09-24 01:09:29 +02:00
|
|
|
const struct wined3d_fallback_card *cards;
|
|
|
|
enum wined3d_pci_device device_id;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
cards = NULL;
|
2018-08-17 16:54:09 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(fallbacks); ++i)
|
|
|
|
{
|
|
|
|
if (*vendor == fallbacks[i].vendor)
|
2018-09-24 01:09:29 +02:00
|
|
|
cards = fallbacks[i].cards;
|
|
|
|
}
|
|
|
|
if (!cards)
|
|
|
|
{
|
|
|
|
*vendor = HW_VENDOR_NVIDIA;
|
|
|
|
cards = card_fallback_nvidia;
|
2016-03-15 16:55:14 +01:00
|
|
|
}
|
|
|
|
|
2018-09-24 01:09:29 +02:00
|
|
|
device_id = cards->device_id;
|
|
|
|
for (i = 0; cards[i].feature_level; ++i)
|
|
|
|
{
|
|
|
|
if (feature_level >= cards[i].feature_level)
|
|
|
|
device_id = cards[i].device_id;
|
|
|
|
}
|
|
|
|
return device_id;
|
2004-09-29 23:26:47 +02:00
|
|
|
}
|
|
|
|
|
2020-03-03 15:17:46 +01:00
|
|
|
struct wined3d_adapter * CDECL wined3d_get_adapter(const struct wined3d *wined3d, unsigned int idx)
|
|
|
|
{
|
|
|
|
TRACE("wined3d %p, idx %u.\n", wined3d, idx);
|
|
|
|
|
|
|
|
if (idx >= wined3d->adapter_count)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return wined3d->adapters[idx];
|
|
|
|
}
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
UINT CDECL wined3d_get_adapter_count(const struct wined3d *wined3d)
|
|
|
|
{
|
2012-06-22 15:57:31 +02:00
|
|
|
TRACE("wined3d %p, reporting %u adapters.\n",
|
2011-02-01 19:39:53 +01:00
|
|
|
wined3d, wined3d->adapter_count);
|
2009-03-11 10:15:09 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
return wined3d->adapter_count;
|
2004-09-23 06:34:27 +02:00
|
|
|
}
|
|
|
|
|
2020-03-03 15:18:14 +01:00
|
|
|
struct wined3d_output * CDECL wined3d_adapter_get_output(const struct wined3d_adapter *adapter,
|
|
|
|
unsigned int idx)
|
|
|
|
{
|
|
|
|
TRACE("adapter %p, idx %u.\n", adapter, idx);
|
|
|
|
|
|
|
|
if (idx >= adapter->output_count)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return &adapter->outputs[idx];
|
|
|
|
}
|
|
|
|
|
2020-03-03 15:18:00 +01:00
|
|
|
unsigned int CDECL wined3d_adapter_get_output_count(const struct wined3d_adapter *adapter)
|
|
|
|
{
|
|
|
|
TRACE("adapter %p, reporting %u outputs.\n", adapter, adapter->output_count);
|
|
|
|
|
|
|
|
return adapter->output_count;
|
|
|
|
}
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
HRESULT CDECL wined3d_register_software_device(struct wined3d *wined3d, void *init_function)
|
2009-12-21 23:17:26 +01:00
|
|
|
{
|
2011-02-01 19:39:53 +01:00
|
|
|
FIXME("wined3d %p, init_function %p stub!\n", wined3d, init_function);
|
2009-12-21 23:17:26 +01:00
|
|
|
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
|
|
|
|
2020-03-25 10:50:59 +01:00
|
|
|
static BOOL CALLBACK enum_monitor_proc(HMONITOR monitor, HDC hdc, RECT *rect, LPARAM lparam)
|
|
|
|
{
|
|
|
|
struct wined3d_output_desc *desc = (struct wined3d_output_desc *)lparam;
|
|
|
|
MONITORINFOEXW monitor_info;
|
|
|
|
|
|
|
|
monitor_info.cbSize = sizeof(monitor_info);
|
|
|
|
if (GetMonitorInfoW(monitor, (MONITORINFO *)&monitor_info) &&
|
|
|
|
!lstrcmpiW(desc->device_name, monitor_info.szDevice))
|
|
|
|
{
|
|
|
|
desc->monitor = monitor;
|
|
|
|
desc->desktop_rect = monitor_info.rcMonitor;
|
|
|
|
desc->attached_to_desktop = TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2020-03-19 10:07:30 +01:00
|
|
|
HRESULT CDECL wined3d_output_get_desc(const struct wined3d_output *output,
|
2015-11-24 18:06:17 +01:00
|
|
|
struct wined3d_output_desc *desc)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
2020-03-19 10:07:30 +01:00
|
|
|
TRACE("output %p, desc %p.\n", output, desc);
|
2008-08-24 23:43:26 +02:00
|
|
|
|
2020-03-25 10:50:59 +01:00
|
|
|
memset(desc, 0, sizeof(*desc));
|
2020-03-19 10:07:46 +01:00
|
|
|
desc->ordinal = output->ordinal;
|
2020-03-25 10:50:59 +01:00
|
|
|
lstrcpyW(desc->device_name, output->device_name);
|
|
|
|
EnumDisplayMonitors(NULL, NULL, enum_monitor_proc, (LPARAM)desc);
|
2020-11-23 16:56:52 +01:00
|
|
|
return WINED3D_OK;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
|
|
|
|
2005-07-13 16:15:54 +02:00
|
|
|
/* FIXME: GetAdapterModeCount and EnumAdapterModes currently only returns modes
|
2004-09-28 04:12:12 +02:00
|
|
|
of the same bpp but different resolutions */
|
|
|
|
|
2006-10-11 03:51:13 +02:00
|
|
|
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
|
2020-03-05 16:03:40 +01:00
|
|
|
unsigned int CDECL wined3d_output_get_mode_count(const struct wined3d_output *output,
|
2012-06-29 07:37:57 +02:00
|
|
|
enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering)
|
2010-08-23 18:28:10 +02:00
|
|
|
{
|
2012-06-28 13:11:13 +02:00
|
|
|
const struct wined3d_adapter *adapter;
|
|
|
|
const struct wined3d_format *format;
|
|
|
|
unsigned int i = 0;
|
|
|
|
unsigned int j = 0;
|
|
|
|
UINT format_bits;
|
|
|
|
DEVMODEW mode;
|
|
|
|
|
2020-03-05 16:03:40 +01:00
|
|
|
TRACE("output %p, format %s, scanline_ordering %#x.\n",
|
|
|
|
output, debug_d3dformat(format_id), scanline_ordering);
|
2010-08-23 18:28:10 +02:00
|
|
|
|
2020-03-05 16:03:40 +01:00
|
|
|
adapter = output->adapter;
|
2018-10-31 10:31:50 +01:00
|
|
|
format = wined3d_get_format(adapter, format_id, WINED3D_BIND_RENDER_TARGET);
|
2012-06-28 13:11:13 +02:00
|
|
|
format_bits = format->byte_count * CHAR_BIT;
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2012-06-28 13:11:13 +02:00
|
|
|
memset(&mode, 0, sizeof(mode));
|
|
|
|
mode.dmSize = sizeof(mode);
|
2007-02-23 09:27:42 +01:00
|
|
|
|
2020-03-05 16:03:40 +01:00
|
|
|
while (EnumDisplaySettingsExW(output->device_name, j++, &mode, 0))
|
2012-06-28 13:11:13 +02:00
|
|
|
{
|
2012-06-29 07:37:57 +02:00
|
|
|
if (mode.dmFields & DM_DISPLAYFLAGS)
|
|
|
|
{
|
|
|
|
if (scanline_ordering == WINED3D_SCANLINE_ORDERING_PROGRESSIVE
|
|
|
|
&& (mode.u2.dmDisplayFlags & DM_INTERLACED))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED
|
|
|
|
&& !(mode.u2.dmDisplayFlags & DM_INTERLACED))
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-06-28 13:11:13 +02:00
|
|
|
if (format_id == WINED3DFMT_UNKNOWN)
|
2009-06-22 10:15:59 +02:00
|
|
|
{
|
2012-06-28 13:11:13 +02:00
|
|
|
/* This is for d3d8, do not enumerate P8 here. */
|
|
|
|
if (mode.dmBitsPerPel == 32 || mode.dmBitsPerPel == 16) ++i;
|
|
|
|
}
|
|
|
|
else if (mode.dmBitsPerPel == format_bits)
|
|
|
|
{
|
|
|
|
++i;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
2011-02-01 19:39:53 +01:00
|
|
|
}
|
|
|
|
|
2020-03-05 16:03:40 +01:00
|
|
|
TRACE("Returning %u matching modes (out of %u total) for output %p.\n", i, j, output);
|
2012-06-28 13:11:13 +02:00
|
|
|
|
|
|
|
return i;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
|
|
|
|
2006-10-11 03:51:13 +02:00
|
|
|
/* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
|
2020-03-05 16:03:23 +01:00
|
|
|
HRESULT CDECL wined3d_output_get_mode(const struct wined3d_output *output,
|
2012-07-02 14:45:56 +02:00
|
|
|
enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering,
|
2020-03-05 16:03:23 +01:00
|
|
|
unsigned int mode_idx, struct wined3d_display_mode *mode)
|
2010-08-23 18:28:10 +02:00
|
|
|
{
|
2012-06-28 13:11:12 +02:00
|
|
|
const struct wined3d_adapter *adapter;
|
|
|
|
const struct wined3d_format *format;
|
|
|
|
UINT format_bits;
|
|
|
|
DEVMODEW m;
|
|
|
|
UINT i = 0;
|
|
|
|
int j = 0;
|
|
|
|
|
2020-03-05 16:03:23 +01:00
|
|
|
TRACE("output %p, format %s, scanline_ordering %#x, mode_idx %u, mode %p.\n",
|
|
|
|
output, debug_d3dformat(format_id), scanline_ordering, mode_idx, mode);
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2020-03-05 16:03:23 +01:00
|
|
|
if (!mode)
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3DERR_INVALIDCALL;
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2020-03-05 16:03:23 +01:00
|
|
|
adapter = output->adapter;
|
2018-10-31 10:31:50 +01:00
|
|
|
format = wined3d_get_format(adapter, format_id, WINED3D_BIND_RENDER_TARGET);
|
2012-06-28 13:11:12 +02:00
|
|
|
format_bits = format->byte_count * CHAR_BIT;
|
2005-07-13 16:15:54 +02:00
|
|
|
|
2012-06-28 13:11:12 +02:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.dmSize = sizeof(m);
|
2007-08-05 19:50:45 +02:00
|
|
|
|
2012-06-28 13:11:12 +02:00
|
|
|
while (i <= mode_idx)
|
|
|
|
{
|
2020-03-05 16:03:23 +01:00
|
|
|
if (!EnumDisplaySettingsExW(output->device_name, j++, &m, 0))
|
2009-12-09 20:32:09 +01:00
|
|
|
{
|
2012-06-28 13:11:12 +02:00
|
|
|
WARN("Invalid mode_idx %u.\n", mode_idx);
|
|
|
|
return WINED3DERR_INVALIDCALL;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
|
|
|
|
2012-07-02 14:45:56 +02:00
|
|
|
if (m.dmFields & DM_DISPLAYFLAGS)
|
|
|
|
{
|
|
|
|
if (scanline_ordering == WINED3D_SCANLINE_ORDERING_PROGRESSIVE
|
|
|
|
&& (m.u2.dmDisplayFlags & DM_INTERLACED))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED
|
|
|
|
&& !(m.u2.dmDisplayFlags & DM_INTERLACED))
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-06-28 13:11:11 +02:00
|
|
|
if (format_id == WINED3DFMT_UNKNOWN)
|
2012-06-28 13:11:12 +02:00
|
|
|
{
|
|
|
|
/* This is for d3d8, do not enumerate P8 here. */
|
|
|
|
if (m.dmBitsPerPel == 32 || m.dmBitsPerPel == 16) ++i;
|
|
|
|
}
|
|
|
|
else if (m.dmBitsPerPel == format_bits)
|
|
|
|
{
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2012-06-28 13:11:12 +02:00
|
|
|
mode->width = m.dmPelsWidth;
|
|
|
|
mode->height = m.dmPelsHeight;
|
|
|
|
mode->refresh_rate = DEFAULT_REFRESH_RATE;
|
|
|
|
if (m.dmFields & DM_DISPLAYFREQUENCY)
|
|
|
|
mode->refresh_rate = m.dmDisplayFrequency;
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2012-06-28 13:11:12 +02:00
|
|
|
if (format_id == WINED3DFMT_UNKNOWN)
|
|
|
|
mode->format_id = pixelformat_for_depth(m.dmBitsPerPel);
|
2009-06-22 10:15:59 +02:00
|
|
|
else
|
2012-06-28 13:11:12 +02:00
|
|
|
mode->format_id = format_id;
|
|
|
|
|
|
|
|
if (!(m.dmFields & DM_DISPLAYFLAGS))
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
|
|
|
|
else if (m.u2.dmDisplayFlags & DM_INTERLACED)
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_INTERLACED;
|
|
|
|
else
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_PROGRESSIVE;
|
|
|
|
|
|
|
|
TRACE("%ux%u@%u %u bpp, %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
|
|
|
|
m.dmBitsPerPel, debug_d3dformat(mode->format_id), mode->scanline_ordering);
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
|
|
|
|
2020-03-06 14:16:48 +01:00
|
|
|
HRESULT CDECL wined3d_output_find_closest_matching_mode(const struct wined3d_output *output,
|
|
|
|
struct wined3d_display_mode *mode)
|
2016-08-25 12:22:51 +02:00
|
|
|
{
|
|
|
|
unsigned int i, j, mode_count, matching_mode_count, closest;
|
|
|
|
struct wined3d_display_mode **matching_modes;
|
|
|
|
struct wined3d_display_mode *modes;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2020-03-06 14:16:48 +01:00
|
|
|
TRACE("output %p, mode %p.\n", output, mode);
|
2016-08-25 12:22:51 +02:00
|
|
|
|
2020-03-06 14:16:48 +01:00
|
|
|
if (!(mode_count = wined3d_output_get_mode_count(output, mode->format_id,
|
|
|
|
WINED3D_SCANLINE_ORDERING_UNKNOWN)))
|
2016-08-25 12:22:51 +02:00
|
|
|
{
|
2020-03-05 16:03:40 +01:00
|
|
|
WARN("Output has 0 matching modes.\n");
|
2016-08-25 12:22:51 +02:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2018-02-14 07:39:59 +01:00
|
|
|
if (!(modes = heap_calloc(mode_count, sizeof(*modes))))
|
2016-08-25 12:22:51 +02:00
|
|
|
return E_OUTOFMEMORY;
|
2018-02-14 07:39:59 +01:00
|
|
|
if (!(matching_modes = heap_calloc(mode_count, sizeof(*matching_modes))))
|
2016-08-25 12:22:51 +02:00
|
|
|
{
|
2018-02-14 07:39:59 +01:00
|
|
|
heap_free(modes);
|
2016-08-25 12:22:51 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < mode_count; ++i)
|
|
|
|
{
|
2020-03-06 14:16:48 +01:00
|
|
|
if (FAILED(hr = wined3d_output_get_mode(output, mode->format_id,
|
|
|
|
WINED3D_SCANLINE_ORDERING_UNKNOWN, i, &modes[i])))
|
2016-08-25 12:22:51 +02:00
|
|
|
{
|
2018-02-14 07:39:59 +01:00
|
|
|
heap_free(matching_modes);
|
|
|
|
heap_free(modes);
|
2016-08-25 12:22:51 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
matching_modes[i] = &modes[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
matching_mode_count = mode_count;
|
|
|
|
|
|
|
|
if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
|
|
|
|
{
|
|
|
|
for (i = 0, j = 0; i < matching_mode_count; ++i)
|
|
|
|
{
|
|
|
|
if (matching_modes[i]->scanline_ordering == mode->scanline_ordering)
|
|
|
|
matching_modes[j++] = matching_modes[i];
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
matching_mode_count = j;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode->refresh_rate)
|
|
|
|
{
|
|
|
|
for (i = 0, j = 0; i < matching_mode_count; ++i)
|
|
|
|
{
|
|
|
|
if (matching_modes[i]->refresh_rate == mode->refresh_rate)
|
|
|
|
matching_modes[j++] = matching_modes[i];
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
matching_mode_count = j;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!mode->width || !mode->height)
|
|
|
|
{
|
|
|
|
struct wined3d_display_mode current_mode;
|
2020-03-06 14:16:48 +01:00
|
|
|
if (FAILED(hr = wined3d_output_get_display_mode(output, ¤t_mode, NULL)))
|
2016-08-25 12:22:51 +02:00
|
|
|
{
|
2018-02-14 07:39:59 +01:00
|
|
|
heap_free(matching_modes);
|
|
|
|
heap_free(modes);
|
2016-08-25 12:22:51 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
mode->width = current_mode.width;
|
|
|
|
mode->height = current_mode.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
closest = ~0u;
|
|
|
|
for (i = 0, j = 0; i < matching_mode_count; ++i)
|
|
|
|
{
|
|
|
|
unsigned int d = abs(mode->width - matching_modes[i]->width)
|
|
|
|
+ abs(mode->height - matching_modes[i]->height);
|
|
|
|
|
|
|
|
if (closest > d)
|
|
|
|
{
|
|
|
|
closest = d;
|
|
|
|
j = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*mode = *matching_modes[j];
|
|
|
|
|
2018-02-14 07:39:59 +01:00
|
|
|
heap_free(matching_modes);
|
|
|
|
heap_free(modes);
|
2016-08-25 12:22:51 +02:00
|
|
|
|
|
|
|
TRACE("Returning %ux%u@%u %s %#x.\n", mode->width, mode->height,
|
|
|
|
mode->refresh_rate, debug_d3dformat(mode->format_id),
|
|
|
|
mode->scanline_ordering);
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2020-03-09 08:41:17 +01:00
|
|
|
struct wined3d_adapter * CDECL wined3d_output_get_adapter(const struct wined3d_output *output)
|
|
|
|
{
|
|
|
|
TRACE("output %p.\n", output);
|
|
|
|
|
|
|
|
return output->adapter;
|
|
|
|
}
|
|
|
|
|
2020-03-06 14:16:29 +01:00
|
|
|
HRESULT CDECL wined3d_output_get_display_mode(const struct wined3d_output *output,
|
2012-06-27 19:02:28 +02:00
|
|
|
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
|
2009-12-21 23:17:26 +01:00
|
|
|
{
|
2012-06-29 07:37:53 +02:00
|
|
|
DEVMODEW m;
|
2012-06-20 17:45:14 +02:00
|
|
|
|
2020-03-06 14:16:29 +01:00
|
|
|
TRACE("output %p, display_mode %p, rotation %p.\n", output, mode, rotation);
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2020-03-06 14:16:29 +01:00
|
|
|
if (!mode)
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3DERR_INVALIDCALL;
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2012-06-29 07:37:53 +02:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.dmSize = sizeof(m);
|
2007-08-05 19:50:45 +02:00
|
|
|
|
2020-03-06 14:16:29 +01:00
|
|
|
EnumDisplaySettingsExW(output->device_name, ENUM_CURRENT_SETTINGS, &m, 0);
|
2012-06-29 07:37:53 +02:00
|
|
|
mode->width = m.dmPelsWidth;
|
|
|
|
mode->height = m.dmPelsHeight;
|
|
|
|
mode->refresh_rate = DEFAULT_REFRESH_RATE;
|
|
|
|
if (m.dmFields & DM_DISPLAYFREQUENCY)
|
|
|
|
mode->refresh_rate = m.dmDisplayFrequency;
|
|
|
|
mode->format_id = pixelformat_for_depth(m.dmBitsPerPel);
|
2012-06-20 17:45:14 +02:00
|
|
|
|
2012-06-29 07:37:53 +02:00
|
|
|
/* Lie about the format. X11 can't change the color depth, and some apps
|
|
|
|
* are pretty angry if they SetDisplayMode from 24 to 16 bpp and find out
|
|
|
|
* that GetDisplayMode still returns 24 bpp. This should probably be
|
|
|
|
* handled in winex11 instead. */
|
2020-03-06 14:16:29 +01:00
|
|
|
if (output->screen_format && output->screen_format != mode->format_id)
|
2012-06-29 07:37:53 +02:00
|
|
|
{
|
|
|
|
WARN("Overriding format %s with stored format %s.\n",
|
|
|
|
debug_d3dformat(mode->format_id),
|
2020-03-06 14:16:29 +01:00
|
|
|
debug_d3dformat(output->screen_format));
|
|
|
|
mode->format_id = output->screen_format;
|
2012-06-29 07:37:53 +02:00
|
|
|
}
|
2012-06-27 19:02:27 +02:00
|
|
|
|
2012-06-29 07:37:53 +02:00
|
|
|
if (!(m.dmFields & DM_DISPLAYFLAGS))
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
|
|
|
|
else if (m.u2.dmDisplayFlags & DM_INTERLACED)
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_INTERLACED;
|
|
|
|
else
|
|
|
|
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_PROGRESSIVE;
|
2012-06-27 19:02:28 +02:00
|
|
|
|
2012-06-29 07:37:53 +02:00
|
|
|
if (rotation)
|
|
|
|
{
|
|
|
|
switch (m.u1.s2.dmDisplayOrientation)
|
2012-06-27 19:02:28 +02:00
|
|
|
{
|
2012-06-29 07:37:53 +02:00
|
|
|
case DMDO_DEFAULT:
|
|
|
|
*rotation = WINED3D_DISPLAY_ROTATION_0;
|
|
|
|
break;
|
|
|
|
case DMDO_90:
|
|
|
|
*rotation = WINED3D_DISPLAY_ROTATION_90;
|
|
|
|
break;
|
|
|
|
case DMDO_180:
|
|
|
|
*rotation = WINED3D_DISPLAY_ROTATION_180;
|
|
|
|
break;
|
|
|
|
case DMDO_270:
|
|
|
|
*rotation = WINED3D_DISPLAY_ROTATION_270;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("Unhandled display rotation %#x.\n", m.u1.s2.dmDisplayOrientation);
|
|
|
|
*rotation = WINED3D_DISPLAY_ROTATION_UNSPECIFIED;
|
|
|
|
break;
|
2012-06-27 19:02:28 +02:00
|
|
|
}
|
2011-02-01 19:39:53 +01:00
|
|
|
}
|
2004-09-28 04:12:12 +02:00
|
|
|
|
2012-06-27 19:02:27 +02:00
|
|
|
TRACE("Returning %ux%u@%u %s %#x.\n", mode->width, mode->height,
|
|
|
|
mode->refresh_rate, debug_d3dformat(mode->format_id),
|
|
|
|
mode->scanline_ordering);
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-09-28 04:12:12 +02:00
|
|
|
}
|
2004-09-23 06:34:27 +02:00
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
static BOOL equal_display_mode(const DEVMODEW *mode1, const DEVMODEW *mode2)
|
2012-06-22 15:57:27 +02:00
|
|
|
{
|
2020-11-02 10:44:57 +01:00
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_PELSWIDTH
|
|
|
|
&& mode1->dmPelsWidth != mode2->dmPelsWidth)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_PELSHEIGHT
|
|
|
|
&& mode1->dmPelsHeight != mode2->dmPelsHeight)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_BITSPERPEL
|
|
|
|
&& mode1->dmBitsPerPel != mode2->dmBitsPerPel)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYFLAGS
|
|
|
|
&& mode1->u2.dmDisplayFlags != mode2->u2.dmDisplayFlags)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYFREQUENCY
|
|
|
|
&& mode1->dmDisplayFrequency != mode2->dmDisplayFrequency)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYORIENTATION
|
|
|
|
&& mode1->u1.s2.dmDisplayOrientation != mode2->u1.s2.dmDisplayOrientation)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (mode1->dmFields & mode2->dmFields & DM_POSITION
|
|
|
|
&& (mode1->u1.s2.dmPosition.x != mode2->u1.s2.dmPosition.x
|
|
|
|
|| mode1->u1.s2.dmPosition.y != mode2->u1.s2.dmPosition.y))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT CDECL wined3d_restore_display_modes(struct wined3d *wined3d)
|
|
|
|
{
|
|
|
|
unsigned int adapter_idx, output_idx = 0;
|
|
|
|
DEVMODEW current_mode, registry_mode;
|
|
|
|
struct wined3d_adapter *adapter;
|
|
|
|
DISPLAY_DEVICEW display_device;
|
|
|
|
struct wined3d_output *output;
|
|
|
|
BOOL do_mode_change = FALSE;
|
2012-06-22 15:57:27 +02:00
|
|
|
LONG ret;
|
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
TRACE("wined3d %p.\n", wined3d);
|
2012-06-22 15:57:27 +02:00
|
|
|
|
2014-11-18 21:26:57 +01:00
|
|
|
memset(¤t_mode, 0, sizeof(current_mode));
|
2020-11-02 10:44:57 +01:00
|
|
|
memset(®istry_mode, 0, sizeof(registry_mode));
|
2014-11-18 21:26:57 +01:00
|
|
|
current_mode.dmSize = sizeof(current_mode);
|
2020-11-02 10:44:57 +01:00
|
|
|
registry_mode.dmSize = sizeof(registry_mode);
|
|
|
|
display_device.cb = sizeof(display_device);
|
|
|
|
while (EnumDisplayDevicesW(NULL, output_idx++, &display_device, 0))
|
2014-11-18 21:26:57 +01:00
|
|
|
{
|
2020-11-02 10:44:57 +01:00
|
|
|
if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_CURRENT_SETTINGS, ¤t_mode, 0))
|
|
|
|
{
|
|
|
|
ERR("Failed to read the current display mode for %s.\n",
|
|
|
|
wine_dbgstr_w(display_device.DeviceName));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2014-11-18 21:26:57 +01:00
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_REGISTRY_SETTINGS, ®istry_mode, 0))
|
|
|
|
{
|
|
|
|
ERR("Failed to read the registry display mode for %s.\n",
|
|
|
|
wine_dbgstr_w(display_device.DeviceName));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2012-06-22 15:57:27 +02:00
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
if (!equal_display_mode(¤t_mode, ®istry_mode))
|
|
|
|
{
|
|
|
|
do_mode_change = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-06-22 15:57:27 +02:00
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
if (do_mode_change)
|
|
|
|
{
|
|
|
|
ret = ChangeDisplaySettingsExW(NULL, NULL, NULL, 0, NULL);
|
|
|
|
if (ret != DISP_CHANGE_SUCCESSFUL)
|
2014-11-18 21:26:57 +01:00
|
|
|
{
|
2020-11-02 10:44:57 +01:00
|
|
|
ERR("Failed to restore all outputs to their registry display settings, error %d.\n", ret);
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
2014-11-18 21:26:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2012-06-27 19:02:27 +02:00
|
|
|
{
|
2020-11-02 10:44:57 +01:00
|
|
|
TRACE("Skipping redundant mode setting call.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (adapter_idx = 0; adapter_idx < wined3d->adapter_count; ++adapter_idx)
|
|
|
|
{
|
|
|
|
adapter = wined3d->adapters[adapter_idx];
|
|
|
|
for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
|
2014-11-18 21:26:57 +01:00
|
|
|
{
|
2020-11-02 10:44:57 +01:00
|
|
|
output = &adapter->outputs[output_idx];
|
|
|
|
|
|
|
|
if (!EnumDisplaySettingsExW(output->device_name, ENUM_CURRENT_SETTINGS, ¤t_mode, 0))
|
|
|
|
{
|
|
|
|
ERR("Failed to read the current display mode for %s.\n",
|
|
|
|
wine_dbgstr_w(output->device_name));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
output->screen_format = pixelformat_for_depth(current_mode.dmBitsPerPel);
|
2014-11-18 21:26:57 +01:00
|
|
|
}
|
2012-06-27 19:02:27 +02:00
|
|
|
}
|
|
|
|
|
2020-11-02 10:44:57 +01:00
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT CDECL wined3d_output_set_display_mode(struct wined3d_output *output,
|
|
|
|
const struct wined3d_display_mode *mode)
|
|
|
|
{
|
|
|
|
enum wined3d_format_id new_format_id;
|
|
|
|
const struct wined3d_format *format;
|
|
|
|
DEVMODEW new_mode, current_mode;
|
|
|
|
LONG ret;
|
|
|
|
|
|
|
|
TRACE("output %p, mode %p.\n", output, mode);
|
|
|
|
TRACE("mode %ux%u@%u %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
|
|
|
|
debug_d3dformat(mode->format_id), mode->scanline_ordering);
|
|
|
|
|
|
|
|
memset(&new_mode, 0, sizeof(new_mode));
|
|
|
|
new_mode.dmSize = sizeof(new_mode);
|
|
|
|
memset(¤t_mode, 0, sizeof(current_mode));
|
|
|
|
current_mode.dmSize = sizeof(current_mode);
|
|
|
|
|
|
|
|
format = wined3d_get_format(output->adapter, mode->format_id, WINED3D_BIND_RENDER_TARGET);
|
|
|
|
|
|
|
|
new_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
|
|
|
new_mode.dmBitsPerPel = format->byte_count * CHAR_BIT;
|
|
|
|
new_mode.dmPelsWidth = mode->width;
|
|
|
|
new_mode.dmPelsHeight = mode->height;
|
|
|
|
new_mode.dmDisplayFrequency = mode->refresh_rate;
|
|
|
|
if (mode->refresh_rate)
|
|
|
|
new_mode.dmFields |= DM_DISPLAYFREQUENCY;
|
|
|
|
if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
|
|
|
|
{
|
|
|
|
new_mode.dmFields |= DM_DISPLAYFLAGS;
|
|
|
|
if (mode->scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED)
|
|
|
|
new_mode.u2.dmDisplayFlags |= DM_INTERLACED;
|
|
|
|
}
|
|
|
|
new_format_id = mode->format_id;
|
|
|
|
|
2012-06-22 15:57:27 +02:00
|
|
|
/* Only change the mode if necessary. */
|
2020-03-06 14:16:16 +01:00
|
|
|
if (!EnumDisplaySettingsW(output->device_name, ENUM_CURRENT_SETTINGS, ¤t_mode))
|
2012-06-22 15:57:27 +02:00
|
|
|
{
|
2014-11-18 21:26:57 +01:00
|
|
|
ERR("Failed to get current display mode.\n");
|
2012-06-22 15:57:27 +02:00
|
|
|
}
|
2020-11-02 10:44:57 +01:00
|
|
|
else if (equal_display_mode(¤t_mode, &new_mode))
|
2012-06-22 15:57:27 +02:00
|
|
|
{
|
|
|
|
TRACE("Skipping redundant mode setting call.\n");
|
2020-03-06 14:16:16 +01:00
|
|
|
output->screen_format = new_format_id;
|
2012-06-22 15:57:27 +02:00
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2020-03-06 14:16:16 +01:00
|
|
|
ret = ChangeDisplaySettingsExW(output->device_name, &new_mode, NULL, CDS_FULLSCREEN, NULL);
|
2012-06-22 15:57:27 +02:00
|
|
|
if (ret != DISP_CHANGE_SUCCESSFUL)
|
|
|
|
{
|
2014-11-18 21:26:57 +01:00
|
|
|
if (new_mode.dmFields & DM_DISPLAYFREQUENCY)
|
2012-06-22 15:57:27 +02:00
|
|
|
{
|
|
|
|
WARN("ChangeDisplaySettingsExW failed, trying without the refresh rate.\n");
|
2014-11-18 21:26:57 +01:00
|
|
|
new_mode.dmFields &= ~DM_DISPLAYFREQUENCY;
|
|
|
|
new_mode.dmDisplayFrequency = 0;
|
2020-03-06 14:16:16 +01:00
|
|
|
ret = ChangeDisplaySettingsExW(output->device_name, &new_mode, NULL, CDS_FULLSCREEN, NULL);
|
2012-06-22 15:57:27 +02:00
|
|
|
}
|
|
|
|
if (ret != DISP_CHANGE_SUCCESSFUL)
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Store the new values. */
|
2020-03-06 14:16:16 +01:00
|
|
|
output->screen_format = new_format_id;
|
2012-06-22 15:57:27 +02:00
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2021-03-25 16:46:43 +01:00
|
|
|
HRESULT CDECL wined3d_output_set_gamma_ramp(struct wined3d_output *output, const struct wined3d_gamma_ramp *ramp)
|
|
|
|
{
|
|
|
|
HDC dc;
|
|
|
|
|
|
|
|
TRACE("output %p, ramp %p.\n", output, ramp);
|
|
|
|
|
|
|
|
dc = CreateDCW(output->device_name, NULL, NULL, NULL);
|
|
|
|
SetDeviceGammaRamp(dc, (void *)ramp);
|
|
|
|
DeleteDC(dc);
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2021-03-25 16:46:44 +01:00
|
|
|
HRESULT wined3d_output_get_gamma_ramp(struct wined3d_output *output, struct wined3d_gamma_ramp *ramp)
|
|
|
|
{
|
|
|
|
HDC dc;
|
|
|
|
|
|
|
|
TRACE("output %p, ramp %p.\n", output, ramp);
|
|
|
|
|
|
|
|
dc = CreateDCW(output->device_name, NULL, NULL, NULL);
|
|
|
|
GetDeviceGammaRamp(dc, ramp);
|
|
|
|
DeleteDC(dc);
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2020-03-10 10:35:09 +01:00
|
|
|
HRESULT CDECL wined3d_adapter_get_identifier(const struct wined3d_adapter *adapter,
|
|
|
|
DWORD flags, struct wined3d_adapter_identifier *identifier)
|
2010-11-18 20:50:40 +01:00
|
|
|
{
|
2020-03-10 10:35:09 +01:00
|
|
|
TRACE("adapter %p, flags %#x, identifier %p.\n", adapter, flags, identifier);
|
2004-09-29 23:26:47 +02:00
|
|
|
|
2018-12-03 14:41:06 +01:00
|
|
|
wined3d_mutex_lock();
|
|
|
|
|
2019-04-30 13:06:38 +02:00
|
|
|
wined3d_copy_name(identifier->driver, adapter->driver_info.name, identifier->driver_size);
|
|
|
|
wined3d_copy_name(identifier->description, adapter->driver_info.description, identifier->description_size);
|
2009-07-07 11:08:03 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
identifier->driver_version.u.HighPart = adapter->driver_info.version_high;
|
|
|
|
identifier->driver_version.u.LowPart = adapter->driver_info.version_low;
|
|
|
|
identifier->vendor_id = adapter->driver_info.vendor;
|
|
|
|
identifier->device_id = adapter->driver_info.device;
|
|
|
|
identifier->subsystem_id = 0;
|
|
|
|
identifier->revision = 0;
|
2019-03-12 16:30:18 +01:00
|
|
|
identifier->device_identifier = IID_D3DDEVICE_D3DUID;
|
|
|
|
identifier->driver_uuid = adapter->driver_uuid;
|
|
|
|
identifier->device_uuid = adapter->device_uuid;
|
2020-12-14 15:27:24 +01:00
|
|
|
identifier->whql_level = (flags & WINED3DENUM_WHQL_LEVEL) ? 1 : 0;
|
2018-12-03 14:41:06 +01:00
|
|
|
identifier->adapter_luid = adapter->luid;
|
2018-11-21 10:13:21 +01:00
|
|
|
identifier->video_memory = min(~(SIZE_T)0, adapter->driver_info.vram_bytes);
|
2018-11-21 10:13:22 +01:00
|
|
|
identifier->shared_system_memory = min(~(SIZE_T)0, adapter->driver_info.sysmem_bytes);
|
2004-09-29 23:26:47 +02:00
|
|
|
|
2018-12-03 14:41:06 +01:00
|
|
|
wined3d_mutex_unlock();
|
|
|
|
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-09-29 23:26:47 +02:00
|
|
|
}
|
|
|
|
|
2020-03-09 08:40:21 +01:00
|
|
|
HRESULT CDECL wined3d_output_get_raster_status(const struct wined3d_output *output,
|
2012-07-18 21:32:30 +02:00
|
|
|
struct wined3d_raster_status *raster_status)
|
|
|
|
{
|
|
|
|
LONGLONG freq_per_frame, freq_per_line;
|
|
|
|
LARGE_INTEGER counter, freq_per_sec;
|
|
|
|
struct wined3d_display_mode mode;
|
|
|
|
static UINT once;
|
|
|
|
|
|
|
|
if (!once++)
|
2020-03-09 08:40:21 +01:00
|
|
|
FIXME("output %p, raster_status %p semi-stub!\n", output, raster_status);
|
2012-07-18 21:32:30 +02:00
|
|
|
else
|
2020-03-09 08:40:21 +01:00
|
|
|
WARN("output %p, raster_status %p semi-stub!\n", output, raster_status);
|
2012-07-18 21:32:30 +02:00
|
|
|
|
|
|
|
/* Obtaining the raster status is a widely implemented but optional
|
|
|
|
* feature. When this method returns OK StarCraft 2 expects the
|
|
|
|
* raster_status->InVBlank value to actually change over time.
|
|
|
|
* And Endless Alice Crysis doesn't care even if this method fails.
|
|
|
|
* Thus this method returns OK and fakes raster_status by
|
|
|
|
* QueryPerformanceCounter. */
|
|
|
|
|
|
|
|
if (!QueryPerformanceCounter(&counter) || !QueryPerformanceFrequency(&freq_per_sec))
|
|
|
|
return WINED3DERR_INVALIDCALL;
|
2020-03-09 08:40:21 +01:00
|
|
|
if (FAILED(wined3d_output_get_display_mode(output, &mode, NULL)))
|
2012-07-18 21:32:30 +02:00
|
|
|
return WINED3DERR_INVALIDCALL;
|
|
|
|
if (mode.refresh_rate == DEFAULT_REFRESH_RATE)
|
|
|
|
mode.refresh_rate = 60;
|
|
|
|
|
|
|
|
freq_per_frame = freq_per_sec.QuadPart / mode.refresh_rate;
|
|
|
|
/* Assume 20 scan lines in the vertical blank. */
|
|
|
|
freq_per_line = freq_per_frame / (mode.height + 20);
|
|
|
|
raster_status->scan_line = (counter.QuadPart % freq_per_frame) / freq_per_line;
|
|
|
|
if (raster_status->scan_line < mode.height)
|
|
|
|
raster_status->in_vblank = FALSE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
raster_status->scan_line = 0;
|
|
|
|
raster_status->in_vblank = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning fake value, in_vblank %u, scan_line %u.\n",
|
|
|
|
raster_status->in_vblank, raster_status->scan_line);
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
2020-03-09 08:41:33 +01:00
|
|
|
HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d_adapter *adapter,
|
|
|
|
enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id,
|
2011-02-01 19:39:53 +01:00
|
|
|
enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id)
|
2010-08-23 18:28:10 +02:00
|
|
|
{
|
2010-08-30 20:29:49 +02:00
|
|
|
const struct wined3d_format *rt_format;
|
|
|
|
const struct wined3d_format *ds_format;
|
2005-09-19 16:31:21 +02:00
|
|
|
|
2020-03-09 08:41:33 +01:00
|
|
|
TRACE("adapter %p, device_type %s, adapter_format %s, render_target_format %s, "
|
|
|
|
"depth_stencil_format %s.\n",
|
|
|
|
adapter, debug_d3ddevicetype(device_type), debug_d3dformat(adapter_format_id),
|
2011-02-01 19:39:53 +01:00
|
|
|
debug_d3dformat(render_target_format_id), debug_d3dformat(depth_stencil_format_id));
|
2004-10-05 04:14:06 +02:00
|
|
|
|
2018-10-31 10:31:50 +01:00
|
|
|
rt_format = wined3d_get_format(adapter, render_target_format_id, WINED3D_BIND_RENDER_TARGET);
|
|
|
|
ds_format = wined3d_get_format(adapter, depth_stencil_format_id, WINED3D_BIND_DEPTH_STENCIL);
|
2019-03-28 09:53:52 +01:00
|
|
|
|
|
|
|
if (!(rt_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_RENDERTARGET))
|
2010-03-21 19:05:38 +01:00
|
|
|
{
|
2019-03-28 09:53:52 +01:00
|
|
|
WARN("Format %s is not render target format.\n", debug_d3dformat(rt_format->id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
2010-03-21 19:05:38 +01:00
|
|
|
}
|
2020-06-05 13:49:28 +02:00
|
|
|
if (!(ds_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
|
2019-03-28 09:53:52 +01:00
|
|
|
{
|
|
|
|
WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format->id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
2019-03-28 09:53:54 +01:00
|
|
|
if (adapter->adapter_ops->adapter_check_format(adapter, NULL, rt_format, ds_format))
|
2010-03-21 19:05:38 +01:00
|
|
|
{
|
2019-03-28 09:53:53 +01:00
|
|
|
TRACE("Formats match.\n");
|
|
|
|
return WINED3D_OK;
|
2019-03-28 09:53:52 +01:00
|
|
|
}
|
|
|
|
|
2019-03-28 09:53:53 +01:00
|
|
|
TRACE("Unsupported format pair: %s and %s.\n",
|
|
|
|
debug_d3dformat(render_target_format_id),
|
|
|
|
debug_d3dformat(depth_stencil_format_id));
|
|
|
|
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
2004-10-05 04:14:06 +02:00
|
|
|
}
|
|
|
|
|
2020-03-10 10:35:20 +01:00
|
|
|
HRESULT CDECL wined3d_check_device_multisample_type(const struct wined3d_adapter *adapter,
|
2011-12-12 20:53:59 +01:00
|
|
|
enum wined3d_device_type device_type, enum wined3d_format_id surface_format_id, BOOL windowed,
|
2012-01-08 21:15:00 +01:00
|
|
|
enum wined3d_multisample_type multisample_type, DWORD *quality_levels)
|
2009-08-27 10:04:56 +02:00
|
|
|
{
|
2018-08-23 14:34:03 +02:00
|
|
|
const struct wined3d_format *format;
|
2016-01-28 00:15:43 +01:00
|
|
|
HRESULT hr = WINED3D_OK;
|
2011-08-25 21:05:03 +02:00
|
|
|
|
2020-03-10 10:35:20 +01:00
|
|
|
TRACE("adapter %p, device_type %s, surface_format %s, "
|
2011-02-01 19:39:53 +01:00
|
|
|
"windowed %#x, multisample_type %#x, quality_levels %p.\n",
|
2020-03-10 10:35:20 +01:00
|
|
|
adapter, debug_d3ddevicetype(device_type), debug_d3dformat(surface_format_id),
|
2011-02-01 19:39:53 +01:00
|
|
|
windowed, multisample_type, quality_levels);
|
2005-07-13 16:15:54 +02:00
|
|
|
|
2016-01-28 00:15:43 +01:00
|
|
|
if (surface_format_id == WINED3DFMT_UNKNOWN)
|
|
|
|
return WINED3DERR_INVALIDCALL;
|
2016-02-04 20:10:43 +01:00
|
|
|
if (multisample_type < WINED3D_MULTISAMPLE_NONE)
|
2016-01-28 00:15:43 +01:00
|
|
|
return WINED3DERR_INVALIDCALL;
|
2016-02-04 20:10:43 +01:00
|
|
|
if (multisample_type > WINED3D_MULTISAMPLE_16_SAMPLES)
|
|
|
|
{
|
|
|
|
FIXME("multisample_type %u not handled yet.\n", multisample_type);
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2004-10-05 04:14:06 +02:00
|
|
|
|
2018-08-23 14:34:03 +02:00
|
|
|
format = wined3d_get_format(adapter, surface_format_id, 0);
|
|
|
|
|
2016-01-28 00:15:43 +01:00
|
|
|
if (multisample_type && !(format->multisample_types & 1u << (multisample_type - 1)))
|
|
|
|
hr = WINED3DERR_NOTAVAILABLE;
|
2011-08-25 21:05:03 +02:00
|
|
|
|
2016-01-28 00:15:43 +01:00
|
|
|
if (SUCCEEDED(hr) || (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE && format->multisample_types))
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
2011-08-25 21:05:03 +02:00
|
|
|
if (quality_levels)
|
2016-01-28 00:15:43 +01:00
|
|
|
{
|
|
|
|
if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
|
|
|
|
*quality_levels = wined3d_popcount(format->multisample_types);
|
|
|
|
else
|
|
|
|
*quality_levels = 1;
|
|
|
|
}
|
|
|
|
return WINED3D_OK;
|
2011-08-25 21:05:03 +02:00
|
|
|
}
|
|
|
|
|
2016-01-28 00:15:43 +01:00
|
|
|
TRACE("Returning not supported.\n");
|
|
|
|
return hr;
|
2004-10-05 04:14:06 +02:00
|
|
|
}
|
|
|
|
|
2019-03-28 09:53:48 +01:00
|
|
|
static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *adapter,
|
|
|
|
const struct wined3d_format *adapter_format, const struct wined3d_format *ds_format,
|
2015-04-24 10:33:48 +02:00
|
|
|
enum wined3d_gl_resource_type gl_type)
|
2008-03-16 17:02:02 +01:00
|
|
|
{
|
2019-03-28 09:53:48 +01:00
|
|
|
if (!ds_format->depth_size && !ds_format->stencil_size)
|
2018-08-23 14:34:02 +02:00
|
|
|
return FALSE;
|
2010-03-25 16:55:26 +01:00
|
|
|
|
2019-03-28 09:53:54 +01:00
|
|
|
return adapter->adapter_ops->adapter_check_format(adapter, adapter_format, NULL, ds_format);
|
2008-03-16 17:02:02 +01:00
|
|
|
}
|
|
|
|
|
2019-03-28 09:53:51 +01:00
|
|
|
static BOOL wined3d_check_surface_format(const struct wined3d_format *format)
|
2009-03-11 10:15:09 +01:00
|
|
|
{
|
2018-09-22 01:26:08 +02:00
|
|
|
if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] | format->flags[WINED3D_GL_RES_TYPE_RB]) & WINED3DFMT_FLAG_BLIT)
|
2008-08-07 21:51:35 +02:00
|
|
|
return TRUE;
|
|
|
|
|
2017-09-08 18:44:07 +02:00
|
|
|
if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_EXTENSION | WINED3DFMT_FLAG_TEXTURE))
|
|
|
|
== (WINED3DFMT_FLAG_EXTENSION | WINED3DFMT_FLAG_TEXTURE))
|
|
|
|
return TRUE;
|
|
|
|
|
2008-08-07 21:36:55 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2013-04-18 09:35:13 +02:00
|
|
|
/* OpenGL supports mipmapping on all formats. Wrapping is unsupported, but we
|
|
|
|
* have to report mipmapping so we cannot reject WRAPANDMIP. Tests show that
|
|
|
|
* Windows reports WRAPANDMIP on unfilterable surfaces as well, apparently to
|
|
|
|
* show that wrapping is supported. The lack of filtering will sort out the
|
|
|
|
* mipmapping capability anyway.
|
|
|
|
*
|
|
|
|
* For now lets report this on all formats, but in the future we may want to
|
|
|
|
* restrict it to some should applications need that. */
|
2020-03-10 10:35:35 +01:00
|
|
|
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
|
|
|
|
const struct wined3d_adapter *adapter, enum wined3d_device_type device_type,
|
|
|
|
enum wined3d_format_id adapter_format_id, DWORD usage, unsigned int bind_flags,
|
|
|
|
enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
|
2009-08-27 10:04:56 +02:00
|
|
|
{
|
2017-12-11 10:25:24 +01:00
|
|
|
const struct wined3d_format *adapter_format, *format;
|
2017-05-31 11:43:18 +02:00
|
|
|
enum wined3d_gl_resource_type gl_type, gl_type_end;
|
2018-02-13 01:00:43 +01:00
|
|
|
BOOL mipmap_gen_supported = TRUE;
|
2018-10-31 10:31:49 +01:00
|
|
|
unsigned int allowed_bind_flags;
|
2013-04-18 09:35:13 +02:00
|
|
|
DWORD format_flags = 0;
|
|
|
|
DWORD allowed_usage;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
2020-12-25 17:41:19 +01:00
|
|
|
TRACE("wined3d %p, adapter %p, device_type %s, adapter_format %s, usage %s, "
|
2018-10-31 10:31:49 +01:00
|
|
|
"bind_flags %s, resource_type %s, check_format %s.\n",
|
2020-03-10 10:35:35 +01:00
|
|
|
wined3d, adapter, debug_d3ddevicetype(device_type), debug_d3dformat(adapter_format_id),
|
2020-12-25 17:41:19 +01:00
|
|
|
debug_d3dusage(usage), wined3d_debug_bind_flags(bind_flags),
|
2018-10-31 10:31:49 +01:00
|
|
|
debug_d3dresourcetype(resource_type), debug_d3dformat(check_format_id));
|
2011-02-01 19:39:53 +01:00
|
|
|
|
2018-10-31 10:31:50 +01:00
|
|
|
adapter_format = wined3d_get_format(adapter, adapter_format_id, WINED3D_BIND_RENDER_TARGET);
|
|
|
|
format = wined3d_get_format(adapter, check_format_id, bind_flags);
|
2017-12-11 10:25:24 +01:00
|
|
|
|
2016-04-18 19:06:31 +02:00
|
|
|
switch (resource_type)
|
|
|
|
{
|
2017-05-31 11:43:18 +02:00
|
|
|
case WINED3D_RTYPE_NONE:
|
2018-10-31 10:31:49 +01:00
|
|
|
allowed_usage = 0;
|
|
|
|
allowed_bind_flags = WINED3D_BIND_RENDER_TARGET
|
2020-09-29 23:06:17 +02:00
|
|
|
| WINED3D_BIND_DEPTH_STENCIL
|
|
|
|
| WINED3D_BIND_UNORDERED_ACCESS;
|
2017-05-31 11:43:18 +02:00
|
|
|
gl_type = WINED3D_GL_RES_TYPE_TEX_2D;
|
|
|
|
gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
|
|
|
|
break;
|
|
|
|
|
2018-04-02 22:58:23 +02:00
|
|
|
case WINED3D_RTYPE_TEXTURE_1D:
|
|
|
|
allowed_usage = WINED3DUSAGE_DYNAMIC
|
|
|
|
| WINED3DUSAGE_SOFTWAREPROCESSING
|
|
|
|
| WINED3DUSAGE_QUERY_FILTER
|
|
|
|
| WINED3DUSAGE_QUERY_GENMIPMAP
|
|
|
|
| WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBREAD
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBWRITE
|
|
|
|
| WINED3DUSAGE_QUERY_VERTEXTEXTURE
|
|
|
|
| WINED3DUSAGE_QUERY_WRAPANDMIP;
|
2020-09-29 23:06:17 +02:00
|
|
|
allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE
|
|
|
|
| WINED3D_BIND_UNORDERED_ACCESS;
|
2018-04-02 22:58:23 +02:00
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_1D;
|
|
|
|
break;
|
|
|
|
|
2016-04-18 19:06:31 +02:00
|
|
|
case WINED3D_RTYPE_TEXTURE_2D:
|
2018-10-31 10:31:49 +01:00
|
|
|
allowed_usage = WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING;
|
|
|
|
if (bind_flags & WINED3D_BIND_RENDER_TARGET)
|
2016-02-08 00:04:41 +01:00
|
|
|
allowed_usage |= WINED3DUSAGE_QUERY_SRGBWRITE;
|
2018-10-31 10:31:49 +01:00
|
|
|
allowed_bind_flags = WINED3D_BIND_RENDER_TARGET
|
2020-09-29 23:06:17 +02:00
|
|
|
| WINED3D_BIND_DEPTH_STENCIL
|
|
|
|
| WINED3D_BIND_UNORDERED_ACCESS;
|
2018-10-31 10:31:49 +01:00
|
|
|
if (!(bind_flags & WINED3D_BIND_SHADER_RESOURCE))
|
2016-04-18 19:06:31 +02:00
|
|
|
{
|
2019-03-28 09:53:51 +01:00
|
|
|
if (!wined3d_check_surface_format(format))
|
2016-04-18 19:06:31 +02:00
|
|
|
{
|
2019-03-28 09:53:51 +01:00
|
|
|
TRACE("%s is not supported for plain surfaces.\n", debug_d3dformat(format->id));
|
2016-04-18 19:06:31 +02:00
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2008-08-07 21:36:55 +02:00
|
|
|
|
2017-05-31 11:43:18 +02:00
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_RB;
|
2016-04-18 19:06:31 +02:00
|
|
|
break;
|
|
|
|
}
|
2018-02-13 01:00:44 +01:00
|
|
|
allowed_usage |= WINED3DUSAGE_DYNAMIC
|
2016-01-27 00:06:23 +01:00
|
|
|
| WINED3DUSAGE_LEGACY_CUBEMAP
|
2013-04-18 09:35:13 +02:00
|
|
|
| WINED3DUSAGE_SOFTWAREPROCESSING
|
|
|
|
| WINED3DUSAGE_QUERY_FILTER
|
2018-02-13 01:00:44 +01:00
|
|
|
| WINED3DUSAGE_QUERY_GENMIPMAP
|
2013-04-18 09:35:13 +02:00
|
|
|
| WINED3DUSAGE_QUERY_LEGACYBUMPMAP
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBREAD
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBWRITE
|
|
|
|
| WINED3DUSAGE_QUERY_VERTEXTEXTURE
|
|
|
|
| WINED3DUSAGE_QUERY_WRAPANDMIP;
|
2018-10-31 10:31:49 +01:00
|
|
|
allowed_bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
|
2017-05-31 11:43:18 +02:00
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_2D;
|
2016-01-27 00:06:23 +01:00
|
|
|
if (usage & WINED3DUSAGE_LEGACY_CUBEMAP)
|
|
|
|
{
|
2018-10-31 10:31:49 +01:00
|
|
|
allowed_usage &= ~WINED3DUSAGE_QUERY_LEGACYBUMPMAP;
|
|
|
|
allowed_bind_flags &= ~WINED3D_BIND_DEPTH_STENCIL;
|
2017-05-31 11:43:18 +02:00
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_CUBE;
|
2016-01-27 00:06:23 +01:00
|
|
|
}
|
2010-05-05 18:22:37 +02:00
|
|
|
break;
|
2008-03-18 09:43:27 +01:00
|
|
|
|
2016-01-27 00:06:24 +01:00
|
|
|
case WINED3D_RTYPE_TEXTURE_3D:
|
2013-04-18 09:35:13 +02:00
|
|
|
allowed_usage = WINED3DUSAGE_DYNAMIC
|
|
|
|
| WINED3DUSAGE_SOFTWAREPROCESSING
|
|
|
|
| WINED3DUSAGE_QUERY_FILTER
|
|
|
|
| WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBREAD
|
|
|
|
| WINED3DUSAGE_QUERY_SRGBWRITE
|
|
|
|
| WINED3DUSAGE_QUERY_VERTEXTEXTURE
|
|
|
|
| WINED3DUSAGE_QUERY_WRAPANDMIP;
|
2020-09-29 23:06:17 +02:00
|
|
|
allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE
|
|
|
|
| WINED3D_BIND_UNORDERED_ACCESS;
|
2017-05-31 11:43:18 +02:00
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
|
2013-04-18 09:35:13 +02:00
|
|
|
break;
|
2008-03-17 19:27:24 +01:00
|
|
|
|
2021-02-12 03:33:29 +01:00
|
|
|
case WINED3D_RTYPE_BUFFER:
|
|
|
|
if (wined3d_format_is_typeless(format))
|
|
|
|
{
|
|
|
|
TRACE("Requested WINED3D_RTYPE_BUFFER, but format %s is typeless.\n", debug_d3dformat(check_format_id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
allowed_usage = WINED3DUSAGE_DYNAMIC;
|
|
|
|
allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE
|
|
|
|
| WINED3D_BIND_UNORDERED_ACCESS;
|
|
|
|
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER;
|
|
|
|
break;
|
|
|
|
|
2013-04-18 09:35:13 +02:00
|
|
|
default:
|
|
|
|
FIXME("Unhandled resource type %s.\n", debug_d3dresourcetype(resource_type));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2008-03-22 22:41:30 +01:00
|
|
|
|
2013-04-18 09:35:13 +02:00
|
|
|
if ((usage & allowed_usage) != usage)
|
|
|
|
{
|
|
|
|
TRACE("Requested usage %#x, but resource type %s only allows %#x.\n",
|
|
|
|
usage, debug_d3dresourcetype(resource_type), allowed_usage);
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2008-03-17 18:37:15 +01:00
|
|
|
|
2018-10-31 10:31:49 +01:00
|
|
|
if ((bind_flags & allowed_bind_flags) != bind_flags)
|
|
|
|
{
|
|
|
|
TRACE("Requested bind flags %s, but resource type %s only allows %s.\n",
|
|
|
|
wined3d_debug_bind_flags(bind_flags), debug_d3dresourcetype(resource_type),
|
|
|
|
wined3d_debug_bind_flags(allowed_bind_flags));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bind_flags & WINED3D_BIND_SHADER_RESOURCE)
|
2016-04-18 19:06:31 +02:00
|
|
|
format_flags |= WINED3DFMT_FLAG_TEXTURE;
|
2019-03-29 13:00:17 +01:00
|
|
|
if (bind_flags & WINED3D_BIND_RENDER_TARGET)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_RENDERTARGET;
|
2020-06-05 13:49:28 +02:00
|
|
|
if (bind_flags & WINED3D_BIND_DEPTH_STENCIL)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL;
|
2020-09-29 23:06:17 +02:00
|
|
|
if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS;
|
2013-04-18 09:35:13 +02:00
|
|
|
if (usage & WINED3DUSAGE_QUERY_FILTER)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_FILTERING;
|
|
|
|
if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING;
|
|
|
|
if (usage & WINED3DUSAGE_QUERY_SRGBREAD)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_SRGB_READ;
|
|
|
|
if (usage & WINED3DUSAGE_QUERY_SRGBWRITE)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_SRGB_WRITE;
|
|
|
|
if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_VTF;
|
|
|
|
if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP)
|
|
|
|
format_flags |= WINED3DFMT_FLAG_BUMPMAP;
|
2008-03-21 23:45:52 +01:00
|
|
|
|
2013-04-18 09:35:13 +02:00
|
|
|
if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D))
|
|
|
|
{
|
|
|
|
TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n");
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2013-01-24 11:37:41 +01:00
|
|
|
|
2017-05-31 11:43:18 +02:00
|
|
|
for (; gl_type <= gl_type_end; ++gl_type)
|
2013-04-18 09:35:13 +02:00
|
|
|
{
|
2018-10-31 10:31:49 +01:00
|
|
|
if ((bind_flags & WINED3D_BIND_RENDER_TARGET)
|
2019-03-29 13:00:17 +01:00
|
|
|
&& !adapter->adapter_ops->adapter_check_format(adapter, adapter_format, format, NULL))
|
2017-05-31 11:43:18 +02:00
|
|
|
{
|
2018-10-31 10:31:49 +01:00
|
|
|
TRACE("Requested WINED3D_BIND_RENDER_TARGET, but format %s is not supported for render targets.\n",
|
2017-05-31 11:43:18 +02:00
|
|
|
debug_d3dformat(check_format_id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3D depth / stencil textures are never supported. */
|
2018-10-31 10:31:49 +01:00
|
|
|
if (bind_flags == WINED3D_BIND_DEPTH_STENCIL && gl_type == WINED3D_GL_RES_TYPE_TEX_3D)
|
2017-05-31 11:43:18 +02:00
|
|
|
continue;
|
|
|
|
|
2018-10-31 10:31:49 +01:00
|
|
|
if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL)
|
2019-03-28 09:53:48 +01:00
|
|
|
&& !wined3d_check_depth_stencil_format(adapter, adapter_format, format, gl_type))
|
2017-05-31 11:43:18 +02:00
|
|
|
{
|
2018-10-31 10:31:49 +01:00
|
|
|
TRACE("Requested WINED3D_BIND_DEPTH_STENCIL, but format %s is not supported for depth/stencil buffers.\n",
|
2017-05-31 11:43:18 +02:00
|
|
|
debug_d3dformat(check_format_id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2017-12-11 10:25:24 +01:00
|
|
|
|
2020-09-29 23:06:17 +02:00
|
|
|
if ((bind_flags & WINED3D_BIND_UNORDERED_ACCESS) && wined3d_format_is_typeless(format))
|
|
|
|
{
|
|
|
|
TRACE("Requested WINED3D_BIND_UNORDERED_ACCESS, but format %s is typeless.\n",
|
|
|
|
debug_d3dformat(check_format_id));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
2020-06-15 18:36:02 +02:00
|
|
|
if ((format->flags[gl_type] & format_flags) != format_flags)
|
|
|
|
{
|
|
|
|
TRACE("Requested format flags %#x, but format %s only has %#x.\n",
|
|
|
|
format_flags, debug_d3dformat(check_format_id), format->flags[gl_type]);
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
2018-02-13 15:54:13 +01:00
|
|
|
if (!(format->flags[gl_type] & WINED3DFMT_FLAG_GEN_MIPMAP))
|
2018-02-13 01:00:43 +01:00
|
|
|
mipmap_gen_supported = FALSE;
|
2017-12-11 10:25:24 +01:00
|
|
|
}
|
|
|
|
|
2018-02-13 01:00:44 +01:00
|
|
|
if ((usage & WINED3DUSAGE_QUERY_GENMIPMAP) && !mipmap_gen_supported)
|
2017-12-11 10:25:24 +01:00
|
|
|
{
|
|
|
|
TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n");
|
2018-02-13 01:00:44 +01:00
|
|
|
return WINED3DOK_NOMIPGEN;
|
2013-04-18 09:35:13 +02:00
|
|
|
}
|
2010-05-05 18:22:37 +02:00
|
|
|
|
2013-04-18 09:35:13 +02:00
|
|
|
return WINED3D_OK;
|
2004-10-05 04:14:06 +02:00
|
|
|
}
|
|
|
|
|
2020-03-10 10:35:46 +01:00
|
|
|
unsigned int CDECL wined3d_calculate_format_pitch(const struct wined3d_adapter *adapter,
|
|
|
|
enum wined3d_format_id format_id, unsigned int width)
|
2014-04-23 14:35:20 +02:00
|
|
|
{
|
2016-02-09 21:29:56 +01:00
|
|
|
unsigned int row_pitch, slice_pitch;
|
2014-04-23 14:35:20 +02:00
|
|
|
|
2020-03-10 10:35:46 +01:00
|
|
|
TRACE("adapter %p, format_id %s, width %u.\n", adapter, debug_d3dformat(format_id), width);
|
2014-04-23 14:35:20 +02:00
|
|
|
|
2018-08-23 14:34:03 +02:00
|
|
|
wined3d_format_calculate_pitch(wined3d_get_format(adapter, format_id, 0),
|
2016-02-09 21:29:56 +01:00
|
|
|
1, width, 1, &row_pitch, &slice_pitch);
|
|
|
|
|
|
|
|
return row_pitch;
|
2014-04-23 14:35:20 +02:00
|
|
|
}
|
|
|
|
|
2020-03-09 08:40:40 +01:00
|
|
|
HRESULT CDECL wined3d_check_device_format_conversion(const struct wined3d_output *output,
|
|
|
|
enum wined3d_device_type device_type, enum wined3d_format_id src_format,
|
|
|
|
enum wined3d_format_id dst_format)
|
2009-12-21 23:17:26 +01:00
|
|
|
{
|
2020-03-09 08:40:40 +01:00
|
|
|
FIXME("output %p, device_type %s, src_format %s, dst_format %s stub!\n",
|
|
|
|
output, debug_d3ddevicetype(device_type), debug_d3dformat(src_format),
|
2009-12-21 23:17:26 +01:00
|
|
|
debug_d3dformat(dst_format));
|
2004-10-05 04:14:06 +02:00
|
|
|
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-10-05 04:14:06 +02:00
|
|
|
}
|
|
|
|
|
2020-03-09 08:40:53 +01:00
|
|
|
HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d,
|
|
|
|
const struct wined3d_output *output, enum wined3d_device_type device_type,
|
|
|
|
enum wined3d_format_id display_format, enum wined3d_format_id backbuffer_format,
|
|
|
|
BOOL windowed)
|
2010-09-01 18:41:06 +02:00
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
BOOL present_conversion = wined3d->flags & WINED3D_PRESENT_CONVERSION;
|
2010-09-01 18:41:06 +02:00
|
|
|
|
2020-03-09 08:40:53 +01:00
|
|
|
TRACE("wined3d %p, output %p, device_type %s, display_format %s, backbuffer_format %s, windowed %#x.\n",
|
|
|
|
wined3d, output, debug_d3ddevicetype(device_type), debug_d3dformat(display_format),
|
2010-09-01 18:41:06 +02:00
|
|
|
debug_d3dformat(backbuffer_format), windowed);
|
|
|
|
|
|
|
|
/* The task of this function is to check whether a certain display / backbuffer format
|
2020-04-21 15:36:43 +02:00
|
|
|
* combination is available on the given output. In fullscreen mode microsoft specified
|
2010-09-01 18:41:06 +02:00
|
|
|
* that the display format shouldn't provide alpha and that ignoring alpha the backbuffer
|
|
|
|
* and display format should match exactly.
|
2014-01-27 20:33:03 +01:00
|
|
|
* In windowed mode format conversion can occur and this depends on the driver. */
|
2010-09-01 18:41:06 +02:00
|
|
|
|
|
|
|
/* There are only 4 display formats. */
|
|
|
|
if (!(display_format == WINED3DFMT_B5G6R5_UNORM
|
|
|
|
|| display_format == WINED3DFMT_B5G5R5X1_UNORM
|
|
|
|
|| display_format == WINED3DFMT_B8G8R8X8_UNORM
|
|
|
|
|| display_format == WINED3DFMT_B10G10R10A2_UNORM))
|
|
|
|
{
|
2012-06-22 15:57:31 +02:00
|
|
|
TRACE("Format %s is not supported as display format.\n", debug_d3dformat(display_format));
|
2010-09-01 18:41:06 +02:00
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
2014-01-29 19:28:35 +01:00
|
|
|
if (!windowed)
|
2010-09-01 18:41:06 +02:00
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
/* If the requested display format is not available, don't continue. */
|
2020-03-09 08:40:53 +01:00
|
|
|
if (!wined3d_output_get_mode_count(output, display_format,
|
|
|
|
WINED3D_SCANLINE_ORDERING_UNKNOWN))
|
2014-01-27 20:33:03 +01:00
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("No available modes for display format %s.\n", debug_d3dformat(display_format));
|
2014-01-27 20:33:03 +01:00
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2010-09-01 18:41:06 +02:00
|
|
|
|
2014-01-29 19:28:35 +01:00
|
|
|
present_conversion = FALSE;
|
|
|
|
}
|
|
|
|
else if (display_format == WINED3DFMT_B10G10R10A2_UNORM)
|
|
|
|
{
|
|
|
|
/* WINED3DFMT_B10G10R10A2_UNORM is only allowed in fullscreen mode. */
|
|
|
|
TRACE("Unsupported format combination %s / %s in windowed mode.\n",
|
|
|
|
debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (present_conversion)
|
|
|
|
{
|
|
|
|
/* Use the display format as back buffer format if the latter is
|
|
|
|
* WINED3DFMT_UNKNOWN. */
|
2014-01-27 20:33:03 +01:00
|
|
|
if (backbuffer_format == WINED3DFMT_UNKNOWN)
|
|
|
|
backbuffer_format = display_format;
|
2010-09-01 18:41:06 +02:00
|
|
|
|
2020-03-09 08:40:53 +01:00
|
|
|
if (FAILED(wined3d_check_device_format_conversion(output, device_type, backbuffer_format,
|
|
|
|
display_format)))
|
2014-01-27 20:33:03 +01:00
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("Format conversion from %s to %s not supported.\n",
|
|
|
|
debug_d3dformat(backbuffer_format), debug_d3dformat(display_format));
|
2014-01-27 20:33:03 +01:00
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2010-09-01 18:41:06 +02:00
|
|
|
}
|
2014-01-27 20:33:03 +01:00
|
|
|
else
|
2010-09-01 18:41:06 +02:00
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
/* When format conversion from the back buffer format to the display
|
|
|
|
* format is not allowed, only a limited number of combinations are
|
|
|
|
* valid. */
|
2010-09-01 18:41:06 +02:00
|
|
|
|
2014-01-27 20:33:03 +01:00
|
|
|
if (display_format == WINED3DFMT_B5G6R5_UNORM && backbuffer_format != WINED3DFMT_B5G6R5_UNORM)
|
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("Unsupported format combination %s / %s.\n",
|
2014-01-27 20:33:03 +01:00
|
|
|
debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_format == WINED3DFMT_B5G5R5X1_UNORM
|
|
|
|
&& !(backbuffer_format == WINED3DFMT_B5G5R5X1_UNORM || backbuffer_format == WINED3DFMT_B5G5R5A1_UNORM))
|
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("Unsupported format combination %s / %s.\n",
|
2014-01-27 20:33:03 +01:00
|
|
|
debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_format == WINED3DFMT_B8G8R8X8_UNORM
|
|
|
|
&& !(backbuffer_format == WINED3DFMT_B8G8R8X8_UNORM || backbuffer_format == WINED3DFMT_B8G8R8A8_UNORM))
|
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("Unsupported format combination %s / %s.\n",
|
2014-01-27 20:33:03 +01:00
|
|
|
debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_format == WINED3DFMT_B10G10R10A2_UNORM
|
|
|
|
&& backbuffer_format != WINED3DFMT_B10G10R10A2_UNORM)
|
|
|
|
{
|
2014-01-29 19:28:35 +01:00
|
|
|
TRACE("Unsupported format combination %s / %s.\n",
|
2014-01-27 20:33:03 +01:00
|
|
|
debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2010-09-01 18:41:06 +02:00
|
|
|
}
|
|
|
|
|
2014-01-29 19:28:35 +01:00
|
|
|
/* Validate that the back buffer format is usable for render targets. */
|
2020-03-10 10:35:35 +01:00
|
|
|
if (FAILED(wined3d_check_device_format(wined3d, output->adapter, device_type,
|
2020-03-09 08:40:53 +01:00
|
|
|
display_format, 0, WINED3D_BIND_RENDER_TARGET, WINED3D_RTYPE_TEXTURE_2D,
|
|
|
|
backbuffer_format)))
|
2014-01-29 19:28:35 +01:00
|
|
|
{
|
|
|
|
TRACE("Format %s not allowed for render targets.\n", debug_d3dformat(backbuffer_format));
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
2010-09-01 18:41:06 +02:00
|
|
|
|
2014-01-29 19:28:35 +01:00
|
|
|
return WINED3D_OK;
|
2010-09-01 18:41:06 +02:00
|
|
|
}
|
|
|
|
|
2020-03-13 10:35:29 +01:00
|
|
|
HRESULT CDECL wined3d_get_device_caps(const struct wined3d_adapter *adapter,
|
2018-06-13 12:23:59 +02:00
|
|
|
enum wined3d_device_type device_type, struct wined3d_caps *caps)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
2019-03-22 09:42:05 +01:00
|
|
|
const struct wined3d_d3d_info *d3d_info;
|
2013-04-25 12:16:47 +02:00
|
|
|
struct wined3d_vertex_caps vertex_caps;
|
2013-12-13 09:07:47 +01:00
|
|
|
DWORD ckey_caps, blit_caps, fx_caps;
|
2017-02-20 13:12:14 +01:00
|
|
|
struct fragment_caps fragment_caps;
|
|
|
|
struct shader_caps shader_caps;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2020-03-13 10:35:29 +01:00
|
|
|
TRACE("adapter %p, device_type %s, caps %p.\n",
|
|
|
|
adapter, debug_d3ddevicetype(device_type), caps);
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
d3d_info = &adapter->d3d_info;
|
|
|
|
|
2011-12-12 20:53:59 +01:00
|
|
|
caps->DeviceType = (device_type == WINED3D_DEVICE_TYPE_HAL) ? WINED3D_DEVICE_TYPE_HAL : WINED3D_DEVICE_TYPE_REF;
|
2005-06-22 20:30:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->Caps = 0;
|
|
|
|
caps->Caps2 = WINED3DCAPS2_CANRENDERWINDOWED |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DCAPS2_FULLSCREENGAMMA |
|
|
|
|
WINED3DCAPS2_DYNAMICTEXTURES;
|
2008-11-10 10:42:27 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->Caps3 = WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD |
|
2008-11-10 10:42:27 +01:00
|
|
|
WINED3DCAPS3_COPY_TO_VIDMEM |
|
|
|
|
WINED3DCAPS3_COPY_TO_SYSTEMMEM;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->CursorCaps = WINED3DCURSORCAPS_COLOR |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DCURSORCAPS_LOWRES;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->DevCaps = WINED3DDEVCAPS_FLOATTLVERTEX |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DDEVCAPS_EXECUTESYSTEMMEMORY |
|
|
|
|
WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY|
|
|
|
|
WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY |
|
|
|
|
WINED3DDEVCAPS_DRAWPRIMTLVERTEX |
|
|
|
|
WINED3DDEVCAPS_HWTRANSFORMANDLIGHT |
|
|
|
|
WINED3DDEVCAPS_EXECUTEVIDEOMEMORY |
|
|
|
|
WINED3DDEVCAPS_PUREDEVICE |
|
|
|
|
WINED3DDEVCAPS_HWRASTERIZATION |
|
|
|
|
WINED3DDEVCAPS_TEXTUREVIDEOMEMORY |
|
|
|
|
WINED3DDEVCAPS_TEXTURESYSTEMMEMORY |
|
|
|
|
WINED3DDEVCAPS_CANRENDERAFTERFLIP |
|
|
|
|
WINED3DDEVCAPS_DRAWPRIMITIVES2 |
|
2013-01-24 00:39:12 +01:00
|
|
|
WINED3DDEVCAPS_DRAWPRIMITIVES2EX;
|
2008-03-18 19:26:00 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_CULLNONE |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPMISCCAPS_CULLCCW |
|
|
|
|
WINED3DPMISCCAPS_CULLCW |
|
|
|
|
WINED3DPMISCCAPS_COLORWRITEENABLE |
|
|
|
|
WINED3DPMISCCAPS_CLIPTLVERTS |
|
|
|
|
WINED3DPMISCCAPS_CLIPPLANESCALEDPOINTS |
|
|
|
|
WINED3DPMISCCAPS_MASKZ |
|
2008-06-27 00:52:07 +02:00
|
|
|
WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING;
|
2006-08-04 22:37:27 +02:00
|
|
|
/* TODO:
|
2007-02-14 23:31:05 +01:00
|
|
|
WINED3DPMISCCAPS_NULLREFERENCE
|
|
|
|
WINED3DPMISCCAPS_FOGANDSPECULARALPHA
|
|
|
|
WINED3DPMISCCAPS_FOGVERTEXCLAMPED */
|
2006-08-04 22:37:27 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->RasterCaps = WINED3DPRASTERCAPS_DITHER |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPRASTERCAPS_PAT |
|
|
|
|
WINED3DPRASTERCAPS_WFOG |
|
|
|
|
WINED3DPRASTERCAPS_ZFOG |
|
|
|
|
WINED3DPRASTERCAPS_FOGVERTEX |
|
|
|
|
WINED3DPRASTERCAPS_FOGTABLE |
|
|
|
|
WINED3DPRASTERCAPS_STIPPLE |
|
|
|
|
WINED3DPRASTERCAPS_SUBPIXEL |
|
|
|
|
WINED3DPRASTERCAPS_ZTEST |
|
|
|
|
WINED3DPRASTERCAPS_SCISSORTEST |
|
|
|
|
WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS |
|
|
|
|
WINED3DPRASTERCAPS_DEPTHBIAS;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->ZCmpCaps = WINED3DPCMPCAPS_ALWAYS |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPCMPCAPS_EQUAL |
|
|
|
|
WINED3DPCMPCAPS_GREATER |
|
|
|
|
WINED3DPCMPCAPS_GREATEREQUAL |
|
|
|
|
WINED3DPCMPCAPS_LESS |
|
|
|
|
WINED3DPCMPCAPS_LESSEQUAL |
|
|
|
|
WINED3DPCMPCAPS_NEVER |
|
|
|
|
WINED3DPCMPCAPS_NOTEQUAL;
|
|
|
|
|
2014-04-15 09:15:20 +02:00
|
|
|
/* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA
|
|
|
|
* are legacy settings for srcblend only. */
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->SrcBlendCaps = WINED3DPBLENDCAPS_BOTHINVSRCALPHA |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPBLENDCAPS_BOTHSRCALPHA |
|
|
|
|
WINED3DPBLENDCAPS_DESTALPHA |
|
|
|
|
WINED3DPBLENDCAPS_DESTCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_INVDESTALPHA |
|
|
|
|
WINED3DPBLENDCAPS_INVDESTCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_INVSRCALPHA |
|
|
|
|
WINED3DPBLENDCAPS_INVSRCCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_ONE |
|
|
|
|
WINED3DPBLENDCAPS_SRCALPHA |
|
|
|
|
WINED3DPBLENDCAPS_SRCALPHASAT |
|
|
|
|
WINED3DPBLENDCAPS_SRCCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_ZERO;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->DestBlendCaps = WINED3DPBLENDCAPS_DESTALPHA |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPBLENDCAPS_DESTCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_INVDESTALPHA |
|
|
|
|
WINED3DPBLENDCAPS_INVDESTCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_INVSRCALPHA |
|
|
|
|
WINED3DPBLENDCAPS_INVSRCCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_ONE |
|
|
|
|
WINED3DPBLENDCAPS_SRCALPHA |
|
|
|
|
WINED3DPBLENDCAPS_SRCCOLOR |
|
|
|
|
WINED3DPBLENDCAPS_ZERO;
|
2014-04-15 09:15:20 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->AlphaCmpCaps = WINED3DPCMPCAPS_ALWAYS |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPCMPCAPS_EQUAL |
|
|
|
|
WINED3DPCMPCAPS_GREATER |
|
|
|
|
WINED3DPCMPCAPS_GREATEREQUAL |
|
|
|
|
WINED3DPCMPCAPS_LESS |
|
|
|
|
WINED3DPCMPCAPS_LESSEQUAL |
|
|
|
|
WINED3DPCMPCAPS_NEVER |
|
|
|
|
WINED3DPCMPCAPS_NOTEQUAL;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->ShadeCaps = WINED3DPSHADECAPS_SPECULARGOURAUDRGB |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPSHADECAPS_COLORGOURAUDRGB |
|
|
|
|
WINED3DPSHADECAPS_ALPHAFLATBLEND |
|
|
|
|
WINED3DPSHADECAPS_ALPHAGOURAUDBLEND |
|
|
|
|
WINED3DPSHADECAPS_COLORFLATRGB |
|
|
|
|
WINED3DPSHADECAPS_FOGFLAT |
|
|
|
|
WINED3DPSHADECAPS_FOGGOURAUD |
|
|
|
|
WINED3DPSHADECAPS_SPECULARFLATRGB;
|
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->TextureCaps = WINED3DPTEXTURECAPS_ALPHA |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPTEXTURECAPS_ALPHAPALETTE |
|
2008-08-20 20:51:41 +02:00
|
|
|
WINED3DPTEXTURECAPS_TRANSPARENCY |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPTEXTURECAPS_BORDER |
|
|
|
|
WINED3DPTEXTURECAPS_MIPMAP |
|
|
|
|
WINED3DPTEXTURECAPS_PROJECTED |
|
|
|
|
WINED3DPTEXTURECAPS_PERSPECTIVE;
|
2007-08-21 12:13:42 +02:00
|
|
|
|
2018-09-18 00:31:20 +02:00
|
|
|
if (!d3d_info->texture_npot)
|
2009-10-29 10:37:11 +01:00
|
|
|
{
|
2015-07-02 17:41:35 +02:00
|
|
|
caps->TextureCaps |= WINED3DPTEXTURECAPS_POW2;
|
2018-09-18 00:31:20 +02:00
|
|
|
if (d3d_info->texture_npot_conditional)
|
2015-07-02 17:41:35 +02:00
|
|
|
caps->TextureCaps |= WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL;
|
2007-08-21 12:13:42 +02:00
|
|
|
}
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->TextureFilterCaps = WINED3DPTFILTERCAPS_MAGFLINEAR |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPTFILTERCAPS_MAGFPOINT |
|
|
|
|
WINED3DPTFILTERCAPS_MINFLINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_MINFPOINT |
|
|
|
|
WINED3DPTFILTERCAPS_MIPFLINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_MIPFPOINT |
|
|
|
|
WINED3DPTFILTERCAPS_LINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_LINEARMIPLINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_LINEARMIPNEAREST |
|
|
|
|
WINED3DPTFILTERCAPS_MIPLINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_MIPNEAREST |
|
|
|
|
WINED3DPTFILTERCAPS_NEAREST;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
caps->CubeTextureFilterCaps = 0;
|
|
|
|
caps->VolumeTextureFilterCaps = 0;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->TextureAddressCaps = WINED3DPTADDRESSCAPS_INDEPENDENTUV |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DPTADDRESSCAPS_CLAMP |
|
|
|
|
WINED3DPTADDRESSCAPS_WRAP;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
caps->VolumeTextureAddressCaps = 0;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->LineCaps = WINED3DLINECAPS_TEXTURE |
|
2008-08-19 16:34:54 +02:00
|
|
|
WINED3DLINECAPS_ZTEST |
|
|
|
|
WINED3DLINECAPS_BLEND |
|
|
|
|
WINED3DLINECAPS_ALPHACMP |
|
|
|
|
WINED3DLINECAPS_FOG;
|
|
|
|
/* WINED3DLINECAPS_ANTIALIAS is not supported on Windows, and dx and gl seem to have a different
|
|
|
|
* idea how generating the smoothing alpha values works; the result is different
|
|
|
|
*/
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2018-09-25 23:14:37 +02:00
|
|
|
caps->MaxTextureWidth = d3d_info->limits.texture_size;
|
|
|
|
caps->MaxTextureHeight = d3d_info->limits.texture_size;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
caps->MaxVolumeExtent = 0;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->MaxTextureRepeat = 32768;
|
2018-09-25 23:14:37 +02:00
|
|
|
caps->MaxTextureAspectRatio = d3d_info->limits.texture_size;
|
2019-02-11 12:04:53 +01:00
|
|
|
caps->MaxVertexW = 1e10f;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2020-07-22 19:00:56 +02:00
|
|
|
caps->GuardBandLeft = -32768.0f;
|
|
|
|
caps->GuardBandTop = -32768.0f;
|
|
|
|
caps->GuardBandRight = 32768.0f;
|
|
|
|
caps->GuardBandBottom = 32768.0f;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->ExtentsAdjust = 0.0f;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->StencilCaps = WINED3DSTENCILCAPS_DECRSAT |
|
2008-03-18 19:26:00 +01:00
|
|
|
WINED3DSTENCILCAPS_INCRSAT |
|
|
|
|
WINED3DSTENCILCAPS_INVERT |
|
|
|
|
WINED3DSTENCILCAPS_KEEP |
|
|
|
|
WINED3DSTENCILCAPS_REPLACE |
|
|
|
|
WINED3DSTENCILCAPS_ZERO;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
caps->MaxAnisotropy = 0;
|
2018-08-23 14:34:04 +02:00
|
|
|
caps->MaxPointSize = d3d_info->limits.pointsize_max;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2014-03-28 21:03:46 +01:00
|
|
|
caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
|
|
|
|
caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
|
2019-02-20 21:53:56 +01:00
|
|
|
caps->MaxStreams = WINED3D_MAX_STREAMS;
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->MaxStreamStride = 1024;
|
2004-10-06 02:05:29 +02:00
|
|
|
|
2008-03-18 19:26:00 +01:00
|
|
|
/* d3d9.dll sets D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES here because StretchRects is implemented in d3d9 */
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->DevCaps2 = WINED3DDEVCAPS2_STREAMOFFSET |
|
|
|
|
WINED3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET;
|
|
|
|
caps->MaxNpatchTessellationLevel = 0;
|
2008-03-18 19:26:00 +01:00
|
|
|
|
2018-08-24 15:44:03 +02:00
|
|
|
caps->NumSimultaneousRTs = d3d_info->limits.max_rt_count;
|
2008-03-18 19:39:26 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->StretchRectFilterCaps = WINED3DPTFILTERCAPS_MINFPOINT |
|
2008-03-18 19:39:26 +01:00
|
|
|
WINED3DPTFILTERCAPS_MAGFPOINT |
|
|
|
|
WINED3DPTFILTERCAPS_MINFLINEAR |
|
|
|
|
WINED3DPTFILTERCAPS_MAGFLINEAR;
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->VertexTextureFilterCaps = 0;
|
2008-03-18 19:39:26 +01:00
|
|
|
|
2019-03-29 13:00:13 +01:00
|
|
|
adapter->shader_backend->shader_get_caps(adapter, &shader_caps);
|
2019-03-29 13:00:15 +01:00
|
|
|
adapter->fragment_pipe->get_caps(adapter, &fragment_caps);
|
2019-03-29 13:00:14 +01:00
|
|
|
adapter->vertex_pipe->vp_get_caps(adapter, &vertex_caps);
|
2008-07-03 21:36:18 +02:00
|
|
|
|
2008-03-29 23:55:09 +01:00
|
|
|
/* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->PrimitiveMiscCaps |= fragment_caps.PrimitiveMiscCaps;
|
2008-03-29 23:55:09 +01:00
|
|
|
|
2013-01-21 09:08:35 +01:00
|
|
|
caps->VertexShaderVersion = shader_caps.vs_version;
|
|
|
|
caps->MaxVertexShaderConst = shader_caps.vs_uniform_count;
|
2008-03-22 14:27:53 +01:00
|
|
|
|
2013-01-21 09:08:35 +01:00
|
|
|
caps->PixelShaderVersion = shader_caps.ps_version;
|
|
|
|
caps->PixelShader1xMaxValue = shader_caps.ps_1x_max_value;
|
2008-03-22 14:27:53 +01:00
|
|
|
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->TextureOpCaps = fragment_caps.TextureOpCaps;
|
|
|
|
caps->MaxTextureBlendStages = fragment_caps.MaxTextureBlendStages;
|
|
|
|
caps->MaxSimultaneousTextures = fragment_caps.MaxSimultaneousTextures;
|
2008-07-03 21:36:18 +02:00
|
|
|
|
2013-04-25 12:16:47 +02:00
|
|
|
caps->MaxUserClipPlanes = vertex_caps.max_user_clip_planes;
|
|
|
|
caps->MaxActiveLights = vertex_caps.max_active_lights;
|
|
|
|
caps->MaxVertexBlendMatrices = vertex_caps.max_vertex_blend_matrices;
|
|
|
|
caps->MaxVertexBlendMatrixIndex = vertex_caps.max_vertex_blend_matrix_index;
|
|
|
|
caps->VertexProcessingCaps = vertex_caps.vertex_processing_caps;
|
|
|
|
caps->FVFCaps = vertex_caps.fvf_caps;
|
|
|
|
caps->RasterCaps |= vertex_caps.raster_caps;
|
|
|
|
|
2008-03-22 14:27:53 +01:00
|
|
|
/* The following caps are shader specific, but they are things we cannot detect, or which
|
|
|
|
* are the same among all shader models. So to avoid code duplication set the shader version
|
|
|
|
* specific, but otherwise constant caps here
|
|
|
|
*/
|
2011-10-25 16:58:45 +02:00
|
|
|
if (caps->VertexShaderVersion >= 3)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
|
|
|
/* Where possible set the caps based on OpenGL extensions and if they
|
|
|
|
* aren't set (in case of software rendering) use the VS 3.0 from
|
|
|
|
* MSDN or else if there's OpenGL spec use a hardcoded value minimum
|
|
|
|
* VS3.0 value. */
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.caps = WINED3DVS20CAPS_PREDICATION;
|
2011-02-01 19:39:53 +01:00
|
|
|
/* VS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.dynamic_flow_control_depth = WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH;
|
2019-03-29 13:00:16 +01:00
|
|
|
caps->VS20Caps.temp_count = 32;
|
2011-02-01 19:39:53 +01:00
|
|
|
/* level of nesting in loops / if-statements; VS 3.0 requires MAX (4) */
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.static_flow_control_depth = WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxVShaderInstructionsExecuted = 65535; /* VS 3.0 needs at least 65535, some cards even use 2^32-1 */
|
2019-04-06 11:37:33 +02:00
|
|
|
caps->MaxVertexShader30InstructionSlots = WINED3DMIN30SHADERINSTRUCTIONS;
|
2014-04-15 09:15:19 +02:00
|
|
|
caps->VertexTextureFilterCaps = WINED3DPTFILTERCAPS_MINFPOINT | WINED3DPTFILTERCAPS_MAGFPOINT;
|
2011-02-01 19:39:53 +01:00
|
|
|
}
|
2011-10-25 16:58:44 +02:00
|
|
|
else if (caps->VertexShaderVersion == 2)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.caps = 0;
|
|
|
|
caps->VS20Caps.dynamic_flow_control_depth = WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH;
|
2019-04-06 11:37:33 +02:00
|
|
|
caps->VS20Caps.temp_count = WINED3DVS20_MIN_NUMTEMPS;
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.static_flow_control_depth = 1;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxVShaderInstructionsExecuted = 65535;
|
|
|
|
caps->MaxVertexShader30InstructionSlots = 0;
|
|
|
|
}
|
2019-03-29 13:00:16 +01:00
|
|
|
else /* VS 1.x */
|
|
|
|
{
|
2011-12-08 21:04:05 +01:00
|
|
|
caps->VS20Caps.caps = 0;
|
|
|
|
caps->VS20Caps.dynamic_flow_control_depth = 0;
|
|
|
|
caps->VS20Caps.temp_count = 0;
|
|
|
|
caps->VS20Caps.static_flow_control_depth = 0;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxVShaderInstructionsExecuted = 0;
|
|
|
|
caps->MaxVertexShader30InstructionSlots = 0;
|
|
|
|
}
|
|
|
|
|
2011-10-25 16:58:45 +02:00
|
|
|
if (caps->PixelShaderVersion >= 3)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
|
|
|
/* Where possible set the caps based on OpenGL extensions and if they
|
|
|
|
* aren't set (in case of software rendering) use the PS 3.0 from
|
|
|
|
* MSDN or else if there's OpenGL spec use a hardcoded value minimum
|
|
|
|
* PS 3.0 value. */
|
|
|
|
|
|
|
|
/* Caps is more or less undocumented on MSDN but it appears to be
|
|
|
|
* used for PS20Caps based on results from R9600/FX5900/Geforce6800
|
|
|
|
* cards from Windows */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.caps = WINED3DPS20CAPS_ARBITRARYSWIZZLE |
|
2008-03-22 14:27:53 +01:00
|
|
|
WINED3DPS20CAPS_GRADIENTINSTRUCTIONS |
|
|
|
|
WINED3DPS20CAPS_PREDICATION |
|
|
|
|
WINED3DPS20CAPS_NODEPENDENTREADLIMIT |
|
|
|
|
WINED3DPS20CAPS_NOTEXINSTRUCTIONLIMIT;
|
2011-02-01 19:39:53 +01:00
|
|
|
/* PS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.dynamic_flow_control_depth = WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH;
|
2019-03-29 13:00:16 +01:00
|
|
|
caps->PS20Caps.temp_count = 32;
|
2011-02-01 19:39:53 +01:00
|
|
|
/* PS 3.0 requires MAX_STATICFLOWCONTROLDEPTH (4) */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.static_flow_control_depth = WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH;
|
2011-02-01 19:39:53 +01:00
|
|
|
/* PS 3.0 requires MAX_NUMINSTRUCTIONSLOTS (512) */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.instruction_slot_count = WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxPShaderInstructionsExecuted = 65535;
|
2019-03-29 13:00:16 +01:00
|
|
|
caps->MaxPixelShader30InstructionSlots = WINED3DMIN30SHADERINSTRUCTIONS;
|
2009-10-29 10:37:10 +01:00
|
|
|
}
|
2019-03-29 13:00:16 +01:00
|
|
|
else if (caps->PixelShaderVersion == 2)
|
2009-10-29 10:37:10 +01:00
|
|
|
{
|
2008-03-22 14:27:53 +01:00
|
|
|
/* Below we assume PS2.0 specs, not extended 2.0a(GeforceFX)/2.0b(Radeon R3xx) ones */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.caps = 0;
|
|
|
|
caps->PS20Caps.dynamic_flow_control_depth = 0; /* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */
|
2019-04-06 11:37:33 +02:00
|
|
|
caps->PS20Caps.temp_count = WINED3DPS20_MIN_NUMTEMPS;
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.static_flow_control_depth = WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH; /* Minimum: 1 */
|
2011-02-01 19:39:53 +01:00
|
|
|
/* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.instruction_slot_count = WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxPShaderInstructionsExecuted = 512; /* Minimum value, a GeforceFX uses 1024 */
|
|
|
|
caps->MaxPixelShader30InstructionSlots = 0;
|
|
|
|
}
|
|
|
|
else /* PS 1.x */
|
|
|
|
{
|
2011-12-08 21:04:06 +01:00
|
|
|
caps->PS20Caps.caps = 0;
|
|
|
|
caps->PS20Caps.dynamic_flow_control_depth = 0;
|
|
|
|
caps->PS20Caps.temp_count = 0;
|
|
|
|
caps->PS20Caps.static_flow_control_depth = 0;
|
|
|
|
caps->PS20Caps.instruction_slot_count = 0;
|
2011-02-01 19:39:53 +01:00
|
|
|
|
|
|
|
caps->MaxPShaderInstructionsExecuted = 0;
|
|
|
|
caps->MaxPixelShader30InstructionSlots = 0;
|
|
|
|
}
|
|
|
|
|
2011-10-25 16:58:44 +02:00
|
|
|
if (caps->VertexShaderVersion >= 2)
|
2011-02-01 19:39:53 +01:00
|
|
|
{
|
2008-03-18 19:26:00 +01:00
|
|
|
/* OpenGL supports all the formats below, perhaps not always
|
|
|
|
* without conversion, but it supports them.
|
|
|
|
* Further GLSL doesn't seem to have an official unsigned type so
|
|
|
|
* don't advertise it yet as I'm not sure how we handle it.
|
|
|
|
* We might need to add some clamping in the shader engine to
|
|
|
|
* support it.
|
|
|
|
* TODO: WINED3DDTCAPS_USHORT2N, WINED3DDTCAPS_USHORT4N, WINED3DDTCAPS_UDEC3, WINED3DDTCAPS_DEC3N */
|
2011-02-01 19:39:53 +01:00
|
|
|
caps->DeclTypes = WINED3DDTCAPS_UBYTE4 |
|
|
|
|
WINED3DDTCAPS_UBYTE4N |
|
|
|
|
WINED3DDTCAPS_SHORT2N |
|
|
|
|
WINED3DDTCAPS_SHORT4N;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
caps->DeclTypes = 0;
|
|
|
|
}
|
2008-03-18 19:26:00 +01:00
|
|
|
|
2008-07-29 18:03:59 +02:00
|
|
|
/* Set DirectDraw helper Caps */
|
|
|
|
ckey_caps = WINEDDCKEYCAPS_DESTBLT |
|
|
|
|
WINEDDCKEYCAPS_SRCBLT;
|
|
|
|
fx_caps = WINEDDFXCAPS_BLTALPHA |
|
|
|
|
WINEDDFXCAPS_BLTMIRRORLEFTRIGHT |
|
|
|
|
WINEDDFXCAPS_BLTMIRRORUPDOWN |
|
|
|
|
WINEDDFXCAPS_BLTROTATION90 |
|
|
|
|
WINEDDFXCAPS_BLTSHRINKX |
|
|
|
|
WINEDDFXCAPS_BLTSHRINKXN |
|
|
|
|
WINEDDFXCAPS_BLTSHRINKY |
|
2014-09-24 13:01:59 +02:00
|
|
|
WINEDDFXCAPS_BLTSHRINKYN |
|
2008-07-29 18:03:59 +02:00
|
|
|
WINEDDFXCAPS_BLTSTRETCHX |
|
|
|
|
WINEDDFXCAPS_BLTSTRETCHXN |
|
|
|
|
WINEDDFXCAPS_BLTSTRETCHY |
|
|
|
|
WINEDDFXCAPS_BLTSTRETCHYN;
|
|
|
|
blit_caps = WINEDDCAPS_BLT |
|
|
|
|
WINEDDCAPS_BLTCOLORFILL |
|
|
|
|
WINEDDCAPS_BLTDEPTHFILL |
|
|
|
|
WINEDDCAPS_BLTSTRETCH |
|
|
|
|
WINEDDCAPS_CANBLTSYSMEM |
|
|
|
|
WINEDDCAPS_CANCLIP |
|
|
|
|
WINEDDCAPS_CANCLIPSTRETCHED |
|
|
|
|
WINEDDCAPS_COLORKEY |
|
2017-01-16 15:07:15 +01:00
|
|
|
WINEDDCAPS_COLORKEYHWASSIST;
|
2008-07-29 18:03:59 +02:00
|
|
|
|
|
|
|
/* Fill the ddraw caps structure */
|
2011-12-12 20:53:58 +01:00
|
|
|
caps->ddraw_caps.caps = WINEDDCAPS_GDI |
|
2008-07-29 18:03:59 +02:00
|
|
|
WINEDDCAPS_PALETTE |
|
2008-07-23 22:38:52 +02:00
|
|
|
blit_caps;
|
2011-12-12 20:53:58 +01:00
|
|
|
caps->ddraw_caps.caps2 = WINEDDCAPS2_CERTIFIED |
|
|
|
|
WINEDDCAPS2_NOPAGELOCKREQUIRED |
|
|
|
|
WINEDDCAPS2_PRIMARYGAMMA |
|
|
|
|
WINEDDCAPS2_WIDESURFACES |
|
2008-07-29 18:03:59 +02:00
|
|
|
WINEDDCAPS2_CANRENDERWINDOWED;
|
2011-12-12 20:53:58 +01:00
|
|
|
caps->ddraw_caps.color_key_caps = ckey_caps;
|
|
|
|
caps->ddraw_caps.fx_caps = fx_caps;
|
|
|
|
caps->ddraw_caps.svb_caps = blit_caps;
|
|
|
|
caps->ddraw_caps.svb_color_key_caps = ckey_caps;
|
|
|
|
caps->ddraw_caps.svb_fx_caps = fx_caps;
|
|
|
|
caps->ddraw_caps.vsb_caps = blit_caps;
|
|
|
|
caps->ddraw_caps.vsb_color_key_caps = ckey_caps;
|
|
|
|
caps->ddraw_caps.vsb_fx_caps = fx_caps;
|
|
|
|
caps->ddraw_caps.ssb_caps = blit_caps;
|
|
|
|
caps->ddraw_caps.ssb_color_key_caps = ckey_caps;
|
|
|
|
caps->ddraw_caps.ssb_fx_caps = fx_caps;
|
|
|
|
|
2019-08-11 11:35:16 +02:00
|
|
|
caps->ddraw_caps.dds_caps = WINEDDSCAPS_FLIP
|
2018-09-25 00:25:19 +02:00
|
|
|
| WINEDDSCAPS_OFFSCREENPLAIN
|
|
|
|
| WINEDDSCAPS_PALETTE
|
2019-08-11 11:35:15 +02:00
|
|
|
| WINEDDSCAPS_PRIMARYSURFACE
|
|
|
|
| WINEDDSCAPS_TEXTURE
|
|
|
|
| WINEDDSCAPS_ZBUFFER
|
|
|
|
| WINEDDSCAPS_MIPMAP;
|
2008-07-23 22:38:52 +02:00
|
|
|
|
2017-02-20 13:12:14 +01:00
|
|
|
caps->shader_double_precision = d3d_info->shader_double_precision;
|
2018-10-01 18:01:12 +02:00
|
|
|
caps->viewport_array_index_any_shader = d3d_info->viewport_array_index_any_shader;
|
2017-02-20 13:12:14 +01:00
|
|
|
|
2018-06-13 12:24:02 +02:00
|
|
|
caps->max_feature_level = d3d_info->feature_level;
|
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
adapter->adapter_ops->adapter_get_wined3d_caps(adapter, caps);
|
|
|
|
|
2006-04-07 12:51:12 +02:00
|
|
|
return WINED3D_OK;
|
2004-10-06 02:05:29 +02:00
|
|
|
}
|
|
|
|
|
2020-03-10 10:30:50 +01:00
|
|
|
HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter,
|
2018-09-24 01:09:31 +02:00
|
|
|
enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment,
|
|
|
|
const enum wined3d_feature_level *feature_levels, unsigned int feature_level_count,
|
|
|
|
struct wined3d_device_parent *device_parent, struct wined3d_device **device)
|
2009-01-16 10:14:24 +01:00
|
|
|
{
|
2019-04-18 11:00:20 +02:00
|
|
|
struct wined3d_device *object;
|
2009-01-07 02:20:08 +01:00
|
|
|
HRESULT hr;
|
2004-10-08 22:52:33 +02:00
|
|
|
|
2020-03-10 10:30:50 +01:00
|
|
|
TRACE("wined3d %p, adapter %p, device_type %#x, focus_window %p, flags %#x, "
|
2018-09-24 01:09:31 +02:00
|
|
|
"surface_alignment %u, feature_levels %p, feature_level_count %u, device_parent %p, device %p.\n",
|
2020-03-10 10:30:50 +01:00
|
|
|
wined3d, adapter, device_type, focus_window, flags, surface_alignment,
|
2018-09-24 01:09:31 +02:00
|
|
|
feature_levels, feature_level_count, device_parent, device);
|
2009-11-18 10:45:53 +01:00
|
|
|
|
2019-04-18 11:00:20 +02:00
|
|
|
if (FAILED(hr = adapter->adapter_ops->adapter_create_device(wined3d, adapter,
|
2018-09-24 01:09:31 +02:00
|
|
|
device_type, focus_window, flags, surface_alignment,
|
2019-04-18 11:00:20 +02:00
|
|
|
feature_levels, feature_level_count, device_parent, &object)))
|
2009-07-06 10:08:42 +02:00
|
|
|
return hr;
|
2008-07-09 01:59:10 +02:00
|
|
|
|
2019-04-18 11:00:20 +02:00
|
|
|
TRACE("Created device %p.\n", object);
|
|
|
|
*device = object;
|
2009-04-14 20:24:26 +02:00
|
|
|
|
2011-05-18 22:30:13 +02:00
|
|
|
device_parent->ops->wined3d_device_created(device_parent, *device);
|
2009-04-14 20:24:26 +02:00
|
|
|
|
2009-07-06 10:08:42 +02:00
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
2008-08-03 00:59:48 +02:00
|
|
|
|
2020-04-22 23:34:55 +02:00
|
|
|
static const struct wined3d_state_entry_template misc_state_template_no3d[] =
|
|
|
|
{
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX), {STATE_VDECL}},
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_HULL), {STATE_VDECL}},
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_DOMAIN), {STATE_VDECL}},
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY), {STATE_VDECL}},
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL), {STATE_VDECL}},
|
|
|
|
{STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_COMPUTE), {STATE_VDECL}},
|
|
|
|
{STATE_GRAPHICS_SHADER_RESOURCE_BINDING, {STATE_VDECL}},
|
|
|
|
{STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING, {STATE_VDECL}},
|
|
|
|
{STATE_COMPUTE_SHADER_RESOURCE_BINDING, {STATE_VDECL}},
|
|
|
|
{STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING, {STATE_VDECL}},
|
|
|
|
{STATE_STREAM_OUTPUT, {STATE_VDECL}},
|
|
|
|
{STATE_BLEND, {STATE_VDECL}},
|
|
|
|
{STATE_BLEND_FACTOR, {STATE_VDECL}},
|
2020-09-02 07:27:42 +02:00
|
|
|
{STATE_SAMPLE_MASK, {STATE_VDECL}},
|
2020-09-25 05:43:11 +02:00
|
|
|
{STATE_DEPTH_STENCIL, {STATE_VDECL}},
|
2021-02-03 14:12:47 +01:00
|
|
|
{STATE_STENCIL_REF, {STATE_VDECL}},
|
2020-04-22 23:34:55 +02:00
|
|
|
{STATE_STREAMSRC, {STATE_VDECL}},
|
|
|
|
{STATE_VDECL, {STATE_VDECL, state_nop}},
|
|
|
|
{STATE_RASTERIZER, {STATE_VDECL}},
|
|
|
|
{STATE_SCISSORRECT, {STATE_VDECL}},
|
|
|
|
{STATE_POINTSPRITECOORDORIGIN, {STATE_VDECL}},
|
|
|
|
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT01), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT10), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT11), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_LSCALE), {STATE_VDECL}},
|
|
|
|
{STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_LOFFSET), {STATE_VDECL}},
|
|
|
|
|
|
|
|
{STATE_VIEWPORT, {STATE_VDECL}},
|
|
|
|
{STATE_INDEXBUFFER, {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ANTIALIAS), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAPU), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAPV), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_LINEPATTERN), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_MONOENABLE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ROP2), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_PLANEMASK), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_LASTPIXEL), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ZFUNC), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_DITHERENABLE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_SUBPIXEL), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_SUBPIXELX), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_STIPPLEDALPHA), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_STIPPLEENABLE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_MIPMAPLODBIAS), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ANISOTROPY), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_FLUSHBATCH), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP0), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP1), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP2), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP3), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP4), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP5), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP6), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP7), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP8), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP9), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP10), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP11), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP12), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP13), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP14), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_WRAP15), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_EXTENTS), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_COLORKEYBLENDENABLE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_SOFTWAREVERTEXPROCESSING), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_PATCHEDGESTYLE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_PATCHSEGMENTS), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_POSITIONDEGREE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_NORMALDEGREE), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_MINTESSELLATIONLEVEL), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_MAXTESSELLATIONLEVEL), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ADAPTIVETESS_X), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Y), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Z), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ADAPTIVETESS_W), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), {STATE_VDECL}},
|
|
|
|
{STATE_RENDER(WINED3D_RS_ZVISIBLE), {STATE_VDECL}},
|
|
|
|
/* Samplers */
|
|
|
|
{STATE_SAMPLER(0), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(1), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(2), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(3), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(4), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(5), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(6), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(7), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(8), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(9), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(10), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(11), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(12), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(13), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(14), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(15), {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(16), /* Vertex sampler 0 */ {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(17), /* Vertex sampler 1 */ {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(18), /* Vertex sampler 2 */ {STATE_VDECL}},
|
|
|
|
{STATE_SAMPLER(19), /* Vertex sampler 3 */ {STATE_VDECL}},
|
|
|
|
{STATE_BASEVERTEXINDEX, {STATE_VDECL}},
|
|
|
|
{STATE_FRAMEBUFFER, {STATE_VDECL}},
|
|
|
|
{STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), {STATE_VDECL}},
|
|
|
|
{STATE_SHADER(WINED3D_SHADER_TYPE_HULL), {STATE_VDECL}},
|
|
|
|
{STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN), {STATE_VDECL}},
|
|
|
|
{STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY), {STATE_VDECL}},
|
|
|
|
{STATE_SHADER(WINED3D_SHADER_TYPE_COMPUTE), {STATE_VDECL}},
|
|
|
|
{0}, /* Terminate */
|
|
|
|
};
|
|
|
|
|
2019-03-28 09:53:57 +01:00
|
|
|
static void adapter_no3d_destroy(struct wined3d_adapter *adapter)
|
|
|
|
{
|
|
|
|
wined3d_adapter_cleanup(adapter);
|
|
|
|
heap_free(adapter);
|
|
|
|
}
|
|
|
|
|
2019-04-18 11:00:20 +02:00
|
|
|
static HRESULT adapter_no3d_create_device(struct wined3d *wined3d, const struct wined3d_adapter *adapter,
|
|
|
|
enum wined3d_device_type device_type, HWND focus_window, unsigned int flags, BYTE surface_alignment,
|
|
|
|
const enum wined3d_feature_level *levels, unsigned int level_count,
|
|
|
|
struct wined3d_device_parent *device_parent, struct wined3d_device **device)
|
|
|
|
{
|
2019-06-05 14:24:07 +02:00
|
|
|
struct wined3d_device_no3d *device_no3d;
|
2019-04-18 11:00:20 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
if (!(device_no3d = heap_alloc_zero(sizeof(*device_no3d))))
|
2019-04-18 11:00:20 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2020-05-18 17:52:46 +02:00
|
|
|
if (FAILED(hr = wined3d_device_init(&device_no3d->d, wined3d, adapter->ordinal, device_type, focus_window,
|
|
|
|
flags, surface_alignment, levels, level_count, adapter->gl_info.supported, device_parent)))
|
2019-04-18 11:00:20 +02:00
|
|
|
{
|
|
|
|
WARN("Failed to initialize device, hr %#x.\n", hr);
|
2019-06-05 14:24:07 +02:00
|
|
|
heap_free(device_no3d);
|
2019-04-18 11:00:20 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
*device = &device_no3d->d;
|
|
|
|
|
2019-04-18 11:00:20 +02:00
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_device(struct wined3d_device *device)
|
|
|
|
{
|
|
|
|
wined3d_device_cleanup(device);
|
|
|
|
heap_free(device);
|
|
|
|
}
|
|
|
|
|
2021-04-15 17:52:35 +02:00
|
|
|
static struct wined3d_context *adapter_no3d_acquire_context(struct wined3d_device *device,
|
2019-06-05 14:24:07 +02:00
|
|
|
struct wined3d_texture *texture, unsigned int sub_resource_idx)
|
2018-08-22 19:43:00 +02:00
|
|
|
{
|
2019-06-05 14:24:07 +02:00
|
|
|
TRACE("device %p, texture %p, sub_resource_idx %u.\n", device, texture, sub_resource_idx);
|
2019-05-07 12:30:10 +02:00
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
wined3d_from_cs(device->cs);
|
2019-05-07 12:30:10 +02:00
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
if (!device->context_count)
|
|
|
|
return NULL;
|
2019-05-07 12:30:10 +02:00
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
return &wined3d_device_no3d(device)->context_no3d;
|
2019-05-07 12:30:10 +02:00
|
|
|
}
|
|
|
|
|
2021-04-15 17:52:35 +02:00
|
|
|
static void adapter_no3d_release_context(struct wined3d_context *context)
|
2019-05-07 12:30:10 +02:00
|
|
|
{
|
2019-06-05 14:24:07 +02:00
|
|
|
TRACE("context %p.\n", context);
|
2018-08-22 19:43:00 +02:00
|
|
|
}
|
|
|
|
|
2019-03-17 18:51:05 +01:00
|
|
|
static void adapter_no3d_get_wined3d_caps(const struct wined3d_adapter *adapter, struct wined3d_caps *caps)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-03-28 09:53:53 +01:00
|
|
|
static BOOL adapter_no3d_check_format(const struct wined3d_adapter *adapter,
|
|
|
|
const struct wined3d_format *adapter_format, const struct wined3d_format *rt_format,
|
|
|
|
const struct wined3d_format *ds_format)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-05-07 12:30:08 +02:00
|
|
|
static HRESULT adapter_no3d_init_3d(struct wined3d_device *device)
|
|
|
|
{
|
2019-06-05 14:24:07 +02:00
|
|
|
struct wined3d_context *context_no3d;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2019-05-07 12:30:08 +02:00
|
|
|
TRACE("device %p.\n", device);
|
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
context_no3d = &wined3d_device_no3d(device)->context_no3d;
|
|
|
|
if (FAILED(hr = wined3d_context_no3d_init(context_no3d, device->swapchains[0])))
|
|
|
|
{
|
|
|
|
WARN("Failed to initialise context.\n");
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!device_context_add(device, context_no3d))
|
|
|
|
{
|
|
|
|
ERR("Failed to add the newly created context to the context list.\n");
|
|
|
|
wined3d_context_cleanup(context_no3d);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Initialised context %p.\n", context_no3d);
|
|
|
|
|
2019-05-07 12:30:08 +02:00
|
|
|
if (!(device->blitter = wined3d_cpu_blitter_create()))
|
|
|
|
{
|
|
|
|
ERR("Failed to create CPU blitter.\n");
|
2019-06-05 14:24:07 +02:00
|
|
|
device_context_remove(device, context_no3d);
|
|
|
|
wined3d_context_cleanup(context_no3d);
|
2019-05-07 12:30:08 +02:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_uninit_3d(struct wined3d_device *device)
|
|
|
|
{
|
2019-06-05 14:24:07 +02:00
|
|
|
struct wined3d_context *context_no3d;
|
|
|
|
|
2019-05-07 12:30:08 +02:00
|
|
|
TRACE("device %p.\n", device);
|
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
context_no3d = &wined3d_device_no3d(device)->context_no3d;
|
2019-05-07 12:30:08 +02:00
|
|
|
device->blitter->ops->blitter_destroy(device->blitter, NULL);
|
2020-06-02 01:16:59 +02:00
|
|
|
wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
|
|
|
|
|
2019-06-05 14:24:07 +02:00
|
|
|
device_context_remove(device, context_no3d);
|
|
|
|
wined3d_context_cleanup(context_no3d);
|
2019-05-07 12:30:08 +02:00
|
|
|
}
|
|
|
|
|
2019-08-15 23:01:38 +02:00
|
|
|
static void *adapter_no3d_map_bo_address(struct wined3d_context *context,
|
2020-04-22 15:12:46 +02:00
|
|
|
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
|
2019-08-15 23:01:38 +02:00
|
|
|
{
|
|
|
|
if (data->buffer_object)
|
|
|
|
{
|
|
|
|
ERR("Unsupported buffer object %#lx.\n", data->buffer_object);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return data->addr;
|
|
|
|
}
|
|
|
|
|
2020-04-22 15:12:45 +02:00
|
|
|
static void adapter_no3d_unmap_bo_address(struct wined3d_context *context,
|
|
|
|
const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
|
2019-08-15 23:01:38 +02:00
|
|
|
{
|
|
|
|
if (data->buffer_object)
|
|
|
|
ERR("Unsupported buffer object %#lx.\n", data->buffer_object);
|
|
|
|
}
|
|
|
|
|
2019-09-24 16:20:43 +02:00
|
|
|
static void adapter_no3d_copy_bo_address(struct wined3d_context *context,
|
2020-04-22 23:34:54 +02:00
|
|
|
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size)
|
2019-09-24 16:20:43 +02:00
|
|
|
{
|
|
|
|
if (dst->buffer_object)
|
|
|
|
ERR("Unsupported dst buffer object %#lx.\n", dst->buffer_object);
|
|
|
|
if (src->buffer_object)
|
|
|
|
ERR("Unsupported src buffer object %#lx.\n", src->buffer_object);
|
|
|
|
if (dst->buffer_object || src->buffer_object)
|
|
|
|
return;
|
|
|
|
memcpy(dst->addr, src->addr, size);
|
|
|
|
}
|
|
|
|
|
2020-10-09 11:56:53 +02:00
|
|
|
static HRESULT adapter_no3d_create_swapchain(struct wined3d_device *device,
|
|
|
|
struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent,
|
2019-08-08 00:47:04 +02:00
|
|
|
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain)
|
|
|
|
{
|
|
|
|
struct wined3d_swapchain *swapchain_no3d;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2020-10-09 11:56:53 +02:00
|
|
|
TRACE("device %p, desc %p, state_parent %p, parent %p, parent_ops %p, swapchain %p.\n",
|
|
|
|
device, desc, state_parent, parent, parent_ops, swapchain);
|
2019-08-08 00:47:04 +02:00
|
|
|
|
|
|
|
if (!(swapchain_no3d = heap_alloc_zero(sizeof(*swapchain_no3d))))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2020-10-09 11:56:53 +02:00
|
|
|
if (FAILED(hr = wined3d_swapchain_no3d_init(swapchain_no3d, device, desc, state_parent, parent,
|
|
|
|
parent_ops)))
|
2019-08-08 00:47:04 +02:00
|
|
|
{
|
|
|
|
WARN("Failed to initialise swapchain, hr %#x.\n", hr);
|
|
|
|
heap_free(swapchain_no3d);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Created swapchain %p.\n", swapchain_no3d);
|
|
|
|
*swapchain = swapchain_no3d;
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_swapchain(struct wined3d_swapchain *swapchain)
|
|
|
|
{
|
|
|
|
wined3d_swapchain_cleanup(swapchain);
|
|
|
|
heap_free(swapchain);
|
|
|
|
}
|
|
|
|
|
2019-08-11 11:35:08 +02:00
|
|
|
static HRESULT adapter_no3d_create_buffer(struct wined3d_device *device,
|
|
|
|
const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data,
|
|
|
|
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
|
|
|
{
|
|
|
|
struct wined3d_buffer *buffer_no3d;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p.\n",
|
|
|
|
device, desc, data, parent, parent_ops, buffer);
|
|
|
|
|
|
|
|
if (!(buffer_no3d = heap_alloc_zero(sizeof(*buffer_no3d))))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
if (FAILED(hr = wined3d_buffer_no3d_init(buffer_no3d, device, desc, data, parent, parent_ops)))
|
|
|
|
{
|
|
|
|
WARN("Failed to initialise buffer, hr %#x.\n", hr);
|
|
|
|
heap_free(buffer_no3d);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Created buffer %p.\n", buffer_no3d);
|
|
|
|
*buffer = buffer_no3d;
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_buffer(struct wined3d_buffer *buffer)
|
|
|
|
{
|
|
|
|
struct wined3d_device *device = buffer->resource.device;
|
|
|
|
unsigned int swapchain_count = device->swapchain_count;
|
|
|
|
|
|
|
|
TRACE("buffer %p.\n", buffer);
|
|
|
|
|
|
|
|
/* Take a reference to the device, in case releasing the buffer would
|
|
|
|
* cause the device to be destroyed. However, swapchain resources don't
|
|
|
|
* take a reference to the device, and we wouldn't want to increment the
|
|
|
|
* refcount on a device that's in the process of being destroyed. */
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_incref(device);
|
|
|
|
wined3d_buffer_cleanup(buffer);
|
|
|
|
wined3d_cs_destroy_object(device->cs, heap_free, buffer);
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_decref(device);
|
|
|
|
}
|
|
|
|
|
2019-08-13 10:31:36 +02:00
|
|
|
static HRESULT adapter_no3d_create_texture(struct wined3d_device *device,
|
|
|
|
const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count,
|
|
|
|
uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
|
|
|
{
|
|
|
|
struct wined3d_texture *texture_no3d;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("device %p, desc %p, layer_count %u, level_count %u, flags %#x, parent %p, parent_ops %p, texture %p.\n",
|
|
|
|
device, desc, layer_count, level_count, flags, parent, parent_ops, texture);
|
|
|
|
|
|
|
|
if (!(texture_no3d = wined3d_texture_allocate_object_memory(sizeof(*texture_no3d), level_count, layer_count)))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
if (FAILED(hr = wined3d_texture_no3d_init(texture_no3d, device, desc,
|
|
|
|
layer_count, level_count, flags, parent, parent_ops)))
|
|
|
|
{
|
|
|
|
WARN("Failed to initialise texture, hr %#x.\n", hr);
|
|
|
|
heap_free(texture_no3d);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Created texture %p.\n", texture_no3d);
|
|
|
|
*texture = texture_no3d;
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_texture(struct wined3d_texture *texture)
|
|
|
|
{
|
|
|
|
struct wined3d_device *device = texture->resource.device;
|
|
|
|
unsigned int swapchain_count = device->swapchain_count;
|
|
|
|
|
|
|
|
TRACE("texture %p.\n", texture);
|
|
|
|
|
|
|
|
/* Take a reference to the device, in case releasing the texture would
|
|
|
|
* cause the device to be destroyed. However, swapchain resources don't
|
|
|
|
* take a reference to the device, and we wouldn't want to increment the
|
|
|
|
* refcount on a device that's in the process of being destroyed. */
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_incref(device);
|
|
|
|
|
|
|
|
wined3d_texture_sub_resources_destroyed(texture);
|
|
|
|
texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent);
|
|
|
|
|
|
|
|
wined3d_texture_cleanup(texture);
|
|
|
|
wined3d_cs_destroy_object(device->cs, heap_free, texture);
|
|
|
|
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_decref(device);
|
|
|
|
}
|
|
|
|
|
2019-08-11 11:35:10 +02:00
|
|
|
static HRESULT adapter_no3d_create_rendertarget_view(const struct wined3d_view_desc *desc,
|
|
|
|
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
|
|
|
|
struct wined3d_rendertarget_view **view)
|
|
|
|
{
|
|
|
|
struct wined3d_rendertarget_view *view_no3d;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
|
|
|
|
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
|
|
|
|
|
|
|
|
if (!(view_no3d = heap_alloc_zero(sizeof(*view_no3d))))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
if (FAILED(hr = wined3d_rendertarget_view_no3d_init(view_no3d, desc, resource, parent, parent_ops)))
|
|
|
|
{
|
|
|
|
WARN("Failed to initialise view, hr %#x.\n", hr);
|
|
|
|
heap_free(view_no3d);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Created render target view %p.\n", view_no3d);
|
|
|
|
*view = view_no3d;
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_rendertarget_view(struct wined3d_rendertarget_view *view)
|
|
|
|
{
|
|
|
|
struct wined3d_device *device = view->resource->device;
|
|
|
|
unsigned int swapchain_count = device->swapchain_count;
|
|
|
|
|
|
|
|
TRACE("view %p.\n", view);
|
|
|
|
|
|
|
|
/* Take a reference to the device, in case releasing the view's resource
|
|
|
|
* would cause the device to be destroyed. However, swapchain resources
|
|
|
|
* don't take a reference to the device, and we wouldn't want to increment
|
|
|
|
* the refcount on a device that's in the process of being destroyed. */
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_incref(device);
|
|
|
|
wined3d_rendertarget_view_cleanup(view);
|
|
|
|
wined3d_cs_destroy_object(device->cs, heap_free, view);
|
|
|
|
if (swapchain_count)
|
|
|
|
wined3d_device_decref(device);
|
|
|
|
}
|
|
|
|
|
2019-08-11 11:35:11 +02:00
|
|
|
static HRESULT adapter_no3d_create_shader_resource_view(const struct wined3d_view_desc *desc,
|
|
|
|
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
|
|
|
|
struct wined3d_shader_resource_view **view)
|
|
|
|
{
|
|
|
|
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
|
|
|
|
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_shader_resource_view(struct wined3d_shader_resource_view *view)
|
|
|
|
{
|
|
|
|
TRACE("view %p.\n", view);
|
|
|
|
}
|
|
|
|
|
2019-08-11 11:35:12 +02:00
|
|
|
static HRESULT adapter_no3d_create_unordered_access_view(const struct wined3d_view_desc *desc,
|
|
|
|
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
|
|
|
|
struct wined3d_unordered_access_view **view)
|
|
|
|
{
|
|
|
|
TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
|
|
|
|
wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_unordered_access_view(struct wined3d_unordered_access_view *view)
|
|
|
|
{
|
|
|
|
TRACE("view %p.\n", view);
|
|
|
|
}
|
|
|
|
|
2019-08-14 14:04:39 +02:00
|
|
|
static HRESULT adapter_no3d_create_sampler(struct wined3d_device *device, const struct wined3d_sampler_desc *desc,
|
|
|
|
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_sampler **sampler)
|
|
|
|
{
|
|
|
|
TRACE("device %p, desc %p, parent %p, parent_ops %p, sampler %p.\n",
|
|
|
|
device, desc, parent, parent_ops, sampler);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_sampler(struct wined3d_sampler *sampler)
|
|
|
|
{
|
|
|
|
TRACE("sampler %p.\n", sampler);
|
|
|
|
}
|
|
|
|
|
2019-08-15 11:50:00 +02:00
|
|
|
static HRESULT adapter_no3d_create_query(struct wined3d_device *device, enum wined3d_query_type type,
|
|
|
|
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
|
|
|
|
{
|
|
|
|
TRACE("device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
|
|
|
|
device, type, parent, parent_ops, query);
|
|
|
|
|
|
|
|
return WINED3DERR_NOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void adapter_no3d_destroy_query(struct wined3d_query *query)
|
|
|
|
{
|
|
|
|
TRACE("query %p.\n", query);
|
|
|
|
}
|
|
|
|
|
2019-08-15 11:50:01 +02:00
|
|
|
static void adapter_no3d_flush_context(struct wined3d_context *context)
|
|
|
|
{
|
|
|
|
TRACE("context %p.\n", context);
|
|
|
|
}
|
|
|
|
|
2020-04-27 23:58:25 +02:00
|
|
|
static void adapter_no3d_draw_primitive(struct wined3d_device *device,
|
|
|
|
const struct wined3d_state *state, const struct wined3d_draw_parameters *parameters)
|
|
|
|
{
|
|
|
|
ERR("device %p, state %p, parameters %p.\n", device, state, parameters);
|
|
|
|
}
|
|
|
|
|
2020-04-27 23:58:24 +02:00
|
|
|
static void adapter_no3d_dispatch_compute(struct wined3d_device *device,
|
|
|
|
const struct wined3d_state *state, const struct wined3d_dispatch_parameters *parameters)
|
|
|
|
{
|
|
|
|
ERR("device %p, state %p, parameters %p.\n", device, state, parameters);
|
|
|
|
}
|
|
|
|
|
2021-04-15 17:52:35 +02:00
|
|
|
static void adapter_no3d_clear_uav(struct wined3d_context *context,
|
2019-09-24 16:20:42 +02:00
|
|
|
struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value)
|
|
|
|
{
|
|
|
|
ERR("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
|
|
|
|
}
|
|
|
|
|
2018-08-22 19:43:00 +02:00
|
|
|
static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
|
|
|
|
{
|
2020-04-27 23:58:24 +02:00
|
|
|
.adapter_destroy = adapter_no3d_destroy,
|
|
|
|
.adapter_create_device = adapter_no3d_create_device,
|
|
|
|
.adapter_destroy_device = adapter_no3d_destroy_device,
|
|
|
|
.adapter_acquire_context = adapter_no3d_acquire_context,
|
|
|
|
.adapter_release_context = adapter_no3d_release_context,
|
|
|
|
.adapter_get_wined3d_caps = adapter_no3d_get_wined3d_caps,
|
|
|
|
.adapter_check_format = adapter_no3d_check_format,
|
|
|
|
.adapter_init_3d = adapter_no3d_init_3d,
|
|
|
|
.adapter_uninit_3d = adapter_no3d_uninit_3d,
|
|
|
|
.adapter_map_bo_address = adapter_no3d_map_bo_address,
|
|
|
|
.adapter_unmap_bo_address = adapter_no3d_unmap_bo_address,
|
|
|
|
.adapter_copy_bo_address = adapter_no3d_copy_bo_address,
|
|
|
|
.adapter_create_swapchain = adapter_no3d_create_swapchain,
|
|
|
|
.adapter_destroy_swapchain = adapter_no3d_destroy_swapchain,
|
|
|
|
.adapter_create_buffer = adapter_no3d_create_buffer,
|
|
|
|
.adapter_destroy_buffer = adapter_no3d_destroy_buffer,
|
|
|
|
.adapter_create_texture = adapter_no3d_create_texture,
|
|
|
|
.adapter_destroy_texture = adapter_no3d_destroy_texture,
|
|
|
|
.adapter_create_rendertarget_view = adapter_no3d_create_rendertarget_view,
|
|
|
|
.adapter_destroy_rendertarget_view = adapter_no3d_destroy_rendertarget_view,
|
|
|
|
.adapter_create_shader_resource_view = adapter_no3d_create_shader_resource_view,
|
|
|
|
.adapter_destroy_shader_resource_view = adapter_no3d_destroy_shader_resource_view,
|
|
|
|
.adapter_create_unordered_access_view = adapter_no3d_create_unordered_access_view,
|
|
|
|
.adapter_destroy_unordered_access_view = adapter_no3d_destroy_unordered_access_view,
|
|
|
|
.adapter_create_sampler = adapter_no3d_create_sampler,
|
|
|
|
.adapter_destroy_sampler = adapter_no3d_destroy_sampler,
|
|
|
|
.adapter_create_query = adapter_no3d_create_query,
|
|
|
|
.adapter_destroy_query = adapter_no3d_destroy_query,
|
|
|
|
.adapter_flush_context = adapter_no3d_flush_context,
|
2020-04-27 23:58:25 +02:00
|
|
|
.adapter_draw_primitive = adapter_no3d_draw_primitive,
|
2020-04-27 23:58:24 +02:00
|
|
|
.adapter_dispatch_compute = adapter_no3d_dispatch_compute,
|
|
|
|
.adapter_clear_uav = adapter_no3d_clear_uav,
|
2018-08-22 19:43:00 +02:00
|
|
|
};
|
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter *adapter, unsigned int wined3d_creation_flags)
|
2018-09-25 00:25:21 +02:00
|
|
|
{
|
|
|
|
struct wined3d_d3d_info *d3d_info = &adapter->d3d_info;
|
|
|
|
|
|
|
|
d3d_info->wined3d_creation_flags = wined3d_creation_flags;
|
2018-09-25 23:14:34 +02:00
|
|
|
d3d_info->texture_npot = TRUE;
|
2018-09-25 23:14:35 +02:00
|
|
|
d3d_info->feature_level = WINED3D_FEATURE_LEVEL_5;
|
2018-09-25 00:25:21 +02:00
|
|
|
}
|
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
static struct wined3d_adapter *wined3d_adapter_no3d_create(unsigned int ordinal, unsigned int wined3d_creation_flags)
|
2013-01-13 22:08:09 +01:00
|
|
|
{
|
2019-03-22 09:42:05 +01:00
|
|
|
struct wined3d_adapter *adapter;
|
2020-07-08 09:58:34 +02:00
|
|
|
LUID primary_luid, *luid = NULL;
|
2019-03-22 09:42:05 +01:00
|
|
|
|
2018-09-18 00:31:18 +02:00
|
|
|
static const struct wined3d_gpu_description gpu_description =
|
|
|
|
{
|
|
|
|
HW_VENDOR_SOFTWARE, CARD_WINE, "WineD3D DirectDraw Emulation", DRIVER_WINE, 128,
|
|
|
|
};
|
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
TRACE("ordinal %u, wined3d_creation_flags %#x.\n", ordinal, wined3d_creation_flags);
|
|
|
|
|
|
|
|
if (!(adapter = heap_alloc_zero(sizeof(*adapter))))
|
|
|
|
return NULL;
|
2011-02-01 19:39:54 +01:00
|
|
|
|
2020-07-08 09:58:34 +02:00
|
|
|
if (ordinal == 0 && wined3d_get_primary_adapter_luid(&primary_luid))
|
|
|
|
luid = &primary_luid;
|
|
|
|
|
|
|
|
if (!wined3d_adapter_init(adapter, ordinal, luid, &wined3d_adapter_no3d_ops))
|
2019-03-22 09:42:05 +01:00
|
|
|
{
|
|
|
|
heap_free(adapter);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-09-22 01:26:08 +02:00
|
|
|
if (!wined3d_adapter_no3d_init_format_info(adapter))
|
2019-03-22 09:42:05 +01:00
|
|
|
{
|
2020-07-22 19:00:54 +02:00
|
|
|
wined3d_adapter_cleanup(adapter);
|
2019-03-22 09:42:05 +01:00
|
|
|
heap_free(adapter);
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-01-16 08:51:47 +01:00
|
|
|
|
2020-07-22 19:00:55 +02:00
|
|
|
if (!wined3d_driver_info_init(&adapter->driver_info, &gpu_description, WINED3D_FEATURE_LEVEL_NONE, 0, 0))
|
|
|
|
{
|
|
|
|
wined3d_adapter_cleanup(adapter);
|
|
|
|
heap_free(adapter);
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-07-08 09:57:51 +02:00
|
|
|
adapter->vram_bytes_used = 0;
|
|
|
|
TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->driver_info.vram_bytes));
|
|
|
|
|
2013-04-25 12:16:47 +02:00
|
|
|
adapter->vertex_pipe = &none_vertex_pipe;
|
2013-01-16 08:51:47 +01:00
|
|
|
adapter->fragment_pipe = &none_fragment_pipe;
|
2020-04-22 23:34:55 +02:00
|
|
|
adapter->misc_state_template = misc_state_template_no3d;
|
2013-01-16 08:51:47 +01:00
|
|
|
adapter->shader_backend = &none_shader_backend;
|
2013-04-02 15:04:57 +02:00
|
|
|
|
2018-09-25 00:25:21 +02:00
|
|
|
wined3d_adapter_no3d_init_d3d_info(adapter, wined3d_creation_flags);
|
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
TRACE("Created adapter %p.\n", adapter);
|
|
|
|
|
|
|
|
return adapter;
|
2018-08-16 09:39:21 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 15:22:19 +01:00
|
|
|
static BOOL wined3d_adapter_create_output(struct wined3d_adapter *adapter, const WCHAR *output_name)
|
|
|
|
{
|
|
|
|
struct wined3d_output *outputs;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!adapter->outputs && !(adapter->outputs = heap_calloc(1, sizeof(*adapter->outputs))))
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(outputs = heap_realloc(adapter->outputs,
|
|
|
|
sizeof(*adapter->outputs) * (adapter->output_count + 1))))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
adapter->outputs = outputs;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FAILED(hr = wined3d_output_init(&adapter->outputs[adapter->output_count],
|
|
|
|
adapter->output_count, adapter, output_name)))
|
|
|
|
{
|
|
|
|
ERR("Failed to initialise output %s, hr %#x.\n", wine_dbgstr_w(output_name), hr);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
++adapter->output_count;
|
|
|
|
TRACE("Initialised output %s.\n", wine_dbgstr_w(output_name));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2020-07-08 09:58:34 +02:00
|
|
|
BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, unsigned int ordinal, const LUID *luid,
|
2019-04-19 18:34:46 +02:00
|
|
|
const struct wined3d_adapter_ops *adapter_ops)
|
2018-08-16 09:39:21 +02:00
|
|
|
{
|
2021-01-25 15:22:19 +01:00
|
|
|
unsigned int output_idx = 0, primary_idx = 0;
|
2018-08-16 09:39:21 +02:00
|
|
|
DISPLAY_DEVICEW display_device;
|
2020-03-03 15:18:14 +01:00
|
|
|
BOOL ret = FALSE;
|
2018-08-16 09:39:21 +02:00
|
|
|
|
|
|
|
adapter->ordinal = ordinal;
|
2020-03-03 15:18:14 +01:00
|
|
|
adapter->output_count = 0;
|
2021-01-25 15:22:19 +01:00
|
|
|
adapter->outputs = NULL;
|
2018-08-16 09:39:21 +02:00
|
|
|
|
2020-07-08 09:58:34 +02:00
|
|
|
if (luid)
|
|
|
|
{
|
|
|
|
adapter->luid = *luid;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN("Allocating a random LUID.\n");
|
|
|
|
if (!AllocateLocallyUniqueId(&adapter->luid))
|
|
|
|
{
|
|
|
|
ERR("Failed to allocate a LUID, error %#x.\n", GetLastError());
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TRACE("adapter %p LUID %08x:%08x.\n", adapter, adapter->luid.HighPart, adapter->luid.LowPart);
|
|
|
|
|
2013-04-02 15:04:57 +02:00
|
|
|
display_device.cb = sizeof(display_device);
|
2021-01-25 15:22:19 +01:00
|
|
|
while (EnumDisplayDevicesW(NULL, output_idx++, &display_device, 0))
|
2019-10-30 15:01:29 +01:00
|
|
|
{
|
2021-01-25 15:22:19 +01:00
|
|
|
/* Detached outputs are not enumerated */
|
|
|
|
if (!(display_device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (display_device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
|
|
|
|
primary_idx = adapter->output_count;
|
|
|
|
|
|
|
|
if (!wined3d_adapter_create_output(adapter, display_device.DeviceName))
|
|
|
|
goto done;
|
2019-10-30 15:01:29 +01:00
|
|
|
}
|
2021-01-25 15:22:19 +01:00
|
|
|
TRACE("Initialised %d outputs for adapter %p.\n", adapter->output_count, adapter);
|
2020-03-03 15:18:14 +01:00
|
|
|
|
2021-01-25 15:22:19 +01:00
|
|
|
/* Make the primary output first */
|
|
|
|
if (primary_idx)
|
2020-03-03 15:18:14 +01:00
|
|
|
{
|
2021-01-25 15:22:19 +01:00
|
|
|
struct wined3d_output tmp = adapter->outputs[0];
|
|
|
|
adapter->outputs[0] = adapter->outputs[primary_idx];
|
|
|
|
adapter->outputs[0].ordinal = 0;
|
|
|
|
adapter->outputs[primary_idx] = tmp;
|
|
|
|
adapter->outputs[primary_idx].ordinal = primary_idx;
|
2020-03-03 15:18:14 +01:00
|
|
|
}
|
2017-02-10 12:26:57 +01:00
|
|
|
|
2019-03-12 16:30:18 +01:00
|
|
|
memset(&adapter->driver_uuid, 0, sizeof(adapter->driver_uuid));
|
|
|
|
memset(&adapter->device_uuid, 0, sizeof(adapter->device_uuid));
|
|
|
|
|
2018-08-30 14:54:49 +02:00
|
|
|
adapter->formats = NULL;
|
2019-04-19 18:34:46 +02:00
|
|
|
adapter->adapter_ops = adapter_ops;
|
2020-03-03 15:18:14 +01:00
|
|
|
ret = TRUE;
|
|
|
|
done:
|
|
|
|
if (!ret)
|
|
|
|
{
|
|
|
|
for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
|
|
|
|
wined3d_output_cleanup(&adapter->outputs[output_idx]);
|
|
|
|
heap_free(adapter->outputs);
|
|
|
|
}
|
|
|
|
return ret;
|
2019-03-22 09:42:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct wined3d_adapter *wined3d_adapter_create(unsigned int ordinal, DWORD wined3d_creation_flags)
|
|
|
|
{
|
2018-08-16 09:39:21 +02:00
|
|
|
if (wined3d_creation_flags & WINED3D_NO3D)
|
2019-03-22 09:42:05 +01:00
|
|
|
return wined3d_adapter_no3d_create(ordinal, wined3d_creation_flags);
|
|
|
|
|
2019-04-01 14:50:26 +02:00
|
|
|
if (wined3d_settings.renderer == WINED3D_RENDERER_VULKAN)
|
|
|
|
return wined3d_adapter_vk_create(ordinal, wined3d_creation_flags);
|
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
return wined3d_adapter_gl_create(ordinal, wined3d_creation_flags);
|
2007-06-09 14:27:41 +02:00
|
|
|
}
|
|
|
|
|
2009-09-16 08:37:15 +02:00
|
|
|
static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {}
|
|
|
|
|
|
|
|
const struct wined3d_parent_ops wined3d_null_parent_ops =
|
|
|
|
{
|
|
|
|
wined3d_null_wined3d_object_destroyed,
|
|
|
|
};
|
2010-04-04 19:51:37 +02:00
|
|
|
|
2014-03-20 15:51:45 +01:00
|
|
|
HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags)
|
2010-04-04 19:51:37 +02:00
|
|
|
{
|
|
|
|
wined3d->ref = 1;
|
2011-06-23 11:43:40 +02:00
|
|
|
wined3d->flags = flags;
|
2010-04-04 19:51:37 +02:00
|
|
|
|
2018-08-16 09:39:21 +02:00
|
|
|
TRACE("Initialising adapters.\n");
|
2013-01-18 12:05:24 +01:00
|
|
|
|
2019-03-22 09:42:05 +01:00
|
|
|
if (!(wined3d->adapters[0] = wined3d_adapter_create(0, flags)))
|
2010-04-04 19:51:37 +02:00
|
|
|
{
|
2019-03-22 09:42:05 +01:00
|
|
|
WARN("Failed to create adapter.\n");
|
2013-01-13 22:08:09 +01:00
|
|
|
return E_FAIL;
|
2010-04-04 19:51:37 +02:00
|
|
|
}
|
2013-01-18 12:05:24 +01:00
|
|
|
wined3d->adapter_count = 1;
|
2010-04-04 19:51:37 +02:00
|
|
|
|
|
|
|
return WINED3D_OK;
|
|
|
|
}
|