1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-09 14:10:09 +00:00

XNAMath 2.05

This commit is contained in:
Chuck Walbourn 2016-05-23 12:48:50 -07:00
parent 9de470febc
commit 299a9e1ad9
5 changed files with 521 additions and 272 deletions

View File

@ -17,7 +17,7 @@
#error XNAMATH and XBOXMATH are incompatible in the same compilation module. Use one or the other.
#endif
#define XNAMATH_VERSION 204
#define XNAMATH_VERSION 205
#if !defined(_XM_X64_) && !defined(_XM_X86_)
#if defined(_M_AMD64) || defined(_AMD64_)
@ -340,6 +340,7 @@ typedef struct _XMMATRIX
typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX
#endif
{
#if defined(_XM_NO_INTRINSICS_) || !defined(XM_STRICT_MATRIX)
union
{
XMVECTOR r[4];
@ -352,6 +353,9 @@ typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX
};
FLOAT m[4][4];
};
#else
XMVECTOR r[4];
#endif
#ifdef __cplusplus
@ -363,8 +367,10 @@ typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX
FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
explicit _XMMATRIX(_In_count_c_(16) CONST FLOAT *pArray);
#if defined(_XM_NO_INTRINSICS_) || !defined(XM_STRICT_MATRIX)
FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
#endif
_XMMATRIX& operator= (CONST _XMMATRIX& M);
@ -745,7 +751,7 @@ typedef struct _XMHENDN3
_XMHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMHENDN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMHENDN3& operator= (CONST _XMHENDN3& HenDN3);
_XMHENDN3& operator= (CONST UINT Packed);
@ -780,7 +786,7 @@ typedef struct _XMHEND3
_XMHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMHEND3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMHEND3& operator= (CONST _XMHEND3& HenD3);
_XMHEND3& operator= (CONST UINT Packed);
@ -815,7 +821,7 @@ typedef struct _XMUHENDN3
_XMUHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMUHENDN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUHENDN3& operator= (CONST _XMUHENDN3& UHenDN3);
_XMUHENDN3& operator= (CONST UINT Packed);
@ -850,7 +856,7 @@ typedef struct _XMUHEND3
_XMUHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMUHEND3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUHEND3& operator= (CONST _XMUHEND3& UHenD3);
_XMUHEND3& operator= (CONST UINT Packed);
@ -885,7 +891,7 @@ typedef struct _XMDHENN3
_XMDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMDHENN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMDHENN3& operator= (CONST _XMDHENN3& DHenN3);
_XMDHENN3& operator= (CONST UINT Packed);
@ -920,7 +926,7 @@ typedef struct _XMDHEN3
_XMDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMDHEN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMDHEN3& operator= (CONST _XMDHEN3& DHen3);
_XMDHEN3& operator= (CONST UINT Packed);
@ -955,7 +961,7 @@ typedef struct _XMUDHENN3
_XMUDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMUDHENN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUDHENN3& operator= (CONST _XMUDHENN3& UDHenN3);
_XMUDHENN3& operator= (CONST UINT Packed);
@ -990,7 +996,7 @@ typedef struct _XMUDHEN3
_XMUDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMUDHEN3(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUDHEN3& operator= (CONST _XMUDHEN3& UDHen3);
_XMUDHEN3& operator= (CONST UINT Packed);
@ -1023,7 +1029,7 @@ typedef struct _XMU565
_XMU565(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMU565(_In_count_c_(3) CONST FLOAT *pArray);
operator USHORT () { return v; }
operator USHORT () const { return v; }
_XMU565& operator= (CONST _XMU565& U565);
_XMU565& operator= (CONST USHORT Packed);
@ -1064,7 +1070,7 @@ typedef struct _XMFLOAT3PK
_XMFLOAT3PK(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMFLOAT3PK(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMFLOAT3PK& operator= (CONST _XMFLOAT3PK& float3pk);
_XMFLOAT3PK& operator= (CONST UINT Packed);
@ -1102,7 +1108,7 @@ typedef struct _XMFLOAT3SE
_XMFLOAT3SE(FLOAT _x, FLOAT _y, FLOAT _z);
explicit _XMFLOAT3SE(_In_count_c_(3) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMFLOAT3SE& operator= (CONST _XMFLOAT3SE& float3se);
_XMFLOAT3SE& operator= (CONST UINT Packed);
@ -1327,7 +1333,7 @@ typedef struct _XMXDECN4
_XMXDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMXDECN4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMXDECN4& operator= (CONST _XMXDECN4& XDecN4);
_XMXDECN4& operator= (CONST UINT Packed);
@ -1363,7 +1369,7 @@ typedef struct _XMXDEC4
_XMXDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMXDEC4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMXDEC4& operator= (CONST _XMXDEC4& XDec4);
_XMXDEC4& operator= (CONST UINT Packed);
@ -1399,7 +1405,7 @@ typedef struct _XMDECN4
_XMDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMDECN4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMDECN4& operator= (CONST _XMDECN4& DecN4);
_XMDECN4& operator= (CONST UINT Packed);
@ -1435,7 +1441,7 @@ typedef struct _XMDEC4
_XMDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMDEC4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMDEC4& operator= (CONST _XMDEC4& Dec4);
_XMDEC4& operator= (CONST UINT Packed);
@ -1471,7 +1477,7 @@ typedef struct _XMUDECN4
_XMUDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMUDECN4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUDECN4& operator= (CONST _XMUDECN4& UDecN4);
_XMUDECN4& operator= (CONST UINT Packed);
@ -1507,7 +1513,7 @@ typedef struct _XMUDEC4
_XMUDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMUDEC4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return v; }
operator UINT () const { return v; }
_XMUDEC4& operator= (CONST _XMUDEC4& UDec4);
_XMUDEC4& operator= (CONST UINT Packed);
@ -1544,7 +1550,7 @@ typedef struct _XMXICON4
_XMXICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMXICON4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMXICON4& operator= (CONST _XMXICON4& XIcoN4);
_XMXICON4& operator= (CONST UINT64 Packed);
@ -1580,7 +1586,7 @@ typedef struct _XMXICO4
_XMXICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMXICO4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMXICO4& operator= (CONST _XMXICO4& XIco4);
_XMXICO4& operator= (CONST UINT64 Packed);
@ -1616,7 +1622,7 @@ typedef struct _XMICON4
_XMICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMICON4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMICON4& operator= (CONST _XMICON4& IcoN4);
_XMICON4& operator= (CONST UINT64 Packed);
@ -1652,7 +1658,7 @@ typedef struct _XMICO4
_XMICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMICO4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMICO4& operator= (CONST _XMICO4& Ico4);
_XMICO4& operator= (CONST UINT64 Packed);
@ -1688,7 +1694,7 @@ typedef struct _XMUICON4
_XMUICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMUICON4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMUICON4& operator= (CONST _XMUICON4& UIcoN4);
_XMUICON4& operator= (CONST UINT64 Packed);
@ -1724,7 +1730,7 @@ typedef struct _XMUICO4
_XMUICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMUICO4(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT64 () { return v; }
operator UINT64 () const { return v; }
_XMUICO4& operator= (CONST _XMUICO4& UIco4);
_XMUICO4& operator= (CONST UINT64 Packed);
@ -1761,7 +1767,7 @@ typedef struct _XMCOLOR
_XMCOLOR(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a);
explicit _XMCOLOR(_In_count_c_(4) CONST FLOAT *pArray);
operator UINT () { return c; }
operator UINT () const { return c; }
_XMCOLOR& operator= (CONST _XMCOLOR& Color);
_XMCOLOR& operator= (CONST UINT Color);
@ -1796,6 +1802,7 @@ typedef struct _XMBYTEN4
explicit _XMBYTEN4(_In_count_c_(4) CONST FLOAT *pArray);
_XMBYTEN4& operator= (CONST _XMBYTEN4& ByteN4);
_XMBYTEN4& operator= (UINT Packed) { v = Packed; return *this; }
#endif // __cplusplus
@ -1826,6 +1833,7 @@ typedef struct _XMBYTE4
explicit _XMBYTE4(_In_count_c_(4) CONST FLOAT *pArray);
_XMBYTE4& operator= (CONST _XMBYTE4& Byte4);
_XMBYTE4& operator= (UINT Packed) { v = Packed; return *this; }
#endif // __cplusplus
@ -1856,6 +1864,7 @@ typedef struct _XMUBYTEN4
explicit _XMUBYTEN4(_In_count_c_(4) CONST FLOAT *pArray);
_XMUBYTEN4& operator= (CONST _XMUBYTEN4& UByteN4);
_XMUBYTEN4& operator= (UINT Packed) { v = Packed; return *this; }
#endif // __cplusplus
@ -1886,6 +1895,7 @@ typedef struct _XMUBYTE4
explicit _XMUBYTE4(_In_count_c_(4) CONST FLOAT *pArray);
_XMUBYTE4& operator= (CONST _XMUBYTE4& UByte4);
_XMUBYTE4& operator= (UINT Packed) { v = Packed; return *this; }
#endif // __cplusplus
@ -1916,7 +1926,7 @@ typedef struct _XMUNIBBLE4
_XMUNIBBLE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
explicit _XMUNIBBLE4(_In_count_c_(4) CONST FLOAT *pArray);
operator USHORT () { return v; }
operator USHORT () const { return v; }
_XMUNIBBLE4& operator= (CONST _XMUNIBBLE4& UNibble4);
_XMUNIBBLE4& operator= (CONST USHORT Packed);
@ -1950,7 +1960,7 @@ typedef struct _XMU555
_XMU555(FLOAT _x, FLOAT _y, FLOAT _z, BOOL _w);
_XMU555(_In_count_c_(3) CONST FLOAT *pArray, BOOL _w);
operator USHORT () { return v; }
operator USHORT () const { return v; }
_XMU555& operator= (CONST _XMU555& U555);
_XMU555& operator= (CONST USHORT Packed);
@ -2124,20 +2134,21 @@ XMVECTOR XMConvertVectorFloatToUInt(FXMVECTOR VFloat, UINT MulExponent);
FLOAT XMConvertHalfToFloat(HALF Value);
FLOAT* XMConvertHalfToFloatStream(_Out_bytecap_x_(sizeof(FLOAT)+OutputStride*(HalfCount-1)) FLOAT* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(HALF)+InputStride*(HalfCount-1)) CONST HALF* pInputStream,
_In_ UINT InputStride, _In_ UINT HalfCount);
_In_ size_t InputStride, _In_ size_t HalfCount);
HALF XMConvertFloatToHalf(FLOAT Value);
HALF* XMConvertFloatToHalfStream(_Out_bytecap_x_(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(FLOAT)+InputStride*(FloatCount-1)) CONST FLOAT* pInputStream,
_In_ UINT InputStride, _In_ UINT FloatCount);
_In_ size_t InputStride, _In_ size_t FloatCount);
#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
#else
#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3);
XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent);
XMVECTOR XMVectorSplatConstantInt(INT IntConstant);
// VMX128 versions defined below as macros
#endif
/****************************************************************************
@ -2385,14 +2396,15 @@ XMVECTOR XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control);
XMVECTOR XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2);
XMVECTOR XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2);
#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
#else
#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements);
XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements);
XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements);
XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3);
XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements,
UINT Select0, UINT Select1, UINT Select2, UINT Select3);
// VMX128 versions defined below as macros
#endif
XMVECTOR XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2);
@ -2533,23 +2545,23 @@ XMVECTOR XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LineP
XMVECTOR XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, CXMVECTOR Line2Point2);
XMVECTOR XMVector2Transform(FXMVECTOR V, CXMMATRIX M);
XMFLOAT4* XMVector2TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMFLOAT4* XMVector2TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMVECTOR XMVector2TransformCoord(FXMVECTOR V, CXMMATRIX M);
XMFLOAT2* XMVector2TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMVECTOR XMVector2TransformNormal(FXMVECTOR V, CXMMATRIX M);
XMFLOAT2* XMVector2TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
/****************************************************************************
*
@ -2601,37 +2613,37 @@ XMVECTOR XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
XMVECTOR XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
XMVECTOR XMVector3Transform(FXMVECTOR V, CXMMATRIX M);
XMFLOAT4* XMVector3TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMFLOAT4* XMVector3TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMVECTOR XMVector3TransformCoord(FXMVECTOR V, CXMMATRIX M);
XMFLOAT3* XMVector3TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMVECTOR XMVector3TransformNormal(FXMVECTOR V, CXMMATRIX M);
XMFLOAT3* XMVector3TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
XMVECTOR XMVector3Project(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
XMFLOAT3* XMVector3ProjectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount,
_In_ size_t InputStride, _In_ size_t VectorCount,
FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
XMVECTOR XMVector3Unproject(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
XMFLOAT3* XMVector3UnprojectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount,
_In_ size_t InputStride, _In_ size_t VectorCount,
FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
@ -2680,9 +2692,9 @@ XMVECTOR XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
XMVECTOR XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
XMVECTOR XMVector4Transform(FXMVECTOR V, CXMMATRIX M);
XMFLOAT4* XMVector4TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(VectorCount-1)) CONST XMFLOAT4* pInputStream,
_In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t VectorCount, CXMMATRIX M);
/****************************************************************************
*
@ -2697,7 +2709,7 @@ BOOL XMMatrixIsIdentity(CXMMATRIX M);
XMMATRIX XMMatrixMultiply(CXMMATRIX M1, CXMMATRIX M2);
XMMATRIX XMMatrixMultiplyTranspose(CXMMATRIX M1, CXMMATRIX M2);
XMMATRIX XMMatrixTranspose(CXMMATRIX M);
XMMATRIX XMMatrixInverse(_Out_ XMVECTOR* pDeterminant, CXMMATRIX M);
XMMATRIX XMMatrixInverse(_Out_opt_ XMVECTOR* pDeterminant, CXMMATRIX M);
XMVECTOR XMMatrixDeterminant(CXMMATRIX M);
BOOL XMMatrixDecompose(_Out_ XMVECTOR *outScale, _Out_ XMVECTOR *outRotQuat, _Out_ XMVECTOR *outTrans, CXMMATRIX M);
@ -2806,9 +2818,9 @@ XMVECTOR XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTO
VOID XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, FXMVECTOR P1, FXMVECTOR P2);
XMVECTOR XMPlaneTransform(FXMVECTOR P, CXMMATRIX M);
XMFLOAT4* XMPlaneTransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(PlaneCount-1)) XMFLOAT4* pOutputStream,
_In_ UINT OutputStride,
_In_ size_t OutputStride,
_In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(PlaneCount-1)) CONST XMFLOAT4* pInputStream,
_In_ UINT InputStride, _In_ UINT PlaneCount, CXMMATRIX M);
_In_ size_t InputStride, _In_ size_t PlaneCount, CXMMATRIX M);
XMVECTOR XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal);
XMVECTOR XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3);
@ -2859,6 +2871,197 @@ VOID XMScalarSinCosEst(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Va
FLOAT XMScalarASinEst(FLOAT Value);
FLOAT XMScalarACosEst(FLOAT Value);
/****************************************************************************
*
* Templates
*
****************************************************************************/
#if defined(__cplusplus)
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
// PermuteHelper internal template (SSE only)
namespace XNAMathInternal
{
// Slow path fallback for permutes that do not map to a single SSE shuffle opcode.
template<UINT Shuffle, bool WhichX, bool WhichY, bool WhichZ, bool WhichW> struct PermuteHelper
{
static XMVECTOR Permute(FXMVECTOR v1, FXMVECTOR v2)
{
static const XMVECTORU32 selectMask =
{
WhichX ? 0xFFFFFFFF : 0,
WhichY ? 0xFFFFFFFF : 0,
WhichZ ? 0xFFFFFFFF : 0,
WhichW ? 0xFFFFFFFF : 0,
};
XMVECTOR shuffled1 = _mm_shuffle_ps(v1, v1, Shuffle);
XMVECTOR shuffled2 = _mm_shuffle_ps(v2, v2, Shuffle);
XMVECTOR masked1 = _mm_andnot_ps(selectMask, shuffled1);
XMVECTOR masked2 = _mm_and_ps(selectMask, shuffled2);
return _mm_or_ps(masked1, masked2);
}
};
// Fast path for permutes that only read from the first vector.
template<UINT Shuffle> struct PermuteHelper<Shuffle, false, false, false, false>
{
static XMVECTOR Permute(FXMVECTOR v1, FXMVECTOR v2) { (v2); return _mm_shuffle_ps(v1, v1, Shuffle); }
};
// Fast path for permutes that only read from the second vector.
template<UINT Shuffle> struct PermuteHelper<Shuffle, true, true, true, true>
{
static XMVECTOR Permute(FXMVECTOR v1, FXMVECTOR v2){ (v1); return _mm_shuffle_ps(v2, v2, Shuffle); }
};
// Fast path for permutes that read XY from the first vector, ZW from the second.
template<UINT Shuffle> struct PermuteHelper<Shuffle, false, false, true, true>
{
static XMVECTOR Permute(FXMVECTOR v1, FXMVECTOR v2) { return _mm_shuffle_ps(v1, v2, Shuffle); }
};
// Fast path for permutes that read XY from the second vector, ZW from the first.
template<UINT Shuffle> struct PermuteHelper<Shuffle, true, true, false, false>
{
static XMVECTOR Permute(FXMVECTOR v1, FXMVECTOR v2) { return _mm_shuffle_ps(v2, v1, Shuffle); }
};
};
#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_
// General permute template
template<UINT PermuteX, UINT PermuteY, UINT PermuteZ, UINT PermuteW>
inline XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
static_assert(PermuteX <= 7, "PermuteX template parameter out of range");
static_assert(PermuteY <= 7, "PermuteY template parameter out of range");
static_assert(PermuteZ <= 7, "PermuteZ template parameter out of range");
static_assert(PermuteW <= 7, "PermuteW template parameter out of range");
#else
XMASSERT(PermuteX <= 7);
XMASSERT(PermuteY <= 7);
XMASSERT(PermuteZ <= 7);
XMASSERT(PermuteW <= 7);
#endif
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
const UINT Shuffle = _MM_SHUFFLE(PermuteW & 3, PermuteZ & 3, PermuteY & 3, PermuteX & 3);
const bool WhichX = PermuteX > 3;
const bool WhichY = PermuteY > 3;
const bool WhichZ = PermuteZ > 3;
const bool WhichW = PermuteW > 3;
return XNAMathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
#else
XMVECTOR c = XMVectorPermuteControl( PermuteX, PermuteY, PermuteZ, PermuteW );
return XMVectorPermute( V1, V2, c );
#endif
}
// Special-case permute templates
template<> inline XMVECTOR XMVectorPermute<0,1,2,3>(FXMVECTOR V1, FXMVECTOR V2) { (V2); return V1; }
template<> inline XMVECTOR XMVectorPermute<4,5,6,7>(FXMVECTOR V1, FXMVECTOR V2) { (V1); return V2; }
//------------------------------------------------------------------------------
// General swizzle template
template<UINT SwizzleX, UINT SwizzleY, UINT SwizzleZ, UINT SwizzleW>
inline XMVECTOR XMVectorSwizzle(FXMVECTOR V)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
static_assert(SwizzleX <= 3, "SwizzleX template parameter out of range");
static_assert(SwizzleY <= 3, "SwizzleY template parameter out of range");
static_assert(SwizzleZ <= 3, "SwizzleZ template parameter out of range");
static_assert(SwizzleW <= 3, "SwizzleW template parameter out of range");
#else
XMASSERT(SwizzleX <= 3);
XMASSERT(SwizzleY <= 3);
XMASSERT(SwizzleZ <= 3);
XMASSERT(SwizzleW <= 3);
#endif
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
return _mm_shuffle_ps( V, V, _MM_SHUFFLE( SwizzleW, SwizzleZ, SwizzleY, SwizzleX ) );
#elif defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
return __vpermwi(V, ((SwizzleX & 3) << 6) | ((SwizzleY & 3) << 4) | ((SwizzleZ & 3) << 2) | (SwizzleW & 3) );
#else
return XMVectorSwizzle( V, SwizzleX, SwizzleY, SwizzleZ, SwizzleW );
#endif
}
// Specialized swizzles
template<> inline XMVECTOR XMVectorSwizzle<0,1,2,3>(FXMVECTOR V) { return V; }
//------------------------------------------------------------------------------
template<UINT Elements>
inline XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
static_assert( Elements < 4, "Elements template parameter out of range" );
#else
XMASSERT( Elements < 4 );
#endif
#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
#else
return XMVectorPermute<Elements, (Elements + 1), (Elements + 2), (Elements + 3)>(V1, V2);
#endif
}
template<UINT Elements>
inline XMVECTOR XMVectorRotateLeft(FXMVECTOR V)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
static_assert( Elements < 4, "Elements template parameter out of range" );
#else
XMASSERT( Elements < 4 );
#endif
#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
#else
return XMVectorSwizzle<Elements & 3, (Elements + 1) & 3, (Elements + 2) & 3, (Elements + 3) & 3>(V);
#endif
}
template<UINT Elements>
inline XMVECTOR XMVectorRotateRight(FXMVECTOR V)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
static_assert( Elements < 4, "Elements template parameter out of range" );
#else
XMASSERT( Elements < 4 );
#endif
#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
#else
return XMVectorSwizzle<(4 - Elements) & 3, (5 - Elements) & 3, (6 - Elements) & 3, (7 - Elements) & 3>(V);
#endif
}
template<UINT VSLeftRotateElements, UINT Select0, UINT Select1, UINT Select2, UINT Select3>
inline XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS)
{
#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
#else
XMVECTOR Control = XMVectorSelectControl(Select0&1, Select1&1, Select2&1, Select3&1);
return XMVectorSelect( VD, XMVectorRotateLeft<VSLeftRotateElements>(VS), Control );
#endif
}
#endif // __cplusplus
/****************************************************************************
*
* Globals
@ -3013,7 +3216,10 @@ XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = {32768.0f*65536.0f,32768.0f*65
****************************************************************************/
#pragma warning(push)
#pragma warning(disable:4214 4204 4365 4616 6001)
#pragma warning(disable:4068 4214 4204 4365 4616 6001)
#pragma prefast(push)
#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
#if !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_)
@ -3029,7 +3235,8 @@ XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = {32768.0f*65536.0f,32768.0f*65
//------------------------------------------------------------------------------
#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
#else
XMFINLINE XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3)
{
@ -3174,8 +3381,7 @@ XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateE
return XMVectorSelect( VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control );
}
// Implemented for VMX128 intrinsics as #defines aboves
#endif _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_
#endif
//------------------------------------------------------------------------------
@ -3184,6 +3390,7 @@ XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateE
#include "xnamathmatrix.inl"
#include "xnamathmisc.inl"
#pragma prefast(pop)
#pragma warning(pop)
#endif // __XNAMATH_H__

