Module: wine Branch: master Commit: 291c4f3b65c8a0beb72c590a835285f15da22203 URL: http://source.winehq.org/git/wine.git/?a=commit;h=291c4f3b65c8a0beb72c590a83...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Oct 16 01:32:19 2014 +0200
d3d8/tests: Port the applicable parts of the new unsupported shaders tests to d3d8.
---
dlls/d3d8/tests/device.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index a84166c..02ec210 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -2855,6 +2855,7 @@ static void test_unsupported_shaders(void) DWORD vs, ps; HWND window; HRESULT hr; + D3DCAPS8 caps;
static const DWORD vs_2_0[] = { @@ -2873,6 +2874,38 @@ static void test_unsupported_shaders(void) 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff /* end */ }; +#if 0 + vs_1_1 + dcl_position v0 + def c255, 1.0, 1.0, 1.0, 1.0 + add r0, v0, c255 + mov oPos, r0 +#endif + static const DWORD vs_1_255[] = + { + 0xfffe0101, + 0x0000001f, 0x80000000, 0x900f0000, + 0x00000051, 0xa00f00ff, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x00000002, 0x800f0000, 0x90e40000, 0xa0e400ff, + 0x00000001, 0xc00f0000, 0x80e40000, + 0x0000ffff + }; +#if 0 + vs_1_1 + dcl_position v0 + def c256, 1.0, 1.0, 1.0, 1.0 + add r0, v0, c256 + mov oPos, r0 +#endif + static const DWORD vs_1_256[] = + { + 0xfffe0101, + 0x0000001f, 0x80000000, 0x900f0000, + 0x00000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x00000002, 0x800f0000, 0x90e40000, 0xa0e40100, + 0x00000001, 0xc00f0000, 0x80e40000, + 0x0000ffff + };
static const DWORD decl[] = { @@ -2906,6 +2939,23 @@ static void test_unsupported_shaders(void) hr = IDirect3DDevice8_CreatePixelShader(device, ps_2_0, &ps); ok(hr == D3DERR_INVALIDCALL, "IDirect3DDevice8_CreatePixelShader returned %#08x\n", hr);
+ hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.MaxVertexShaderConst < 256) + { + hr = IDirect3DDevice8_CreateVertexShader(device, decl, vs_1_255, &vs, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + else + { + hr = IDirect3DDevice8_CreateVertexShader(device, decl, vs_1_255, &vs, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_DeleteVertexShader(device, vs); + ok(hr == D3D_OK, "IDirect3DDevice8_DeleteVertexShader returned %#08x\n", hr); + hr = IDirect3DDevice8_CreateVertexShader(device, decl, vs_1_256, &vs, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + } + refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D8_Release(d3d);