Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4e9cf000
Commit
4e9cf000
authored
Feb 23, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add tests for z-clipping with D3DRS_ZENABLE disabled.
parent
19199bc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
145 additions
and
0 deletions
+145
-0
visual.c
dlls/d3d8/tests/visual.c
+145
-0
No files found.
dlls/d3d8/tests/visual.c
View file @
4e9cf000
...
@@ -25,6 +25,16 @@
...
@@ -25,6 +25,16 @@
static
HMODULE
d3d8_handle
=
0
;
static
HMODULE
d3d8_handle
=
0
;
struct
vec3
{
float
x
,
y
,
z
;
};
struct
vec4
{
float
x
,
y
,
z
,
w
;
};
static
HWND
create_window
(
void
)
static
HWND
create_window
(
void
)
{
{
WNDCLASS
wc
=
{
0
};
WNDCLASS
wc
=
{
0
};
...
@@ -2766,6 +2776,140 @@ static void resz_test(IDirect3DDevice8 *device)
...
@@ -2766,6 +2776,140 @@ static void resz_test(IDirect3DDevice8 *device)
IDirect3DSurface8_Release
(
original_rt
);
IDirect3DSurface8_Release
(
original_rt
);
}
}
static
void
zenable_test
(
IDirect3DDevice8
*
device
)
{
static
const
struct
{
struct
vec4
position
;
D3DCOLOR
diffuse
;
}
tquad
[]
=
{
{{
0
.
0
f
,
480
.
0
f
,
-
0
.
5
f
,
1
.
0
f
},
0xff00ff00
},
{{
0
.
0
f
,
0
.
0
f
,
-
0
.
5
f
,
1
.
0
f
},
0xff00ff00
},
{{
640
.
0
f
,
480
.
0
f
,
1
.
5
f
,
1
.
0
f
},
0xff00ff00
},
{{
640
.
0
f
,
0
.
0
f
,
1
.
5
f
,
1
.
0
f
},
0xff00ff00
},
};
D3DCOLOR
color
;
D3DCAPS8
caps
;
HRESULT
hr
;
UINT
x
,
y
;
UINT
i
,
j
;
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZENABLE
,
D3DZB_FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable z-buffering, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
D3DFVF_XYZRHW
|
D3DFVF_DIFFUSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set FVF, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xffff0000
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear render target, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
tquad
,
sizeof
(
*
tquad
));
ok
(
SUCCEEDED
(
hr
),
"Failed to draw, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
{
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
getPixelColor
(
device
,
x
,
y
);
ok
(
color_match
(
color
,
0x0000ff00
,
1
),
"Expected color 0x0000ff00 at %u, %u, got 0x%08x.
\n
"
,
x
,
y
,
color
);
}
}
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present backbuffer, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
if
(
caps
.
PixelShaderVersion
>=
D3DPS_VERSION
(
1
,
1
)
&&
caps
.
VertexShaderVersion
>=
D3DVS_VERSION
(
1
,
1
))
{
static
const
DWORD
vs_code
[]
=
{
0xfffe0101
,
/* vs_1_1 */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x00000001
,
0xd00f0000
,
0x90e40000
,
/* mov oD0, v0 */
0x0000ffff
};
static
const
DWORD
ps_code
[]
=
{
0xffff0101
,
/* ps_1_1 */
0x00000001
,
0x800f0000
,
0x90e40000
,
/* mov r0, v0 */
0x0000ffff
/* end */
};
static
const
struct
vec3
quad
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
-
0
.
5
f
},
{
-
1
.
0
f
,
1
.
0
f
,
-
0
.
5
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
5
f
},
{
1
.
0
f
,
1
.
0
f
,
1
.
5
f
},
};
static
const
D3DCOLOR
expected
[]
=
{
0x00ff0000
,
0x0060df60
,
0x009fdf9f
,
0x00ff0000
,
0x00ff0000
,
0x00609f60
,
0x009f9f9f
,
0x00ff0000
,
0x00ff0000
,
0x00606060
,
0x009f609f
,
0x00ff0000
,
0x00ff0000
,
0x00602060
,
0x009f209f
,
0x00ff0000
,
};
static
const
DWORD
decl
[]
=
{
D3DVSD_STREAM
(
0
),
D3DVSD_REG
(
D3DVSDE_POSITION
,
D3DVSDT_FLOAT3
),
D3DVSD_END
()
};
DWORD
vs
,
ps
;
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
vs_code
,
&
vs
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create vertex shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
device
,
ps_code
,
&
ps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create pixel shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
vs
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set vertex shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetPixelShader
(
device
,
ps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set pixel shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xffff0000
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear render target, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
ok
(
SUCCEEDED
(
hr
),
"Failed to draw, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
{
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
getPixelColor
(
device
,
x
,
y
);
ok
(
color_match
(
color
,
expected
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u, %u, got 0x%08x.
\n
"
,
expected
[
i
*
4
+
j
],
x
,
y
,
color
);
}
}
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present backbuffer, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetPixelShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set pixel shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set vertex shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DeletePixelShader
(
device
,
ps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to delete pixel shader, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DeleteVertexShader
(
device
,
vs
);
ok
(
SUCCEEDED
(
hr
),
"Failed to delete vertex shader, hr %#x.
\n
"
,
hr
);
}
}
START_TEST
(
visual
)
START_TEST
(
visual
)
{
{
IDirect3DDevice8
*
device_ptr
;
IDirect3DDevice8
*
device_ptr
;
...
@@ -2845,6 +2989,7 @@ START_TEST(visual)
...
@@ -2845,6 +2989,7 @@ START_TEST(visual)
intz_test
(
device_ptr
);
intz_test
(
device_ptr
);
shadow_test
(
device_ptr
);
shadow_test
(
device_ptr
);
multisample_copy_rects_test
(
device_ptr
);
multisample_copy_rects_test
(
device_ptr
);
zenable_test
(
device_ptr
);
resz_test
(
device_ptr
);
resz_test
(
device_ptr
);
cleanup
:
cleanup
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment