From: Andrey Gusev andrey.goosev@gmail.com
Signed-off-by: Andrey Gusev andrey.goosev@gmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- After thinking about it a bit more I'm slightly preferring it as a single patch. Sorry for suggesting you otherwise previously.
dlls/d3dcompiler_43/reflection.c | 9 +++++++++ include/d3d11shader.h | 7 +++++++ 2 files changed, 16 insertions(+)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index 5a59c64f94d..b36631b9855 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -665,6 +665,14 @@ static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetThreadGroupSize( return 0; }
+static UINT64 STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetRequiresFlags( + ID3D11ShaderReflection *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtbl = { /* IUnknown methods */ @@ -690,6 +698,7 @@ static const struct ID3D11ShaderReflectionVtbl d3dcompiler_shader_reflection_vtb d3dcompiler_shader_reflection_GetNumInterfaceSlots, d3dcompiler_shader_reflection_GetMinFeatureLevel, d3dcompiler_shader_reflection_GetThreadGroupSize, + d3dcompiler_shader_reflection_GetRequiresFlags, };
/* ID3D11ShaderReflectionConstantBuffer methods */ diff --git a/include/d3d11shader.h b/include/d3d11shader.h index f9c3b9511ef..479020abbe5 100644 --- a/include/d3d11shader.h +++ b/include/d3d11shader.h @@ -174,7 +174,13 @@ DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer) }; #undef INTERFACE
+#if D3D_COMPILER_VERSION <= 42 +DEFINE_GUID(IID_ID3D11ShaderReflection, 0x17f27486, 0xa342, 0x4d10, 0x88, 0x42, 0xab, 0x08, 0x74, 0xe7, 0xf6, 0x70); +#elif D3D_COMPILER_VERSION == 43 DEFINE_GUID(IID_ID3D11ShaderReflection, 0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1); +#else +DEFINE_GUID(IID_ID3D11ShaderReflection, 0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84); +#endif
#define INTERFACE ID3D11ShaderReflection DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown) @@ -202,6 +208,7 @@ DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown) STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE; STDMETHOD(GetMinFeatureLevel)(THIS_ enum D3D_FEATURE_LEVEL *level) PURE; STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ UINT *sizex, UINT *sizey, UINT *sizez) PURE; + STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE; }; #undef INTERFACE
From: David Adam david.adam.cnrs@gmail.com
Most of those new tests were written by Rico Schüller kgbricola@web.de for bug 33456.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Raise tolerance in a few tests to make the Linux testbot happy.
dlls/d3dx9_36/tests/math.c | 705 +++++++++++++++++++++++++++++++++++++ 1 file changed, 705 insertions(+)
diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index 1bca9455eef..04f5849850c 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -639,6 +639,486 @@ static void D3DXMatrixTest(void) expect_matrix(&expectedmat, &gotmat, 8);
/*____________D3DXMatrixTransformation______________*/ + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 8.5985f, -21.024f, 14.383499, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 0.0f, 52.0f, 54.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 18.2985f, -29.624001f, 15.683499f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 9.7f, 43.400002f, 55.299999f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 8.5985f, -21.024f, 14.383499, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 8.5985f, -21.024f, 14.383499, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 8.5985f, -21.024f, 14.383499, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 32); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 104.565598f, -35.492798f, -25.306400f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 0.0f, 52.0f, 54.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + -287420.0f, -14064.0f, 37122.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 18.2985f, -29.624001f, 15.683499f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 18.2985f, -29.624001f, 15.683499f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 18.2985f, -29.624001f, 15.683499f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 32); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 114.265594f, -44.092796f, -24.006401f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -3.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 7.0f, 0.0f, + 9.7f, 43.400002f, 55.299999f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 9.7f, -8.6f, 1.3f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + -287410.3125f, -14072.599609f, 37123.300781f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 8.598499f, -21.024f, 14.383499f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 32); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 113.164093f, -56.5168f, -10.922897f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + 0.9504f, -0.8836f, 0.9244f, 0.0f, + 1.0212f, 0.1936f, -1.3588f, 0.0f, + 8.5985f, -21.024f, 14.383499, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 86280.34375f, -357366.3125f, -200024.125f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 32); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + -287410.3125f, -14064.0f, 37122.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 512); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 86280.34375f, -357366.3125f, -200009.75f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, &r, NULL); + expect_matrix(&expectedmat, &gotmat, 2048); + + set_matrix(&expectedmat, + 25521.0f, 39984.0f, 20148.0f, 0.0f, + 39984.0f, 4933.0f, -3324.0f, 0.0f, + 20148.0f, -3324.0f, -5153.0f, 0.0f, + -287410.3125f, -14072.599609f, 37123.300781f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, NULL, &last); + expect_matrix(&expectedmat, &gotmat, 0); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 86290.046875f, -357374.90625f, -200022.828125f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, &r, &last); + expect_matrix(&expectedmat, &gotmat, 32); + set_matrix(&expectedmat, -0.21480007f, 1.3116000f, 0.47520003f, 0.0f, 0.95040143f, -0.88360137f, 0.92439979f, 0.0f, @@ -647,6 +1127,231 @@ static void D3DXMatrixTest(void) D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, &r, &last); expect_matrix(&expectedmat, &gotmat, 512);
+ set_matrix(&expectedmat, + -0.2148f, 1.3116f, 0.4752f, 0.0f, + -2.8512f, 2.6508f, -2.7732f, 0.0f, + 7.148399f, 1.3552f, -9.5116f, 0.0f, + 122.86409f, -65.116798f, -9.622897f, 1.0f); + D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 8); + + set_matrix(&expectedmat, + 53094.015625f, 2044.133789f, 21711.687500f, 0.0f, + -7294.705078f, 47440.683594f, 28077.113281, 0.0f, + -12749.161133f, 28365.580078f, 13503.520508f, 0.0f, + 18.2985f, -29.624001f, 15.683499f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, &r, &last); + expect_matrix(&expectedmat, &gotmat, 32); + + q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 2.0f, + + set_matrix(&expectedmat, + 41.0f, -12.0f, -24.0f, 0.0f, + -12.0f, 25.0f, -12.0f, 0.0f, + -24.0f, -12.0f, 34.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 57.0f, -12.0f, -36.0f, 0.0f, + -12.0f, 25.0f, -12.0f, 0.0f, + -36.0f, -12.0f, 43.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 0.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 25.0f, 0.0f, -20.0f, 0.0f, + 0.0f, 25.0f, -20.0f, 0.0f, + -20.0f, -20.0f, 35.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 5.0f, -4.0f, 0.0f, 0.0f, + -4.0f, 5.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 27.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f, + axis.x = 5.0f, axis.y = 2.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 5.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 2.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f, + axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 4.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f, + axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 4.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f, + axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 8.0f, -6.0f, 0.0f, + 0.0f, -6.0f, 17.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f, + axis.x = 0.0f, axis.y = 4.0f, axis.z = 0.0f, + + set_matrix(&expectedmat, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 4.0f, -8.0f, 0.0f, + 0.0f, -8.0f, 16.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 1.0f, + axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 5.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 4.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 5.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 3.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 3.0f, axis.y = 3.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 3796587.0f, -1377948.0f, -1589940.0f, 0.0f, + -1377948.0f, 3334059.0f, -1879020.0f, 0.0f, + -1589940.0f, -1879020.0f, 2794443.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 1265529.0f, -459316.0f, -529980.0f, 0.0f, + -459316.0f, 1111353.0f, -626340.0f, 0.0f, + -529980.0f, -626340.0f, 931481.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 2457497.0f, -434612.0f, -1423956.0f, 0.0f, + -434612.0f, 1111865.0f, -644868.0f, 0.0f, + -1423956.0f, -644868.0f, 1601963.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 0.0f, axis.y = 0.0f, axis.z = 3.0f, + + set_matrix(&expectedmat, + 1787952.0f, 37056.0f, -1340964.0f, 0.0f, + 37056.0f, 768.0f, -27792.0f, 0.0f, + -1340964.0f, -27792.0f, 1005723.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 0.0f, axis.y = 0.0f, axis.z = 1.0f, + + set_matrix(&expectedmat, + 595984.0f, 12352.0f, -446988.0f, 0.0f, + 12352.0f, 256.0f, -9264.0f, 0.0f, + -446988.0f, -9264.0f, 335241.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 0.0f, axis.y = 3.0f, axis.z = 0.0f, + + set_matrix(&expectedmat, + 150528.0f, 464352.0f, -513408.0f, 0.0f, + 464352.0f, 1432443.0f, -1583772.0f, 0.0f, + -513408.0f, -1583772.0f, 1751088.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 0.0f, axis.y = 1.0f, axis.z = 0.0f, + + set_matrix(&expectedmat, + 50176.0f, 154784.0f, -171136.0f, 0.0f, + 154784.0f, 477481.0f, -527924.0f, 0.0f, + -171136.0f, -527924.0f, 583696.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + + q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f, + axis.x = 1.0f, axis.y = 0.0f, axis.z = 0.0f, + + set_matrix(&expectedmat, + 619369.0f, -626452.0f, 88144.0f, 0.0f, + -626452.0f, 633616.0f, -89152.0f, 0.0f, + 88144.0f, -89152, 12544.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL); + expect_matrix(&expectedmat, &gotmat, 0); + /*____________D3DXMatrixTranslation______________*/ set_matrix(&expectedmat, 1.0f, 0.0f, 0.0f, 0.0f,