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
24280497
Commit
24280497
authored
Apr 21, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Use a separate device for z_range_test().
parent
f8bd0523
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
visual.c
dlls/d3d8/tests/visual.c
+34
-18
No files found.
dlls/d3d8/tests/visual.c
View file @
24280497
...
...
@@ -1491,8 +1491,17 @@ done:
DestroyWindow
(
window
);
}
static
void
z_range_test
(
IDirect3DDevice8
*
device
)
static
void
z_range_test
(
void
)
{
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
D3DCOLOR
color
;
ULONG
refcount
;
D3DCAPS8
caps
;
DWORD
shader
;
HWND
window
;
HRESULT
hr
;
static
const
struct
vertex
quad
[]
=
{
{
-
1
.
0
f
,
0
.
0
f
,
1
.
1
f
,
0xffff0000
},
...
...
@@ -1509,22 +1518,18 @@ static void z_range_test(IDirect3DDevice8 *device)
};
static
const
struct
tvertex
quad3
[]
=
{
{
0
.
0
f
,
240
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
{
0
.
0
f
,
480
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
{
640
.
0
f
,
240
.
0
f
,
-
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
{
640
.
0
f
,
480
.
0
f
,
-
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
{
0
.
0
f
,
240
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
{
0
.
0
f
,
480
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xffffff00
},
};
static
const
struct
tvertex
quad4
[]
=
{
{
0
.
0
f
,
240
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
{
0
.
0
f
,
480
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
{
640
.
0
f
,
240
.
0
f
,
-
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
{
640
.
0
f
,
480
.
0
f
,
-
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
{
0
.
0
f
,
240
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
{
0
.
0
f
,
480
.
0
f
,
1
.
1
f
,
1
.
0
f
,
0xff00ff00
},
};
HRESULT
hr
;
DWORD
color
;
DWORD
shader
;
D3DCAPS8
caps
;
static
const
DWORD
shader_code
[]
=
{
0xfffe0101
,
/* vs_1_1 */
...
...
@@ -1541,6 +1546,16 @@ static void z_range_test(IDirect3DDevice8 *device)
D3DVSD_END
()
};
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
...
...
@@ -1555,6 +1570,8 @@ static void z_range_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffffffff
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disabled lighting, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_CLIPPING
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to enable clipping, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZENABLE
,
D3DZB_TRUE
);
...
...
@@ -1644,7 +1661,8 @@ static void z_range_test(IDirect3DDevice8 *device)
if
(
caps
.
VertexShaderVersion
<
D3DVS_VERSION
(
1
,
1
))
{
skip
(
"Vertex shaders not supported
\n
"
);
goto
out
;
IDirect3DDevice8_Release
(
device
);
goto
done
;
}
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
vertex_declaration
,
shader_code
,
&
shader
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create vertex shader, hr %#x.
\n
"
,
hr
);
...
...
@@ -1703,13 +1721,11 @@ static void z_range_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#x.
\n
"
,
hr
);
out:
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZENABLE
,
D3DZB_FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable z test, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_CLIPPING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable clipping, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZWRITEENABLE
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to enable z writes, hr %#x.
\n
"
,
hr
);
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
test_scalar_instructions
(
void
)
...
...
@@ -4946,7 +4962,6 @@ START_TEST(visual)
lighting_test
(
device_ptr
);
clear_test
(
device_ptr
);
fog_test
(
device_ptr
);
z_range_test
(
device_ptr
);
refcount
=
IDirect3DDevice8_Release
(
device_ptr
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
...
...
@@ -4954,6 +4969,7 @@ cleanup:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
z_range_test
();
offscreen_test
();
alpha_test
();
test_scalar_instructions
();
...
...
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