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
479195ea
Commit
479195ea
authored
Mar 04, 2013
by
Nozomi Kodama
Committed by
Alexandre Julliard
Mar 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Save multiplications for better performance.
parent
9085f1d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
35 deletions
+45
-35
math.c
dlls/d3dx9_36/math.c
+45
-35
No files found.
dlls/d3dx9_36/math.c
View file @
479195ea
...
...
@@ -2378,60 +2378,70 @@ HRESULT WINAPI D3DXSHEvalConeLight(UINT order, const D3DXVECTOR3 *dir, FLOAT rad
FLOAT
*
WINAPI
D3DXSHEvalDirection
(
FLOAT
*
out
,
UINT
order
,
const
D3DXVECTOR3
*
dir
)
{
const
FLOAT
dirxx
=
dir
->
x
*
dir
->
x
;
const
FLOAT
dirxy
=
dir
->
x
*
dir
->
y
;
const
FLOAT
dirxz
=
dir
->
x
*
dir
->
z
;
const
FLOAT
diryy
=
dir
->
y
*
dir
->
y
;
const
FLOAT
diryz
=
dir
->
y
*
dir
->
z
;
const
FLOAT
dirzz
=
dir
->
z
*
dir
->
z
;
const
FLOAT
dirxxxx
=
dirxx
*
dirxx
;
const
FLOAT
diryyyy
=
diryy
*
diryy
;
const
FLOAT
dirzzzz
=
dirzz
*
dirzz
;
const
FLOAT
dirxyxy
=
dirxy
*
dirxy
;
TRACE
(
"out %p, order %u, dir %p
\n
"
,
out
,
order
,
dir
);
if
(
(
order
<
D3DXSH_MINORDER
)
||
(
order
>
D3DXSH_MAXORDER
)
)
if
(
(
order
<
D3DXSH_MINORDER
)
||
(
order
>
D3DXSH_MAXORDER
)
)
return
out
;
out
[
0
]
=
0
.
5
f
/
sqrt
(
D3DX_PI
);
out
[
1
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
3
.
0
f
)
*
dir
->
y
;
out
[
2
]
=
0
.
5
f
/
sqrt
(
D3DX_PI
/
3
.
0
f
)
*
dir
->
z
;
out
[
3
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
3
.
0
f
)
*
dir
->
x
;
if
(
order
==
2
)
if
(
order
==
2
)
return
out
;
out
[
4
]
=
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
->
x
*
dir
->
y
;
out
[
5
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
->
y
*
dir
->
z
;
out
[
6
]
=
0
.
25
f
/
sqrt
(
D3DX_PI
/
5
.
0
f
)
*
(
3
.
0
f
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
7
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
->
x
*
dir
->
z
;
out
[
8
]
=
0
.
25
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
);
if
(
order
==
3
)
out
[
4
]
=
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
x
y
;
out
[
5
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
y
z
;
out
[
6
]
=
0
.
25
f
/
sqrt
(
D3DX_PI
/
5
.
0
f
)
*
(
3
.
0
f
*
dirzz
-
1
.
0
f
);
out
[
7
]
=
-
0
.
5
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
dir
x
z
;
out
[
8
]
=
0
.
25
f
/
sqrt
(
D3DX_PI
/
15
.
0
f
)
*
(
dirxx
-
diryy
);
if
(
order
==
3
)
return
out
;
out
[
9
]
=
-
sqrt
(
70
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
y
*
(
3
.
0
f
*
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
);
out
[
10
]
=
sqrt
(
105
.
0
f
/
D3DX_PI
)
/
2
.
0
f
*
dir
->
x
*
dir
->
y
*
dir
->
z
;
out
[
11
]
=
-
sqrt
(
42
.
0
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
y
*
(
-
1
.
0
f
+
5
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
12
]
=
sqrt
(
7
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
->
z
*
(
5
.
0
f
*
dir
->
z
*
dir
->
z
-
3
.
0
f
);
out
[
13
]
=
sqrt
(
42
.
0
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
x
*
(
1
.
0
f
-
5
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
14
]
=
sqrt
(
105
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
->
z
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
);
out
[
15
]
=
-
sqrt
(
70
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
x
*
(
dir
->
x
*
dir
->
x
-
3
.
0
f
*
dir
->
y
*
dir
->
y
);
if
(
order
==
4
)
out
[
9
]
=
-
sqrt
(
70
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
y
*
(
3
.
0
f
*
dir
xx
-
diryy
);
out
[
10
]
=
sqrt
(
105
.
0
f
/
D3DX_PI
)
/
2
.
0
f
*
dir
x
y
*
dir
->
z
;
out
[
11
]
=
-
sqrt
(
42
.
0
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
y
*
(
-
1
.
0
f
+
5
.
0
f
*
dirzz
);
out
[
12
]
=
sqrt
(
7
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
->
z
*
(
5
.
0
f
*
dirzz
-
3
.
0
f
);
out
[
13
]
=
sqrt
(
42
.
0
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
x
*
(
1
.
0
f
-
5
.
0
f
*
dirzz
);
out
[
14
]
=
sqrt
(
105
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
->
z
*
(
dirxx
-
diryy
);
out
[
15
]
=
-
sqrt
(
70
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
x
*
(
dirxx
-
3
.
0
f
*
diryy
);
if
(
order
==
4
)
return
out
;
out
[
16
]
=
0
.
75
f
*
sqrt
(
35
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
dir
->
y
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
);
out
[
16
]
=
0
.
75
f
*
sqrt
(
35
.
0
f
/
D3DX_PI
)
*
dir
xy
*
(
dirxx
-
diryy
);
out
[
17
]
=
3
.
0
f
*
dir
->
z
*
out
[
9
];
out
[
18
]
=
0
.
75
f
*
sqrt
(
5
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
dir
->
y
*
(
7
.
0
f
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
19
]
=
0
.
375
f
*
sqrt
(
10
.
0
f
/
D3DX_PI
)
*
dir
->
y
*
dir
->
z
*
(
3
.
0
f
-
7
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
20
]
=
3
.
0
f
/
(
16
.
0
f
*
sqrt
(
D3DX_PI
)
)
*
(
35
.
0
f
*
dir
->
z
*
dir
->
z
*
dir
->
z
*
dir
->
z
-
30
.
f
*
dir
->
z
*
dir
->
z
+
3
.
0
f
);
out
[
21
]
=
0
.
375
f
*
sqrt
(
10
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
dir
->
z
*
(
3
.
0
f
-
7
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
22
]
=
0
.
375
f
*
sqrt
(
5
.
0
f
/
D3DX_PI
)
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
)
*
(
7
.
0
f
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
18
]
=
0
.
75
f
*
sqrt
(
5
.
0
f
/
D3DX_PI
)
*
dir
xy
*
(
7
.
0
f
*
dirzz
-
1
.
0
f
);
out
[
19
]
=
0
.
375
f
*
sqrt
(
10
.
0
f
/
D3DX_PI
)
*
dir
yz
*
(
3
.
0
f
-
7
.
0
f
*
dirzz
);
out
[
20
]
=
3
.
0
f
/
(
16
.
0
f
*
sqrt
(
D3DX_PI
))
*
(
35
.
0
f
*
dirzzzz
-
30
.
f
*
dirzz
+
3
.
0
f
);
out
[
21
]
=
0
.
375
f
*
sqrt
(
10
.
0
f
/
D3DX_PI
)
*
dir
xz
*
(
3
.
0
f
-
7
.
0
f
*
dirzz
);
out
[
22
]
=
0
.
375
f
*
sqrt
(
5
.
0
f
/
D3DX_PI
)
*
(
dirxx
-
diryy
)
*
(
7
.
0
f
*
dirz
z
-
1
.
0
f
);
out
[
23
]
=
3
.
0
*
dir
->
z
*
out
[
15
];
out
[
24
]
=
3
.
0
f
/
16
.
0
f
*
sqrt
(
35
.
0
f
/
D3DX_PI
)
*
(
dir
->
x
*
dir
->
x
*
dir
->
x
*
dir
->
x
-
6
.
0
f
*
dir
->
x
*
dir
->
x
*
dir
->
y
*
dir
->
y
+
dir
->
y
*
dir
->
y
*
dir
->
y
*
dir
->
y
);
if
(
order
==
5
)
out
[
24
]
=
3
.
0
f
/
16
.
0
f
*
sqrt
(
35
.
0
f
/
D3DX_PI
)
*
(
dirxxxx
-
6
.
0
f
*
dirxyxy
+
diryyyy
);
if
(
order
==
5
)
return
out
;
out
[
25
]
=
-
3
.
0
f
/
32
.
0
f
*
sqrt
(
154
.
0
f
/
D3DX_PI
)
*
dir
->
y
*
(
5
.
0
f
*
dir
->
x
*
dir
->
x
*
dir
->
x
*
dir
->
x
-
10
.
0
f
*
dir
->
x
*
dir
->
x
*
dir
->
y
*
dir
->
y
+
dir
->
y
*
dir
->
y
*
dir
->
y
*
dir
->
y
);
out
[
26
]
=
0
.
75
f
*
sqrt
(
385
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
dir
->
y
*
dir
->
z
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
);
out
[
27
]
=
sqrt
(
770
.
0
f
/
D3DX_PI
)
/
32
.
0
f
*
dir
->
y
*
(
3
.
0
f
*
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
)
*
(
1
.
0
f
-
9
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
28
]
=
sqrt
(
1155
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
->
x
*
dir
->
y
*
dir
->
z
*
(
3
.
0
f
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
29
]
=
sqrt
(
165
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
y
*
(
14
.
0
f
*
dir
->
z
*
dir
->
z
-
21
.
0
f
*
dir
->
z
*
dir
->
z
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
30
]
=
sqrt
(
11
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
z
*
(
63
.
0
f
*
dir
->
z
*
dir
->
z
*
dir
->
z
*
dir
->
z
-
70
.
0
f
*
dir
->
z
*
dir
->
z
+
15
.
0
f
);
out
[
31
]
=
sqrt
(
165
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
x
*
(
14
.
0
f
*
dir
->
z
*
dir
->
z
-
21
.
0
f
*
dir
->
z
*
dir
->
z
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
32
]
=
sqrt
(
1155
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
z
*
(
dir
->
x
*
dir
->
x
-
dir
->
y
*
dir
->
y
)
*
(
3
.
0
f
*
dir
->
z
*
dir
->
z
-
1
.
0
f
);
out
[
33
]
=
sqrt
(
770
.
0
f
/
D3DX_PI
)
/
32
.
0
f
*
dir
->
x
*
(
dir
->
x
*
dir
->
x
-
3
.
0
f
*
dir
->
y
*
dir
->
y
)
*
(
1
.
0
f
-
9
.
0
f
*
dir
->
z
*
dir
->
z
);
out
[
34
]
=
3
.
0
f
/
16
.
0
f
*
sqrt
(
385
.
0
f
/
D3DX_PI
)
*
dir
->
z
*
(
dir
->
x
*
dir
->
x
*
dir
->
x
*
dir
->
x
-
6
.
0
*
dir
->
x
*
dir
->
x
*
dir
->
y
*
dir
->
y
+
dir
->
y
*
dir
->
y
*
dir
->
y
*
dir
->
y
);
out
[
35
]
=
-
3
.
0
f
/
32
.
0
f
*
sqrt
(
154
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
(
dir
->
x
*
dir
->
x
*
dir
->
x
*
dir
->
x
-
10
.
0
f
*
dir
->
x
*
dir
->
x
*
dir
->
y
*
dir
->
y
+
5
.
0
f
*
dir
->
y
*
dir
->
y
*
dir
->
y
*
dir
->
y
);
out
[
25
]
=
-
3
.
0
f
/
32
.
0
f
*
sqrt
(
154
.
0
f
/
D3DX_PI
)
*
dir
->
y
*
(
5
.
0
f
*
dirxxxx
-
10
.
0
f
*
dirxyxy
+
diryyyy
);
out
[
26
]
=
0
.
75
f
*
sqrt
(
385
.
0
f
/
D3DX_PI
)
*
dir
xy
*
dir
->
z
*
(
dirxx
-
diryy
);
out
[
27
]
=
sqrt
(
770
.
0
f
/
D3DX_PI
)
/
32
.
0
f
*
dir
->
y
*
(
3
.
0
f
*
dirxx
-
diryy
)
*
(
1
.
0
f
-
9
.
0
f
*
dirzz
);
out
[
28
]
=
sqrt
(
1155
.
0
f
/
D3DX_PI
)
/
4
.
0
f
*
dir
xy
*
dir
->
z
*
(
3
.
0
f
*
dirz
z
-
1
.
0
f
);
out
[
29
]
=
sqrt
(
165
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
y
*
(
14
.
0
f
*
dirzz
-
21
.
0
f
*
dirzzzz
-
1
.
0
f
);
out
[
30
]
=
sqrt
(
11
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
z
*
(
63
.
0
f
*
dirzzzz
-
70
.
0
f
*
dirzz
+
15
.
0
f
);
out
[
31
]
=
sqrt
(
165
.
0
f
/
D3DX_PI
)
/
16
.
0
f
*
dir
->
x
*
(
14
.
0
f
*
dirzz
-
21
.
0
f
*
dirzzzz
-
1
.
0
f
);
out
[
32
]
=
sqrt
(
1155
.
0
f
/
D3DX_PI
)
/
8
.
0
f
*
dir
->
z
*
(
dirxx
-
diryy
)
*
(
3
.
0
f
*
dirzz
-
1
.
0
f
);
out
[
33
]
=
sqrt
(
770
.
0
f
/
D3DX_PI
)
/
32
.
0
f
*
dir
->
x
*
(
dirxx
-
3
.
0
f
*
diryy
)
*
(
1
.
0
f
-
9
.
0
f
*
dirzz
);
out
[
34
]
=
3
.
0
f
/
16
.
0
f
*
sqrt
(
385
.
0
f
/
D3DX_PI
)
*
dir
->
z
*
(
dirxxxx
-
6
.
0
*
dirxyxy
+
diryyyy
);
out
[
35
]
=
-
3
.
0
f
/
32
.
0
f
*
sqrt
(
154
.
0
f
/
D3DX_PI
)
*
dir
->
x
*
(
dirxxxx
-
10
.
0
f
*
dirxyxy
+
5
.
0
f
*
diryyyy
);
return
out
;
}
...
...
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