DirectXPackedVector.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. //-------------------------------------------------------------------------------------
  2. // DirectXPackedVector.h -- SIMD C++ Math library
  3. //
  4. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  5. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  6. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  7. // PARTICULAR PURPOSE.
  8. //
  9. // Copyright (c) Microsoft Corporation. All rights reserved.
  10. //
  11. // http://go.microsoft.com/fwlink/?LinkID=615560
  12. //-------------------------------------------------------------------------------------
  13. #pragma once
  14. #include "DirectXMath.h"
  15. namespace DirectX
  16. {
  17. namespace PackedVector
  18. {
  19. #pragma warning(push)
  20. #pragma warning(disable:4201 4365 4324 4996)
  21. // C4201: nonstandard extension used
  22. // C4365: Off by default noise
  23. // C4324: alignment padding warnings
  24. // C4996: deprecation warnings
  25. //------------------------------------------------------------------------------
  26. // ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into
  27. // a 32 bit integer. The normalized color is packed into 32 bits using 8 bit
  28. // unsigned, normalized integers for the alpha, red, green, and blue components.
  29. // The alpha component is stored in the most significant bits and the blue
  30. // component in the least significant bits (A8R8G8B8):
  31. // [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0]
  32. struct XMCOLOR
  33. {
  34. union
  35. {
  36. struct
  37. {
  38. uint8_t b; // Blue: 0/255 to 255/255
  39. uint8_t g; // Green: 0/255 to 255/255
  40. uint8_t r; // Red: 0/255 to 255/255
  41. uint8_t a; // Alpha: 0/255 to 255/255
  42. };
  43. uint32_t c;
  44. };
  45. XMCOLOR() XM_CTOR_DEFAULT
  46. XM_CONSTEXPR XMCOLOR(uint32_t Color) : c(Color) {}
  47. XMCOLOR(float _r, float _g, float _b, float _a);
  48. explicit XMCOLOR(_In_reads_(4) const float *pArray);
  49. operator uint32_t () const { return c; }
  50. XMCOLOR& operator= (const XMCOLOR& Color) { c = Color.c; return *this; }
  51. XMCOLOR& operator= (const uint32_t Color) { c = Color; return *this; }
  52. };
  53. //------------------------------------------------------------------------------
  54. // 16 bit floating point number consisting of a sign bit, a 5 bit biased
  55. // exponent, and a 10 bit mantissa
  56. typedef uint16_t HALF;
  57. //------------------------------------------------------------------------------
  58. // 2D Vector; 16 bit floating point components
  59. struct XMHALF2
  60. {
  61. union
  62. {
  63. struct
  64. {
  65. HALF x;
  66. HALF y;
  67. };
  68. uint32_t v;
  69. };
  70. XMHALF2() XM_CTOR_DEFAULT
  71. explicit XM_CONSTEXPR XMHALF2(uint32_t Packed) : v(Packed) {}
  72. XM_CONSTEXPR XMHALF2(HALF _x, HALF _y) : x(_x), y(_y) {}
  73. explicit XMHALF2(_In_reads_(2) const HALF *pArray) : x(pArray[0]), y(pArray[1]) {}
  74. XMHALF2(float _x, float _y);
  75. explicit XMHALF2(_In_reads_(2) const float *pArray);
  76. XMHALF2& operator= (const XMHALF2& Half2) { x = Half2.x; y = Half2.y; return *this; }
  77. XMHALF2& operator= (uint32_t Packed) { v = Packed; return *this; }
  78. };
  79. //------------------------------------------------------------------------------
  80. // 2D Vector; 16 bit signed normalized integer components
  81. struct XMSHORTN2
  82. {
  83. union
  84. {
  85. struct
  86. {
  87. int16_t x;
  88. int16_t y;
  89. };
  90. uint32_t v;
  91. };
  92. XMSHORTN2() XM_CTOR_DEFAULT
  93. explicit XM_CONSTEXPR XMSHORTN2(uint32_t Packed) : v(Packed) {}
  94. XM_CONSTEXPR XMSHORTN2(int16_t _x, int16_t _y) : x(_x), y(_y) {}
  95. explicit XMSHORTN2(_In_reads_(2) const int16_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  96. XMSHORTN2(float _x, float _y);
  97. explicit XMSHORTN2(_In_reads_(2) const float *pArray);
  98. XMSHORTN2& operator= (const XMSHORTN2& ShortN2) { x = ShortN2.x; y = ShortN2.y; return *this; }
  99. XMSHORTN2& operator= (uint32_t Packed) { v = Packed; return *this; }
  100. };
  101. // 2D Vector; 16 bit signed integer components
  102. struct XMSHORT2
  103. {
  104. union
  105. {
  106. struct
  107. {
  108. int16_t x;
  109. int16_t y;
  110. };
  111. uint32_t v;
  112. };
  113. XMSHORT2() XM_CTOR_DEFAULT
  114. explicit XM_CONSTEXPR XMSHORT2(uint32_t Packed) : v(Packed) {}
  115. XM_CONSTEXPR XMSHORT2(int16_t _x, int16_t _y) : x(_x), y(_y) {}
  116. explicit XMSHORT2(_In_reads_(2) const int16_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  117. XMSHORT2(float _x, float _y);
  118. explicit XMSHORT2(_In_reads_(2) const float *pArray);
  119. XMSHORT2& operator= (const XMSHORT2& Short2) { x = Short2.x; y = Short2.y; return *this; }
  120. XMSHORT2& operator= (uint32_t Packed) { v = Packed; return *this; }
  121. };
  122. // 2D Vector; 16 bit unsigned normalized integer components
  123. struct XMUSHORTN2
  124. {
  125. union
  126. {
  127. struct
  128. {
  129. uint16_t x;
  130. uint16_t y;
  131. };
  132. uint32_t v;
  133. };
  134. XMUSHORTN2() XM_CTOR_DEFAULT
  135. explicit XM_CONSTEXPR XMUSHORTN2(uint32_t Packed) : v(Packed) {}
  136. XM_CONSTEXPR XMUSHORTN2(uint16_t _x, uint16_t _y) : x(_x), y(_y) {}
  137. explicit XMUSHORTN2(_In_reads_(2) const uint16_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  138. XMUSHORTN2(float _x, float _y);
  139. explicit XMUSHORTN2(_In_reads_(2) const float *pArray);
  140. XMUSHORTN2& operator= (const XMUSHORTN2& UShortN2) { x = UShortN2.x; y = UShortN2.y; return *this; }
  141. XMUSHORTN2& operator= (uint32_t Packed) { v = Packed; return *this; }
  142. };
  143. // 2D Vector; 16 bit unsigned integer components
  144. struct XMUSHORT2
  145. {
  146. union
  147. {
  148. struct
  149. {
  150. uint16_t x;
  151. uint16_t y;
  152. };
  153. uint32_t v;
  154. };
  155. XMUSHORT2() XM_CTOR_DEFAULT
  156. explicit XM_CONSTEXPR XMUSHORT2(uint32_t Packed) : v(Packed) {}
  157. XM_CONSTEXPR XMUSHORT2(uint16_t _x, uint16_t _y) : x(_x), y(_y) {}
  158. explicit XMUSHORT2(_In_reads_(2) const uint16_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  159. XMUSHORT2(float _x, float _y);
  160. explicit XMUSHORT2(_In_reads_(2) const float *pArray);
  161. XMUSHORT2& operator= (const XMUSHORT2& UShort2) { x = UShort2.x; y = UShort2.y; return *this; }
  162. XMUSHORT2& operator= (uint32_t Packed) { v = Packed; return *this; }
  163. };
  164. //------------------------------------------------------------------------------
  165. // 2D Vector; 8 bit signed normalized integer components
  166. struct XMBYTEN2
  167. {
  168. union
  169. {
  170. struct
  171. {
  172. int8_t x;
  173. int8_t y;
  174. };
  175. uint16_t v;
  176. };
  177. XMBYTEN2() XM_CTOR_DEFAULT
  178. explicit XM_CONSTEXPR XMBYTEN2(uint16_t Packed) : v(Packed) {}
  179. XM_CONSTEXPR XMBYTEN2(int8_t _x, int8_t _y) : x(_x), y(_y) {}
  180. explicit XMBYTEN2(_In_reads_(2) const int8_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  181. XMBYTEN2(float _x, float _y);
  182. explicit XMBYTEN2(_In_reads_(2) const float *pArray);
  183. XMBYTEN2& operator= (const XMBYTEN2& ByteN2) { x = ByteN2.x; y = ByteN2.y; return *this; }
  184. XMBYTEN2& operator= (uint16_t Packed) { v = Packed; return *this; }
  185. };
  186. // 2D Vector; 8 bit signed integer components
  187. struct XMBYTE2
  188. {
  189. union
  190. {
  191. struct
  192. {
  193. int8_t x;
  194. int8_t y;
  195. };
  196. uint16_t v;
  197. };
  198. XMBYTE2() XM_CTOR_DEFAULT
  199. explicit XM_CONSTEXPR XMBYTE2(uint16_t Packed) : v(Packed) {}
  200. XM_CONSTEXPR XMBYTE2(int8_t _x, int8_t _y) : x(_x), y(_y) {}
  201. explicit XMBYTE2(_In_reads_(2) const int8_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  202. XMBYTE2(float _x, float _y);
  203. explicit XMBYTE2(_In_reads_(2) const float *pArray);
  204. XMBYTE2& operator= (const XMBYTE2& Byte2) { x = Byte2.x; y = Byte2.y; return *this; }
  205. XMBYTE2& operator= (uint16_t Packed) { v = Packed; return *this; }
  206. };
  207. // 2D Vector; 8 bit unsigned normalized integer components
  208. struct XMUBYTEN2
  209. {
  210. union
  211. {
  212. struct
  213. {
  214. uint8_t x;
  215. uint8_t y;
  216. };
  217. uint16_t v;
  218. };
  219. XMUBYTEN2() XM_CTOR_DEFAULT
  220. explicit XM_CONSTEXPR XMUBYTEN2(uint16_t Packed) : v(Packed) {}
  221. XM_CONSTEXPR XMUBYTEN2(uint8_t _x, uint8_t _y) : x(_x), y(_y) {}
  222. explicit XMUBYTEN2(_In_reads_(2) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  223. XMUBYTEN2(float _x, float _y);
  224. explicit XMUBYTEN2(_In_reads_(2) const float *pArray);
  225. XMUBYTEN2& operator= (const XMUBYTEN2& UByteN2) { x = UByteN2.x; y = UByteN2.y; return *this; }
  226. XMUBYTEN2& operator= (uint16_t Packed) { v = Packed; return *this; }
  227. };
  228. // 2D Vector; 8 bit unsigned integer components
  229. struct XMUBYTE2
  230. {
  231. union
  232. {
  233. struct
  234. {
  235. uint8_t x;
  236. uint8_t y;
  237. };
  238. uint16_t v;
  239. };
  240. XMUBYTE2() XM_CTOR_DEFAULT
  241. explicit XM_CONSTEXPR XMUBYTE2(uint16_t Packed) : v(Packed) {}
  242. XM_CONSTEXPR XMUBYTE2(uint8_t _x, uint8_t _y) : x(_x), y(_y) {}
  243. explicit XMUBYTE2(_In_reads_(2) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]) {}
  244. XMUBYTE2(float _x, float _y);
  245. explicit XMUBYTE2(_In_reads_(2) const float *pArray);
  246. XMUBYTE2& operator= (const XMUBYTE2& UByte2) { x = UByte2.x; y = UByte2.y; return *this; }
  247. XMUBYTE2& operator= (uint16_t Packed) { v = Packed; return *this; }
  248. };
  249. //------------------------------------------------------------------------------
  250. // 3D vector: 5/6/5 unsigned integer components
  251. struct XMU565
  252. {
  253. union
  254. {
  255. struct
  256. {
  257. uint16_t x : 5; // 0 to 31
  258. uint16_t y : 6; // 0 to 63
  259. uint16_t z : 5; // 0 to 31
  260. };
  261. uint16_t v;
  262. };
  263. XMU565() XM_CTOR_DEFAULT
  264. explicit XM_CONSTEXPR XMU565(uint16_t Packed) : v(Packed) {}
  265. XM_CONSTEXPR XMU565(uint8_t _x, uint8_t _y, uint8_t _z) : x(_x), y(_y), z(_z) {}
  266. explicit XMU565(_In_reads_(3) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]) {}
  267. XMU565(float _x, float _y, float _z);
  268. explicit XMU565(_In_reads_(3) const float *pArray);
  269. operator uint16_t () const { return v; }
  270. XMU565& operator= (const XMU565& U565) { v = U565.v; return *this; }
  271. XMU565& operator= (uint16_t Packed) { v = Packed; return *this; }
  272. };
  273. //------------------------------------------------------------------------------
  274. // 3D vector: 11/11/10 floating-point components
  275. // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
  276. // and 6-bit mantissa for x component, a 5-bit biased exponent and
  277. // 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit
  278. // mantissa for z. The z component is stored in the most significant bits
  279. // and the x component in the least significant bits. No sign bits so
  280. // all partial-precision numbers are positive.
  281. // (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0]
  282. struct XMFLOAT3PK
  283. {
  284. union
  285. {
  286. struct
  287. {
  288. uint32_t xm : 6; // x-mantissa
  289. uint32_t xe : 5; // x-exponent
  290. uint32_t ym : 6; // y-mantissa
  291. uint32_t ye : 5; // y-exponent
  292. uint32_t zm : 5; // z-mantissa
  293. uint32_t ze : 5; // z-exponent
  294. };
  295. uint32_t v;
  296. };
  297. XMFLOAT3PK() XM_CTOR_DEFAULT
  298. explicit XM_CONSTEXPR XMFLOAT3PK(uint32_t Packed) : v(Packed) {}
  299. XMFLOAT3PK(float _x, float _y, float _z);
  300. explicit XMFLOAT3PK(_In_reads_(3) const float *pArray);
  301. operator uint32_t () const { return v; }
  302. XMFLOAT3PK& operator= (const XMFLOAT3PK& float3pk) { v = float3pk.v; return *this; }
  303. XMFLOAT3PK& operator= (uint32_t Packed) { v = Packed; return *this; }
  304. };
  305. //------------------------------------------------------------------------------
  306. // 3D vector: 9/9/9 floating-point components with shared 5-bit exponent
  307. // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
  308. // with 9-bit mantissa for the x, y, and z component. The shared exponent
  309. // is stored in the most significant bits and the x component mantissa is in
  310. // the least significant bits. No sign bits so all partial-precision numbers
  311. // are positive.
  312. // (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0]
  313. struct XMFLOAT3SE
  314. {
  315. union
  316. {
  317. struct
  318. {
  319. uint32_t xm : 9; // x-mantissa
  320. uint32_t ym : 9; // y-mantissa
  321. uint32_t zm : 9; // z-mantissa
  322. uint32_t e : 5; // shared exponent
  323. };
  324. uint32_t v;
  325. };
  326. XMFLOAT3SE() XM_CTOR_DEFAULT
  327. explicit XM_CONSTEXPR XMFLOAT3SE(uint32_t Packed) : v(Packed) {}
  328. XMFLOAT3SE(float _x, float _y, float _z);
  329. explicit XMFLOAT3SE(_In_reads_(3) const float *pArray);
  330. operator uint32_t () const { return v; }
  331. XMFLOAT3SE& operator= (const XMFLOAT3SE& float3se) { v = float3se.v; return *this; }
  332. XMFLOAT3SE& operator= (uint32_t Packed) { v = Packed; return *this; }
  333. };
  334. //------------------------------------------------------------------------------
  335. // 4D Vector; 16 bit floating point components
  336. struct XMHALF4
  337. {
  338. union
  339. {
  340. struct
  341. {
  342. HALF x;
  343. HALF y;
  344. HALF z;
  345. HALF w;
  346. };
  347. uint64_t v;
  348. };
  349. XMHALF4() XM_CTOR_DEFAULT
  350. explicit XM_CONSTEXPR XMHALF4(uint64_t Packed) : v(Packed) {}
  351. XM_CONSTEXPR XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) : x(_x), y(_y), z(_z), w(_w) {}
  352. explicit XMHALF4(_In_reads_(4) const HALF *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  353. XMHALF4(float _x, float _y, float _z, float _w);
  354. explicit XMHALF4(_In_reads_(4) const float *pArray);
  355. XMHALF4& operator= (const XMHALF4& Half4) { x = Half4.x; y = Half4.y; z = Half4.z; w = Half4.w; return *this; }
  356. XMHALF4& operator= (uint64_t Packed) { v = Packed; return *this; }
  357. };
  358. //------------------------------------------------------------------------------
  359. // 4D Vector; 16 bit signed normalized integer components
  360. struct XMSHORTN4
  361. {
  362. union
  363. {
  364. struct
  365. {
  366. int16_t x;
  367. int16_t y;
  368. int16_t z;
  369. int16_t w;
  370. };
  371. uint64_t v;
  372. };
  373. XMSHORTN4() XM_CTOR_DEFAULT
  374. explicit XM_CONSTEXPR XMSHORTN4(uint64_t Packed) : v(Packed) {}
  375. XM_CONSTEXPR XMSHORTN4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  376. explicit XMSHORTN4(_In_reads_(4) const int16_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  377. XMSHORTN4(float _x, float _y, float _z, float _w);
  378. explicit XMSHORTN4(_In_reads_(4) const float *pArray);
  379. XMSHORTN4& operator= (const XMSHORTN4& ShortN4) { x = ShortN4.x; y = ShortN4.y; z = ShortN4.z; w = ShortN4.w; return *this; }
  380. XMSHORTN4& operator= (uint64_t Packed) { v = Packed; return *this; }
  381. };
  382. // 4D Vector; 16 bit signed integer components
  383. struct XMSHORT4
  384. {
  385. union
  386. {
  387. struct
  388. {
  389. int16_t x;
  390. int16_t y;
  391. int16_t z;
  392. int16_t w;
  393. };
  394. uint64_t v;
  395. };
  396. XMSHORT4() XM_CTOR_DEFAULT
  397. explicit XM_CONSTEXPR XMSHORT4(uint64_t Packed) : v(Packed) {}
  398. XM_CONSTEXPR XMSHORT4(int16_t _x, int16_t _y, int16_t _z, int16_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  399. explicit XMSHORT4(_In_reads_(4) const int16_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  400. XMSHORT4(float _x, float _y, float _z, float _w);
  401. explicit XMSHORT4(_In_reads_(4) const float *pArray);
  402. XMSHORT4& operator= (const XMSHORT4& Short4) { x = Short4.x; y = Short4.y; z = Short4.z; w = Short4.w; return *this; }
  403. XMSHORT4& operator= (uint64_t Packed) { v = Packed; return *this; }
  404. };
  405. // 4D Vector; 16 bit unsigned normalized integer components
  406. struct XMUSHORTN4
  407. {
  408. union
  409. {
  410. struct
  411. {
  412. uint16_t x;
  413. uint16_t y;
  414. uint16_t z;
  415. uint16_t w;
  416. };
  417. uint64_t v;
  418. };
  419. XMUSHORTN4() XM_CTOR_DEFAULT
  420. explicit XM_CONSTEXPR XMUSHORTN4(uint64_t Packed) : v(Packed) {}
  421. XM_CONSTEXPR XMUSHORTN4(uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  422. explicit XMUSHORTN4(_In_reads_(4) const uint16_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  423. XMUSHORTN4(float _x, float _y, float _z, float _w);
  424. explicit XMUSHORTN4(_In_reads_(4) const float *pArray);
  425. XMUSHORTN4& operator= (const XMUSHORTN4& UShortN4) { x = UShortN4.x; y = UShortN4.y; z = UShortN4.z; w = UShortN4.w; return *this; }
  426. XMUSHORTN4& operator= (uint64_t Packed) { v = Packed; return *this; }
  427. };
  428. // 4D Vector; 16 bit unsigned integer components
  429. struct XMUSHORT4
  430. {
  431. union
  432. {
  433. struct
  434. {
  435. uint16_t x;
  436. uint16_t y;
  437. uint16_t z;
  438. uint16_t w;
  439. };
  440. uint64_t v;
  441. };
  442. XMUSHORT4() XM_CTOR_DEFAULT
  443. explicit XM_CONSTEXPR XMUSHORT4(uint64_t Packed) : v(Packed) {}
  444. XM_CONSTEXPR XMUSHORT4(uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  445. explicit XMUSHORT4(_In_reads_(4) const uint16_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  446. XMUSHORT4(float _x, float _y, float _z, float _w);
  447. explicit XMUSHORT4(_In_reads_(4) const float *pArray);
  448. XMUSHORT4& operator= (const XMUSHORT4& UShort4) { x = UShort4.x; y = UShort4.y; z = UShort4.z; w = UShort4.w; return *this; }
  449. XMUSHORT4& operator= (uint32_t Packed) { v = Packed; return *this; }
  450. };
  451. //------------------------------------------------------------------------------
  452. // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
  453. // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
  454. // normalized integer for the w component and 10 bit signed, normalized
  455. // integers for the z, y, and x components. The w component is stored in the
  456. // most significant bits and the x component in the least significant bits
  457. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  458. struct XMXDECN4
  459. {
  460. union
  461. {
  462. struct
  463. {
  464. int32_t x : 10; // -511/511 to 511/511
  465. int32_t y : 10; // -511/511 to 511/511
  466. int32_t z : 10; // -511/511 to 511/511
  467. uint32_t w : 2; // 0/3 to 3/3
  468. };
  469. uint32_t v;
  470. };
  471. XMXDECN4() XM_CTOR_DEFAULT
  472. explicit XM_CONSTEXPR XMXDECN4(uint32_t Packed) : v(Packed) {}
  473. XMXDECN4(float _x, float _y, float _z, float _w);
  474. explicit XMXDECN4(_In_reads_(4) const float *pArray);
  475. operator uint32_t () const { return v; }
  476. XMXDECN4& operator= (const XMXDECN4& XDecN4) { v = XDecN4.v; return *this; }
  477. XMXDECN4& operator= (uint32_t Packed) { v = Packed; return *this; }
  478. };
  479. // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
  480. // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned
  481. // integer for the w component and 10 bit signed integers for the
  482. // z, y, and x components. The w component is stored in the
  483. // most significant bits and the x component in the least significant bits
  484. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  485. struct XM_DEPRECATED XMXDEC4
  486. {
  487. union
  488. {
  489. struct
  490. {
  491. int32_t x : 10; // -511 to 511
  492. int32_t y : 10; // -511 to 511
  493. int32_t z : 10; // -511 to 511
  494. uint32_t w : 2; // 0 to 3
  495. };
  496. uint32_t v;
  497. };
  498. XMXDEC4() XM_CTOR_DEFAULT
  499. explicit XM_CONSTEXPR XMXDEC4(uint32_t Packed) : v(Packed) {}
  500. XMXDEC4(float _x, float _y, float _z, float _w);
  501. explicit XMXDEC4(_In_reads_(4) const float *pArray);
  502. operator uint32_t () const { return v; }
  503. XMXDEC4& operator= (const XMXDEC4& XDec4) { v = XDec4.v; return *this; }
  504. XMXDEC4& operator= (uint32_t Packed) { v = Packed; return *this; }
  505. };
  506. // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
  507. // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed,
  508. // normalized integer for the w component and 10 bit signed, normalized
  509. // integers for the z, y, and x components. The w component is stored in the
  510. // most significant bits and the x component in the least significant bits
  511. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  512. struct XM_DEPRECATED XMDECN4
  513. {
  514. union
  515. {
  516. struct
  517. {
  518. int32_t x : 10; // -511/511 to 511/511
  519. int32_t y : 10; // -511/511 to 511/511
  520. int32_t z : 10; // -511/511 to 511/511
  521. int32_t w : 2; // -1/1 to 1/1
  522. };
  523. uint32_t v;
  524. };
  525. XMDECN4() XM_CTOR_DEFAULT
  526. explicit XM_CONSTEXPR XMDECN4(uint32_t Packed) : v(Packed) {}
  527. XMDECN4(float _x, float _y, float _z, float _w);
  528. explicit XMDECN4(_In_reads_(4) const float *pArray);
  529. operator uint32_t () const { return v; }
  530. XMDECN4& operator= (const XMDECN4& DecN4) { v = DecN4.v; return *this; }
  531. XMDECN4& operator= (uint32_t Packed) { v = Packed; return *this; }
  532. };
  533. // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
  534. // The 4D Vector is packed into 32 bits as follows: a 2 bit signed,
  535. // integer for the w component and 10 bit signed integers for the
  536. // z, y, and x components. The w component is stored in the
  537. // most significant bits and the x component in the least significant bits
  538. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  539. struct XM_DEPRECATED XMDEC4
  540. {
  541. union
  542. {
  543. struct
  544. {
  545. int32_t x : 10; // -511 to 511
  546. int32_t y : 10; // -511 to 511
  547. int32_t z : 10; // -511 to 511
  548. int32_t w : 2; // -1 to 1
  549. };
  550. uint32_t v;
  551. };
  552. XMDEC4() XM_CTOR_DEFAULT
  553. explicit XM_CONSTEXPR XMDEC4(uint32_t Packed) : v(Packed) {}
  554. XMDEC4(float _x, float _y, float _z, float _w);
  555. explicit XMDEC4(_In_reads_(4) const float *pArray);
  556. operator uint32_t () const { return v; }
  557. XMDEC4& operator= (const XMDEC4& Dec4) { v = Dec4.v; return *this; }
  558. XMDEC4& operator= (uint32_t Packed) { v = Packed; return *this; }
  559. };
  560. // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
  561. // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
  562. // normalized integer for the w component and 10 bit unsigned, normalized
  563. // integers for the z, y, and x components. The w component is stored in the
  564. // most significant bits and the x component in the least significant bits
  565. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  566. struct XMUDECN4
  567. {
  568. union
  569. {
  570. struct
  571. {
  572. uint32_t x : 10; // 0/1023 to 1023/1023
  573. uint32_t y : 10; // 0/1023 to 1023/1023
  574. uint32_t z : 10; // 0/1023 to 1023/1023
  575. uint32_t w : 2; // 0/3 to 3/3
  576. };
  577. uint32_t v;
  578. };
  579. XMUDECN4() XM_CTOR_DEFAULT
  580. explicit XM_CONSTEXPR XMUDECN4(uint32_t Packed) : v(Packed) {}
  581. XMUDECN4(float _x, float _y, float _z, float _w);
  582. explicit XMUDECN4(_In_reads_(4) const float *pArray);
  583. operator uint32_t () const { return v; }
  584. XMUDECN4& operator= (const XMUDECN4& UDecN4) { v = UDecN4.v; return *this; }
  585. XMUDECN4& operator= (uint32_t Packed) { v = Packed; return *this; }
  586. };
  587. // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
  588. // The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
  589. // integer for the w component and 10 bit unsigned integers
  590. // for the z, y, and x components. The w component is stored in the
  591. // most significant bits and the x component in the least significant bits
  592. // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
  593. struct XMUDEC4
  594. {
  595. union
  596. {
  597. struct
  598. {
  599. uint32_t x : 10; // 0 to 1023
  600. uint32_t y : 10; // 0 to 1023
  601. uint32_t z : 10; // 0 to 1023
  602. uint32_t w : 2; // 0 to 3
  603. };
  604. uint32_t v;
  605. };
  606. XMUDEC4() XM_CTOR_DEFAULT
  607. explicit XM_CONSTEXPR XMUDEC4(uint32_t Packed) : v(Packed) {}
  608. XMUDEC4(float _x, float _y, float _z, float _w);
  609. explicit XMUDEC4(_In_reads_(4) const float *pArray);
  610. operator uint32_t () const { return v; }
  611. XMUDEC4& operator= (const XMUDEC4& UDec4) { v = UDec4.v; return *this; }
  612. XMUDEC4& operator= (uint32_t Packed) { v = Packed; return *this; }
  613. };
  614. //------------------------------------------------------------------------------
  615. // 4D Vector; 8 bit signed normalized integer components
  616. struct XMBYTEN4
  617. {
  618. union
  619. {
  620. struct
  621. {
  622. int8_t x;
  623. int8_t y;
  624. int8_t z;
  625. int8_t w;
  626. };
  627. uint32_t v;
  628. };
  629. XMBYTEN4() XM_CTOR_DEFAULT
  630. XM_CONSTEXPR XMBYTEN4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  631. explicit XM_CONSTEXPR XMBYTEN4(uint32_t Packed) : v(Packed) {}
  632. explicit XMBYTEN4(_In_reads_(4) const int8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  633. XMBYTEN4(float _x, float _y, float _z, float _w);
  634. explicit XMBYTEN4(_In_reads_(4) const float *pArray);
  635. XMBYTEN4& operator= (const XMBYTEN4& ByteN4) { x = ByteN4.x; y = ByteN4.y; z = ByteN4.z; w = ByteN4.w; return *this; }
  636. XMBYTEN4& operator= (uint32_t Packed) { v = Packed; return *this; }
  637. };
  638. // 4D Vector; 8 bit signed integer components
  639. struct XMBYTE4
  640. {
  641. union
  642. {
  643. struct
  644. {
  645. int8_t x;
  646. int8_t y;
  647. int8_t z;
  648. int8_t w;
  649. };
  650. uint32_t v;
  651. };
  652. XMBYTE4() XM_CTOR_DEFAULT
  653. XM_CONSTEXPR XMBYTE4(int8_t _x, int8_t _y, int8_t _z, int8_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  654. explicit XM_CONSTEXPR XMBYTE4(uint32_t Packed) : v(Packed) {}
  655. explicit XMBYTE4(_In_reads_(4) const int8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  656. XMBYTE4(float _x, float _y, float _z, float _w);
  657. explicit XMBYTE4(_In_reads_(4) const float *pArray);
  658. XMBYTE4& operator= (const XMBYTE4& Byte4) { x = Byte4.x; y = Byte4.y; z = Byte4.z; w = Byte4.w; return *this; }
  659. XMBYTE4& operator= (uint32_t Packed) { v = Packed; return *this; }
  660. };
  661. // 4D Vector; 8 bit unsigned normalized integer components
  662. struct XMUBYTEN4
  663. {
  664. union
  665. {
  666. struct
  667. {
  668. uint8_t x;
  669. uint8_t y;
  670. uint8_t z;
  671. uint8_t w;
  672. };
  673. uint32_t v;
  674. };
  675. XMUBYTEN4() XM_CTOR_DEFAULT
  676. XM_CONSTEXPR XMUBYTEN4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  677. explicit XM_CONSTEXPR XMUBYTEN4(uint32_t Packed) : v(Packed) {}
  678. explicit XMUBYTEN4(_In_reads_(4) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  679. XMUBYTEN4(float _x, float _y, float _z, float _w);
  680. explicit XMUBYTEN4(_In_reads_(4) const float *pArray);
  681. XMUBYTEN4& operator= (const XMUBYTEN4& UByteN4) { x = UByteN4.x; y = UByteN4.y; z = UByteN4.z; w = UByteN4.w; return *this; }
  682. XMUBYTEN4& operator= (uint32_t Packed) { v = Packed; return *this; }
  683. };
  684. // 4D Vector; 8 bit unsigned integer components
  685. struct XMUBYTE4
  686. {
  687. union
  688. {
  689. struct
  690. {
  691. uint8_t x;
  692. uint8_t y;
  693. uint8_t z;
  694. uint8_t w;
  695. };
  696. uint32_t v;
  697. };
  698. XMUBYTE4() XM_CTOR_DEFAULT
  699. XM_CONSTEXPR XMUBYTE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  700. explicit XM_CONSTEXPR XMUBYTE4(uint32_t Packed) : v(Packed) {}
  701. explicit XMUBYTE4(_In_reads_(4) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  702. XMUBYTE4(float _x, float _y, float _z, float _w);
  703. explicit XMUBYTE4(_In_reads_(4) const float *pArray);
  704. XMUBYTE4& operator= (const XMUBYTE4& UByte4) { x = UByte4.x; y = UByte4.y; z = UByte4.z; w = UByte4.w; return *this; }
  705. XMUBYTE4& operator= (uint32_t Packed) { v = Packed; return *this; }
  706. };
  707. //------------------------------------------------------------------------------
  708. // 4D vector; 4 bit unsigned integer components
  709. struct XMUNIBBLE4
  710. {
  711. union
  712. {
  713. struct
  714. {
  715. uint16_t x : 4; // 0 to 15
  716. uint16_t y : 4; // 0 to 15
  717. uint16_t z : 4; // 0 to 15
  718. uint16_t w : 4; // 0 to 15
  719. };
  720. uint16_t v;
  721. };
  722. XMUNIBBLE4() XM_CTOR_DEFAULT
  723. explicit XM_CONSTEXPR XMUNIBBLE4(uint16_t Packed) : v(Packed) {}
  724. XM_CONSTEXPR XMUNIBBLE4(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w) : x(_x), y(_y), z(_z), w(_w) {}
  725. explicit XMUNIBBLE4(_In_reads_(4) const uint8_t *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(pArray[3]) {}
  726. XMUNIBBLE4(float _x, float _y, float _z, float _w);
  727. explicit XMUNIBBLE4(_In_reads_(4) const float *pArray);
  728. operator uint16_t () const { return v; }
  729. XMUNIBBLE4& operator= (const XMUNIBBLE4& UNibble4) { v = UNibble4.v; return *this; }
  730. XMUNIBBLE4& operator= (uint16_t Packed) { v = Packed; return *this; }
  731. };
  732. //------------------------------------------------------------------------------
  733. // 4D vector: 5/5/5/1 unsigned integer components
  734. struct XMU555
  735. {
  736. union
  737. {
  738. struct
  739. {
  740. uint16_t x : 5; // 0 to 31
  741. uint16_t y : 5; // 0 to 31
  742. uint16_t z : 5; // 0 to 31
  743. uint16_t w : 1; // 0 or 1
  744. };
  745. uint16_t v;
  746. };
  747. XMU555() XM_CTOR_DEFAULT
  748. explicit XM_CONSTEXPR XMU555(uint16_t Packed) : v(Packed) {}
  749. XM_CONSTEXPR XMU555(uint8_t _x, uint8_t _y, uint8_t _z, bool _w) : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {}
  750. XMU555(_In_reads_(3) const uint8_t *pArray, _In_ bool _w) : x(pArray[0]), y(pArray[1]), z(pArray[2]), w(_w ? 0x1 : 0) {}
  751. XMU555(float _x, float _y, float _z, bool _w);
  752. XMU555(_In_reads_(3) const float *pArray, _In_ bool _w);
  753. operator uint16_t () const { return v; }
  754. XMU555& operator= (const XMU555& U555) { v = U555.v; return *this; }
  755. XMU555& operator= (uint16_t Packed) { v = Packed; return *this; }
  756. };
  757. #pragma warning(pop)
  758. /****************************************************************************
  759. *
  760. * Data conversion operations
  761. *
  762. ****************************************************************************/
  763. float XMConvertHalfToFloat(HALF Value);
  764. float* XMConvertHalfToFloatStream(_Out_writes_bytes_(sizeof(float)+OutputStride*(HalfCount-1)) float* pOutputStream,
  765. _In_ size_t OutputStride,
  766. _In_reads_bytes_(sizeof(HALF)+InputStride*(HalfCount-1)) const HALF* pInputStream,
  767. _In_ size_t InputStride, _In_ size_t HalfCount);
  768. HALF XMConvertFloatToHalf(float Value);
  769. HALF* XMConvertFloatToHalfStream(_Out_writes_bytes_(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream,
  770. _In_ size_t OutputStride,
  771. _In_reads_bytes_(sizeof(float)+InputStride*(FloatCount-1)) const float* pInputStream,
  772. _In_ size_t InputStride, _In_ size_t FloatCount);
  773. /****************************************************************************
  774. *
  775. * Load operations
  776. *
  777. ****************************************************************************/
  778. XMVECTOR XM_CALLCONV XMLoadColor(_In_ const XMCOLOR* pSource);
  779. XMVECTOR XM_CALLCONV XMLoadHalf2(_In_ const XMHALF2* pSource);
  780. XMVECTOR XM_CALLCONV XMLoadShortN2(_In_ const XMSHORTN2* pSource);
  781. XMVECTOR XM_CALLCONV XMLoadShort2(_In_ const XMSHORT2* pSource);
  782. XMVECTOR XM_CALLCONV XMLoadUShortN2(_In_ const XMUSHORTN2* pSource);
  783. XMVECTOR XM_CALLCONV XMLoadUShort2(_In_ const XMUSHORT2* pSource);
  784. XMVECTOR XM_CALLCONV XMLoadByteN2(_In_ const XMBYTEN2* pSource);
  785. XMVECTOR XM_CALLCONV XMLoadByte2(_In_ const XMBYTE2* pSource);
  786. XMVECTOR XM_CALLCONV XMLoadUByteN2(_In_ const XMUBYTEN2* pSource);
  787. XMVECTOR XM_CALLCONV XMLoadUByte2(_In_ const XMUBYTE2* pSource);
  788. XMVECTOR XM_CALLCONV XMLoadU565(_In_ const XMU565* pSource);
  789. XMVECTOR XM_CALLCONV XMLoadFloat3PK(_In_ const XMFLOAT3PK* pSource);
  790. XMVECTOR XM_CALLCONV XMLoadFloat3SE(_In_ const XMFLOAT3SE* pSource);
  791. XMVECTOR XM_CALLCONV XMLoadHalf4(_In_ const XMHALF4* pSource);
  792. XMVECTOR XM_CALLCONV XMLoadShortN4(_In_ const XMSHORTN4* pSource);
  793. XMVECTOR XM_CALLCONV XMLoadShort4(_In_ const XMSHORT4* pSource);
  794. XMVECTOR XM_CALLCONV XMLoadUShortN4(_In_ const XMUSHORTN4* pSource);
  795. XMVECTOR XM_CALLCONV XMLoadUShort4(_In_ const XMUSHORT4* pSource);
  796. XMVECTOR XM_CALLCONV XMLoadXDecN4(_In_ const XMXDECN4* pSource);
  797. XMVECTOR XM_CALLCONV XMLoadUDecN4(_In_ const XMUDECN4* pSource);
  798. XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(_In_ const XMUDECN4* pSource);
  799. XMVECTOR XM_CALLCONV XMLoadUDec4(_In_ const XMUDEC4* pSource);
  800. XMVECTOR XM_CALLCONV XMLoadByteN4(_In_ const XMBYTEN4* pSource);
  801. XMVECTOR XM_CALLCONV XMLoadByte4(_In_ const XMBYTE4* pSource);
  802. XMVECTOR XM_CALLCONV XMLoadUByteN4(_In_ const XMUBYTEN4* pSource);
  803. XMVECTOR XM_CALLCONV XMLoadUByte4(_In_ const XMUBYTE4* pSource);
  804. XMVECTOR XM_CALLCONV XMLoadUNibble4(_In_ const XMUNIBBLE4* pSource);
  805. XMVECTOR XM_CALLCONV XMLoadU555(_In_ const XMU555* pSource);
  806. #pragma warning(push)
  807. #pragma warning(disable : 4996)
  808. // C4996: ignore deprecation warning
  809. XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadDecN4(_In_ const XMDECN4* pSource);
  810. XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadDec4(_In_ const XMDEC4* pSource);
  811. XMVECTOR XM_DEPRECATED XM_CALLCONV XMLoadXDec4(_In_ const XMXDEC4* pSource);
  812. #pragma warning(pop)
  813. /****************************************************************************
  814. *
  815. * Store operations
  816. *
  817. ****************************************************************************/
  818. void XM_CALLCONV XMStoreColor(_Out_ XMCOLOR* pDestination, _In_ FXMVECTOR V);
  819. void XM_CALLCONV XMStoreHalf2(_Out_ XMHALF2* pDestination, _In_ FXMVECTOR V);
  820. void XM_CALLCONV XMStoreShortN2(_Out_ XMSHORTN2* pDestination, _In_ FXMVECTOR V);
  821. void XM_CALLCONV XMStoreShort2(_Out_ XMSHORT2* pDestination, _In_ FXMVECTOR V);
  822. void XM_CALLCONV XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, _In_ FXMVECTOR V);
  823. void XM_CALLCONV XMStoreUShort2(_Out_ XMUSHORT2* pDestination, _In_ FXMVECTOR V);
  824. void XM_CALLCONV XMStoreByteN2(_Out_ XMBYTEN2* pDestination, _In_ FXMVECTOR V);
  825. void XM_CALLCONV XMStoreByte2(_Out_ XMBYTE2* pDestination, _In_ FXMVECTOR V);
  826. void XM_CALLCONV XMStoreUByteN2(_Out_ XMUBYTEN2* pDestination, _In_ FXMVECTOR V);
  827. void XM_CALLCONV XMStoreUByte2(_Out_ XMUBYTE2* pDestination, _In_ FXMVECTOR V);
  828. void XM_CALLCONV XMStoreU565(_Out_ XMU565* pDestination, _In_ FXMVECTOR V);
  829. void XM_CALLCONV XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, _In_ FXMVECTOR V);
  830. void XM_CALLCONV XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, _In_ FXMVECTOR V);
  831. void XM_CALLCONV XMStoreHalf4(_Out_ XMHALF4* pDestination, _In_ FXMVECTOR V);
  832. void XM_CALLCONV XMStoreShortN4(_Out_ XMSHORTN4* pDestination, _In_ FXMVECTOR V);
  833. void XM_CALLCONV XMStoreShort4(_Out_ XMSHORT4* pDestination, _In_ FXMVECTOR V);
  834. void XM_CALLCONV XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, _In_ FXMVECTOR V);
  835. void XM_CALLCONV XMStoreUShort4(_Out_ XMUSHORT4* pDestination, _In_ FXMVECTOR V);
  836. void XM_CALLCONV XMStoreXDecN4(_Out_ XMXDECN4* pDestination, _In_ FXMVECTOR V);
  837. void XM_CALLCONV XMStoreUDecN4(_Out_ XMUDECN4* pDestination, _In_ FXMVECTOR V);
  838. void XM_CALLCONV XMStoreUDecN4_XR(_Out_ XMUDECN4* pDestination, _In_ FXMVECTOR V);
  839. void XM_CALLCONV XMStoreUDec4(_Out_ XMUDEC4* pDestination, _In_ FXMVECTOR V);
  840. void XM_CALLCONV XMStoreByteN4(_Out_ XMBYTEN4* pDestination, _In_ FXMVECTOR V);
  841. void XM_CALLCONV XMStoreByte4(_Out_ XMBYTE4* pDestination, _In_ FXMVECTOR V);
  842. void XM_CALLCONV XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, _In_ FXMVECTOR V);
  843. void XM_CALLCONV XMStoreUByte4(_Out_ XMUBYTE4* pDestination, _In_ FXMVECTOR V);
  844. void XM_CALLCONV XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, _In_ FXMVECTOR V);
  845. void XM_CALLCONV XMStoreU555(_Out_ XMU555* pDestination, _In_ FXMVECTOR V);
  846. #pragma warning(push)
  847. #pragma warning(disable : 4996)
  848. // C4996: ignore deprecation warning
  849. void XM_DEPRECATED XM_CALLCONV XMStoreDecN4(_Out_ XMDECN4* pDestination, _In_ FXMVECTOR V);
  850. void XM_DEPRECATED XM_CALLCONV XMStoreDec4(_Out_ XMDEC4* pDestination, _In_ FXMVECTOR V);
  851. void XM_DEPRECATED XM_CALLCONV XMStoreXDec4(_Out_ XMXDEC4* pDestination, _In_ FXMVECTOR V);
  852. #pragma warning(pop)
  853. /****************************************************************************
  854. *
  855. * Implementation
  856. *
  857. ****************************************************************************/
  858. #pragma warning(push)
  859. #pragma warning(disable:4068 4214 4204 4365 4616 6001 6101)
  860. // C4068/4616: ignore unknown pragmas
  861. // C4214/4204: nonstandard extension used
  862. // C4365: Off by default noise
  863. // C6001/6101: False positives
  864. #ifdef _PREFAST_
  865. #pragma prefast(push)
  866. #pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
  867. #endif
  868. #include "DirectXPackedVector.inl"
  869. #ifdef _PREFAST_
  870. #pragma prefast(pop)
  871. #endif
  872. #pragma warning(pop)
  873. }; // namespace PackedVector
  874. }; // namespace DirectX