View File

@ -115,16 +115,16 @@ XMFINLINE FLOAT XMConvertHalfToFloat
XMINLINE FLOAT* XMConvertHalfToFloatStream
(
FLOAT* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST HALF* pInputStream,
UINT InputStride,
UINT HalfCount
size_t InputStride,
size_t HalfCount
)
{
#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
UINT i;
BYTE* pHalf = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pHalf = (CONST BYTE*)pInputStream;
BYTE* pFloat = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -132,7 +132,7 @@ XMINLINE FLOAT* XMConvertHalfToFloatStream
for (i = 0; i < HalfCount; i++)
{
*(FLOAT*)pFloat = XMConvertHalfToFloat(*(HALF*)pHalf);
*(FLOAT*)pFloat = XMConvertHalfToFloat(*(const HALF*)pHalf);
pHalf += InputStride;
pFloat += OutputStride;
}
@ -190,15 +190,15 @@ XMFINLINE HALF XMConvertFloatToHalf
XMINLINE HALF* XMConvertFloatToHalfStream
(
HALF* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST FLOAT* pInputStream,
UINT InputStride,
UINT FloatCount
size_t InputStride,
size_t FloatCount
)
{
#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
UINT i;
size_t i;
BYTE* pFloat = (BYTE*)pInputStream;
BYTE* pHalf = (BYTE*)pOutputStream;
@ -939,7 +939,7 @@ XMFINLINE XMVECTOR XMLoadSInt3
XMVECTOR V;
XMASSERT(pSource);
#ifdef _XBOX
#ifdef _XBOX_VER
V = XMLoadInt3( (const UINT*)pSource );
return XMConvertVectorIntToFloat( V, 0 );
#else
@ -1637,7 +1637,7 @@ XMFINLINE XMVECTOR XMLoadFloat3PK
Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18);
}
return XMLoadFloat3A( (XMFLOAT3A*)&Result );
return XMLoadFloat3A( (const XMFLOAT3A*)&Result );
}
//------------------------------------------------------------------------------
@ -1746,7 +1746,7 @@ XMFINLINE XMVECTOR XMLoadFloat3SE
Result[2] = ((Exponent + 112) << 23) | (Mantissa << 14);
}
return XMLoadFloat3A( (XMFLOAT3A*)&Result );
return XMLoadFloat3A( (const XMFLOAT3A*)&Result );
}
//------------------------------------------------------------------------------
@ -1791,7 +1791,7 @@ XMFINLINE XMVECTOR XMLoadSInt4
XMVECTOR V;
XMASSERT(pSource);
#ifdef _XBOX
#ifdef _XBOX_VER
V = XMLoadInt4( (const UINT*)pSource );
return XMConvertVectorIntToFloat( V, 0 );
#else
@ -3747,8 +3747,8 @@ XMFINLINE VOID XMStoreByteN2
XMStoreFloat4A( &tmp, N );
pDestination->x = (BYTE)tmp.x;
pDestination->y = (BYTE)tmp.y;
pDestination->x = (CHAR)tmp.x;
pDestination->y = (CHAR)tmp.y;
}
//------------------------------------------------------------------------------
@ -3771,8 +3771,8 @@ XMFINLINE VOID XMStoreByte2
XMStoreFloat4A( &tmp, N );
pDestination->x = (BYTE)tmp.x;
pDestination->y = (BYTE)tmp.y;
pDestination->x = (CHAR)tmp.x;
pDestination->y = (CHAR)tmp.y;
}
//------------------------------------------------------------------------------

