d3d9: Remove the shader version varying tests.

My Windows 7 installation rejects mixing ps_3_0 with anything other than
vs_3_0 and vice versa, making testing how those versions pass varyings
moot. Since I have never seen an app mixing 3.0 and non-3.0 shaders I
see no reason to keep the tests.
This commit is contained in:
Stefan Dösinger 2010-07-06 13:00:17 +02:00 committed by Alexandre Julliard
parent a56df96a0e
commit a554d1e296

View file

@ -5833,397 +5833,6 @@ static void fixed_function_varying_test(IDirect3DDevice9 *device) {
IDirect3DVertexDeclaration9_Release(decl);
}
static void vshader_version_varying_test(IDirect3DDevice9 *device) {
static const DWORD ps_code[] = {
0xffff0300, /* ps_3_0 */
0x05000030, 0xf00f0000, 0x00000003, 0x00000003, 0x00000001, 0x00000000, /* defi i0, 3, 3, 1, 0 */
0x05000051, 0xa00f0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 0.0, 0.0, 0.0, 0.0 */
0x0200001f, 0x8001000a, 0x900f0003, /* dcl_color1 v3 */
0x0200001f, 0x8000000b, 0x900f0004, /* dcl_fog v4 */
0x0200001f, 0x80030005, 0x900f0005, /* dcl_texcoord3 v5 */
0x0200001f, 0x80000003, 0x900f0006, /* dcl_normal v6 */
0x0200001f, 0x80000006, 0x900f0007, /* dcl_tangent v7 */
0x0200001f, 0x80000001, 0x900f0008, /* dcl_blendweight v8 */
0x0200001f, 0x8000000c, 0x900f0009, /* dcl_depth v9 */
0x02000001, 0x800f0000, 0xa0e40000, /* mov r0, c0 */
0x0200001b, 0xf0e40800, 0xf0e40000, /* loop aL, i0 */
0x04000002, 0x800f0000, 0x80e40000, 0x90e42000, 0xf0e40800, /* add r0, r0, v0[aL] */
0x0000001d, /* endloop */
0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */
0x0000ffff /* end */
};
static const DWORD vs_1_code[] = {
0xfffe0101, /* vs_1_1 */
0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */
0x00000051, 0xa00f0000, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, /* def c0, 0.1, 0.0, 0.0, 0.0 */
0x00000051, 0xa00f0001, 0x00000000, 0x3e4ccccd, 0x00000000, 0x00000000, /* def c1, 0.0, 0.2, 0.0, 0.0 */
0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3ecccccd, 0x00000000, /* def c2, 0.0, 0.0, 0.4, 0.0 */
0x00000051, 0xa00f0003, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c3, 1.0, 1.0, 1.0, 1.0 */
0x00000001, 0xd00f0000, 0xa0e40002, /* mov oD0, c2 */
0x00000001, 0xd00f0001, 0xa0e40000, /* mov oD1, c0 */
0x00000001, 0xc00f0001, 0xa0550001, /* mov oFog, c1.g */
0x00000001, 0xe00f0000, 0xa0e40003, /* mov oT0, c3 */
0x00000001, 0xe00f0001, 0xa0e40003, /* mov oT1, c3 */
0x00000001, 0xe00f0002, 0xa0e40003, /* mov oT2, c3 */
0x00000001, 0xe00f0003, 0xa0e40002, /* mov oT3, c2 */
0x00000001, 0xe00f0004, 0xa0e40003, /* mov oT4, c3 */
0x00000001, 0xe00f0005, 0xa0e40003, /* mov oT5, c3 */
0x00000001, 0xe00f0006, 0xa0e40003, /* mov oT6, c3 */
0x00000001, 0xe00f0007, 0xa0e40003, /* mov oT7, c3 */
0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */
0x0000ffff
};
DWORD vs_2_code[] = {
0xfffe0200, /* vs_2_0 */
0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */
0x05000051, 0xa00f0000, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, /* def c0, 0.1, 0.0, 0.0, 0.0 */
0x05000051, 0xa00f0001, 0x00000000, 0x3e4ccccd, 0x00000000, 0x00000000, /* def c1, 0.0, 0.2, 0.0, 0.0 */
0x05000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3ecccccd, 0x00000000, /* def c2, 0.0, 0.0, 0.4, 0.0 */
0x05000051, 0xa00f0003, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c3, 1.0, 1.0, 1.0, 1.0 */
0x02000001, 0xd00f0000, 0xa0e40002, /* mov oD0, c2 */
0x02000001, 0xd00f0001, 0xa0e40000, /* mov oD1, c0 */
0x02000001, 0xc00f0001, 0xa0550001, /* mov oFog, c1.g */
0x02000001, 0xe00f0000, 0xa0e40003, /* mov oT0, c3 */
0x02000001, 0xe00f0001, 0xa0e40003, /* mov oT1, c3 */
0x02000001, 0xe00f0002, 0xa0e40003, /* mov oT2, c3 */
0x02000001, 0xe00f0003, 0xa0e40002, /* mov oT3, c2 */
0x02000001, 0xe00f0004, 0xa0e40003, /* mov oT4, c3 */
0x02000001, 0xe00f0005, 0xa0e40003, /* mov oT5, c3 */
0x02000001, 0xe00f0006, 0xa0e40003, /* mov oT6, c3 */
0x02000001, 0xe00f0007, 0xa0e40003, /* mov oT7, c3 */
0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */
0x0000ffff /* end */
};
/* TODO: Define normal, tangent, blendweight and depth here */
static const DWORD vs_3_code[] = {
0xfffe0300, /* vs_3_0 */
0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */
0x0200001f, 0x8001000a, 0xe00f0009, /* dcl_color1 o9 */
0x0200001f, 0x8000000b, 0xe00f0002, /* dcl_fog o2 */
0x0200001f, 0x80030005, 0xe00f0005, /* dcl_texcoord3 o5 */
0x0200001f, 0x80000000, 0xe00f000b, /* dcl_position o11 */
0x05000051, 0xa00f0000, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, /* def c0, 0.1, 0.0, 0.0, 0.0 */
0x05000051, 0xa00f0001, 0x00000000, 0x3e4ccccd, 0x00000000, 0x00000000, /* def c1, 0.0, 0.2, 0.0, 0.0 */
0x05000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3ecccccd, 0x00000000, /* def c2, 0.0, 0.0, 0.4, 0.0 */
0x05000051, 0xa00f0003, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c3, 1.0, 1.0, 1.0, 1.0 */
0x02000001, 0xe00f0009, 0xa0e40000, /* mov o9, c0 */
0x02000001, 0xe00f0002, 0xa0e40001, /* mov o2, c1 */
0x02000001, 0xe00f0005, 0xa0e40002, /* mov o5, c2 */
0x02000001, 0xe00f000b, 0x90e40000, /* mov o11, v0 */
0x0000ffff /* end */
};
float quad1[] = {
-1.0, -1.0, 0.1,
0.0, -1.0, 0.1,
-1.0, 0.0, 0.1,
0.0, 0.0, 0.1
};
float quad2[] = {
0.0, -1.0, 0.1,
1.0, -1.0, 0.1,
0.0, 0.0, 0.1,
1.0, 0.0, 0.1
};
float quad3[] = {
-1.0, 0.0, 0.1,
0.0, 0.0, 0.1,
-1.0, 1.0, 0.1,
0.0, 1.0, 0.1
};
HRESULT hr;
DWORD color;
IDirect3DPixelShader9 *pixelshader = NULL;
IDirect3DVertexShader9 *vs_1_shader = NULL;
IDirect3DVertexShader9 *vs_2_shader = NULL;
IDirect3DVertexShader9 *vs_3_shader = NULL;
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff110000, 0.0, 0);
ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear returned %#x.\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, ps_code, &pixelshader);
ok(hr == D3D_OK, "IDirect3DDevice_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_code, &vs_1_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_2_code, &vs_2_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_3_code, &vs_3_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, pixelshader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ);
hr = IDirect3DDevice9_BeginScene(device);
ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr);
if(SUCCEEDED(hr))
{
hr = IDirect3DDevice9_SetVertexShader(device, vs_1_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vs_2_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vs_3_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_EndScene(device);
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr);
}
color = getPixelColor(device, 160, 120);
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x1a, 0x34, 0x67), 1),
"vs_3_0 returned color 0x%08x, expected 0x00193366\n", color);
/* Accept two ways of oFog handling:
*
* oFog is supposed to be a scalar. The pixel shader declares a vec4 oFog input and reads all components.
* The vertex shader writes oFog without a writemask. There are two ways windows drivers deal with this:
*
* 1) Keep oFog a scalar, and assign v4 = {oFog, 0, 0, 0}. oFog = 0x33, so the result color is 004d0067.
* This happens with software vertex processing and on Intel cards
*
* 2) Make oFog a vec4, and assign v4 = {oFog.x, oFog.y, oFog.z, oFog.w}. This way the result color is
* 0x004d339a. This happens on Nvidia Geforce 6+ cards
*/
color = getPixelColor(device, 160, 360);
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1) ||
color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x33, 0x9a), 1),
"vs_1_1 returned color 0x%08x, expected 0x004c0066\n", color);
color = getPixelColor(device, 480, 360);
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1) ||
color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x33, 0x9a), 1),
"vs_2_0 returned color 0x%08x, expected 0x004d0067 or 0x004d33a0\n", color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
/* cleanup */
hr = IDirect3DDevice9_SetPixelShader(device, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
if(pixelshader) IDirect3DPixelShader9_Release(pixelshader);
if(vs_1_shader) IDirect3DVertexShader9_Release(vs_1_shader);
if(vs_2_shader) IDirect3DVertexShader9_Release(vs_2_shader);
if(vs_3_shader) IDirect3DVertexShader9_Release(vs_3_shader);
}
static void pshader_version_varying_test(IDirect3DDevice9 *device) {
static const DWORD vs_code[] = {
0xfffe0300, /* vs_3_0 */
0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */
0x0200001f, 0x80000000, 0xe00f0000, /* dcl_position o0 */
0x0200001f, 0x8000000a, 0xe00f0001, /* dcl_color0 o1 */
0x0200001f, 0x80000005, 0xe00f0002, /* dcl_texcoord0 o2 */
0x0200001f, 0x8000000b, 0xe00f0003, /* dcl_fog o3 */
0x0200001f, 0x80000003, 0xe00f0004, /* dcl_normal o4 */
0x0200001f, 0x8000000c, 0xe00f0005, /* dcl_depth o5 */
0x0200001f, 0x80000006, 0xe00f0006, /* dcl_tangent o6 */
0x0200001f, 0x80000001, 0xe00f0007, /* dcl_blendweight o7 */
0x05000051, 0xa00f0001, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, /* def c1, 0.1, 0.0, 0.0, 0.0 */
0x05000051, 0xa00f0002, 0x00000000, 0x3e4ccccd, 0x00000000, 0x3f800000, /* def c2, 0.0, 0.2, 0.0, 1.0 */
0x05000051, 0xa00f0003, 0x3ecccccd, 0x3f59999a, 0x3f666666, 0x00000000, /* def c3, 0.4, 0.85,0.9, 0.0 */
0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 1.0, 1.0, 1.0 */
0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */
0x02000001, 0xe00f0001, 0xa0e40001, /* mov o1, c1 */
0x02000001, 0xe00f0002, 0xa0e40002, /* mov o2, c2 */
0x02000001, 0xe00f0003, 0xa0e40003, /* mov o3, c3 */
0x02000001, 0xe00f0004, 0xa0e40000, /* mov o4, c0 */
0x02000001, 0xe00f0005, 0xa0e40000, /* mov o5, c0 */
0x02000001, 0xe00f0006, 0xa0e40000, /* mov o6, c0 */
0x02000001, 0xe00f0007, 0xa0e40000, /* mov o7, c0 */
0x0000ffff /* end */
};
static const DWORD ps_1_code[] = {
0xffff0104, /* ps_1_4 */
0x00000051, 0xa00f0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 0.0, 0.0, 0.0, 0.0 */
0x00000040, 0x80070001, 0xb0e40000, /* texcrd r1.xyz, t0 */
0x00000001, 0x80080001, 0xa0ff0000, /* mov r1.a, c0.a */
0x00000002, 0x800f0000, 0x90e40000, 0x80e40001, /* add r0, v0, r1 */
0x0000ffff /* end */
};
static const DWORD ps_2_code[] = {
0xffff0200, /* ps_2_0 */
0x0200001f, 0x80000000, 0xb00f0000, /* dcl t0 */
0x0200001f, 0x80000000, 0x900f0000, /* dcl v0 */
0x0200001f, 0x80000000, 0x900f0001, /* dcl v1 */
0x02000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */
0x03000002, 0x800f0000, 0x80e40000,0xb0e40000, /* add r0, r0, t0 */
0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */
0x0000ffff /* end */
};
static const DWORD ps_3_code[] = {
0xffff0300, /* ps_3_0 */
0x0200001f, 0x80000005, 0x900f0000, /* dcl_texcoord0 v0 */
0x0200001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */
0x0200001f, 0x8000000b, 0x900f0002, /* dcl_fog v2 */
0x02000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */
0x03000002, 0x800f0000, 0x80e40000, 0x90e40001, /* add r0, r0, v1 */
0x03000002, 0x800f0000, 0x80e40000, 0x90e40002, /* mov r0, r0, v2 */
0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */
0x0000ffff /* end */
};
float quad1[] = {
-1.0, -1.0, 0.1,
0.0, -1.0, 0.1,
-1.0, 0.0, 0.1,
0.0, 0.0, 0.1
};
float quad2[] = {
0.0, -1.0, 0.1,
1.0, -1.0, 0.1,
0.0, 0.0, 0.1,
1.0, 0.0, 0.1
};
float quad3[] = {
-1.0, 0.0, 0.1,
0.0, 0.0, 0.1,
-1.0, 1.0, 0.1,
0.0, 1.0, 0.1
};
float quad4[] = {
0.0, 0.0, 0.1,
1.0, 0.0, 0.1,
0.0, 1.0, 0.1,
1.0, 1.0, 0.1
};
HRESULT hr;
DWORD color;
IDirect3DVertexShader9 *vertexshader = NULL;
IDirect3DPixelShader9 *ps_1_shader = NULL;
IDirect3DPixelShader9 *ps_2_shader = NULL;
IDirect3DPixelShader9 *ps_3_shader = NULL;
IDirect3DTexture9 *texture = NULL;
D3DLOCKED_RECT lr;
unsigned int x, y;
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0, 0);
ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear returned %#x.\n", hr);
hr = IDirect3DDevice9_CreateTexture(device, 512, 512, 1, 0, D3DFMT_A16B16G16R16, D3DPOOL_MANAGED, &texture, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture returned %08x\n", hr);
if(FAILED(hr)) {
skip("D3DFMT_A16B16G16R16 textures not supported\n");
return;
}
hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0);
ok(hr == D3D_OK, "IDirect3DTexture9_LockRect returned %08x\n", hr);
for(y = 0; y < 512; y++) {
for(x = 0; x < 512; x++) {
double r_f = (double) x / (double) 512;
double g_f = (double) y / (double) 512;
unsigned short *dst = (unsigned short *) (((unsigned char *) lr.pBits) + y * lr.Pitch + x * 8);
unsigned short r = (unsigned short) (r_f * 65535.0);
unsigned short g = (unsigned short) (g_f * 65535.0);
dst[0] = r;
dst[1] = g;
dst[2] = 0;
dst[3] = 65535;
}
}
hr = IDirect3DTexture9_UnlockRect(texture, 0);
ok(hr == D3D_OK, "IDirect3DTexture9_UnlockRect returned %08x\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_code, &vertexshader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, ps_1_code, &ps_1_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, ps_2_code, &ps_2_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, ps_3_code, &ps_3_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vertexshader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ);
hr = IDirect3DDevice9_BeginScene(device);
ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr);
if(SUCCEEDED(hr))
{
hr = IDirect3DDevice9_SetPixelShader(device, ps_1_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, ps_2_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, ps_3_shader);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture);
ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState returned %#x.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD);
ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState returned %#x.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState returned %#x.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState returned %#x.\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(float) * 3);
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
hr = IDirect3DDevice9_EndScene(device);
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr);
}
color = getPixelColor(device, 160, 120);
ok((color & 0x00ff0000) >= 0x00790000 && (color & 0x00ff0000) <= 0x00810000 &&
(color & 0x0000ff00) == 0x0000ff00 &&
(color & 0x000000ff) >= 0x000000e4 && (color & 0x000000ff) <= 0x000000e6,
"ps_3_0 returned color 0x%08x, expected 0x0080ffe5\n", color);
color = getPixelColor(device, 160, 360);
ok((color & 0x00ff0000) >= 0x00190000 && (color & 0x00ff0000) <= 0x00210000 &&
(color & 0x0000ff00) >= 0x00003300 && (color & 0x0000ff00) <= 0x00003400 &&
(color & 0x000000ff) == 0x00000000,
"ps_1_4 returned color 0x%08x, expected 0x00203300\n", color);
color = getPixelColor(device, 480, 360);
ok((color & 0x00ff0000) >= 0x00190000 && (color & 0x00ff0000) <= 0x00210000 &&
(color & 0x0000ff00) >= 0x00003200 && (color & 0x0000ff00) <= 0x00003400 &&
(color & 0x000000ff) == 0x00000000,
"ps_2_0 returned color 0x%08x, expected 0x00203300\n", color);
color = getPixelColor(device, 480, 160);
ok( color == 0x00ffffff /* Nvidia driver garbage with HW vp */ || (
(color & 0x00ff0000) >= 0x00190000 && (color & 0x00ff0000) <= 0x00210000 &&
(color & 0x0000ff00) >= 0x00003200 && (color & 0x0000ff00) <= 0x00003400 &&
(color & 0x000000ff) == 0x00000000),
"fixed function fragment processing returned color 0x%08x, expected 0x00203300\n", color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
/* cleanup */
hr = IDirect3DDevice9_SetTexture(device, 0, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr);
if(vertexshader) IDirect3DVertexShader9_Release(vertexshader);
if(ps_1_shader) IDirect3DPixelShader9_Release(ps_1_shader);
if(ps_2_shader) IDirect3DPixelShader9_Release(ps_2_shader);
if(ps_3_shader) IDirect3DPixelShader9_Release(ps_3_shader);
if(texture) IDirect3DTexture9_Release(texture);
}
static void test_compare_instructions(IDirect3DDevice9 *device)
{
DWORD shader_sge_vec_code[] = {
@ -11419,8 +11028,6 @@ START_TEST(visual)
vFace_register_test(device_ptr);
vpos_register_test(device_ptr);
multiple_rendertargets_test(device_ptr);
vshader_version_varying_test(device_ptr);
pshader_version_varying_test(device_ptr);
} else {
skip("No ps_3_0 or vs_3_0 support\n");
}