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
60a0fb30
Commit
60a0fb30
authored
Jun 15, 2012
by
Nozomi Kodama
Committed by
Alexandre Julliard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Implementation of D3DXSHMultiply3.
parent
cdd18731
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
1 deletion
+131
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
math.c
dlls/d3dx9_36/math.c
+101
-0
math.c
dlls/d3dx9_36/tests/math.c
+28
-0
d3dx9math.h
include/d3dx9math.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
60a0fb30
...
...
@@ -280,7 +280,7 @@
@ stub D3DXSHEvalHemisphereLight(long ptr long long ptr ptr ptr)
@ stub D3DXSHEvalSphericalLight(long ptr long long long long ptr ptr ptr)
@ stub D3DXSHMultiply2(ptr ptr ptr)
@ st
ub
D3DXSHMultiply3(ptr ptr ptr)
@ st
dcall
D3DXSHMultiply3(ptr ptr ptr)
@ stub D3DXSHMultiply4(ptr ptr ptr)
@ stub D3DXSHMultiply5(ptr ptr ptr)
@ stub D3DXSHMultiply6(ptr ptr ptr)
...
...
dlls/d3dx9_36/math.c
View file @
60a0fb30
...
...
@@ -1967,6 +1967,8 @@ FLOAT *WINAPI D3DXFloat16To32Array(FLOAT *pout, CONST D3DXFLOAT16 *pin, UINT n)
return
pout
;
}
/*_________________D3DXSH________________*/
FLOAT
*
WINAPI
D3DXSHAdd
(
FLOAT
*
out
,
UINT
order
,
const
FLOAT
*
a
,
const
FLOAT
*
b
)
{
UINT
i
;
...
...
@@ -1978,3 +1980,102 @@ FLOAT* WINAPI D3DXSHAdd(FLOAT *out, UINT order, const FLOAT *a, const FLOAT *b)
return
out
;
}
FLOAT
*
WINAPI
D3DXSHMultiply3
(
FLOAT
*
out
,
CONST
FLOAT
*
a
,
CONST
FLOAT
*
b
)
{
FLOAT
t
,
ta
,
tb
;
TRACE
(
"(%p, %p, %p)
\n
"
,
out
,
a
,
b
);
out
[
0
]
=
0
.
28209479
f
*
a
[
0
]
*
b
[
0
];
ta
=
0
.
28209479
f
*
a
[
0
]
-
0
.
12615662
f
*
a
[
6
]
-
0
.
21850968
f
*
a
[
8
];
tb
=
0
.
28209479
f
*
b
[
0
]
-
0
.
12615662
f
*
b
[
6
]
-
0
.
21850968
f
*
b
[
8
];
out
[
1
]
=
ta
*
b
[
1
]
+
tb
*
a
[
1
];
t
=
a
[
1
]
*
b
[
1
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
=
-
0
.
12615662
f
*
t
;
out
[
8
]
=
-
0
.
21850968
f
*
t
;
ta
=
0
.
21850968
f
*
a
[
5
];
tb
=
0
.
21850968
f
*
b
[
5
];
out
[
1
]
+=
ta
*
b
[
2
]
+
tb
*
a
[
2
];
out
[
2
]
=
ta
*
b
[
1
]
+
tb
*
a
[
1
];
t
=
a
[
1
]
*
b
[
2
]
+
a
[
2
]
*
b
[
1
];
out
[
5
]
=
0
.
21850968
f
*
t
;
ta
=
0
.
21850968
f
*
a
[
4
];
tb
=
0
.
21850968
f
*
b
[
4
];
out
[
1
]
+=
ta
*
b
[
3
]
+
tb
*
a
[
3
];
out
[
3
]
=
ta
*
b
[
1
]
+
tb
*
a
[
1
];
t
=
a
[
1
]
*
b
[
3
]
+
a
[
3
]
*
b
[
1
];
out
[
4
]
=
0
.
21850968
f
*
t
;
ta
=
0
.
28209480
f
*
a
[
0
]
+
0
.
25231326
f
*
a
[
6
];
tb
=
0
.
28209480
f
*
b
[
0
]
+
0
.
25231326
f
*
b
[
6
];
out
[
2
]
+=
ta
*
b
[
2
]
+
tb
*
a
[
2
];
t
=
a
[
2
]
*
b
[
2
];
out
[
0
]
+=
0
.
28209480
f
*
t
;
out
[
6
]
+=
0
.
25231326
f
*
t
;
ta
=
0
.
21850969
f
*
a
[
7
];
tb
=
0
.
21850969
f
*
b
[
7
];
out
[
2
]
+=
ta
*
b
[
3
]
+
tb
*
a
[
3
];
out
[
3
]
+=
ta
*
b
[
2
]
+
tb
*
a
[
2
];
t
=
a
[
2
]
*
b
[
3
]
+
a
[
3
]
*
b
[
2
];
out
[
7
]
=
0
.
21850969
f
*
t
;
ta
=
0
.
28209479
f
*
a
[
0
]
-
0
.
12615663
f
*
a
[
6
]
+
0
.
21850969
f
*
a
[
8
];
tb
=
0
.
28209479
f
*
b
[
0
]
-
0
.
12615663
f
*
b
[
6
]
+
0
.
21850969
f
*
b
[
8
];
out
[
3
]
+=
ta
*
b
[
3
]
+
tb
*
a
[
3
];
t
=
a
[
3
]
*
b
[
3
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
-=
0
.
12615663
f
*
t
;
out
[
8
]
+=
0
.
21850969
f
*
t
;
ta
=
0
.
28209479
f
*
a
[
0
]
-
0
.
18022375
f
*
a
[
6
];
tb
=
0
.
28209479
f
*
b
[
0
]
-
0
.
18022375
f
*
b
[
6
];
out
[
4
]
+=
ta
*
b
[
4
]
+
tb
*
a
[
4
];
t
=
a
[
4
]
*
b
[
4
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
-=
0
.
18022375
f
*
t
;
ta
=
0
.
15607835
f
*
a
[
7
];
tb
=
0
.
15607835
f
*
b
[
7
];
out
[
4
]
+=
ta
*
b
[
5
]
+
tb
*
a
[
5
];
out
[
5
]
+=
ta
*
b
[
4
]
+
tb
*
a
[
4
];
t
=
a
[
4
]
*
b
[
5
]
+
a
[
5
]
*
b
[
4
];
out
[
7
]
+=
0
.
15607834
f
*
t
;
ta
=
0
.
28209479
f
*
a
[
0
]
+
0
.
09011186
*
a
[
6
]
-
0
.
15607835
f
*
a
[
8
];
tb
=
0
.
28209479
f
*
b
[
0
]
+
0
.
09011186
*
b
[
6
]
-
0
.
15607835
f
*
b
[
8
];
out
[
5
]
+=
ta
*
b
[
5
]
+
tb
*
a
[
5
];
t
=
a
[
5
]
*
b
[
5
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
+=
0
.
09011186
f
*
t
;
out
[
8
]
-=
0
.
15607835
f
*
t
;
ta
=
0
.
28209480
f
*
a
[
0
];
tb
=
0
.
28209480
f
*
b
[
0
];
out
[
6
]
+=
ta
*
b
[
6
]
+
tb
*
a
[
6
];
t
=
a
[
6
]
*
b
[
6
];
out
[
0
]
+=
0
.
28209480
f
*
t
;
out
[
6
]
+=
0
.
18022376
f
*
t
;
ta
=
0
.
28209479
f
*
a
[
0
]
+
0
.
09011186
*
a
[
6
]
+
0
.
15607835
f
*
a
[
8
];
tb
=
0
.
28209479
f
*
b
[
0
]
+
0
.
09011186
*
b
[
6
]
+
0
.
15607835
f
*
b
[
8
];
out
[
7
]
+=
ta
*
b
[
7
]
+
tb
*
a
[
7
];
t
=
a
[
7
]
*
b
[
7
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
+=
0
.
09011186
f
*
t
;
out
[
8
]
+=
0
.
15607835
f
*
t
;
ta
=
0
.
28209479
f
*
a
[
0
]
-
0
.
18022375
f
*
a
[
6
];
tb
=
0
.
28209479
f
*
b
[
0
]
-
0
.
18022375
f
*
b
[
6
];
out
[
8
]
+=
ta
*
b
[
8
]
+
tb
*
a
[
8
];
t
=
a
[
8
]
*
b
[
8
];
out
[
0
]
+=
0
.
28209479
f
*
t
;
out
[
6
]
-=
0
.
18022375
f
*
t
;
return
out
;
}
dlls/d3dx9_36/tests/math.c
View file @
60a0fb30
...
...
@@ -2399,6 +2399,33 @@ static void test_D3DXSHAdd(void)
}
}
static
void
test_D3DXSHMultiply3
(
void
)
{
unsigned
int
i
;
FLOAT
a
[
20
],
b
[
20
],
c
[
20
];
const
FLOAT
expected
[]
=
{
7
.
813913
f
,
2
.
256058
f
,
5
.
9484005
f
,
4
.
970894
f
,
2
.
899858
f
,
3
.
598946
f
,
1
.
726572
f
,
5
.
573538
f
,
0
.
622063
f
,
9
.
0
f
,
10
.
0
f
,
11
.
0
f
,
12
.
0
f
,
13
.
0
f
,
14
.
0
f
,
15
.
0
f
,
16
.
0
f
,
17
.
0
f
,
18
.
0
f
,
19
.
0
f
,
};
for
(
i
=
0
;
i
<
20
;
i
++
)
{
a
[
i
]
=
1
.
0
f
+
(
FLOAT
)
i
/
100
.
0
f
;
b
[
i
]
=
3
.
0
f
-
(
FLOAT
)
i
/
100
.
0
f
;
c
[
i
]
=
(
FLOAT
)
i
;
}
D3DXSHMultiply3
(
c
,
a
,
b
);
for
(
i
=
0
;
i
<
9
;
i
++
)
ok
(
relative_error
(
c
[
i
],
expected
[
i
])
<
admitted_error
,
"Expected[%d] = %f, received = %f
\n
"
,
i
,
expected
[
i
],
c
[
i
]);
/* D3DXSHMultiply does not modify the elements of the array after the nineth element */
for
(
i
=
8
;
i
<
19
;
i
++
)
ok
(
relative_error
(
c
[
i
],
expected
[
i
])
<
admitted_error
,
"Expected[%d] = %f, received = %f
\n
"
,
i
,
expected
[
i
],
c
[
i
]);
return
;
}
START_TEST
(
math
)
{
D3DXColorTest
();
...
...
@@ -2416,4 +2443,5 @@ START_TEST(math)
test_D3DXVec_Array
();
test_D3DXFloat_Array
();
test_D3DXSHAdd
();
test_D3DXSHMultiply3
();
}
include/d3dx9math.h
View file @
60a0fb30
...
...
@@ -378,6 +378,7 @@ D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pout, CONST FLOAT *pin, UI
FLOAT
*
WINAPI
D3DXFloat16To32Array
(
FLOAT
*
pout
,
CONST
D3DXFLOAT16
*
pin
,
UINT
n
);
FLOAT
*
WINAPI
D3DXSHAdd
(
FLOAT
*
out
,
UINT
order
,
CONST
FLOAT
*
a
,
CONST
FLOAT
*
b
);
FLOAT
*
WINAPI
D3DXSHMultiply3
(
FLOAT
*
out
,
CONST
FLOAT
*
a
,
CONST
FLOAT
*
b
);
#ifdef __cplusplus
}
...
...
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