Commit 291c4f3b authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3d8/tests: Port the applicable parts of the new unsupported shaders tests to d3d8.

parent 894298d5
......@@ -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);
......
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