DirectXTex updated to use XNAMath 2.05 instead of 2.04 for USE_XNAMATH builds

This commit is contained in:
walbourn_cp 2012-06-22 12:14:10 -07:00
parent fe9bb94d6c
commit aa604a531c
2 changed files with 3 additions and 19 deletions

View File

@ -16,8 +16,8 @@
#include "directxtexp.h" #include "directxtexp.h"
#ifdef USE_XNAMATH #ifdef USE_XNAMATH
#if XNAMATH_VERSION < 204 #if XNAMATH_VERSION < 205
#error This file requires XNAMATH v2.04 or later #error This file requires XNAMATH v2.05 or later
#endif #endif
#else #else
using namespace DirectX::PackedVector; using namespace DirectX::PackedVector;
@ -1400,7 +1400,7 @@ bool _StoreScanline( LPVOID pDestination, size_t size, DXGI_FORMAT format,
for( size_t icount = 0; icount < size; icount += sizeof(XMUBYTEN4) ) for( size_t icount = 0; icount < size; icount += sizeof(XMUBYTEN4) )
{ {
if ( sPtr >= ePtr ) break; if ( sPtr >= ePtr ) break;
XMVECTOR v = XMVectorPermute<XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_1W>( *sPtr++, g_XMIdentityR3 ); XMVECTOR v = XMVectorPermute<2, 1, 0, 7>( *sPtr++, g_XMIdentityR3 );
XMStoreUByteN4( dPtr++, v ); XMStoreUByteN4( dPtr++, v );
} }
} }

View File

@ -58,22 +58,6 @@ struct IWICImagingFactory;
namespace DirectX namespace DirectX
{ {
#ifdef USE_XNAMATH
template<uint32_t SwizzleX, uint32_t SwizzleY, uint32_t SwizzleZ, uint32_t SwizzleW>
inline XMVECTOR XMVectorSwizzle(FXMVECTOR V)
{
return XMVectorSwizzle( V, SwizzleX, SwizzleY, SwizzleZ, SwizzleW );
}
template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t PermuteW>
inline XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2)
{
static XMVECTORI32 control = { PermuteX, PermuteY, PermuteZ, PermuteW };
return XMVectorPermute( V1, V2, control );
}
#endif // USE_XNAMATH
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// WIC helper functions // WIC helper functions
DXGI_FORMAT _WICToDXGI( _In_ const GUID& guid ); DXGI_FORMAT _WICToDXGI( _In_ const GUID& guid );