View File

@ -438,8 +438,6 @@ XMINLINE XMMATRIX XMMatrixInverse
static CONST XMVECTORU32 Permute0Z0Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1Z, XM_PERMUTE_0X};
static CONST XMVECTORU32 Permute1W0X0W1Z = {XM_PERMUTE_1W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z};
XMASSERT(pDeterminant);
MT = XMMatrixTranspose(M);
V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleXXYY.v);
@ -517,7 +515,8 @@ XMINLINE XMMATRIX XMMatrixInverse
Determinant = XMVector4Dot(R.r[0], MT.r[0]);
*pDeterminant = Determinant;
if (pDeterminant)
*pDeterminant = Determinant;
Reciprocal = XMVectorReciprocal(Determinant);
@ -529,7 +528,6 @@ XMINLINE XMMATRIX XMMatrixInverse
return Result;
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(pDeterminant);
XMMATRIX MT = XMMatrixTranspose(M);
XMVECTOR V00 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,1,0,0));
XMVECTOR V10 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(3,2,3,2));
@ -635,7 +633,8 @@ XMINLINE XMMATRIX XMMatrixInverse
C6 = _mm_shuffle_ps(C6,C6,_MM_SHUFFLE(3,1,2,0));
// Get the determinate
XMVECTOR vTemp = XMVector4Dot(C0,MT.r[0]);
*pDeterminant = vTemp;
if (pDeterminant)
*pDeterminant = vTemp;
vTemp = _mm_div_ps(g_XMOne,vTemp);
XMMATRIX mResult;
mResult.r[0] = _mm_mul_ps(C0,vTemp);
@ -747,6 +746,9 @@ XMINLINE XMVECTOR XMMatrixDeterminant
#endif // _XM_VMX128_INTRINSICS_
}
#undef XMRANKDECOMPOSE
#undef XM_DECOMP_EPSILON
#define XMRANKDECOMPOSE(a, b, c, x, y, z) \
if((x) < (y)) \
{ \
@ -799,7 +801,13 @@ XMINLINE XMVECTOR XMMatrixDeterminant
#define XM_DECOMP_EPSILON 0.0001f
XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVECTOR *outTrans, CXMMATRIX M )
XMINLINE BOOL XMMatrixDecompose
(
XMVECTOR *outScale,
XMVECTOR *outRotQuat,
XMVECTOR *outTrans,
CXMMATRIX M
)
{
FLOAT fDet;
FLOAT *pfScales;
@ -812,6 +820,10 @@ XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVEC
&g_XMIdentityR2.v
};
XMASSERT( outScale != NULL );
XMASSERT( outRotQuat != NULL );
XMASSERT( outTrans != NULL );
// Get the translation
outTrans[0] = M.r[3];
@ -829,6 +841,7 @@ XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVEC
XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0]));
XMVectorGetXPtr(&pfScales[1],XMVector3Length(ppvBasis[1][0]));
XMVectorGetXPtr(&pfScales[2],XMVector3Length(ppvBasis[2][0]));
pfScales[3] = 0.f;
XMRANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2])
@ -878,7 +891,7 @@ XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVEC
if(XM_DECOMP_EPSILON < fDet)
{
// Non-SRT matrix encountered
// Non-SRT matrix encountered
return FALSE;
}
@ -887,6 +900,9 @@ XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVEC
return TRUE;
}
#undef XMRANKDECOMPOSE
#undef XM_DECOMP_EPSILON
//------------------------------------------------------------------------------
// Transformation operations
//------------------------------------------------------------------------------
@ -2470,6 +2486,7 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH
FLOAT TwoNearZ;
FLOAT ReciprocalWidth;
FLOAT ReciprocalHeight;
FLOAT fRange;
XMMATRIX M;
XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
@ -2479,15 +2496,27 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH
TwoNearZ = NearZ + NearZ;
ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
fRange = FarZ / (FarZ-NearZ);
M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f);
M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f);
M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth,
-(ViewTop + ViewBottom) * ReciprocalHeight,
FarZ / (FarZ - NearZ),
1.0f);
M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f);
M.m[0][0] = TwoNearZ * ReciprocalWidth;
M.m[0][1] = 0.0f;
M.m[0][2] = 0.0f;
M.m[0][3] = 0.0f;
M.m[1][0] = 0.0f;
M.m[1][1] = TwoNearZ * ReciprocalHeight;
M.m[1][2] = 0.0f;
M.m[1][3] = 0.0f;
M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth;
M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight;
M.m[2][2] = fRange;
M.m[2][3] = 1.0f;
M.m[3][0] = 0.0f;
M.m[3][1] = 0.0f;
M.m[3][2] = -fRange * NearZ;
M.m[3][3] = 0.0f;
return M;
#elif defined(_XM_SSE_INTRINSICS_)
@ -2518,10 +2547,10 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH
vTemp = _mm_and_ps(vTemp,g_XMMaskY);
M.r[1] = vTemp;
// 0,0,fRange,1.0f
M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth;
M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight;
M.m[2][2] = fRange;
M.m[2][3] = 1.0f;
M.r[2] = XMVectorSet( -(ViewLeft + ViewRight) * ReciprocalWidth,
-(ViewTop + ViewBottom) * ReciprocalHeight,
fRange,
1.0f );
// 0,0,-fRange * NearZ,0.0f
vValues = _mm_and_ps(vValues,g_XMMaskZ);
M.r[3] = vValues;
@ -2547,6 +2576,7 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH
FLOAT TwoNearZ;
FLOAT ReciprocalWidth;
FLOAT ReciprocalHeight;
FLOAT fRange;
XMMATRIX M;
XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
@ -2556,15 +2586,27 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH
TwoNearZ = NearZ + NearZ;
ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
fRange = FarZ / (NearZ-FarZ);
M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f);
M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f);
M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth,
(ViewTop + ViewBottom) * ReciprocalHeight,
FarZ / (NearZ - FarZ),
-1.0f);
M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f);
M.m[0][0] = TwoNearZ * ReciprocalWidth;
M.m[0][1] = 0.0f;
M.m[0][2] = 0.0f;
M.m[0][3] = 0.0f;
M.m[1][0] = 0.0f;
M.m[1][1] = TwoNearZ * ReciprocalHeight;
M.m[1][2] = 0.0f;
M.m[1][3] = 0.0f;
M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth;
M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight;
M.m[2][2] = fRange;
M.m[2][3] = -1.0f;
M.m[3][0] = 0.0f;
M.m[3][1] = 0.0f;
M.m[3][2] = fRange * NearZ;
M.m[3][3] = 0.0f;
return M;
#elif defined(_XM_SSE_INTRINSICS_)
@ -2596,10 +2638,10 @@ XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH
vTemp = _mm_and_ps(vTemp,g_XMMaskY);
M.r[1] = vTemp;
// 0,0,fRange,1.0f
M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth;
M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight;
M.m[2][2] = fRange;
M.m[2][3] = -1.0f;
M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth,
(ViewTop + ViewBottom) * ReciprocalHeight,
fRange,
-1.0f);
// 0,0,-fRange * NearZ,0.0f
vValues = _mm_and_ps(vValues,g_XMMaskZ);
M.r[3] = vValues;
@ -2940,10 +2982,10 @@ XMFINLINE _XMMATRIX::_XMMATRIX
CONST FLOAT* pArray
)
{
r[0] = XMLoadFloat4((XMFLOAT4*)pArray);
r[1] = XMLoadFloat4((XMFLOAT4*)(pArray + 4));
r[2] = XMLoadFloat4((XMFLOAT4*)(pArray + 8));
r[3] = XMLoadFloat4((XMFLOAT4*)(pArray + 12));
r[0] = XMLoadFloat4((const XMFLOAT4*)pArray);
r[1] = XMLoadFloat4((const XMFLOAT4*)(pArray + 4));
r[2] = XMLoadFloat4((const XMFLOAT4*)(pArray + 8));
r[3] = XMLoadFloat4((const XMFLOAT4*)(pArray + 12));
}
//------------------------------------------------------------------------------
@ -3120,9 +3162,9 @@ XMFINLINE _XMFLOAT4X3& _XMFLOAT4X3::operator=
CONST _XMFLOAT4X3& Float4x3
)
{
XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x3._11);
XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x3._22);
XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x3._33);
XMVECTOR V1 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._11);
XMVECTOR V2 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._22);
XMVECTOR V3 = XMLoadFloat4((const XMFLOAT4*)&Float4x3._33);
XMStoreFloat4((XMFLOAT4*)&_11, V1);
XMStoreFloat4((XMFLOAT4*)&_22, V2);
@ -3138,9 +3180,9 @@ XMFINLINE XMFLOAT4X3A& XMFLOAT4X3A::operator=
CONST XMFLOAT4X3A& Float4x3
)
{
XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._11);
XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._22);
XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._33);
XMVECTOR V1 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x3._11);
XMVECTOR V2 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x3._22);
XMVECTOR V3 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x3._33);
XMStoreFloat4A((XMFLOAT4A*)&_11, V1);
XMStoreFloat4A((XMFLOAT4A*)&_22, V2);
@ -3212,10 +3254,10 @@ XMFINLINE _XMFLOAT4X4& _XMFLOAT4X4::operator=
CONST _XMFLOAT4X4& Float4x4
)
{
XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x4._11);
XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x4._21);
XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x4._31);
XMVECTOR V4 = XMLoadFloat4((XMFLOAT4*)&Float4x4._41);
XMVECTOR V1 = XMLoadFloat4((const XMFLOAT4*)&Float4x4._11);
XMVECTOR V2 = XMLoadFloat4((const XMFLOAT4*)&Float4x4._21);
XMVECTOR V3 = XMLoadFloat4((const XMFLOAT4*)&Float4x4._31);
XMVECTOR V4 = XMLoadFloat4((const XMFLOAT4*)&Float4x4._41);
XMStoreFloat4((XMFLOAT4*)&_11, V1);
XMStoreFloat4((XMFLOAT4*)&_21, V2);
@ -3232,10 +3274,10 @@ XMFINLINE XMFLOAT4X4A& XMFLOAT4X4A::operator=
CONST XMFLOAT4X4A& Float4x4
)
{
XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._11);
XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._21);
XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._31);
XMVECTOR V4 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._41);
XMVECTOR V1 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x4._11);
XMVECTOR V2 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x4._21);
XMVECTOR V3 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x4._31);
XMVECTOR V4 = XMLoadFloat4A((const XMFLOAT4A*)&Float4x4._41);
XMStoreFloat4A((XMFLOAT4A*)&_11, V1);
XMStoreFloat4A((XMFLOAT4A*)&_21, V2);

