A lot of tests get skipped on my Windows XP EeePC just because the Direct3D 9 device creation fails. And apparently that's just because we ask for mixed vertex processing instead of software vertex processing.
How important is it to use mixed mode instead of software, at least for these tests?
It does not seem to make any difference to the test results on my HD4000 graphics card (that one is on Windows 8 and accepts both mixed and software vertex processing unlike the GMA950).
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c index ba0f065..e25a5d3 100644 --- a/dlls/d3dx9_36/tests/core.c +++ b/dlls/d3dx9_36/tests/core.c @@ -1240,7 +1240,7 @@ START_TEST(core) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if(FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 8e12b74..7f238be 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -2686,7 +2686,7 @@ START_TEST(effect) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/tests/line.c b/dlls/d3dx9_36/tests/line.c index b9eacee..89e4fc6 100644 --- a/dlls/d3dx9_36/tests/line.c +++ b/dlls/d3dx9_36/tests/line.c @@ -138,7 +138,7 @@ START_TEST(line) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index 35e38e4..0218000 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -129,7 +129,7 @@ static struct test_context *new_test_context(void) d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, - D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Couldn't create IDirect3DDevice9 object %#x\n", hr); @@ -1183,7 +1183,7 @@ static void D3DXCreateMeshTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -1390,7 +1390,7 @@ static void D3DXCreateMeshFVFTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -2263,7 +2263,7 @@ static void D3DXLoadMeshTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -2462,7 +2462,7 @@ static void D3DXCreateBoxTest(void) memset(&d3dpp, 0, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -2760,7 +2760,7 @@ static void D3DXCreateSphereTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -3004,7 +3004,7 @@ static void D3DXCreateCylinderTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -4004,7 +4004,7 @@ static void D3DXCreateTextTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); @@ -4298,7 +4298,7 @@ static void D3DXGenerateAdjacencyTest(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 75139b1..223bebf 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -1370,7 +1370,7 @@ static void test_setting_constants(void) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 84a70cf..7ae7df9 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -1230,7 +1230,7 @@ START_TEST(surface) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if(FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 2b17f64..9972571 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1803,7 +1803,7 @@ START_TEST(texture) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr); IDirect3D9_Release(d3d); diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index 35cd509..f3976c0 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -284,7 +284,7 @@ START_TEST(volume) ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); if(FAILED(hr)) { skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
On 14 December 2012 00:53, Francois Gouget fgouget@free.fr wrote:
A lot of tests get skipped on my Windows XP EeePC just because the Direct3D 9 device creation fails. And apparently that's just because we ask for mixed vertex processing instead of software vertex processing.
How important is it to use mixed mode instead of software, at least for these tests?
I doubt it matters at all here. In the general case though, we probably want D3DCREATE_HARDWARE_VERTEXPROCESSING if we can get it. (See also create_device() in e.g. dlls/d3d9/tests/device.c)
On Fri, 14 Dec 2012, Henri Verbeet wrote: [...]
How important is it to use mixed mode instead of software, at least for these tests?
I doubt it matters at all here.
Ok. I've sent the patch to wine-patches.
The other thing which is strange is that I only get trouble about mixed vertex processing on Windows. On Linux CreateDevice() succeeds in either mode.
In the general case though, we probably want D3DCREATE_HARDWARE_VERTEXPROCESSING if we can get it. (See also create_device() in e.g. dlls/d3d9/tests/device.c)
About that function, by the time we try software vertex processing we've changed AutoDepthStencilFormat. Shouldn't we try more something like this pseudo-code:
for processing in HARDWARE, SOFTWARE: for format in D3DFMT_D24S8, D3DFMT_D16: if SUCCEEDED(CreateDevice()): return device;
I.e. based on my very limited recent experience it seems to me that the sticking point is more likely to be the vertex processing mode than the depth stencil format (I have confirmed that on my GMA950 CreateDevice() succeeds for the D24S8+SOFTWARE combination).
(I ordered the loop so we pick HARDWARE if at all possible as it seems to be the goal)
On 14 December 2012 13:11, Francois Gouget fgouget@free.fr wrote:
The other thing which is strange is that I only get trouble about mixed vertex processing on Windows. On Linux CreateDevice() succeeds in either mode.
Yeah, we don't really make the difference in Wine, all we have is "hardware", although the GL driver may still end up doing vertex processing in software. The reality is that most applications expect NVIDIA or AMD hardware, and hardware vertex processing. They may or may not fallback to mixed or software if that is not available, and that fallback may or may not be broken.
About that function, by the time we try software vertex processing we've changed AutoDepthStencilFormat. Shouldn't we try more something like this pseudo-code:
for processing in HARDWARE, SOFTWARE: for format in D3DFMT_D24S8, D3DFMT_D16: if SUCCEEDED(CreateDevice()): return device;
I.e. based on my very limited recent experience it seems to me that the sticking point is more likely to be the vertex processing mode than the depth stencil format (I have confirmed that on my GMA950 CreateDevice() succeeds for the D24S8+SOFTWARE combination).
Yeah, we probably should.