Rebase against 4336ed0b84b3dd3097bbbbf8e4b9de2e4d444ad7.

This commit is contained in:
Zebediah Figura
2021-03-12 16:12:02 -06:00
parent 5bcba4ef5a
commit 4a427fa757
8 changed files with 57 additions and 367 deletions

View File

@@ -1,8 +1,7 @@
From 980d867a89c72225b595b6e2a7313c1ddd42c9ad Mon Sep 17 00:00:00 2001
From 861cd6c6409efce4eb03aad3bc01f5df772e77fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 6 Feb 2016 01:15:07 +0100
Subject: [PATCH 1/3] ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB
device.
Subject: [PATCH] ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB device.
---
dlls/ddraw/ddraw.c | 9 +++++++++
@@ -10,10 +9,10 @@ Subject: [PATCH 1/3] ddraw: Don't set HWTRANSFORMANDLIGHT flag on d3d7 RGB
2 files changed, 27 insertions(+)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 97a11ef..9a19536 100644
index 705d0335d95..1d916f93c4f 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -50,6 +50,7 @@ static struct enum_device_entry
@@ -49,6 +49,7 @@ static struct enum_device_entry
char interface_name[100];
char device_name[100];
const GUID *device_guid;
@@ -21,7 +20,7 @@ index 97a11ef..9a19536 100644
} device_list7[] =
{
/* T&L HAL device */
@@ -57,6 +58,7 @@ static struct enum_device_entry
@@ -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,
@@ -29,7 +28,7 @@ index 97a11ef..9a19536 100644
},
/* HAL device */
@@ -64,6 +66,7 @@ static struct enum_device_entry
@@ -63,6 +65,7 @@ static struct enum_device_entry
"WINE Direct3D7 Hardware acceleration using WineD3D",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
@@ -37,7 +36,7 @@ index 97a11ef..9a19536 100644
},
/* RGB device */
@@ -71,6 +74,7 @@ static struct enum_device_entry
@@ -70,6 +73,7 @@ static struct enum_device_entry
"WINE Direct3D7 RGB Software Emulation using WineD3D",
"Wine D3D7 RGB",
&IID_IDirect3DRGBDevice,
@@ -45,7 +44,7 @@ index 97a11ef..9a19536 100644
},
};
@@ -3627,6 +3631,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3749,6 +3753,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
{
struct ddraw *ddraw = impl_from_IDirect3D7(iface);
D3DDEVICEDESC7 device_desc7;
@@ -53,7 +52,7 @@ index 97a11ef..9a19536 100644
HRESULT hr;
size_t i;
@@ -3643,11 +3648,15 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3765,11 +3770,15 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
return hr;
}
@@ -70,11 +69,11 @@ index 97a11ef..9a19536 100644
if (ret != DDENUMRET_OK)
{
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 3f433a6..aa7214a 100644
index d641595baa2..54cc18b74f2 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -311,6 +311,19 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7
return 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)
@@ -92,26 +91,26 @@ index 3f433a6..aa7214a 100644
+
static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
{
IDirectDrawSurface7 *surface, *ds;
@@ -321,6 +334,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
IDirect3D7 *d3d7;
HRESULT hr;
const GUID *device_guid = &IID_IDirect3DHALDevice;
@@ -6719,6 +6732,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;
@@ -6844,6 +6858,10 @@ static void test_surface_lock(void)
if (hal_ok)
devtype = &IID_IDirect3DTnLHalDevice;
if (!(ddraw = create_ddraw()))
@@ -364,6 +378,10 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr);
if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice;
+ hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_software_cb , &software_ok);
+ 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(d3d7, devtype, enum_z_fmt, &z_fmt);
hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
if (FAILED(hr) || !z_fmt.dwSize)
--
2.7.4
2.20.1