Commit 21b82143 authored by Michael Müller's avatar Michael Müller Committed by Vitaly Lipatov

ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB device.

parent 3dea5360
......@@ -49,6 +49,7 @@ static struct enum_device_entry
char interface_name[100];
char device_name[100];
const GUID *device_guid;
DWORD remove_caps;
} device_list7[] =
{
/* T&L HAL device */
......@@ -56,6 +57,7 @@ static struct enum_device_entry
"WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D",
"Wine D3D7 T&L HAL",
&IID_IDirect3DTnLHalDevice,
0,
},
/* HAL device */
......@@ -63,6 +65,7 @@ static struct enum_device_entry
"WINE Direct3D7 Hardware acceleration using WineD3D",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
0,
},
/* RGB device */
......@@ -70,6 +73,7 @@ static struct enum_device_entry
"WINE Direct3D7 RGB Software Emulation using WineD3D",
"Wine D3D7 RGB",
&IID_IDirect3DRGBDevice,
D3DDEVCAPS_HWTRANSFORMANDLIGHT,
},
};
......@@ -3757,6 +3761,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
{
struct ddraw *ddraw = impl_from_IDirect3D7(iface);
D3DDEVICEDESC7 device_desc7;
DWORD dev_caps;
HRESULT hr;
size_t i;
......@@ -3773,11 +3778,15 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
return hr;
}
dev_caps = device_desc7.dwDevCaps;
for (i = 0; i < ARRAY_SIZE(device_list7); i++)
{
HRESULT ret;
device_desc7.deviceGUID = *device_list7[i].device_guid;
device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps;
ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
if (ret != DDENUMRET_OK)
{
......
......@@ -577,6 +577,19 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G
return device;
}
static HRESULT WINAPI enum_devtype_software_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx)
{
BOOL *software_ok = ctx;
if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DRGBDevice))
{
ok(!(desc->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT),
"RGB emulation device shouldn't have HWTRANSFORMANDLIGHT flag\n");
*software_ok = TRUE;
return DDENUMRET_CANCEL;
}
return DDENUMRET_OK;
}
static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
{
const GUID *device_guid = &IID_IDirect3DHALDevice;
......@@ -6837,6 +6850,7 @@ static void test_surface_lock(void)
ULONG refcount;
DDPIXELFORMAT z_fmt;
BOOL hal_ok = FALSE;
BOOL software_ok = FALSE;
const GUID *devtype = &IID_IDirect3DHALDevice;
D3DDEVICEDESC7 device_desc;
BOOL cubemap_supported;
......@@ -6962,6 +6976,10 @@ static void test_surface_lock(void)
if (hal_ok)
devtype = &IID_IDirect3DTnLHalDevice;
hr = IDirect3D7_EnumDevices(d3d, enum_devtype_software_cb, &software_ok);
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
if (!software_ok) win_skip("RGB device not found, unable to check flags\n");
memset(&z_fmt, 0, sizeof(z_fmt));
hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment