Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
5604c7ed
Commit
5604c7ed
authored
13 years ago
by
Matteo Bruni
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d8/tests: Add more INTZ tests.
parent
5eecdc80
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3d8/tests/visual.c
+145
-2
145 additions, 2 deletions
dlls/d3d8/tests/visual.c
with
145 additions
and
2 deletions
dlls/d3d8/tests/visual.c
+
145
−
2
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment