Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5604c7ed
Commit
5604c7ed
authored
Jan 12, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add more INTZ tests.
parent
5eecdc80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
145 additions
and
2 deletions
+145
-2
visual.c
dlls/d3d8/tests/visual.c
+145
-2
No files found.
dlls/d3d8/tests/visual.c
View file @
5604c7ed
...
...
@@ -1854,6 +1854,20 @@ static void intz_test(IDirect3DDevice8 *device)
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
5
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
},
half_quad_1
[]
=
{
{
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
5
f
},
{
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
5
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
},
half_quad_2
[]
=
{
{
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
5
f
},
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
5
f
},
{
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
{
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
},
};
struct
{
...
...
@@ -1888,6 +1902,11 @@ static void intz_test(IDirect3DDevice8 *device)
skip
(
"No pixel shader 1.1 support, skipping INTZ test.
\n
"
);
return
;
}
if
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_POW2
)
{
skip
(
"No unconditional NP2 texture support, skipping INTZ test.
\n
"
);
return
;
}
hr
=
IDirect3DDevice8_GetDirect3D
(
device
,
&
d3d8
);
ok
(
SUCCEEDED
(
hr
),
"GetDirect3D failed, hr %#x.
\n
"
,
hr
);
...
...
@@ -1907,10 +1926,10 @@ static void intz_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_GetDepthStencilSurface
(
device
,
&
original_ds
);
ok
(
SUCCEEDED
(
hr
),
"GetDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
1024
,
1024
,
1
,
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
640
,
480
,
1
,
D3DUSAGE_DEPTHSTENCIL
,
MAKEFOURCC
(
'I'
,
'N'
,
'T'
,
'Z'
),
D3DPOOL_DEFAULT
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"CreateTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
device
,
1024
,
1024
,
D3DFMT_A8R8G8B8
,
hr
=
IDirect3DDevice8_CreateRenderTarget
(
device
,
640
,
480
,
D3DFMT_A8R8G8B8
,
D3DMULTISAMPLE_NONE
,
FALSE
,
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"CreateRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreatePixelShader
(
device
,
ps_code
,
&
ps
);
...
...
@@ -1953,6 +1972,8 @@ static void intz_test(IDirect3DDevice8 *device)
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
ds
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceLevel failed, hr %#x.
\n
"
,
hr
);
/* Render offscreen, using the INTZ texture as depth buffer */
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
rt
,
ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DDevice8_SetPixelShader
(
device
,
0
);
...
...
@@ -1998,6 +2019,128 @@ static void intz_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
1
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
IDirect3DTexture8_Release
(
texture
);
/* Render onscreen while using the INTZ texture as depth buffer */
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
640
,
480
,
1
,
D3DUSAGE_DEPTHSTENCIL
,
MAKEFOURCC
(
'I'
,
'N'
,
'T'
,
'Z'
),
D3DPOOL_DEFAULT
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"CreateTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
ds
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceLevel failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DDevice8_SetPixelShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShader failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_ZBUFFER
,
0
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Clear failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
ds
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
0
,
(
IDirect3DBaseTexture8
*
)
texture
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
1
,
(
IDirect3DBaseTexture8
*
)
texture
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetPixelShader
(
device
,
ps
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShader failed, hr %#x.
\n
"
,
hr
);
/* Read the depth values back. */
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
expected_colors
)
/
sizeof
(
*
expected_colors
);
++
i
)
{
D3DCOLOR
color
=
getPixelColor
(
device
,
expected_colors
[
i
].
x
,
expected_colors
[
i
].
y
);
ok
(
color_match
(
color
,
expected_colors
[
i
].
color
,
1
),
"Expected color 0x%08x at (%u, %u), got 0x%08x.
\n
"
,
expected_colors
[
i
].
color
,
expected_colors
[
i
].
x
,
expected_colors
[
i
].
y
,
color
);
}
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
1
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
IDirect3DTexture8_Release
(
texture
);
/* Render offscreen, then onscreen, and finally check the INTZ texture in both areas */
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
640
,
480
,
1
,
D3DUSAGE_DEPTHSTENCIL
,
MAKEFOURCC
(
'I'
,
'N'
,
'T'
,
'Z'
),
D3DPOOL_DEFAULT
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"CreateTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DTexture8_GetSurfaceLevel
(
texture
,
0
,
&
ds
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceLevel failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
rt
,
ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DDevice8_SetPixelShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShader failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_ZBUFFER
,
0
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Clear failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
half_quad_1
,
sizeof
(
*
half_quad_1
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
half_quad_2
,
sizeof
(
*
half_quad_2
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
ds
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
0
,
(
IDirect3DBaseTexture8
*
)
texture
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetTexture
(
device
,
1
,
(
IDirect3DBaseTexture8
*
)
texture
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetPixelShader
(
device
,
ps
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShader failed, hr %#x.
\n
"
,
hr
);
/* Read the depth values back. */
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
expected_colors
)
/
sizeof
(
*
expected_colors
);
++
i
)
{
D3DCOLOR
color
=
getPixelColor
(
device
,
expected_colors
[
i
].
x
,
expected_colors
[
i
].
y
);
ok
(
color_match
(
color
,
expected_colors
[
i
].
color
,
1
),
"Expected color 0x%08x at (%u, %u), got 0x%08x.
\n
"
,
expected_colors
[
i
].
color
,
expected_colors
[
i
].
x
,
expected_colors
[
i
].
y
,
color
);
}
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
original_ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
original_ds
);
...
...
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