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
77eb58b5
Commit
77eb58b5
authored
Feb 12, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Test rhw table fog z vs rhw.
parent
3b2c6421
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
0 deletions
+122
-0
visual.c
dlls/d3d8/tests/visual.c
+122
-0
No files found.
dlls/d3d8/tests/visual.c
View file @
77eb58b5
...
...
@@ -5515,6 +5515,127 @@ static void test_negative_fixedfunction_fog(void)
DestroyWindow
(
window
);
}
static
void
test_table_fog_zw
(
void
)
{
HRESULT
hr
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
ULONG
refcount
;
HWND
window
;
D3DCOLOR
color
;
D3DCAPS8
caps
;
static
struct
{
struct
vec4
position
;
D3DCOLOR
diffuse
;
}
quad
[]
=
{
{{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
0xffff0000
},
{{
640
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
0xffff0000
},
{{
0
.
0
f
,
480
.
0
f
,
0
.
0
f
,
0
.
0
f
},
0xffff0000
},
{{
640
.
0
f
,
480
.
0
f
,
0
.
0
f
,
0
.
0
f
},
0xffff0000
},
};
static
const
D3DMATRIX
identity
=
{{{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
}}};
static
const
struct
{
float
z
,
w
;
D3DZBUFFERTYPE
z_test
;
D3DCOLOR
color
;
}
tests
[]
=
{
{
0
.
7
f
,
0
.
0
f
,
D3DZB_TRUE
,
0x004cb200
},
{
0
.
7
f
,
0
.
0
f
,
D3DZB_FALSE
,
0x004cb200
},
{
0
.
7
f
,
0
.
3
f
,
D3DZB_TRUE
,
0x004cb200
},
{
0
.
7
f
,
0
.
3
f
,
D3DZB_FALSE
,
0x004cb200
},
{
0
.
7
f
,
3
.
0
f
,
D3DZB_TRUE
,
0x004cb200
},
{
0
.
7
f
,
3
.
0
f
,
D3DZB_FALSE
,
0x004cb200
},
{
0
.
3
f
,
0
.
0
f
,
D3DZB_TRUE
,
0x00b24c00
},
{
0
.
3
f
,
0
.
0
f
,
D3DZB_FALSE
,
0x00b24c00
},
};
unsigned
int
i
;
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
"
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get device caps, hr %#x.
\n
"
,
hr
);
if
(
!
(
caps
.
RasterCaps
&
D3DPRASTERCAPS_FOGTABLE
))
{
skip
(
"D3DPRASTERCAPS_FOGTABLE not supported, skipping POSITIONT table fog test.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_FOGENABLE
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_FOGCOLOR
,
0x0000ff00
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_CLIPPING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderState failed, hr %#x.
\n
"
,
hr
);
/* Work around an AMD Windows driver bug. Needs a proj matrix applied redundantly. */
hr
=
IDirect3DDevice8_SetTransform
(
device
,
D3DTS_PROJECTION
,
&
identity
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set projection transform, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_FOGTABLEMODE
,
D3DFOG_LINEAR
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
D3DFVF_XYZRHW
|
D3DFVF_DIFFUSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fvf, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
*
tests
);
++
i
)
{
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0x000000ff
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear, hr %#x.
\n
"
,
hr
);
quad
[
0
].
position
.
z
=
tests
[
i
].
z
;
quad
[
1
].
position
.
z
=
tests
[
i
].
z
;
quad
[
2
].
position
.
z
=
tests
[
i
].
z
;
quad
[
3
].
position
.
z
=
tests
[
i
].
z
;
quad
[
0
].
position
.
w
=
tests
[
i
].
w
;
quad
[
1
].
position
.
w
=
tests
[
i
].
w
;
quad
[
2
].
position
.
w
=
tests
[
i
].
w
;
quad
[
3
].
position
.
w
=
tests
[
i
].
w
;
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_ZENABLE
,
tests
[
i
].
z_test
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, 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
[
0
]));
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
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
tests
[
i
].
color
,
2
),
"Got unexpected color 0x%08x, expected 0x%08x, case %u.
\n
"
,
color
,
tests
[
i
].
color
,
i
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#x.
\n
"
,
hr
);
}
done:
refcount
=
IDirect3DDevice8_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
START_TEST
(
visual
)
{
D3DADAPTER_IDENTIFIER8
identifier
;
...
...
@@ -5567,4 +5688,5 @@ START_TEST(visual)
test_3dc_formats
();
test_fog_interpolation
();
test_negative_fixedfunction_fog
();
test_table_fog_zw
();
}
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