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
965e2714
Commit
965e2714
authored
Nov 11, 2012
by
Nozomi Kodama
Committed by
Alexandre Julliard
Nov 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Fix the case out = in for D3DXSHRotate.
parent
1ca9ed90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
17 deletions
+42
-17
math.c
dlls/d3dx9_36/math.c
+6
-6
math.c
dlls/d3dx9_36/tests/math.c
+36
-11
No files found.
dlls/d3dx9_36/math.c
View file @
965e2714
...
@@ -2774,7 +2774,7 @@ static void rotate_X(FLOAT *out, UINT order, FLOAT a, FLOAT *in)
...
@@ -2774,7 +2774,7 @@ static void rotate_X(FLOAT *out, UINT order, FLOAT a, FLOAT *in)
FLOAT
*
WINAPI
D3DXSHRotate
(
FLOAT
*
out
,
UINT
order
,
CONST
D3DXMATRIX
*
matrix
,
CONST
FLOAT
*
in
)
FLOAT
*
WINAPI
D3DXSHRotate
(
FLOAT
*
out
,
UINT
order
,
CONST
D3DXMATRIX
*
matrix
,
CONST
FLOAT
*
in
)
{
{
FLOAT
alpha
,
beta
,
gamma
,
sinb
,
temp
[
36
];
FLOAT
alpha
,
beta
,
gamma
,
sinb
,
temp
[
36
]
,
temp1
[
36
]
;
TRACE
(
"out %p, order %u, matrix %p, in %p
\n
"
,
out
,
order
,
matrix
,
in
);
TRACE
(
"out %p, order %u, matrix %p, in %p
\n
"
,
out
,
order
,
matrix
,
in
);
...
@@ -2848,11 +2848,11 @@ FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, CONST D3DXMATRIX *matrix, CON
...
@@ -2848,11 +2848,11 @@ FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, CONST D3DXMATRIX *matrix, CON
gamma
=
0
.
0
f
;
gamma
=
0
.
0
f
;
}
}
D3DXSHRotateZ
(
out
,
order
,
gamma
,
in
);
D3DXSHRotateZ
(
temp
,
order
,
gamma
,
in
);
rotate_X
(
temp
,
order
,
1
.
0
f
,
out
);
rotate_X
(
temp
1
,
order
,
1
.
0
f
,
temp
);
D3DXSHRotateZ
(
out
,
order
,
beta
,
temp
);
D3DXSHRotateZ
(
temp
,
order
,
beta
,
temp1
);
rotate_X
(
temp
,
order
,
-
1
.
0
f
,
out
);
rotate_X
(
temp
1
,
order
,
-
1
.
0
f
,
temp
);
D3DXSHRotateZ
(
out
,
order
,
alpha
,
temp
);
D3DXSHRotateZ
(
out
,
order
,
alpha
,
temp
1
);
return
out
;
return
out
;
}
}
...
...
dlls/d3dx9_36/tests/math.c
View file @
965e2714
...
@@ -2751,7 +2751,7 @@ static void test_D3DXSHMultiply4(void)
...
@@ -2751,7 +2751,7 @@ static void test_D3DXSHMultiply4(void)
static
void
test_D3DXSHRotate
(
void
)
static
void
test_D3DXSHRotate
(
void
)
{
{
D3DXMATRIX
m
[
4
];
D3DXMATRIX
m
[
4
];
FLOAT
expected
,
in
[
49
],
out
[
49
],
*
received_ptr
;
FLOAT
expected
,
in
[
49
],
out
[
49
],
*
out_temp
,
*
received_ptr
;
static
const
FLOAT
table
[]
=
static
const
FLOAT
table
[]
=
{
/* Rotation around X-axis Pi/2 */
{
/* Rotation around X-axis Pi/2 */
1
.
01
f
,
-
3
.
01
f
,
2
.
01
f
,
4
.
01
f
,
-
8
.
01
f
,
-
6
.
01
f
,
1
.
01
f
,
-
3
.
01
f
,
2
.
01
f
,
4
.
01
f
,
-
8
.
01
f
,
-
6
.
01
f
,
...
@@ -2760,6 +2760,8 @@ static void test_D3DXSHRotate(void)
...
@@ -2760,6 +2760,8 @@ static void test_D3DXSHRotate(void)
30
.
241013
f
,
26
.
919991
f
,
39
.
236877
f
,
-
22
.
632446
f
,
6
.
707388
f
,
-
11
.
768282
f
,
30
.
241013
f
,
26
.
919991
f
,
39
.
236877
f
,
-
22
.
632446
f
,
6
.
707388
f
,
-
11
.
768282
f
,
3
.
443672
f
,
-
6
.
07445
f
,
11
.
61839
f
,
1
.
527561
f
,
37
.
89633
f
,
-
56
.
9012
f
,
3
.
443672
f
,
-
6
.
07445
f
,
11
.
61839
f
,
1
.
527561
f
,
37
.
89633
f
,
-
56
.
9012
f
,
47
.
42289
f
,
50
.
39153
f
,
10
.
61819
f
,
25
.
50101
f
,
0
.
04
9241
f
,
16
.
98330
f
,
47
.
42289
f
,
50
.
39153
f
,
10
.
61819
f
,
25
.
50101
f
,
0
.
04
9241
f
,
16
.
98330
f
,
1
.
01
f
,
-
3
.
01
f
,
-
3
.
01
f
,
4
.
01
f
,
-
8
.
01
f
,
-
6
.
01
f
,
-
11
.
307889
f
,
-
8
.
01
f
,
14
.
297919
f
,
/* Rotation around X-axis -Pi/2 */
/* Rotation around X-axis -Pi/2 */
1
.
01
f
,
3
.
01
f
,
-
2
.
01
f
,
4
.
01
f
,
8
.
01
f
,
-
6
.
01
f
,
1
.
01
f
,
3
.
01
f
,
-
2
.
01
f
,
4
.
01
f
,
8
.
01
f
,
-
6
.
01
f
,
-
11
.
307890
f
,
-
5
.
01
f
,
-
1
.
565839
f
,
-
1
.
093598
f
,
-
11
.
01
f
,
-
19
.
833414
f
,
-
11
.
307890
f
,
-
5
.
01
f
,
-
1
.
565839
f
,
-
1
.
093598
f
,
-
11
.
01
f
,
-
19
.
833414
f
,
...
@@ -2767,6 +2769,8 @@ static void test_D3DXSHRotate(void)
...
@@ -2767,6 +2769,8 @@ static void test_D3DXSHRotate(void)
-
30
.
241013
f
,
26
.
919991
f
,
39
.
236877
f
,
22
.
632446
f
,
6
.
707388
f
,
11
.
768282
f
,
-
30
.
241013
f
,
26
.
919991
f
,
39
.
236877
f
,
22
.
632446
f
,
6
.
707388
f
,
11
.
768282
f
,
3
.
443672
f
,
6
.
07445
f
,
11
.
61839
f
,
-
1
.
527561
f
,
37
.
89633
f
,
56
.
9012
f
,
3
.
443672
f
,
6
.
07445
f
,
11
.
61839
f
,
-
1
.
527561
f
,
37
.
89633
f
,
56
.
9012
f
,
-
47
.
42289
f
,
50
.
39153
f
,
-
10
.
61819
f
,
25
.
50101
f
,
-
0
.
04
9248
f
,
16
.
98330
f
,
-
47
.
42289
f
,
50
.
39153
f
,
-
10
.
61819
f
,
25
.
50101
f
,
-
0
.
04
9248
f
,
16
.
98330
f
,
1
.
01
f
,
3
.
01
f
,
-
3
.
01
f
,
4
.
01
f
,
8
.
01
f
,
-
6
.
01
f
,
-
11
.
307890
f
,
-
8
.
01
f
,
14
.
297919
f
,
/* Yaw Pi/3, Pitch Pi/4, Roll Pi/5 */
/* Yaw Pi/3, Pitch Pi/4, Roll Pi/5 */
1
.
01
f
,
4
.
944899
f
,
1
.
442301
f
,
1
.
627281
f
,
0
.
219220
f
,
10
.
540824
f
,
1
.
01
f
,
4
.
944899
f
,
1
.
442301
f
,
1
.
627281
f
,
0
.
219220
f
,
10
.
540824
f
,
-
9
.
136903
f
,
2
.
763750
f
,
-
7
.
30904
f
,
-
5
.
875721
f
,
5
.
303124
f
,
-
8
.
682154
f
,
-
9
.
136903
f
,
2
.
763750
f
,
-
7
.
30904
f
,
-
5
.
875721
f
,
5
.
303124
f
,
-
8
.
682154
f
,
...
@@ -2774,41 +2778,62 @@ static void test_D3DXSHRotate(void)
...
@@ -2774,41 +2778,62 @@ static void test_D3DXSHRotate(void)
14
.
629795
f
,
-
54
.
467102
f
,
-
12
.
231035
f
,
-
4
.
089857
f
,
-
9
.
444222
f
,
3
.
056035
f
,
14
.
629795
f
,
-
54
.
467102
f
,
-
12
.
231035
f
,
-
4
.
089857
f
,
-
9
.
444222
f
,
3
.
056035
f
,
0
.
179257
f
,
-
10
.
041
875
f
,
23
.
090092
f
,
-
23
.
188709
f
,
11
.
727098
f
,
-
65
.
183090
f
,
0
.
179257
f
,
-
10
.
041
875
f
,
23
.
090092
f
,
-
23
.
188709
f
,
11
.
727098
f
,
-
65
.
183090
f
,
48
.
671577
f
,
-
15
.
07320
9
f
,
38
.
793171
f
,
-
26
.
03
9536
f
,
6
.
192769
f
,
-
17
.
672247
f
,
48
.
671577
f
,
-
15
.
07320
9
f
,
38
.
793171
f
,
-
26
.
03
9536
f
,
6
.
192769
f
,
-
17
.
672247
f
,
1
.
01
f
,
4
.
944899
f
,
-
0
.
891142
f
,
4
.
607695
f
,
0
.
219218
f
,
10
.
773325
f
,
-
8
.
204769
f
,
13
.
563829
f
,
-
12
.
007767
f
,
/* Rotation around Z-axis Pi/6 */
/* Rotation around Z-axis Pi/6 */
1
.
01
f
,
3
.
745711
f
,
3
.
01
f
,
2
.
467762
f
,
10
.
307889
f
,
9
.
209813
f
,
1
.
01
f
,
3
.
745711
f
,
3
.
01
f
,
2
.
467762
f
,
10
.
307889
f
,
9
.
209813
f
,
7
.
01
f
,
3
.
931864
f
,
0
.
166212
f
,
16
.
01
f
,
18
.
504042
f
,
17
.
405966
f
,
7
.
01
f
,
3
.
931864
f
,
0
.
166212
f
,
16
.
01
f
,
18
.
504042
f
,
17
.
405966
f
,
13
.
01
f
,
6
.
128016
f
,
-
2
.
02
9941
f
,
-
10
.
01
f
,
13
.
154292
f
,
24
.
01
f
,
13
.
01
f
,
6
.
128016
f
,
-
2
.
02
9941
f
,
-
10
.
01
f
,
13
.
154292
f
,
24
.
01
f
,
29
.
432245
f
,
28
.
334167
f
,
21
.
01
f
,
9
.
056221
f
,
-
4
.
958143
f
,
-
18
.
01
f
,
29
.
432245
f
,
28
.
334167
f
,
21
.
01
f
,
9
.
056221
f
,
-
4
.
958143
f
,
-
18
.
01
f
,
-
27
.
236094
f
,
-
4
.
520332
f
,
16
.
814543
f
,
34
.
01
f
,
43
.
092495
f
,
41
.
994423
f
,
-
27
.
236094
f
,
-
4
.
520332
f
,
16
.
814543
f
,
34
.
01
f
,
43
.
092495
f
,
41
.
994423
f
,
31
.
01
f
,
12
.
716471
f
,
-
8
.
618400
f
,
-
28
.
01
f
,
-
40
.
896347
f
,
-
44
.
190571
,};
31
.
01
f
,
12
.
716471
f
,
-
8
.
618400
f
,
-
28
.
01
f
,
-
40
.
896347
f
,
-
44
.
190571
,
unsigned
int
i
,
j
,
order
;
1
.
01
f
,
3
.
745711
f
,
3
.
01
f
,
1
.
599906
f
,
10
.
307889
f
,
9
.
209813
f
,
7
.
01
f
,
2
.
331957
f
,
-
4
.
421894
f
,
};
unsigned
int
i
,
j
,
l
,
order
;
D3DXMatrixRotationX
(
&
m
[
0
],
-
D3DX_PI
/
2
.
0
f
);
D3DXMatrixRotationX
(
&
m
[
0
],
-
D3DX_PI
/
2
.
0
f
);
D3DXMatrixRotationX
(
&
m
[
1
],
D3DX_PI
/
2
.
0
f
);
D3DXMatrixRotationX
(
&
m
[
1
],
D3DX_PI
/
2
.
0
f
);
D3DXMatrixRotationYawPitchRoll
(
&
m
[
2
],
D3DX_PI
/
3
.
0
f
,
D3DX_PI
/
4
.
0
f
,
D3DX_PI
/
5
.
0
f
);
D3DXMatrixRotationYawPitchRoll
(
&
m
[
2
],
D3DX_PI
/
3
.
0
f
,
D3DX_PI
/
4
.
0
f
,
D3DX_PI
/
5
.
0
f
);
D3DXMatrixRotationZ
(
&
m
[
3
],
D3DX_PI
/
6
.
0
f
);
D3DXMatrixRotationZ
(
&
m
[
3
],
D3DX_PI
/
6
.
0
f
);
for
(
i
=
0
;
i
<
49
;
i
++
)
for
(
l
=
0
;
l
<
2
;
l
++
)
in
[
i
]
=
i
+
1
.
01
f
;
{
if
(
l
==
0
)
out_temp
=
out
;
else
out_temp
=
in
;
for
(
j
=
0
;
j
<
4
;
j
++
)
for
(
j
=
0
;
j
<
4
;
j
++
)
{
{
for
(
order
=
0
;
order
<=
D3DXSH_MAXORDER
;
order
++
)
for
(
order
=
0
;
order
<=
D3DXSH_MAXORDER
;
order
++
)
{
{
for
(
i
=
0
;
i
<
49
;
i
++
)
for
(
i
=
0
;
i
<
49
;
i
++
)
{
out
[
i
]
=
(
i
+
1
.
0
f
)
*
(
i
+
1
.
0
f
);
out
[
i
]
=
(
i
+
1
.
0
f
)
*
(
i
+
1
.
0
f
);
in
[
i
]
=
i
+
1
.
01
f
;
}
received_ptr
=
D3DXSHRotate
(
out
,
order
,
&
m
[
j
],
in
);
received_ptr
=
D3DXSHRotate
(
out_temp
,
order
,
&
m
[
j
],
in
);
ok
(
received_ptr
==
out
,
"Order %u, expected %p, received %p
\n
"
,
order
,
out
,
received_ptr
);
ok
(
received_ptr
==
out_temp
,
"Order %u, expected %p, received %p
\n
"
,
order
,
out
,
received_ptr
);
for
(
i
=
0
;
i
<
49
;
i
++
)
for
(
i
=
0
;
i
<
49
;
i
++
)
{
{
if
(
(
i
>
0
)
&&
(
(
i
>=
order
*
order
)
||
(
order
>
D3DXSH_MAXORDER
)
)
)
if
((
i
>
0
)
&&
((
i
>=
order
*
order
)
||
(
order
>
D3DXSH_MAXORDER
)))
{
if
(
l
==
0
)
expected
=
(
i
+
1
.
0
f
)
*
(
i
+
1
.
0
f
);
expected
=
(
i
+
1
.
0
f
)
*
(
i
+
1
.
0
f
);
else
else
expected
=
table
[
36
*
j
+
i
];
expected
=
i
+
1
.
01
f
;
}
ok
(
relative_error
(
out
[
i
],
expected
)
<
admitted_error
,
"Order %u index %u, expected %f, received %f
\n
"
,
order
,
i
,
expected
,
out
[
i
]);
else
if
((
l
==
0
)
||
(
order
>
3
))
expected
=
table
[
45
*
j
+
i
];
else
expected
=
table
[
45
*
j
+
36
+
i
];
ok
(
relative_error
(
out_temp
[
i
],
expected
)
<
admitted_error
,
"Order %u index %u, expected %f, received %f
\n
"
,
order
,
i
,
expected
,
out_temp
[
i
]);
}
}
}
}
}
}
}
...
...
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