From: Stefan Dösinger <stefan(a)codeweavers.com>
I am not adding tests for creating larger buffers or drawing more
vertices because the behavior of my XP machine doesn't make much sense.
It allows larger buffers and larger draws, but if I draw from a large
buffer I get E_OUTOFMEMORY, even if I draw only 4 vertices. The limit is
slightly above 1024 vertices, so I don't think it has a causal
relationship with dwMaxVertexCount.
---
dlls/ddraw/tests/ddraw1.c | 23 +++++++++++++++++++++++
dlls/ddraw/tests/ddraw2.c | 23 +++++++++++++++++++++++
dlls/ddraw/tests/ddraw4.c | 23 +++++++++++++++++++++++
3 files changed, 69 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 96047744635..0b99b65cc4a 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -15336,6 +15336,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
+
+ ok(!hal->dwMaxBufferSize, "RGB Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "RGB Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "RGB Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "RGB Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
@@ -15353,6 +15360,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "HAL Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "HAL Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ /* D3DDD_MAXVERTEXCOUNT is not set in dwFlags despite dwMaxVertexCount containing
a sensible
+ * value. */
+ ok(hal->dwMaxVertexCount >= 1024 && hal->dwMaxVertexCount <=
32768,
+ "HAL Device hal caps has dwMaxVertexCount %#lx\n",
hal->dwMaxVertexCount);
+ ok(hel->dwMaxVertexCount >= 1024 && hel->dwMaxVertexCount <=
32768,
+ "HAL Device hel caps has dwMaxVertexCount %#lx\n",
hel->dwMaxVertexCount);
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
@@ -15418,6 +15434,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "Ramp Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "Ramp Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "Ramp Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "Ramp Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 3d4a0a26522..36acf14c4a9 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -16316,6 +16316,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
+
+ ok(!hal->dwMaxBufferSize, "RGB Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "RGB Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "RGB Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "RGB Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
@@ -16333,6 +16340,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "HAL Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "HAL Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ /* D3DDD_MAXVERTEXCOUNT is not set in dwFlags despite dwMaxVertexCount containing
a sensible
+ * value. */
+ ok(hal->dwMaxVertexCount >= 1024 && hal->dwMaxVertexCount <=
32768,
+ "HAL Device hal caps has dwMaxVertexCount %#lx\n",
hal->dwMaxVertexCount);
+ ok(hel->dwMaxVertexCount >= 1024 && hel->dwMaxVertexCount <=
32768,
+ "HAL Device hel caps has dwMaxVertexCount %#lx\n",
hel->dwMaxVertexCount);
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
@@ -16398,6 +16414,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "Ramp Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "Ramp Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "Ramp Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "Ramp Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index a0e4fe18c31..cf7812e54ab 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -19389,6 +19389,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION
set\n");
+
+ ok(!hal->dwMaxBufferSize, "RGB Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "RGB Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "RGB Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "RGB Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
@@ -19406,6 +19413,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "HAL Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "HAL Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ /* D3DDD_MAXVERTEXCOUNT is not set in dwFlags despite dwMaxVertexCount containing
a sensible
+ * value. */
+ ok(hal->dwMaxVertexCount >= 1024 && hal->dwMaxVertexCount <=
32768,
+ "HAL Device hal caps has dwMaxVertexCount %#lx\n",
hal->dwMaxVertexCount);
+ ok(hel->dwMaxVertexCount >= 1024 && hel->dwMaxVertexCount <=
32768,
+ "HAL Device hel caps has dwMaxVertexCount %#lx\n",
hel->dwMaxVertexCount);
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
@@ -19471,6 +19487,13 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid,
char *device_d
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX
set\n");
+
+ ok(!hal->dwMaxBufferSize, "Ramp Device hal caps has dwMaxBufferSize
%#lx\n", hal->dwMaxBufferSize);
+ ok(!hel->dwMaxBufferSize, "Ramp Device hel caps has dwMaxBufferSize
%#lx\n", hel->dwMaxBufferSize);
+ todo_wine ok(!hal->dwMaxVertexCount, "Ramp Device hal caps has
dwMaxVertexCount %#lx\n",
+ hal->dwMaxVertexCount);
+ todo_wine ok(hel->dwMaxVertexCount == 2021, "Ramp Device hel caps has
dwMaxVertexCount %#lx\n",
+ hel->dwMaxBufferSize);
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/5687