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
7d989b7f
Commit
7d989b7f
authored
May 12, 2008
by
Dan Kegel
Committed by
Alexandre Julliard
May 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: shademode_test: Increase slop in color comparison.
parent
b5046c28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
visual.c
dlls/d3d9/tests/visual.c
+25
-18
No files found.
dlls/d3d9/tests/visual.c
View file @
7d989b7f
...
@@ -6367,13 +6367,32 @@ out:
...
@@ -6367,13 +6367,32 @@ out:
IDirect3D9_Release
(
d3d
);
IDirect3D9_Release
(
d3d
);
}
}
/* Return true if color is near the expected value */
static
int
color_near
(
DWORD
color
,
DWORD
expected
)
{
const
BYTE
slop
=
1
;
BYTE
r
,
g
,
b
;
BYTE
rx
,
gx
,
bx
;
r
=
(
color
&
0x00ff0000
)
>>
16
;
g
=
(
color
&
0x0000ff00
)
>>
8
;
b
=
(
color
&
0x000000ff
);
rx
=
(
expected
&
0x00ff0000
)
>>
16
;
gx
=
(
expected
&
0x0000ff00
)
>>
8
;
bx
=
(
expected
&
0x000000ff
);
return
((
r
>=
(
rx
-
slop
))
&&
(
r
<=
(
rx
+
slop
)))
&&
((
g
>=
(
gx
-
slop
))
&&
(
g
<=
(
gx
+
slop
)))
&&
((
b
>=
(
bx
-
slop
))
&&
(
b
<=
(
bx
+
slop
)));
}
static
void
shademode_test
(
IDirect3DDevice9
*
device
)
static
void
shademode_test
(
IDirect3DDevice9
*
device
)
{
{
/* Render a quad and try all of the different fixed function shading models. */
/* Render a quad and try all of the different fixed function shading models. */
HRESULT
hr
;
HRESULT
hr
;
DWORD
color0
,
color1
;
DWORD
color0
,
color1
;
DWORD
color0_gouraud
=
0
,
color1_gouraud
=
0
;
DWORD
color0_gouraud
=
0
,
color1_gouraud
=
0
;
BYTE
r
,
g
,
b
;
DWORD
shademode
=
D3DSHADE_FLAT
;
DWORD
shademode
=
D3DSHADE_FLAT
;
DWORD
primtype
=
D3DPT_TRIANGLESTRIP
;
DWORD
primtype
=
D3DPT_TRIANGLESTRIP
;
LPVOID
data
=
NULL
;
LPVOID
data
=
NULL
;
...
@@ -6469,15 +6488,9 @@ static void shademode_test(IDirect3DDevice9 *device)
...
@@ -6469,15 +6488,9 @@ static void shademode_test(IDirect3DDevice9 *device)
case
D3DSHADE_GOURAUD
:
case
D3DSHADE_GOURAUD
:
/* Should be an interpolated blend */
/* Should be an interpolated blend */
r
=
(
color0
&
0x00ff0000
)
>>
16
;
ok
(
color_near
(
color0
,
0x000dca28
),
g
=
(
color0
&
0x0000ff00
)
>>
8
;
"GOURAUD shading has color0 %08x, expected 0x00dca28
\n
"
,
color0
);
b
=
(
color0
&
0x000000ff
);
ok
(
color_near
(
color1
,
0x000d45c7
),
ok
(
r
>=
0x0c
&&
r
<=
0x0e
&&
g
==
0xca
&&
b
>=
0x27
&&
b
<=
0x28
,
"GOURAUD shading has color0 %08x, expected 0x000dca28
\n
"
,
color0
);
r
=
(
color1
&
0x00ff0000
)
>>
16
;
g
=
(
color1
&
0x0000ff00
)
>>
8
;
b
=
(
color1
&
0x000000ff
);
ok
(
r
>=
0x0c
&&
r
<=
0x0d
&&
g
>=
0x44
&&
g
<=
0x45
&&
b
>=
0xc7
&&
b
<=
0xc8
,
"GOURAUD shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
"GOURAUD shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
color0_gouraud
=
color0
;
color0_gouraud
=
color0
;
...
@@ -6487,15 +6500,9 @@ static void shademode_test(IDirect3DDevice9 *device)
...
@@ -6487,15 +6500,9 @@ static void shademode_test(IDirect3DDevice9 *device)
break
;
break
;
case
D3DSHADE_PHONG
:
case
D3DSHADE_PHONG
:
/* Should be the same as GOURAUD, since no hardware implements this */
/* Should be the same as GOURAUD, since no hardware implements this */
r
=
(
color0
&
0x00ff0000
)
>>
16
;
ok
(
color_near
(
color0
,
0x000dca28
),
g
=
(
color0
&
0x0000ff00
)
>>
8
;
b
=
(
color0
&
0x000000ff
);
ok
(
r
>=
0x0c
&&
r
<=
0x0e
&&
g
==
0xca
&&
b
>=
0x27
&&
b
<=
0x28
,
"PHONG shading has color0 %08x, expected 0x000dca28
\n
"
,
color0
);
"PHONG shading has color0 %08x, expected 0x000dca28
\n
"
,
color0
);
r
=
(
color1
&
0x00ff0000
)
>>
16
;
ok
(
color_near
(
color1
,
0x000d45c7
),
g
=
(
color1
&
0x0000ff00
)
>>
8
;
b
=
(
color1
&
0x000000ff
);
ok
(
r
>=
0x0c
&&
r
<=
0x0d
&&
g
>=
0x44
&&
g
<=
0x45
&&
b
>=
0xc7
&&
b
<=
0xc8
,
"PHONG shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
"PHONG shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
ok
(
color0
==
color0_gouraud
,
"difference between GOURAUD and PHONG shading detected: %08x %08x
\n
"
,
ok
(
color0
==
color0_gouraud
,
"difference between GOURAUD and PHONG shading detected: %08x %08x
\n
"
,
...
...
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