d3dx9_36: Implementation of D3DXSHScale.

This commit is contained in:
Nozomi Kodama 2012-06-29 14:57:44 +08:00 committed by Alexandre Julliard
parent 91cf72f00f
commit e3888ec87c
23 changed files with 62 additions and 20 deletions

View File

@ -276,7 +276,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -276,7 +276,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -280,7 +280,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -280,7 +280,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -285,7 +285,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -285,7 +285,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -285,7 +285,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -282,7 +282,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -287,7 +287,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -287,7 +287,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -287,7 +287,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -287,7 +287,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stub D3DXSHRotate(ptr long ptr ptr)
@ stub D3DXSHRotateZ(ptr long long ptr)
@ stub D3DXSHScale(ptr long ptr ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
@ stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr)
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr)
@ stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr)

View File

@ -2093,3 +2093,15 @@ FLOAT* WINAPI D3DXSHMultiply3(FLOAT *out, CONST FLOAT *a, CONST FLOAT *b)
return out;
}
FLOAT* WINAPI D3DXSHScale(FLOAT *out, UINT order, CONST FLOAT *a, CONST FLOAT scale)
{
UINT i;
TRACE("out %p, order %u, a %p, scale %f\n", out, order, a, scale);
for (i = 0; i < order * order; i++)
out[i] = a[i] * scale;
return out;
}

View File

@ -2444,6 +2444,34 @@ static void test_D3DXSHMultiply3(void)
ok(relative_error(c[i], expected[i]) < admitted_error, "Expected[%d] = %f, received = %f\n", i, expected[i], c[i]);
}
static void test_D3DXSHScale(void)
{
unsigned int i, order;
FLOAT a[100], b[100], expected, *received_array;
for (i = 0; i < 100; i++)
{
a[i] = i;
b[i] = i;
}
for (order = 0; order < 10; order++)
{
received_array = D3DXSHScale(b, order, a, 5.0f);
ok(received_array == b, "Expected %p, received %p", b, received_array);
for (i = 0; i < 100; i++)
{
if (i < order * order)
expected = 5.0f * a[i];
/* D3DXSHScale does not modify the elements of the array after the order * order-th element */
else
expected = a[i];
ok(relative_error(b[i], expected) < admitted_error, "order %d, element %d, expected %f, received %f", order, i, expected, b[i]);
}
}
}
START_TEST(math)
{
D3DXColorTest();
@ -2463,4 +2491,5 @@ START_TEST(math)
test_D3DXSHAdd();
test_D3DXSHDot();
test_D3DXSHMultiply3();
test_D3DXSHScale();
}

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -289,7 +289,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -282,7 +282,7 @@
@ stdcall D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) d3dx9_36.D3DXSHPRTCompSuperCluster
@ stdcall D3DXSHRotate(ptr long ptr ptr) d3dx9_36.D3DXSHRotate
@ stdcall D3DXSHRotateZ(ptr long long ptr) d3dx9_36.D3DXSHRotateZ
@ stdcall D3DXSHScale(ptr long ptr ptr) d3dx9_36.D3DXSHScale
@ stdcall D3DXSHScale(ptr long ptr float) d3dx9_36.D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr float ptr ptr) d3dx9_36.D3DXSphereBoundProbe
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXSplitMesh

View File

@ -380,6 +380,7 @@ 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 D3DXSHDot(UINT order, CONST FLOAT *a, CONST FLOAT *b);
FLOAT* WINAPI D3DXSHMultiply3(FLOAT *out, CONST FLOAT *a, CONST FLOAT *b);
FLOAT* WINAPI D3DXSHScale(FLOAT *out, UINT order, CONST FLOAT *a, CONST FLOAT scale);
#ifdef __cplusplus
}