Archived

This topic is now archived and is closed to further replies.

koch

D3DX warning

Recommended Posts

Hi guys, There shows a warning when I execute Direct3D program in a debug mode. The warning is "D3DX: Matrices should be 16-byte aligned for optimized D3DXMatrixMultiply" Is special compiler option needed? Could anyone tell me how to solve this problem? Environment: DirectX8.1, ATI Radion VE, Win2K, VC++6.0, PC: dual XEON TIA koch

Share this post


Link to post
Share on other sites
Take a look at the comment in d3dx8math.h:

quote:


//===========================================================================
//
// Aligned Matrices
//
// This class helps keep matrices 16-byte aligned as preferred by P4 cpus.
// It aligns matrices on the stack and on the heap or in global scope.
// It does this using __declspec(align(16)) which works on VC7 and on VC 6
// with the processor pack. Unfortunately there is no way to detect the
// latter so this is turned on only on VC7. On other compilers this is the
// the same as D3DXMATRIX.
// Using this class on a compiler that does not actually do the alignment
// can be dangerous since it will not expose bugs that ignore alignment.
// E.g if an object of this class in inside a struct or class, and some code
// memcopys data in it assuming tight packing. This could break on a compiler
// that eventually start aligning the matrix.
//
//===========================================================================



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites