Matteo Bruni : d3d8/tests: Extend the shadow test a bit.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Oct 22 10:22:07 CDT 2015
Module: wine
Branch: master
Commit: a3432432a07e6d4ec5ed83764acf66843623b9bc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a3432432a07e6d4ec5ed83764acf66843623b9bc
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Oct 22 00:20:59 2015 +0200
d3d8/tests: Extend the shadow test a bit.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/tests/visual.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
index 9ca3946..088fe76 100644
--- a/dlls/d3d8/tests/visual.c
+++ b/dlls/d3d8/tests/visual.c
@@ -3874,6 +3874,7 @@ done:
static void shadow_test(void)
{
IDirect3DSurface8 *original_rt, *rt;
+ struct surface_readback rb;
IDirect3DDevice8 *device;
IDirect3D8 *d3d;
ULONG refcount;
@@ -3886,15 +3887,12 @@ static void shadow_test(void)
static const DWORD ps_code[] =
{
0xffff0101, /* ps_1_1 */
- 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 1.0, 0.0, 0.0, 0.0 */
+ 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 0.0, 1.0, 1.0 */
0x00000051, 0xa00f0001, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, /* def c1, 0.0, 1.0, 0.0, 0.0 */
- 0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3f800000, 0x00000000, /* def c2, 0.0, 0.0, 1.0, 0.0 */
0x00000042, 0xb00f0000, /* tex t0 */
0x00000042, 0xb00f0001, /* tex t1 */
- 0x00000008, 0xb0070001, 0xa0e40000, 0xb0e40001, /* dp3 t1.xyz, c0, t1 */
- 0x00000005, 0x80070000, 0xa0e40001, 0xb0e40001, /* mul r0.xyz, c1, t1 */
- 0x00000004, 0x80070000, 0xa0e40000, 0xb0e40000, 0x80e40000, /* mad r0.xyz, c0, t0, r0 */
- 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */
+ 0x00000005, 0xb00f0000, 0xa0e40000, 0xb0e40000, /* mul t0, c0, t0 */
+ 0x00000004, 0x800f0000, 0xa0e40001, 0xb0e40001, 0xb0e40000, /* mad r0, c1, t1, t0 */
0x0000ffff, /* end */
};
static const struct
@@ -3932,14 +3930,14 @@ static void shadow_test(void)
}
expected_colors[] =
{
- {400, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)},
- {560, 180, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)},
- {560, 300, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)},
- {400, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)},
- {240, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)},
- { 80, 300, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)},
- { 80, 180, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)},
- {240, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)},
+ {400, 60, 0x00000000},
+ {560, 180, 0xffff00ff},
+ {560, 300, 0xffff00ff},
+ {400, 420, 0xffffffff},
+ {240, 420, 0xffffffff},
+ { 80, 300, 0x00000000},
+ { 80, 180, 0x00000000},
+ {240, 60, 0x00000000},
};
window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
@@ -4066,14 +4064,16 @@ static void shadow_test(void)
ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr);
IDirect3DTexture8_Release(texture);
+ get_rt_readback(original_rt, &rb);
for (j = 0; j < sizeof(expected_colors) / sizeof(*expected_colors); ++j)
{
- D3DCOLOR color = getPixelColor(device, expected_colors[j].x, expected_colors[j].y);
+ D3DCOLOR color = get_readback_color(&rb, expected_colors[j].x, expected_colors[j].y);
ok(color_match(color, expected_colors[j].color, 0),
"Expected color 0x%08x at (%u, %u) for format %s, got 0x%08x.\n",
expected_colors[j].color, expected_colors[j].x, expected_colors[j].y,
formats[i].name, color);
}
+ release_surface_readback(&rb);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr);
More information about the wine-cvs
mailing list