View File

@ -79,7 +79,7 @@ XMFINLINE BOOL XMQuaternionIsIdentity
#elif defined(_XM_SSE_INTRINSICS_)
XMVECTOR vTemp = _mm_cmpeq_ps(Q,g_XMIdentityR3);
return (_mm_movemask_ps(vTemp)==0x0f) ? true : false;
return (_mm_movemask_ps(vTemp)==0x0f);
#else // _XM_VMX128_INTRINSICS_
#endif // _XM_VMX128_INTRINSICS_
}
@ -1477,11 +1477,11 @@ XMFINLINE XMVECTOR XMPlaneTransform
XMFINLINE XMFLOAT4* XMPlaneTransformStream
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT4* pInputStream,
UINT InputStride,
UINT PlaneCount,
CXMMATRIX M
size_t InputStride,
size_t PlaneCount,
CXMMATRIX M
)
{
return XMVector4TransformStream(pOutputStream,
@ -1967,7 +1967,7 @@ XMFINLINE BOOL XMScalarNearEqual
{
FLOAT Delta = S1 - S2;
#if defined(_XM_NO_INTRINSICS_)
UINT AbsDelta = *(UINT*)&Delta & 0x7FFFFFFF;
UINT AbsDelta = *(const UINT*)&Delta & 0x7FFFFFFF;
return (*(FLOAT*)&AbsDelta <= Epsilon);
#elif defined(_XM_SSE_INTRINSICS_)
return (fabsf(Delta) <= Epsilon);
@ -2168,7 +2168,7 @@ XMINLINE FLOAT XMScalarASin
XMVECTOR AbsV, R0, R1, Result;
XMVECTOR V3;
*(UINT*)&AbsValue = *(UINT*)&Value & 0x7FFFFFFF;
*(UINT*)&AbsValue = *(const UINT*)&Value & 0x7FFFFFFF;
Value2 = Value * AbsValue;
Value3 = Value * Value2;
@ -2379,7 +2379,7 @@ XMFINLINE FLOAT XMScalarASinEst
FLOAT AbsV, V2, D;
CONST FLOAT OnePlusEps = 1.00000011921f;
*(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF;
*(UINT*)&AbsV = *(const UINT*)&Value & 0x7FFFFFFF;
V2 = Value * AbsV;
D = OnePlusEps - AbsV;
@ -2426,7 +2426,7 @@ XMFINLINE FLOAT XMScalarACosEst
// return XM_PIDIV2 - XMScalarASin(Value);
*(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF;
*(UINT*)&AbsV = *(const UINT*)&Value & 0x7FFFFFFF;
V2 = Value * AbsV;
D = OnePlusEps - AbsV;

View File

@ -7046,11 +7046,11 @@ XMFINLINE XMVECTOR XMVector2Transform
XMINLINE XMFLOAT4* XMVector2TransformStream
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT2* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -7059,8 +7059,8 @@ XMINLINE XMFLOAT4* XMVector2TransformStream
XMVECTOR X;
XMVECTOR Y;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -7068,7 +7068,7 @@ XMINLINE XMFLOAT4* XMVector2TransformStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat2((XMFLOAT2*)pInputVector);
V = XMLoadFloat2((const XMFLOAT2*)pInputVector);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y);
@ -7088,8 +7088,8 @@ XMINLINE XMFLOAT4* XMVector2TransformStream
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE* pInputVector = (const BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
@ -7114,11 +7114,11 @@ XMINLINE XMFLOAT4* XMVector2TransformStream
XMINLINE XMFLOAT4* XMVector2TransformStreamNC
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT2* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_)
@ -7174,11 +7174,11 @@ XMFINLINE XMVECTOR XMVector2TransformCoord
XMINLINE XMFLOAT2* XMVector2TransformCoordStream
(
XMFLOAT2* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT2* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -7188,8 +7188,8 @@ XMINLINE XMFLOAT2* XMVector2TransformCoordStream
XMVECTOR Y;
XMVECTOR InverseW;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -7197,7 +7197,7 @@ XMINLINE XMFLOAT2* XMVector2TransformCoordStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat2((XMFLOAT2*)pInputVector);
V = XMLoadFloat2((const XMFLOAT2*)pInputVector);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y);
@ -7222,8 +7222,8 @@ XMINLINE XMFLOAT2* XMVector2TransformCoordStream
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE *pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE *pInputVector = (CONST BYTE*)pInputStream;
BYTE *pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
@ -7283,11 +7283,11 @@ XMFINLINE XMVECTOR XMVector2TransformNormal
XMINLINE XMFLOAT2* XMVector2TransformNormalStream
(
XMFLOAT2* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT2* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -7296,8 +7296,8 @@ XMINLINE XMFLOAT2* XMVector2TransformNormalStream
XMVECTOR X;
XMVECTOR Y;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -7305,7 +7305,7 @@ XMINLINE XMFLOAT2* XMVector2TransformNormalStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat2((XMFLOAT2*)pInputVector);
V = XMLoadFloat2((const XMFLOAT2*)pInputVector);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y);
@ -7325,8 +7325,8 @@ XMINLINE XMFLOAT2* XMVector2TransformNormalStream
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE*pInputVector = (const BYTE*)pInputStream;
size_t i;
CONST BYTE*pInputVector = (CONST BYTE*)pInputStream;
BYTE *pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
{
@ -8798,11 +8798,11 @@ XMFINLINE XMVECTOR XMVector3Transform
XMINLINE XMFLOAT4* XMVector3TransformStream
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -8812,8 +8812,8 @@ XMINLINE XMFLOAT4* XMVector3TransformStream
XMVECTOR Y;
XMVECTOR Z;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -8821,7 +8821,7 @@ XMINLINE XMFLOAT4* XMVector3TransformStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Z = XMVectorSplatZ(V);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
@ -8841,8 +8841,8 @@ XMINLINE XMFLOAT4* XMVector3TransformStream
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE* pInputVector = (const BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
@ -8871,10 +8871,10 @@ XMINLINE XMFLOAT4* XMVector3TransformStream
XMINLINE XMFLOAT4* XMVector3TransformStreamNC
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
@ -8937,11 +8937,11 @@ XMFINLINE XMVECTOR XMVector3TransformCoord
XMINLINE XMFLOAT3* XMVector3TransformCoordStream
(
XMFLOAT3* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -8952,8 +8952,8 @@ XMINLINE XMFLOAT3* XMVector3TransformCoordStream
XMVECTOR Z;
XMVECTOR InverseW;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -8961,7 +8961,7 @@ XMINLINE XMFLOAT3* XMVector3TransformCoordStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Z = XMVectorSplatZ(V);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
@ -8990,8 +8990,8 @@ XMINLINE XMFLOAT3* XMVector3TransformCoordStream
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE *pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE *pInputVector = (CONST BYTE*)pInputStream;
BYTE *pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
@ -9066,11 +9066,11 @@ XMFINLINE XMVECTOR XMVector3TransformNormal
XMINLINE XMFLOAT3* XMVector3TransformNormalStream
(
XMFLOAT3* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
CXMMATRIX M
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -9080,8 +9080,8 @@ XMINLINE XMFLOAT3* XMVector3TransformNormalStream
XMVECTOR Y;
XMVECTOR Z;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -9089,7 +9089,7 @@ XMINLINE XMFLOAT3* XMVector3TransformNormalStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Z = XMVectorSplatZ(V);
Y = XMVectorSplatY(V);
X = XMVectorSplatX(V);
@ -9113,8 +9113,8 @@ XMINLINE XMFLOAT3* XMVector3TransformNormalStream
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
UINT i;
const BYTE *pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE *pInputVector = (CONST BYTE*)pInputStream;
BYTE *pOutputVector = (BYTE*)pOutputStream;
for (i = 0; i < VectorCount; i++)
@ -9217,19 +9217,19 @@ XMINLINE XMVECTOR XMVector3Project
XMINLINE XMFLOAT3* XMVector3ProjectStream
(
XMFLOAT3* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
size_t InputStride,
size_t VectorCount,
FLOAT ViewportX,
FLOAT ViewportY,
FLOAT ViewportWidth,
FLOAT ViewportHeight,
FLOAT ViewportMinZ,
FLOAT ViewportMaxZ,
CXMMATRIX Projection,
CXMMATRIX View,
CXMMATRIX World
CXMMATRIX Projection,
CXMMATRIX View,
CXMMATRIX World
)
{
#if defined(_XM_NO_INTRINSICS_)
@ -9239,10 +9239,10 @@ XMINLINE XMFLOAT3* XMVector3ProjectStream
XMVECTOR Scale;
XMVECTOR Offset;
XMVECTOR Result;
UINT i;
size_t i;
FLOAT HalfViewportWidth = ViewportWidth * 0.5f;
FLOAT HalfViewportHeight = ViewportHeight * 0.5f;
BYTE* pInputVector = (BYTE*)pInputStream;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -9263,7 +9263,7 @@ XMINLINE XMFLOAT3* XMVector3ProjectStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Result = XMVector3TransformCoord(V, Transform);
@ -9285,10 +9285,10 @@ XMINLINE XMFLOAT3* XMVector3ProjectStream
XMVECTOR Scale;
XMVECTOR Offset;
XMVECTOR Result;
UINT i;
size_t i;
FLOAT HalfViewportWidth = ViewportWidth * 0.5f;
FLOAT HalfViewportHeight = ViewportHeight * 0.5f;
BYTE* pInputVector = (BYTE*)pInputStream;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
Scale = XMVectorSet(HalfViewportWidth,
@ -9306,7 +9306,7 @@ XMINLINE XMFLOAT3* XMVector3ProjectStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Result = XMVector3TransformCoord(V, Transform);
@ -9409,19 +9409,19 @@ XMFINLINE XMVECTOR XMVector3Unproject
XMINLINE XMFLOAT3* XMVector3UnprojectStream
(
XMFLOAT3* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT3* pInputStream,
UINT InputStride,
UINT VectorCount,
size_t InputStride,
size_t VectorCount,
FLOAT ViewportX,
FLOAT ViewportY,
FLOAT ViewportWidth,
FLOAT ViewportHeight,
FLOAT ViewportMinZ,
FLOAT ViewportMaxZ,
CXMMATRIX Projection,
CXMMATRIX View,
CXMMATRIX World)
CXMMATRIX Projection,
CXMMATRIX View,
CXMMATRIX World)
{
#if defined(_XM_NO_INTRINSICS_)
@ -9431,8 +9431,8 @@ XMINLINE XMFLOAT3* XMVector3UnprojectStream
XMVECTOR V;
XMVECTOR Determinant;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
CONST XMVECTOR D = XMVectorSet(-1.0f, 1.0f, 0.0f, 0.0f);
@ -9457,7 +9457,7 @@ XMINLINE XMFLOAT3* XMVector3UnprojectStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Result = XMVectorMultiplyAdd(V, Scale, Offset);
@ -9480,8 +9480,8 @@ XMINLINE XMFLOAT3* XMVector3UnprojectStream
XMVECTOR V;
XMVECTOR Determinant;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
CONST XMVECTORF32 D = {-1.0f, 1.0f, 0.0f, 0.0f};
@ -9504,7 +9504,7 @@ XMINLINE XMFLOAT3* XMVector3UnprojectStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat3((XMFLOAT3*)pInputVector);
V = XMLoadFloat3((const XMFLOAT3*)pInputVector);
Result = XMVectorMultiplyAdd(V, Scale, Offset);
@ -10811,10 +10811,10 @@ XMFINLINE XMVECTOR XMVector4Transform
XMINLINE XMFLOAT4* XMVector4TransformStream
(
XMFLOAT4* pOutputStream,
UINT OutputStride,
size_t OutputStride,
CONST XMFLOAT4* pInputStream,
UINT InputStride,
UINT VectorCount,
size_t InputStride,
size_t VectorCount,
CXMMATRIX M
)
{
@ -10826,8 +10826,8 @@ XMINLINE XMFLOAT4* XMVector4TransformStream
XMVECTOR Z;
XMVECTOR W;
XMVECTOR Result;
UINT i;
BYTE* pInputVector = (BYTE*)pInputStream;
size_t i;
CONST BYTE* pInputVector = (CONST BYTE*)pInputStream;
BYTE* pOutputVector = (BYTE*)pOutputStream;
XMASSERT(pOutputStream);
@ -10835,7 +10835,7 @@ XMINLINE XMFLOAT4* XMVector4TransformStream
for (i = 0; i < VectorCount; i++)
{
V = XMLoadFloat4((XMFLOAT4*)pInputVector);
V = XMLoadFloat4((const XMFLOAT4*)pInputVector);
W = XMVectorSplatW(V);
Z = XMVectorSplatZ(V);
Y = XMVectorSplatY(V);
@ -10859,7 +10859,7 @@ XMINLINE XMFLOAT4* XMVector4TransformStream
return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_)
UINT i;
size_t i;
XMASSERT(pOutputStream);
XMASSERT(pInputStream);
@ -11249,7 +11249,7 @@ XMFINLINE _XMSHORTN2::_XMSHORTN2
CONST FLOAT* pArray
)
{
XMStoreShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreShortN2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11299,7 +11299,7 @@ XMFINLINE _XMSHORT2::_XMSHORT2
CONST FLOAT* pArray
)
{
XMStoreShort2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreShort2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11349,7 +11349,7 @@ XMFINLINE _XMUSHORTN2::_XMUSHORTN2
CONST FLOAT* pArray
)
{
XMStoreUShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreUShortN2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11399,7 +11399,7 @@ XMFINLINE _XMUSHORT2::_XMUSHORT2
CONST FLOAT* pArray
)
{
XMStoreUShort2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreUShort2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11449,7 +11449,7 @@ XMFINLINE _XMBYTEN2::_XMBYTEN2
CONST FLOAT* pArray
)
{
XMStoreByteN2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreByteN2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11499,7 +11499,7 @@ XMFINLINE _XMBYTE2::_XMBYTE2
CONST FLOAT* pArray
)
{
XMStoreByte2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreByte2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11549,7 +11549,7 @@ XMFINLINE _XMUBYTEN2::_XMUBYTEN2
CONST FLOAT* pArray
)
{
XMStoreUByteN2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreUByteN2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11599,7 +11599,7 @@ XMFINLINE _XMUBYTE2::_XMUBYTE2
CONST FLOAT* pArray
)
{
XMStoreUByte2(this, XMLoadFloat2((XMFLOAT2*)pArray));
XMStoreUByte2(this, XMLoadFloat2((const XMFLOAT2*)pArray));
}
//------------------------------------------------------------------------------
@ -11741,7 +11741,7 @@ XMFINLINE _XMHENDN3::_XMHENDN3
CONST FLOAT* pArray
)
{
XMStoreHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreHenDN3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -11791,7 +11791,7 @@ XMFINLINE _XMHEND3::_XMHEND3
CONST FLOAT* pArray
)
{
XMStoreHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreHenD3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -11841,7 +11841,7 @@ XMFINLINE _XMUHENDN3::_XMUHENDN3
CONST FLOAT* pArray
)
{
XMStoreUHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreUHenDN3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -11891,7 +11891,7 @@ XMFINLINE _XMUHEND3::_XMUHEND3
CONST FLOAT* pArray
)
{
XMStoreUHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreUHenD3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -11941,7 +11941,7 @@ XMFINLINE _XMDHENN3::_XMDHENN3
CONST FLOAT* pArray
)
{
XMStoreDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreDHenN3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -11991,7 +11991,7 @@ XMFINLINE _XMDHEN3::_XMDHEN3
CONST FLOAT* pArray
)
{
XMStoreDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreDHen3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -12041,7 +12041,7 @@ XMFINLINE _XMUDHENN3::_XMUDHENN3
CONST FLOAT* pArray
)
{
XMStoreUDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreUDHenN3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -12091,7 +12091,7 @@ XMFINLINE _XMUDHEN3::_XMUDHEN3
CONST FLOAT* pArray
)
{
XMStoreUDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray));
XMStoreUDHen3(this, XMLoadFloat3((const XMFLOAT3*)pArray));
}
//------------------------------------------------------------------------------
@ -12147,7 +12147,7 @@ XMFINLINE _XMU565::_XMU565
CONST FLOAT *pArray
)
{
XMStoreU565(this, XMLoadFloat3((XMFLOAT3*)pArray ));
XMStoreU565(this, XMLoadFloat3((const XMFLOAT3*)pArray ));
}
XMFINLINE _XMU565& _XMU565::operator=
@ -12189,7 +12189,7 @@ XMFINLINE _XMFLOAT3PK::_XMFLOAT3PK
CONST FLOAT *pArray
)
{
XMStoreFloat3PK(this, XMLoadFloat3((XMFLOAT3*)pArray ));
XMStoreFloat3PK(this, XMLoadFloat3((const XMFLOAT3*)pArray ));
}
XMFINLINE _XMFLOAT3PK& _XMFLOAT3PK::operator=
@ -12231,7 +12231,7 @@ XMFINLINE _XMFLOAT3SE::_XMFLOAT3SE
CONST FLOAT *pArray
)
{
XMStoreFloat3SE(this, XMLoadFloat3((XMFLOAT3*)pArray ));
XMStoreFloat3SE(this, XMLoadFloat3((const XMFLOAT3*)pArray ));
}
XMFINLINE _XMFLOAT3SE& _XMFLOAT3SE::operator=
@ -12459,7 +12459,7 @@ XMFINLINE _XMSHORTN4::_XMSHORTN4
CONST FLOAT* pArray
)
{
XMStoreShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreShortN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12515,7 +12515,7 @@ XMFINLINE _XMSHORT4::_XMSHORT4
CONST FLOAT* pArray
)
{
XMStoreShort4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreShort4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12571,7 +12571,7 @@ XMFINLINE _XMUSHORTN4::_XMUSHORTN4
CONST FLOAT* pArray
)
{
XMStoreUShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUShortN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12627,7 +12627,7 @@ XMFINLINE _XMUSHORT4::_XMUSHORT4
CONST FLOAT* pArray
)
{
XMStoreUShort4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUShort4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12670,7 +12670,7 @@ XMFINLINE _XMXDECN4::_XMXDECN4
CONST FLOAT* pArray
)
{
XMStoreXDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreXDecN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12721,7 +12721,7 @@ XMFINLINE _XMXDEC4::_XMXDEC4
CONST FLOAT* pArray
)
{
XMStoreXDec4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreXDec4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12772,7 +12772,7 @@ XMFINLINE _XMDECN4::_XMDECN4
CONST FLOAT* pArray
)
{
XMStoreDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreDecN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12823,7 +12823,7 @@ XMFINLINE _XMDEC4::_XMDEC4
CONST FLOAT* pArray
)
{
XMStoreDec4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreDec4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12874,7 +12874,7 @@ XMFINLINE _XMUDECN4::_XMUDECN4
CONST FLOAT* pArray
)
{
XMStoreUDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUDecN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12925,7 +12925,7 @@ XMFINLINE _XMUDEC4::_XMUDEC4
CONST FLOAT* pArray
)
{
XMStoreUDec4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUDec4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -12976,7 +12976,7 @@ XMFINLINE _XMXICON4::_XMXICON4
CONST FLOAT* pArray
)
{
XMStoreXIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreXIcoN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13027,7 +13027,7 @@ XMFINLINE _XMXICO4::_XMXICO4
CONST FLOAT* pArray
)
{
XMStoreXIco4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreXIco4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13078,7 +13078,7 @@ XMFINLINE _XMICON4::_XMICON4
CONST FLOAT* pArray
)
{
XMStoreIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreIcoN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13129,7 +13129,7 @@ XMFINLINE _XMICO4::_XMICO4
CONST FLOAT* pArray
)
{
XMStoreIco4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreIco4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13180,7 +13180,7 @@ XMFINLINE _XMUICON4::_XMUICON4
CONST FLOAT* pArray
)
{
XMStoreUIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUIcoN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13231,7 +13231,7 @@ XMFINLINE _XMUICO4::_XMUICO4
CONST FLOAT* pArray
)
{
XMStoreUIco4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUIco4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13282,7 +13282,7 @@ XMFINLINE _XMCOLOR::_XMCOLOR
CONST FLOAT* pArray
)
{
XMStoreColor(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreColor(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13346,7 +13346,7 @@ XMFINLINE _XMBYTEN4::_XMBYTEN4
CONST FLOAT* pArray
)
{
XMStoreByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreByteN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13402,7 +13402,7 @@ XMFINLINE _XMBYTE4::_XMBYTE4
CONST FLOAT* pArray
)
{
XMStoreByte4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreByte4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13458,7 +13458,7 @@ XMFINLINE _XMUBYTEN4::_XMUBYTEN4
CONST FLOAT* pArray
)
{
XMStoreUByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUByteN4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13514,7 +13514,7 @@ XMFINLINE _XMUBYTE4::_XMUBYTE4
CONST FLOAT* pArray
)
{
XMStoreUByte4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUByte4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13570,7 +13570,7 @@ XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4
CONST FLOAT *pArray
)
{
XMStoreUNibble4(this, XMLoadFloat4((XMFLOAT4*)pArray));
XMStoreUNibble4(this, XMLoadFloat4((const XMFLOAT4*)pArray));
}
//------------------------------------------------------------------------------
@ -13636,7 +13636,7 @@ XMFINLINE _XMU555::_XMU555
BOOL _w
)
{
XMVECTOR V = XMLoadFloat3((XMFLOAT3*)pArray);
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pArray);
XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f) ));
}