Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1910 lines
70 KiB

  1. sinclude(`d3d8mkhdr.m4')dnl This file must be preprocessed by the m4 preprocessor.
  2. /*==========================================================================;
  3. *
  4. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  5. *
  6. * File: d3d8types.h
  7. * Content: Direct3D capabilities include file
  8. *
  9. ***************************************************************************/
  10. ;begin_external
  11. #ifndef _D3D8TYPES_H_
  12. #define _D3D8TYPES_H_
  13. ;end_external
  14. ;begin_internal
  15. #ifndef _D3D8TYPESP_H_
  16. #define _D3D8TYPESP_H_
  17. #ifdef _D3D8TYPES_H_
  18. #pragma message( "ERROR: d3d8types.h included with d3d8typesp.h" __FILE__ )
  19. #endif
  20. ;end_internal
  21. #ifndef DIRECT3D_VERSION
  22. #define DIRECT3D_VERSION 0x0800
  23. #endif //DIRECT3D_VERSION
  24. // include this file content only if compiling for DX8 interfaces
  25. #if(DIRECT3D_VERSION >= 0x0800)
  26. #include <float.h>
  27. #pragma warning(disable:4201) // anonymous unions warning
  28. #pragma pack(4)
  29. // D3DCOLOR is equivalent to D3DFMT_A8R8G8B8
  30. #ifndef D3DCOLOR_DEFINED
  31. typedef DWORD D3DCOLOR;
  32. #define D3DCOLOR_DEFINED
  33. #endif
  34. // maps unsigned 8 bits/channel to D3DCOLOR
  35. #define D3DCOLOR_ARGB(a,r,g,b) \
  36. ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
  37. #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
  38. #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
  39. // maps floating point channels (0.f to 1.f range) to D3DCOLOR
  40. #define D3DCOLOR_COLORVALUE(r,g,b,a) \
  41. D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
  42. #ifndef D3DVECTOR_DEFINED
  43. typedef struct _D3DVECTOR {
  44. float x;
  45. float y;
  46. float z;
  47. } D3DVECTOR;
  48. #define D3DVECTOR_DEFINED
  49. #endif
  50. #ifndef D3DCOLORVALUE_DEFINED
  51. typedef struct _D3DCOLORVALUE {
  52. float r;
  53. float g;
  54. float b;
  55. float a;
  56. } D3DCOLORVALUE;
  57. #define D3DCOLORVALUE_DEFINED
  58. #endif
  59. #ifndef D3DRECT_DEFINED
  60. typedef struct _D3DRECT {
  61. LONG x1;
  62. LONG y1;
  63. LONG x2;
  64. LONG y2;
  65. } D3DRECT;
  66. #define D3DRECT_DEFINED
  67. #endif
  68. #ifndef D3DMATRIX_DEFINED
  69. typedef struct _D3DMATRIX {
  70. union {
  71. struct {
  72. float _11, _12, _13, _14;
  73. float _21, _22, _23, _24;
  74. float _31, _32, _33, _34;
  75. float _41, _42, _43, _44;
  76. };
  77. float m[4][4];
  78. };
  79. } D3DMATRIX;
  80. #define D3DMATRIX_DEFINED
  81. #endif
  82. typedef struct _D3DVIEWPORT8 {
  83. DWORD X;
  84. DWORD Y; /* Viewport Top left */
  85. DWORD Width;
  86. DWORD Height; /* Viewport Dimensions */
  87. float MinZ; /* Min/max of clip Volume */
  88. float MaxZ;
  89. } D3DVIEWPORT8;
  90. /*
  91. * Values for clip fields.
  92. */
  93. // Max number of user clipping planes, supported in D3D.
  94. #define D3DMAXUSERCLIPPLANES 32
  95. // These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE
  96. //
  97. #define D3DCLIPPLANE0 (1 << 0)
  98. #define D3DCLIPPLANE1 (1 << 1)
  99. #define D3DCLIPPLANE2 (1 << 2)
  100. #define D3DCLIPPLANE3 (1 << 3)
  101. #define D3DCLIPPLANE4 (1 << 4)
  102. #define D3DCLIPPLANE5 (1 << 5)
  103. // The following bits are used in the ClipUnion and ClipIntersection
  104. // members of the D3DCLIPSTATUS8
  105. //
  106. #define D3DCS_LEFT 0x00000001L
  107. #define D3DCS_RIGHT 0x00000002L
  108. #define D3DCS_TOP 0x00000004L
  109. #define D3DCS_BOTTOM 0x00000008L
  110. #define D3DCS_FRONT 0x00000010L
  111. #define D3DCS_BACK 0x00000020L
  112. #define D3DCS_PLANE0 0x00000040L
  113. #define D3DCS_PLANE1 0x00000080L
  114. #define D3DCS_PLANE2 0x00000100L
  115. #define D3DCS_PLANE3 0x00000200L
  116. #define D3DCS_PLANE4 0x00000400L
  117. #define D3DCS_PLANE5 0x00000800L
  118. #define D3DCS_ALL (D3DCS_LEFT | \
  119. D3DCS_RIGHT | \
  120. D3DCS_TOP | \
  121. D3DCS_BOTTOM | \
  122. D3DCS_FRONT | \
  123. D3DCS_BACK | \
  124. D3DCS_PLANE0 | \
  125. D3DCS_PLANE1 | \
  126. D3DCS_PLANE2 | \
  127. D3DCS_PLANE3 | \
  128. D3DCS_PLANE4 | \
  129. D3DCS_PLANE5)
  130. typedef struct _D3DCLIPSTATUS8 {
  131. DWORD ClipUnion;
  132. DWORD ClipIntersection;
  133. } D3DCLIPSTATUS8;
  134. typedef struct _D3DMATERIAL8 {
  135. D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */
  136. D3DCOLORVALUE Ambient; /* Ambient color RGB */
  137. D3DCOLORVALUE Specular; /* Specular 'shininess' */
  138. D3DCOLORVALUE Emissive; /* Emissive color RGB */
  139. float Power; /* Sharpness if specular highlight */
  140. } D3DMATERIAL8;
  141. typedef enum _D3DLIGHTTYPE {
  142. D3DLIGHT_POINT = 1,
  143. D3DLIGHT_SPOT = 2,
  144. D3DLIGHT_DIRECTIONAL = 3,
  145. D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  146. } D3DLIGHTTYPE;
  147. typedef struct _D3DLIGHT8 {
  148. D3DLIGHTTYPE Type; /* Type of light source */
  149. D3DCOLORVALUE Diffuse; /* Diffuse color of light */
  150. D3DCOLORVALUE Specular; /* Specular color of light */
  151. D3DCOLORVALUE Ambient; /* Ambient color of light */
  152. D3DVECTOR Position; /* Position in world space */
  153. D3DVECTOR Direction; /* Direction in world space */
  154. float Range; /* Cutoff range */
  155. float Falloff; /* Falloff */
  156. float Attenuation0; /* Constant attenuation */
  157. float Attenuation1; /* Linear attenuation */
  158. float Attenuation2; /* Quadratic attenuation */
  159. float Theta; /* Inner angle of spotlight cone */
  160. float Phi; /* Outer angle of spotlight cone */
  161. } D3DLIGHT8;
  162. /*
  163. * Options for clearing
  164. */
  165. #define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */
  166. #define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */
  167. #define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */
  168. #define D3DCLEAR_RESERVED0 0x00000008l /* Defined in D3DHAL.H */ ;internal
  169. /*
  170. * The following defines the rendering states
  171. */
  172. typedef enum _D3DSHADEMODE {
  173. D3DSHADE_FLAT = 1,
  174. D3DSHADE_GOURAUD = 2,
  175. D3DSHADE_PHONG = 3,
  176. D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  177. } D3DSHADEMODE;
  178. typedef enum _D3DFILLMODE {
  179. D3DFILL_POINT = 1,
  180. D3DFILL_WIREFRAME = 2,
  181. D3DFILL_SOLID = 3,
  182. D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  183. } D3DFILLMODE;
  184. typedef struct _D3DLINEPATTERN {
  185. WORD wRepeatFactor;
  186. WORD wLinePattern;
  187. } D3DLINEPATTERN;
  188. typedef enum _D3DBLEND {
  189. D3DBLEND_ZERO = 1,
  190. D3DBLEND_ONE = 2,
  191. D3DBLEND_SRCCOLOR = 3,
  192. D3DBLEND_INVSRCCOLOR = 4,
  193. D3DBLEND_SRCALPHA = 5,
  194. D3DBLEND_INVSRCALPHA = 6,
  195. D3DBLEND_DESTALPHA = 7,
  196. D3DBLEND_INVDESTALPHA = 8,
  197. D3DBLEND_DESTCOLOR = 9,
  198. D3DBLEND_INVDESTCOLOR = 10,
  199. D3DBLEND_SRCALPHASAT = 11,
  200. D3DBLEND_BOTHSRCALPHA = 12,
  201. D3DBLEND_BOTHINVSRCALPHA = 13,
  202. D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  203. } D3DBLEND;
  204. typedef enum _D3DBLENDOP {
  205. D3DBLENDOP_ADD = 1,
  206. D3DBLENDOP_SUBTRACT = 2,
  207. D3DBLENDOP_REVSUBTRACT = 3,
  208. D3DBLENDOP_MIN = 4,
  209. D3DBLENDOP_MAX = 5,
  210. D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  211. } D3DBLENDOP;
  212. typedef enum _D3DTEXTUREADDRESS {
  213. D3DTADDRESS_WRAP = 1,
  214. D3DTADDRESS_MIRROR = 2,
  215. D3DTADDRESS_CLAMP = 3,
  216. D3DTADDRESS_BORDER = 4,
  217. D3DTADDRESS_MIRRORONCE = 5,
  218. D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  219. } D3DTEXTUREADDRESS;
  220. typedef enum _D3DCULL {
  221. D3DCULL_NONE = 1,
  222. D3DCULL_CW = 2,
  223. D3DCULL_CCW = 3,
  224. D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  225. } D3DCULL;
  226. typedef enum _D3DCMPFUNC {
  227. D3DCMP_NEVER = 1,
  228. D3DCMP_LESS = 2,
  229. D3DCMP_EQUAL = 3,
  230. D3DCMP_LESSEQUAL = 4,
  231. D3DCMP_GREATER = 5,
  232. D3DCMP_NOTEQUAL = 6,
  233. D3DCMP_GREATEREQUAL = 7,
  234. D3DCMP_ALWAYS = 8,
  235. D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  236. } D3DCMPFUNC;
  237. typedef enum _D3DSTENCILOP {
  238. D3DSTENCILOP_KEEP = 1,
  239. D3DSTENCILOP_ZERO = 2,
  240. D3DSTENCILOP_REPLACE = 3,
  241. D3DSTENCILOP_INCRSAT = 4,
  242. D3DSTENCILOP_DECRSAT = 5,
  243. D3DSTENCILOP_INVERT = 6,
  244. D3DSTENCILOP_INCR = 7,
  245. D3DSTENCILOP_DECR = 8,
  246. D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  247. } D3DSTENCILOP;
  248. typedef enum _D3DFOGMODE {
  249. D3DFOG_NONE = 0,
  250. D3DFOG_EXP = 1,
  251. D3DFOG_EXP2 = 2,
  252. D3DFOG_LINEAR = 3,
  253. D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  254. } D3DFOGMODE;
  255. typedef enum _D3DZBUFFERTYPE {
  256. D3DZB_FALSE = 0,
  257. D3DZB_TRUE = 1, // Z buffering
  258. D3DZB_USEW = 2, // W buffering
  259. D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  260. } D3DZBUFFERTYPE;
  261. // Primitives supported by draw-primitive API
  262. typedef enum _D3DPRIMITIVETYPE {
  263. D3DPT_POINTLIST = 1,
  264. D3DPT_LINELIST = 2,
  265. D3DPT_LINESTRIP = 3,
  266. D3DPT_TRIANGLELIST = 4,
  267. D3DPT_TRIANGLESTRIP = 5,
  268. D3DPT_TRIANGLEFAN = 6,
  269. ;begin_internal
  270. // d3dhal.w must be updated if these values are changed
  271. D3D_PT_ODD_TRIANGLE_STRIP = 7,
  272. D3D_PT_TRIANGLE_FAN2 = 8,
  273. ;end_internal
  274. D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  275. } D3DPRIMITIVETYPE;
  276. typedef enum _D3DTRANSFORMSTATETYPE {
  277. D3DTS_VIEW = 2,
  278. D3DTS_PROJECTION = 3,
  279. D3DTS_TEXTURE0 = 16,
  280. D3DTS_TEXTURE1 = 17,
  281. D3DTS_TEXTURE2 = 18,
  282. D3DTS_TEXTURE3 = 19,
  283. D3DTS_TEXTURE4 = 20,
  284. D3DTS_TEXTURE5 = 21,
  285. D3DTS_TEXTURE6 = 22,
  286. D3DTS_TEXTURE7 = 23,
  287. ;begin_internal
  288. // If the number of transform states is increased, this must be changed
  289. D3D_MAXTRANSFORMSTATES = 512,
  290. ;end_internal
  291. D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  292. } D3DTRANSFORMSTATETYPE;
  293. #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
  294. #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
  295. #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
  296. #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
  297. #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
  298. typedef enum _D3DRENDERSTATETYPE {
  299. D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
  300. D3DRS_FILLMODE = 8, /* D3DFILLMODE */
  301. D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */
  302. D3DRS_LINEPATTERN = 10, /* D3DLINEPATTERN */
  303. D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */
  304. D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
  305. D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
  306. D3DRS_SRCBLEND = 19, /* D3DBLEND */
  307. D3DRS_DESTBLEND = 20, /* D3DBLEND */
  308. D3DRS_CULLMODE = 22, /* D3DCULL */
  309. D3DRS_ZFUNC = 23, /* D3DCMPFUNC */
  310. D3DRS_ALPHAREF = 24, /* D3DFIXED */
  311. D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */
  312. D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */
  313. D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */
  314. D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */
  315. D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */
  316. D3DRS_ZVISIBLE = 30, /* TRUE to enable z checking */
  317. D3DRS_FOGCOLOR = 34, /* D3DCOLOR */
  318. D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */
  319. D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */
  320. D3DRS_FOGEND = 37, /* Fog end */
  321. D3DRS_FOGDENSITY = 38, /* Fog density */
  322. D3DRS_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */
  323. D3DRS_ZBIAS = 47, /* LONG Z bias */
  324. D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */
  325. D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */
  326. D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */
  327. D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */
  328. D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */
  329. D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
  330. D3DRS_STENCILREF = 57, /* Reference value used in stencil test */
  331. D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */
  332. D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */
  333. D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */
  334. ;begin_internal
  335. // This renderstate is defined for internal use (only) in d3dhal.h ;internal
  336. // There is a duplicate define in d3dhal.h that must be kept in sync with this. ;internal
  337. D3DRENDERSTATE_EVICTMANAGEDTEXTURES=61, /* DDI render state only to Evict textures */
  338. D3DRENDERSTATE_SCENECAPTURE = 62, // DDI only to replace SceneCapture
  339. ;end_internal
  340. D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */
  341. D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */
  342. D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */
  343. D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */
  344. D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */
  345. D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */
  346. D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */
  347. D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */
  348. D3DRS_CLIPPING = 136,
  349. D3DRS_LIGHTING = 137,
  350. D3DRS_AMBIENT = 139,
  351. D3DRS_FOGVERTEXMODE = 140,
  352. D3DRS_COLORVERTEX = 141,
  353. D3DRS_LOCALVIEWER = 142,
  354. D3DRS_NORMALIZENORMALS = 143,
  355. D3DRS_DIFFUSEMATERIALSOURCE = 145,
  356. D3DRS_SPECULARMATERIALSOURCE = 146,
  357. D3DRS_AMBIENTMATERIALSOURCE = 147,
  358. D3DRS_EMISSIVEMATERIALSOURCE = 148,
  359. D3DRS_VERTEXBLEND = 151,
  360. D3DRS_CLIPPLANEENABLE = 152,
  361. D3DRS_SOFTWAREVERTEXPROCESSING = 153,
  362. D3DRS_POINTSIZE = 154, /* float point size */
  363. D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */
  364. D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */
  365. D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */
  366. D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */
  367. D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */
  368. D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */
  369. D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer
  370. D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable
  371. D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation
  372. D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches
  373. D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor
  374. D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */
  375. D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
  376. D3DRS_COLORWRITEENABLE = 168, // per-channel write enable
  377. ;begin_internal
  378. D3DRS_DELETERTPATCH = 169, // IMPORTANT: PLEASE UPDATE D3DHAL.W WHEN THIS VALUE CHANGES
  379. ;end_internal
  380. D3DRS_TWEENFACTOR = 170, // float tween factor
  381. D3DRS_BLENDOP = 171, // D3DBLENDOP setting
  382. D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default)
  383. D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC
  384. ;begin_internal
  385. D3D_MAXRENDERSTATES = 174, // Total number of render states
  386. ;end_internal
  387. D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  388. } D3DRENDERSTATETYPE;
  389. // Values for material source
  390. typedef enum _D3DMATERIALCOLORSOURCE
  391. {
  392. D3DMCS_MATERIAL = 0, // Color from material is used
  393. D3DMCS_COLOR1 = 1, // Diffuse vertex color is used
  394. D3DMCS_COLOR2 = 2, // Specular vertex color is used
  395. D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  396. } D3DMATERIALCOLORSOURCE;
  397. // Bias to apply to the texture coordinate set to apply a wrap to.
  398. #define D3DRENDERSTATE_WRAPBIAS 128UL
  399. /* Flags to construct the WRAP render states */
  400. #define D3DWRAP_U 0x00000001L
  401. #define D3DWRAP_V 0x00000002L
  402. #define D3DWRAP_W 0x00000004L
  403. /* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */
  404. #define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U
  405. #define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V
  406. #define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W
  407. #define D3DWRAPCOORD_3 0x00000008L
  408. /* Flags to construct D3DRS_COLORWRITEENABLE */
  409. #define D3DCOLORWRITEENABLE_RED (1L<<0)
  410. #define D3DCOLORWRITEENABLE_GREEN (1L<<1)
  411. #define D3DCOLORWRITEENABLE_BLUE (1L<<2)
  412. #define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
  413. /*
  414. * State enumerants for per-stage texture processing.
  415. */
  416. typedef enum _D3DTEXTURESTAGESTATETYPE
  417. {
  418. D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
  419. D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */
  420. D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */
  421. D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
  422. D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */
  423. D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */
  424. D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */
  425. D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */
  426. D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */
  427. D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */
  428. D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */
  429. D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */
  430. D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */
  431. D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */
  432. D3DTSS_MAGFILTER = 16, /* D3DTEXTUREFILTER filter to use for magnification */
  433. D3DTSS_MINFILTER = 17, /* D3DTEXTUREFILTER filter to use for minification */
  434. D3DTSS_MIPFILTER = 18, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */
  435. D3DTSS_MIPMAPLODBIAS = 19, /* float Mipmap LOD bias */
  436. D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
  437. D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */
  438. D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */
  439. D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */
  440. D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */
  441. D3DTSS_ADDRESSW = 25, /* D3DTEXTUREADDRESS for W coordinate */
  442. D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */
  443. D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */
  444. D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */
  445. ;begin_internal
  446. D3DTSS_MAX = 29,
  447. ;end_internal
  448. D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
  449. } D3DTEXTURESTAGESTATETYPE;
  450. // Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
  451. // and normal in the camera space) should be taken as texture coordinates
  452. // Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
  453. //
  454. #define D3DTSS_TCI_PASSTHRU 0x00000000
  455. #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
  456. #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
  457. #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
  458. /*
  459. * Enumerations for COLOROP and ALPHAOP texture blending operations set in
  460. * texture processing stage controls in D3DTSS.
  461. */
  462. typedef enum _D3DTEXTUREOP
  463. {
  464. // Control
  465. D3DTOP_DISABLE = 1, // disables stage
  466. D3DTOP_SELECTARG1 = 2, // the default
  467. D3DTOP_SELECTARG2 = 3,
  468. // Modulate
  469. D3DTOP_MODULATE = 4, // multiply args together
  470. D3DTOP_MODULATE2X = 5, // multiply and shift 1 bit
  471. D3DTOP_MODULATE4X = 6, // multiply and shift 2 bits
  472. // Add
  473. D3DTOP_ADD = 7, // add arguments together
  474. D3DTOP_ADDSIGNED = 8, // add with -0.5 bias
  475. D3DTOP_ADDSIGNED2X = 9, // as above but left shift 1 bit
  476. D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation
  477. D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product
  478. // Arg1 + Arg2 - Arg1*Arg2
  479. // = Arg1 + (1-Arg1)*Arg2
  480. // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
  481. D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha
  482. D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha
  483. D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR
  484. // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
  485. D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha
  486. D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color
  487. // Specular mapping
  488. D3DTOP_PREMODULATE = 17, // modulate with next texture before use
  489. D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
  490. // COLOROP only
  491. D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
  492. // COLOROP only
  493. D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
  494. // COLOROP only
  495. D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
  496. // COLOROP only
  497. // Bump mapping
  498. D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
  499. D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
  500. // This can do either diffuse or specular bump mapping with correct input.
  501. // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
  502. // where each component has been scaled and offset to make it signed.
  503. // The result is replicated into all four (including alpha) channels.
  504. // This is a valid COLOROP only.
  505. D3DTOP_DOTPRODUCT3 = 24,
  506. // Triadic ops
  507. D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2
  508. D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2
  509. D3DTOP_FORCE_DWORD = 0x7fffffff,
  510. } D3DTEXTUREOP;
  511. /*
  512. * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending
  513. * operations set in texture processing stage controls in D3DRENDERSTATE.
  514. */
  515. #define D3DTA_SELECTMASK 0x0000000f // mask for arg selector
  516. #define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only)
  517. #define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write)
  518. #define D3DTA_TEXTURE 0x00000002 // select texture color (read only)
  519. #define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only)
  520. #define D3DTA_SPECULAR 0x00000004 // select specular color (read only)
  521. #define D3DTA_TEMP 0x00000005 // select temporary register color (read/write)
  522. #define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier)
  523. #define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier)
  524. //
  525. // Values for D3DTSS_***FILTER texture stage states
  526. //
  527. typedef enum _D3DTEXTUREFILTERTYPE
  528. {
  529. D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only)
  530. D3DTEXF_POINT = 1, // nearest
  531. D3DTEXF_LINEAR = 2, // linear interpolation
  532. D3DTEXF_ANISOTROPIC = 3, // anisotropic
  533. D3DTEXF_FLATCUBIC = 4, // cubic
  534. D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel
  535. D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  536. } D3DTEXTUREFILTERTYPE;
  537. /* Bits for Flags in ProcessVertices call */
  538. #define D3DPV_DONOTCOPYDATA (1 << 0)
  539. //-------------------------------------------------------------------
  540. // Flexible vertex format bits
  541. //
  542. #define D3DFVF_RESERVED0 0x001
  543. #define D3DFVF_POSITION_MASK 0x00E
  544. #define D3DFVF_XYZ 0x002
  545. #define D3DFVF_XYZRHW 0x004
  546. #define D3DFVF_XYZB1 0x006
  547. #define D3DFVF_XYZB2 0x008
  548. #define D3DFVF_XYZB3 0x00a
  549. #define D3DFVF_XYZB4 0x00c
  550. #define D3DFVF_XYZB5 0x00e
  551. #define D3DFVF_NORMAL 0x010
  552. #define D3DFVF_PSIZE 0x020
  553. #define D3DFVF_DIFFUSE 0x040
  554. #define D3DFVF_SPECULAR 0x080
  555. #define D3DFVF_TEXCOUNT_MASK 0xf00
  556. #define D3DFVF_TEXCOUNT_SHIFT 8
  557. #define D3DFVF_TEX0 0x000
  558. #define D3DFVF_TEX1 0x100
  559. #define D3DFVF_TEX2 0x200
  560. #define D3DFVF_TEX3 0x300
  561. #define D3DFVF_TEX4 0x400
  562. #define D3DFVF_TEX5 0x500
  563. #define D3DFVF_TEX6 0x600
  564. #define D3DFVF_TEX7 0x700
  565. #define D3DFVF_TEX8 0x800
  566. #define D3DFVF_LASTBETA_UBYTE4 0x1000
  567. #define D3DFVF_FOG 0x2000 ; internal
  568. #define D3DFVF_RESERVED2 0xE000 // 4 reserved bits
  569. //---------------------------------------------------------------------
  570. // Vertex Shaders
  571. //
  572. /*
  573. Vertex Shader Declaration
  574. The declaration portion of a vertex shader defines the static external
  575. interface of the shader. The information in the declaration includes:
  576. - Assignments of vertex shader input registers to data streams. These
  577. assignments bind a specific vertex register to a single component within a
  578. vertex stream. A vertex stream element is identified by a byte offset
  579. within the stream and a type. The type specifies the arithmetic data type
  580. plus the dimensionality (1, 2, 3, or 4 values). Stream data which is
  581. less than 4 values are always expanded out to 4 values with zero or more
  582. 0.F values and one 1.F value.
  583. - Assignment of vertex shader input registers to implicit data from the
  584. primitive tessellator. This controls the loading of vertex data which is
  585. not loaded from a stream, but rather is generated during primitive
  586. tessellation prior to the vertex shader.
  587. - Loading data into the constant memory at the time a shader is set as the
  588. current shader. Each token specifies values for one or more contiguous 4
  589. DWORD constant registers. This allows the shader to update an arbitrary
  590. subset of the constant memory, overwriting the device state (which
  591. contains the current values of the constant memory). Note that these
  592. values can be subsequently overwritten (between DrawPrimitive calls)
  593. during the time a shader is bound to a device via the
  594. SetVertexShaderConstant method.
  595. Declaration arrays are single-dimensional arrays of DWORDs composed of
  596. multiple tokens each of which is one or more DWORDs. The single-DWORD
  597. token value 0xFFFFFFFF is a special token used to indicate the end of the
  598. declaration array. The single DWORD token value 0x00000000 is a NOP token
  599. with is ignored during the declaration parsing. Note that 0x00000000 is a
  600. valid value for DWORDs following the first DWORD for multiple word tokens.
  601. [31:29] TokenType
  602. 0x0 - NOP (requires all DWORD bits to be zero)
  603. 0x1 - stream selector
  604. 0x2 - stream data definition (map to vertex input memory)
  605. 0x3 - vertex input memory from tessellator
  606. 0x4 - constant memory from shader
  607. 0x5 - extension
  608. 0x6 - reserved
  609. 0x7 - end-of-array (requires all DWORD bits to be 1)
  610. NOP Token (single DWORD token)
  611. [31:29] 0x0
  612. [28:00] 0x0
  613. Stream Selector (single DWORD token)
  614. [31:29] 0x1
  615. [28] indicates whether this is a tessellator stream
  616. [27:04] 0x0
  617. [03:00] stream selector (0..15)
  618. Stream Data Definition (single DWORD token)
  619. Vertex Input Register Load
  620. [31:29] 0x2
  621. [28] 0x0
  622. [27:20] 0x0
  623. [19:16] type (dimensionality and data type)
  624. [15:04] 0x0
  625. [03:00] vertex register address (0..15)
  626. Data Skip (no register load)
  627. [31:29] 0x2
  628. [28] 0x1
  629. [27:20] 0x0
  630. [19:16] count of DWORDS to skip over (0..15)
  631. [15:00] 0x0
  632. Vertex Input Memory from Tessellator Data (single DWORD token)
  633. [31:29] 0x3
  634. [28] indicates whether data is normals or u/v
  635. [27:24] 0x0
  636. [23:20] vertex register address (0..15)
  637. [19:16] type (dimensionality)
  638. [15:04] 0x0
  639. [03:00] vertex register address (0..15)
  640. Constant Memory from Shader (multiple DWORD token)
  641. [31:29] 0x4
  642. [28:25] count of 4*DWORD constants to load (0..15)
  643. [24:07] 0x0
  644. [06:00] constant memory address (0..95)
  645. Extension Token (single or multiple DWORD token)
  646. [31:29] 0x5
  647. [28:24] count of additional DWORDs in token (0..31)
  648. [23:00] extension-specific information
  649. End-of-array token (single DWORD token)
  650. [31:29] 0x7
  651. [28:00] 0x1fffffff
  652. The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element.
  653. Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant.
  654. The token sequence:
  655. Stream Select: stream=0
  656. Stream Data Definition (Load): type=FLOAT3; register=3
  657. Stream Data Definition (Load): type=FLOAT3; register=4
  658. Stream Data Definition (Skip): count=2
  659. Stream Data Definition (Load): type=FLOAT2; register=7
  660. defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data.
  661. Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed.
  662. */
  663. typedef enum _D3DVSD_TOKENTYPE
  664. {
  665. D3DVSD_TOKEN_NOP = 0, // NOP or extension
  666. D3DVSD_TOKEN_STREAM, // stream selector
  667. D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory)
  668. D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator
  669. D3DVSD_TOKEN_CONSTMEM, // constant memory from shader
  670. D3DVSD_TOKEN_EXT, // extension
  671. D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1)
  672. D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum
  673. } D3DVSD_TOKENTYPE;
  674. #define D3DVSD_TOKENTYPESHIFT 29
  675. #define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT)
  676. #define D3DVSD_STREAMNUMBERSHIFT 0
  677. #define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT)
  678. #define D3DVSD_DATALOADTYPESHIFT 28
  679. #define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT)
  680. #define D3DVSD_DATATYPESHIFT 16
  681. #define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT)
  682. #define D3DVSD_SKIPCOUNTSHIFT 16
  683. #define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT)
  684. #define D3DVSD_VERTEXREGSHIFT 0
  685. #define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT)
  686. #define D3DVSD_VERTEXREGINSHIFT 20
  687. #define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT)
  688. #define D3DVSD_CONSTCOUNTSHIFT 25
  689. #define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT)
  690. #define D3DVSD_CONSTADDRESSSHIFT 0
  691. #define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT)
  692. #define D3DVSD_CONSTRSSHIFT 16
  693. #define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT)
  694. #define D3DVSD_EXTCOUNTSHIFT 24
  695. #define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT)
  696. #define D3DVSD_EXTINFOSHIFT 0
  697. #define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT)
  698. #define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
  699. // macros for generation of CreateVertexShader Declaration token array
  700. // Set current stream
  701. // _StreamNumber [0..(MaxStreams-1)] stream to get data from
  702. //
  703. #define D3DVSD_STREAM( _StreamNumber ) \
  704. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber))
  705. // Set tessellator stream
  706. //
  707. #define D3DVSD_STREAMTESSSHIFT 28
  708. #define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT)
  709. #define D3DVSD_STREAM_TESS( ) \
  710. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
  711. // bind single vertex register to vertex element from vertex stream
  712. //
  713. // _VertexRegister [0..15] address of the vertex register
  714. // _Type [D3DVSDT_*] dimensionality and arithmetic data type
  715. #define D3DVSD_REG( _VertexRegister, _Type ) \
  716. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \
  717. ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister))
  718. // Skip _DWORDCount DWORDs in vertex
  719. //
  720. #define D3DVSD_SKIP( _DWORDCount ) \
  721. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \
  722. ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT))
  723. // load data into vertex shader constant memory
  724. //
  725. // _ConstantAddress [0..95] - address of constant array to begin filling data
  726. // _Count [0..15] - number of constant vectors to load (4 DWORDs each)
  727. // followed by 4*_Count DWORDS of data
  728. //
  729. #define D3DVSD_CONST( _ConstantAddress, _Count ) \
  730. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \
  731. ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress))
  732. // enable tessellator generated normals
  733. //
  734. // _VertexRegisterIn [0..15] address of vertex register whose input stream
  735. // will be used in normal computation
  736. // _VertexRegisterOut [0..15] address of vertex register to output the normal to
  737. //
  738. #define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \
  739. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \
  740. ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \
  741. ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut))
  742. // enable tessellator generated surface parameters
  743. //
  744. // _VertexRegister [0..15] address of vertex register to output parameters
  745. //
  746. #define D3DVSD_TESSUV( _VertexRegister ) \
  747. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \
  748. ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister))
  749. // Generates END token
  750. //
  751. #define D3DVSD_END() 0xFFFFFFFF
  752. // Generates NOP token
  753. #define D3DVSD_NOP() 0x00000000
  754. // bit declarations for _Type fields
  755. #define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.)
  756. #define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.)
  757. #define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.)
  758. #define D3DVSDT_FLOAT4 0x03 // 4D float
  759. #define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range
  760. // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A)
  761. #define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte
  762. #define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.)
  763. #define D3DVSDT_SHORT4 0x07 // 4D signed short
  764. // assignments of vertex input registers for fixed function vertex shader
  765. //
  766. #define D3DVSDE_POSITION 0
  767. #define D3DVSDE_BLENDWEIGHT 1
  768. #define D3DVSDE_BLENDINDICES 2
  769. #define D3DVSDE_NORMAL 3
  770. #define D3DVSDE_PSIZE 4
  771. #define D3DVSDE_DIFFUSE 5
  772. #define D3DVSDE_SPECULAR 6
  773. #define D3DVSDE_TEXCOORD0 7
  774. #define D3DVSDE_TEXCOORD1 8
  775. #define D3DVSDE_TEXCOORD2 9
  776. #define D3DVSDE_TEXCOORD3 10
  777. #define D3DVSDE_TEXCOORD4 11
  778. #define D3DVSDE_TEXCOORD5 12
  779. #define D3DVSDE_TEXCOORD6 13
  780. #define D3DVSDE_TEXCOORD7 14
  781. #define D3DVSDE_POSITION2 15
  782. #define D3DVSDE_NORMAL2 16
  783. // Maximum supported number of texture coordinate sets
  784. #define D3DDP_MAXTEXCOORD 8
  785. ;begin_internal
  786. //---------------------------------------------------------------------
  787. //
  788. // Pixel Shader (PS) & Vertex Shader (VS) Instruction Token Definition
  789. //
  790. // **** Version Token ****
  791. // [07:00] minor version number
  792. // [15:08] major version number
  793. // [31:16]
  794. // PS 0xFFFF
  795. // VS 0xFFFE
  796. //
  797. // **** End Token ****
  798. // [31:00] 0x0000FFFF
  799. //
  800. // **** Comment Token ****
  801. // [15:00] 0xFFFE
  802. // [30:16] DWORD Length (up to 2^15 DWORDS = 128KB)
  803. // [31] 0x0
  804. //
  805. // **** Instruction Token ****
  806. // [15:00] Opcode (D3DSIO_*)
  807. // [23:16] Opcode-Specific Controls
  808. // [29:24] Reserved 0x0
  809. // [30] Co-Issue - if set then execute this instruction with the previous instruction(s)
  810. // [31] 0x0
  811. //
  812. // **** Destination Parameter Token ****
  813. // [12:00] Register Number (offset in register file)
  814. // [15:13] Reserved 0x0
  815. // [19:16] Write Mask
  816. // [16] Component 0 (X;Red)
  817. // [17] Component 1 (Y;Green)
  818. // [18] Component 2 (Z;Blue)
  819. // [19] Component 3 (W;Alpha)
  820. // [23:20]
  821. // PS Result Modifier
  822. // VS Reserved 0x0
  823. // [27:24]
  824. // PS Result Shift Scale (signed shift)
  825. // VS Reserved 0x0
  826. // [30:28] Register Type
  827. // [0x0] Temporary Register File
  828. // [0x1] Reserved
  829. // [0x2]
  830. // VS Reserved
  831. // PS Constant Register File (def instruction)
  832. // [0x3]
  833. // VS Address Register (reg num must be zero)
  834. // PS Texture Register
  835. // [0x4]
  836. // VS Rasterizer Output Register File
  837. // PS Reserved
  838. // [0x5]
  839. // VS Attribute Output Register File
  840. // PS Reserved
  841. // [0x6]
  842. // VS Texture Coordinate Register File
  843. // PS Reserved
  844. // [0x7] Reserved
  845. // [31] 0x1
  846. //
  847. // **** Source Parameter Token *****
  848. // [12:00] Register Number (offset in register file)
  849. // [13]
  850. // VS Relative Address
  851. // PS Reserved 0x0
  852. // [14:15]
  853. // VS Relative Address Register Component
  854. // PS Reserved 0x0
  855. // [23:16] Source Component Swizzle
  856. // [17:16] Component 0 Swizzle
  857. // [19:18] Component 1 Swizzle
  858. // [21:20] Component 2 Swizzle
  859. // [23:22] Component 3 Swizzle
  860. // [27:24] Source Modifier
  861. // [0x0] None
  862. // [0x1] Negate
  863. // [0x2] Bias
  864. // [0x3] Bias and Negate
  865. // [0x4] Sign (bx2)
  866. // [0x5] Sign (bx2) and Negate
  867. // [0x6] Complement
  868. // [0x7] x2
  869. // [0x8] x2 and Negate
  870. // [0x9-0xf] Reserved
  871. // [30:28] Register Type
  872. // [0x0] Temporary Register File
  873. // [0x1] Input Register File
  874. // [0x2] Constant Register File
  875. // [0x3] Texture/Addr Register File
  876. // [0x4-0x7] Reserved
  877. // [31] 0x1
  878. //
  879. // The exception for source parameter tokens is with the instruction:
  880. // D3DSIO_DEF c#,f0,f1,f2,f2
  881. // Here, the source parameter tokens (f#) are each taken as 32 bit floats.
  882. //
  883. ;end_internal
  884. //
  885. // Instruction Token Bit Definitions
  886. //
  887. #define D3DSI_OPCODE_MASK 0x0000FFFF
  888. typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE
  889. {
  890. D3DSIO_NOP = 0, // PS/VS
  891. D3DSIO_MOV , // PS/VS
  892. D3DSIO_ADD , // PS/VS
  893. D3DSIO_SUB , // PS
  894. D3DSIO_MAD , // PS/VS
  895. D3DSIO_MUL , // PS/VS
  896. D3DSIO_RCP , // VS
  897. D3DSIO_RSQ , // VS
  898. D3DSIO_DP3 , // PS/VS
  899. D3DSIO_DP4 , // PS/VS
  900. D3DSIO_MIN , // VS
  901. D3DSIO_MAX , // VS
  902. D3DSIO_SLT , // VS
  903. D3DSIO_SGE , // VS
  904. D3DSIO_EXP , // VS
  905. D3DSIO_LOG , // VS
  906. D3DSIO_LIT , // VS
  907. D3DSIO_DST , // VS
  908. D3DSIO_LRP , // PS
  909. D3DSIO_FRC , // VS
  910. D3DSIO_M4x4 , // VS
  911. D3DSIO_M4x3 , // VS
  912. D3DSIO_M3x4 , // VS
  913. D3DSIO_M3x3 , // VS
  914. D3DSIO_M3x2 , // VS
  915. D3DSIO_TEXCOORD = 64, // PS
  916. D3DSIO_TEXKILL , // PS
  917. D3DSIO_TEX , // PS
  918. D3DSIO_TEXBEM , // PS
  919. D3DSIO_TEXBEML , // PS
  920. D3DSIO_TEXREG2AR , // PS
  921. D3DSIO_TEXREG2GB , // PS
  922. D3DSIO_TEXM3x2PAD , // PS
  923. D3DSIO_TEXM3x2TEX , // PS
  924. D3DSIO_TEXM3x3PAD , // PS
  925. D3DSIO_TEXM3x3TEX , // PS
  926. D3DSIO_TEXM3x3DIFF , // PS
  927. D3DSIO_TEXM3x3SPEC , // PS
  928. D3DSIO_TEXM3x3VSPEC , // PS
  929. D3DSIO_EXPP , // VS
  930. D3DSIO_LOGP , // VS
  931. D3DSIO_CND , // PS
  932. D3DSIO_DEF , // PS
  933. D3DSIO_TEXREG2RGB , // PS
  934. D3DSIO_TEXDP3TEX , // PS
  935. D3DSIO_TEXM3x2DEPTH , // PS
  936. D3DSIO_TEXDP3 , // PS
  937. D3DSIO_TEXM3x3 , // PS
  938. D3DSIO_TEXDEPTH , // PS
  939. D3DSIO_CMP , // PS
  940. D3DSIO_BEM , // PS
  941. ;begin_internal
  942. D3DSIO_RESERVED0 = 96, // PS
  943. D3DSIO_RESERVED1 , // PS
  944. D3DSIO_RESERVED2 , // PS
  945. D3DSIO_RESERVED3 , // PS
  946. ;end_internal
  947. D3DSIO_PHASE = 0xFFFD,
  948. D3DSIO_COMMENT = 0xFFFE,
  949. D3DSIO_END = 0xFFFF,
  950. D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  951. } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
  952. //
  953. // Co-Issue Instruction Modifier - if set then this instruction is to be
  954. // issued in parallel with the previous instruction(s) for which this bit
  955. // is not set.
  956. //
  957. #define D3DSI_COISSUE 0x40000000
  958. //
  959. // Parameter Token Bit Definitions
  960. //
  961. #define D3DSP_REGNUM_MASK 0x00001FFF
  962. // destination parameter write mask
  963. #define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red)
  964. #define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green)
  965. #define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue)
  966. #define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha)
  967. #define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components
  968. // destination parameter modifiers
  969. #define D3DSP_DSTMOD_SHIFT 20
  970. #define D3DSP_DSTMOD_MASK 0x00F00000
  971. typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE
  972. {
  973. D3DSPDM_NONE = 0<<D3DSP_DSTMOD_SHIFT, // nop
  974. D3DSPDM_SATURATE= 1<<D3DSP_DSTMOD_SHIFT, // clamp to 0. to 1. range
  975. D3DSPDM_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  976. } D3DSHADER_PARAM_DSTMOD_TYPE;
  977. // destination parameter shift
  978. #define D3DSP_DSTSHIFT_SHIFT 24
  979. #define D3DSP_DSTSHIFT_MASK 0x0F000000
  980. // destination/source parameter register type
  981. #define D3DSP_REGTYPE_SHIFT 28
  982. #define D3DSP_REGTYPE_MASK 0x70000000
  983. typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
  984. {
  985. D3DSPR_TEMP = 0<<D3DSP_REGTYPE_SHIFT, // Temporary Register File
  986. D3DSPR_INPUT = 1<<D3DSP_REGTYPE_SHIFT, // Input Register File
  987. D3DSPR_CONST = 2<<D3DSP_REGTYPE_SHIFT, // Constant Register File
  988. D3DSPR_ADDR = 3<<D3DSP_REGTYPE_SHIFT, // Address Register (VS)
  989. D3DSPR_TEXTURE = 3<<D3DSP_REGTYPE_SHIFT, // Texture Register File (PS)
  990. D3DSPR_RASTOUT = 4<<D3DSP_REGTYPE_SHIFT, // Rasterizer Register File
  991. D3DSPR_ATTROUT = 5<<D3DSP_REGTYPE_SHIFT, // Attribute Output Register File
  992. D3DSPR_TEXCRDOUT= 6<<D3DSP_REGTYPE_SHIFT, // Texture Coordinate Output Register File
  993. D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  994. } D3DSHADER_PARAM_REGISTER_TYPE;
  995. // Register offsets in the Rasterizer Register File
  996. //
  997. typedef enum _D3DVS_RASTOUT_OFFSETS
  998. {
  999. D3DSRO_POSITION = 0,
  1000. D3DSRO_FOG,
  1001. D3DSRO_POINT_SIZE,
  1002. D3DSRO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  1003. } D3DVS_RASTOUT_OFFSETS;
  1004. // Source operand addressing modes
  1005. #define D3DVS_ADDRESSMODE_SHIFT 13
  1006. #define D3DVS_ADDRESSMODE_MASK (1 << D3DVS_ADDRESSMODE_SHIFT)
  1007. typedef enum _D3DVS_ADDRESSMODE_TYPE
  1008. {
  1009. D3DVS_ADDRMODE_ABSOLUTE = (0 << D3DVS_ADDRESSMODE_SHIFT),
  1010. D3DVS_ADDRMODE_RELATIVE = (1 << D3DVS_ADDRESSMODE_SHIFT), // Relative to register A0
  1011. D3DVS_ADDRMODE_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  1012. } D3DVS_ADDRESSMODE_TYPE;
  1013. // Source operand swizzle definitions
  1014. //
  1015. #define D3DVS_SWIZZLE_SHIFT 16
  1016. #define D3DVS_SWIZZLE_MASK 0x00FF0000
  1017. // The following bits define where to take component X from:
  1018. #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
  1019. #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
  1020. #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
  1021. #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
  1022. // The following bits define where to take component Y from:
  1023. #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
  1024. #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
  1025. #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
  1026. #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
  1027. // The following bits define where to take component Z from:
  1028. #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
  1029. #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
  1030. #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
  1031. #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
  1032. // The following bits define where to take component W from:
  1033. #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
  1034. #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
  1035. #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
  1036. #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
  1037. // Value when there is no swizzle (X is taken from X, Y is taken from Y,
  1038. // Z is taken from Z, W is taken from W
  1039. //
  1040. #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
  1041. // source parameter swizzle
  1042. #define D3DSP_SWIZZLE_SHIFT 16
  1043. #define D3DSP_SWIZZLE_MASK 0x00FF0000
  1044. #define D3DSP_NOSWIZZLE \
  1045. ( (0 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
  1046. (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
  1047. (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
  1048. (3 << (D3DSP_SWIZZLE_SHIFT + 6)) )
  1049. // pixel-shader swizzle ops
  1050. #define D3DSP_REPLICATERED \
  1051. ( (0 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
  1052. (0 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
  1053. (0 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
  1054. (0 << (D3DSP_SWIZZLE_SHIFT + 6)) )
  1055. #define D3DSP_REPLICATEGREEN \
  1056. ( (1 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
  1057. (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
  1058. (1 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
  1059. (1 << (D3DSP_SWIZZLE_SHIFT + 6)) )
  1060. #define D3DSP_REPLICATEBLUE \
  1061. ( (2 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
  1062. (2 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
  1063. (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
  1064. (2 << (D3DSP_SWIZZLE_SHIFT + 6)) )
  1065. #define D3DSP_REPLICATEALPHA \
  1066. ( (3 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
  1067. (3 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
  1068. (3 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
  1069. (3 << (D3DSP_SWIZZLE_SHIFT + 6)) )
  1070. // source parameter modifiers
  1071. #define D3DSP_SRCMOD_SHIFT 24
  1072. #define D3DSP_SRCMOD_MASK 0x0F000000
  1073. typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE
  1074. {
  1075. D3DSPSM_NONE = 0<<D3DSP_SRCMOD_SHIFT, // nop
  1076. D3DSPSM_NEG = 1<<D3DSP_SRCMOD_SHIFT, // negate
  1077. D3DSPSM_BIAS = 2<<D3DSP_SRCMOD_SHIFT, // bias
  1078. D3DSPSM_BIASNEG = 3<<D3DSP_SRCMOD_SHIFT, // bias and negate
  1079. D3DSPSM_SIGN = 4<<D3DSP_SRCMOD_SHIFT, // sign
  1080. D3DSPSM_SIGNNEG = 5<<D3DSP_SRCMOD_SHIFT, // sign and negate
  1081. D3DSPSM_COMP = 6<<D3DSP_SRCMOD_SHIFT, // complement
  1082. D3DSPSM_X2 = 7<<D3DSP_SRCMOD_SHIFT, // *2
  1083. D3DSPSM_X2NEG = 8<<D3DSP_SRCMOD_SHIFT, // *2 and negate
  1084. D3DSPSM_DZ = 9<<D3DSP_SRCMOD_SHIFT, // divide through by z component
  1085. D3DSPSM_DW = 10<<D3DSP_SRCMOD_SHIFT, // divide through by w component
  1086. D3DSPSM_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  1087. } D3DSHADER_PARAM_SRCMOD_TYPE;
  1088. // pixel shader version token
  1089. #define D3DPS_VERSION(_Major,_Minor) (0xFFFF0000|((_Major)<<8)|(_Minor))
  1090. // vertex shader version token
  1091. #define D3DVS_VERSION(_Major,_Minor) (0xFFFE0000|((_Major)<<8)|(_Minor))
  1092. // extract major/minor from version cap
  1093. #define D3DSHADER_VERSION_MAJOR(_Version) (((_Version)>>8)&0xFF)
  1094. #define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF)
  1095. // destination/source parameter register type
  1096. #define D3DSI_COMMENTSIZE_SHIFT 16
  1097. #define D3DSI_COMMENTSIZE_MASK 0x7FFF0000
  1098. #define D3DSHADER_COMMENT(_DWordSize) \
  1099. ((((_DWordSize)<<D3DSI_COMMENTSIZE_SHIFT)&D3DSI_COMMENTSIZE_MASK)|D3DSIO_COMMENT)
  1100. // pixel/vertex shader end token
  1101. #define D3DPS_END() 0x0000FFFF
  1102. #define D3DVS_END() 0x0000FFFF
  1103. //---------------------------------------------------------------------
  1104. // High order surfaces
  1105. //
  1106. typedef enum _D3DBASISTYPE
  1107. {
  1108. D3DBASIS_BEZIER = 0,
  1109. D3DBASIS_BSPLINE = 1,
  1110. D3DBASIS_INTERPOLATE = 2,
  1111. D3DBASIS_FORCE_DWORD = 0x7fffffff,
  1112. } D3DBASISTYPE;
  1113. typedef enum _D3DORDERTYPE
  1114. {
  1115. D3DORDER_LINEAR = 1,
  1116. D3DORDER_QUADRATIC = 2,
  1117. D3DORDER_CUBIC = 3,
  1118. D3DORDER_QUINTIC = 5,
  1119. D3DORDER_FORCE_DWORD = 0x7fffffff,
  1120. } D3DORDERTYPE;
  1121. typedef enum _D3DPATCHEDGESTYLE
  1122. {
  1123. D3DPATCHEDGE_DISCRETE = 0,
  1124. D3DPATCHEDGE_CONTINUOUS = 1,
  1125. D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
  1126. } D3DPATCHEDGESTYLE;
  1127. typedef enum _D3DSTATEBLOCKTYPE
  1128. {
  1129. D3DSBT_ALL = 1, // capture all state
  1130. D3DSBT_PIXELSTATE = 2, // capture pixel state
  1131. D3DSBT_VERTEXSTATE = 3, // capture vertex state
  1132. D3DSBT_FORCE_DWORD = 0x7fffffff,
  1133. } D3DSTATEBLOCKTYPE;
  1134. // The D3DVERTEXBLENDFLAGS type is used with D3DRS_VERTEXBLEND state.
  1135. //
  1136. typedef enum _D3DVERTEXBLENDFLAGS
  1137. {
  1138. D3DVBF_DISABLE = 0, // Disable vertex blending
  1139. D3DVBF_1WEIGHTS = 1, // 2 matrix blending
  1140. D3DVBF_2WEIGHTS = 2, // 3 matrix blending
  1141. D3DVBF_3WEIGHTS = 3, // 4 matrix blending
  1142. D3DVBF_TWEENING = 255, // blending using D3DRS_TWEENFACTOR
  1143. D3DVBF_0WEIGHTS = 256, // one matrix is used with weight 1.0
  1144. D3DVBF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
  1145. } D3DVERTEXBLENDFLAGS;
  1146. typedef enum _D3DTEXTURETRANSFORMFLAGS {
  1147. D3DTTFF_DISABLE = 0, // texture coordinates are passed directly
  1148. D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords
  1149. D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords
  1150. D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords
  1151. D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords
  1152. D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element
  1153. D3DTTFF_FORCE_DWORD = 0x7fffffff,
  1154. } D3DTEXTURETRANSFORMFLAGS;
  1155. // Macros to set texture coordinate format bits in the FVF id
  1156. #define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values
  1157. #define D3DFVF_TEXTUREFORMAT1 3 // One floating point value
  1158. #define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values
  1159. #define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values
  1160. #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
  1161. #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
  1162. #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
  1163. #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
  1164. #define D3DFVF_GETTEXCOORDSIZE(FVF, CoordIndex) ((FVF >> (CoordIndex*2 + 16)) & 0x3) ;internal
  1165. //---------------------------------------------------------------------
  1166. /* Direct3D8 Device types */
  1167. typedef enum _D3DDEVTYPE
  1168. {
  1169. D3DDEVTYPE_HAL = 1,
  1170. D3DDEVTYPE_REF = 2,
  1171. D3DDEVTYPE_SW = 3,
  1172. D3DDEVTYPE_FORCE_DWORD = 0x7fffffff
  1173. } D3DDEVTYPE;
  1174. /* Multi-Sample buffer types */
  1175. typedef enum _D3DMULTISAMPLE_TYPE
  1176. {
  1177. D3DMULTISAMPLE_NONE = 0,
  1178. D3DMULTISAMPLE_2_SAMPLES = 2,
  1179. D3DMULTISAMPLE_3_SAMPLES = 3,
  1180. D3DMULTISAMPLE_4_SAMPLES = 4,
  1181. D3DMULTISAMPLE_5_SAMPLES = 5,
  1182. D3DMULTISAMPLE_6_SAMPLES = 6,
  1183. D3DMULTISAMPLE_7_SAMPLES = 7,
  1184. D3DMULTISAMPLE_8_SAMPLES = 8,
  1185. D3DMULTISAMPLE_9_SAMPLES = 9,
  1186. D3DMULTISAMPLE_10_SAMPLES = 10,
  1187. D3DMULTISAMPLE_11_SAMPLES = 11,
  1188. D3DMULTISAMPLE_12_SAMPLES = 12,
  1189. D3DMULTISAMPLE_13_SAMPLES = 13,
  1190. D3DMULTISAMPLE_14_SAMPLES = 14,
  1191. D3DMULTISAMPLE_15_SAMPLES = 15,
  1192. D3DMULTISAMPLE_16_SAMPLES = 16,
  1193. D3DMULTISAMPLE_FORCE_DWORD = 0x7fffffff
  1194. } D3DMULTISAMPLE_TYPE;
  1195. /* Formats
  1196. * Most of these names have the following convention:
  1197. * A = Alpha
  1198. * R = Red
  1199. * G = Green
  1200. * B = Blue
  1201. * X = Unused Bits
  1202. * P = Palette
  1203. * L = Luminance
  1204. * U = dU coordinate for BumpMap
  1205. * V = dV coordinate for BumpMap
  1206. * S = Stencil
  1207. * D = Depth (e.g. Z or W buffer)
  1208. *
  1209. * Further, the order of the pieces are from MSB first; hence
  1210. * D3DFMT_A8L8 indicates that the high byte of this two byte
  1211. * format is alpha.
  1212. *
  1213. * D16 indicates:
  1214. * - An integer 16-bit value.
  1215. * - An app-lockable surface.
  1216. *
  1217. * All Depth/Stencil formats except D3DFMT_D16_LOCKABLE indicate:
  1218. * - no particular bit ordering per pixel, and
  1219. * - are not app lockable, and
  1220. * - the driver is allowed to consume more than the indicated
  1221. * number of bits per Depth channel (but not Stencil channel).
  1222. */
  1223. #ifndef MAKEFOURCC
  1224. #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
  1225. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  1226. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  1227. #endif /* defined(MAKEFOURCC) */
  1228. typedef enum _D3DFORMAT
  1229. {
  1230. /* Unspecified format */ ;internal
  1231. D3DFMT_UNKNOWN = 0,
  1232. /* RGB(A) formats */ ;internal
  1233. D3DFMT_R8G8B8 = 20,
  1234. D3DFMT_A8R8G8B8 = 21,
  1235. D3DFMT_X8R8G8B8 = 22,
  1236. D3DFMT_R5G6B5 = 23,
  1237. D3DFMT_X1R5G5B5 = 24,
  1238. D3DFMT_A1R5G5B5 = 25,
  1239. D3DFMT_A4R4G4B4 = 26,
  1240. D3DFMT_R3G3B2 = 27,
  1241. D3DFMT_A8 = 28,
  1242. D3DFMT_A8R3G3B2 = 29,
  1243. D3DFMT_X4R4G4B4 = 30,
  1244. D3DFMT_A2B10G10R10 = 31,
  1245. D3DFMT_A8B8G8R8 = 32, ;internal
  1246. D3DFMT_X8B8G8R8 = 33, ;internal
  1247. D3DFMT_G16R16 = 34,
  1248. /* Palettized formats */ ;internal
  1249. D3DFMT_A8P8 = 40,
  1250. D3DFMT_P8 = 41,
  1251. /* Luminance Formats */ ;internal
  1252. D3DFMT_L8 = 50,
  1253. D3DFMT_A8L8 = 51,
  1254. D3DFMT_A4L4 = 52,
  1255. /* Bump/Signed Formats */ ;internal
  1256. D3DFMT_V8U8 = 60,
  1257. D3DFMT_L6V5U5 = 61,
  1258. D3DFMT_X8L8V8U8 = 62,
  1259. D3DFMT_Q8W8V8U8 = 63,
  1260. D3DFMT_V16U16 = 64,
  1261. D3DFMT_W11V11U10 = 65,
  1262. D3DFMT_W10V11U11 = 66, ;internal
  1263. D3DFMT_A2W10V10U10 = 67,
  1264. D3DFMT_A8X8V8U8 = 68, ;internal
  1265. D3DFMT_L8X8V8U8 = 69, ;internal
  1266. /* FourCC formats */ ;internal
  1267. D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
  1268. D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
  1269. D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
  1270. D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
  1271. D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
  1272. D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
  1273. D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
  1274. /* Z Formats */ ;internal
  1275. D3DFMT_D16_LOCKABLE = 70,
  1276. D3DFMT_D32 = 71,
  1277. D3DFMT_D15S1 = 73,
  1278. D3DFMT_D24S8 = 75,
  1279. D3DFMT_D16 = 80,
  1280. D3DFMT_D24X8 = 77,
  1281. D3DFMT_D24X4S4 = 79,
  1282. /* These are additional explicit Z formats that the driver can report, */ ;internal
  1283. /* but are not API visible. */ ;internal
  1284. /* NOTE!:: Must be kept in sync w/ DWORD defns in ddrawi.h and ddrawint.h*/ ;internal
  1285. /* NOTE!:: These must be kept in sync w/ defns in d3dhal.h */ ;internal
  1286. D3DFMT_S1D15 = 72, ;internal
  1287. D3DFMT_S8D24 = 74, ;internal
  1288. D3DFMT_X8D24 = 76, ;internal
  1289. D3DFMT_X4S4D24 = 78, ;internal
  1290. D3DFMT_VERTEXDATA =100,
  1291. D3DFMT_INDEX16 =101,
  1292. D3DFMT_INDEX32 =102,
  1293. D3DFMT_FORCE_DWORD =0x7fffffff
  1294. } D3DFORMAT;
  1295. /* Display Modes */
  1296. typedef struct _D3DDISPLAYMODE
  1297. {
  1298. UINT Width;
  1299. UINT Height;
  1300. UINT RefreshRate;
  1301. D3DFORMAT Format;
  1302. } D3DDISPLAYMODE;
  1303. /* Creation Parameters */
  1304. typedef struct _D3DDEVICE_CREATION_PARAMETERS
  1305. {
  1306. UINT AdapterOrdinal;
  1307. D3DDEVTYPE DeviceType;
  1308. HWND hFocusWindow;
  1309. DWORD BehaviorFlags;
  1310. } D3DDEVICE_CREATION_PARAMETERS;
  1311. /* SwapEffects */
  1312. typedef enum _D3DSWAPEFFECT
  1313. {
  1314. D3DSWAPEFFECT_DISCARD = 1,
  1315. D3DSWAPEFFECT_FLIP = 2,
  1316. D3DSWAPEFFECT_COPY = 3,
  1317. D3DSWAPEFFECT_COPY_VSYNC = 4,
  1318. // Internal types numbered backwards ;internal
  1319. D3DSWAPEFFECT_NO_PRESENT = 0x40000000, ;internal
  1320. D3DSWAPEFFECT_FORCE_DWORD = 0x7fffffff
  1321. } D3DSWAPEFFECT;
  1322. /* Pool types */
  1323. typedef enum _D3DPOOL {
  1324. D3DPOOL_DEFAULT = 0,
  1325. D3DPOOL_MANAGED = 1,
  1326. D3DPOOL_SYSTEMMEM = 2,
  1327. D3DPOOL_SCRATCH = 3,
  1328. D3DPOOL_LOCALVIDMEM = 4, ;internal
  1329. D3DPOOL_NONLOCALVIDMEM = 5, ;internal
  1330. D3DPOOL_FORCE_DWORD = 0x7fffffff
  1331. } D3DPOOL;
  1332. #define VALID_POOL(pool) ((UINT)(pool) <= D3DPOOL_SCRATCH) ;internal
  1333. #define VALID_INTERNAL_POOL(pool) ((UINT)(pool) <= D3DPOOL_NONLOCALVIDMEM) ;internal
  1334. #define IS_D3D_ALLOCATED_POOL(Pool) ((Pool == D3DPOOL_SYSTEMMEM) || (Pool == D3DPOOL_SCRATCH)) ;internal
  1335. /* RefreshRate pre-defines */
  1336. #define D3DPRESENT_RATE_DEFAULT 0x00000000
  1337. #define D3DPRESENT_RATE_UNLIMITED 0x7fffffff
  1338. /* Resize Optional Parameters */
  1339. typedef struct _D3DPRESENT_PARAMETERS_
  1340. {
  1341. UINT BackBufferWidth;
  1342. UINT BackBufferHeight;
  1343. D3DFORMAT BackBufferFormat;
  1344. UINT BackBufferCount;
  1345. D3DMULTISAMPLE_TYPE MultiSampleType;
  1346. D3DSWAPEFFECT SwapEffect;
  1347. HWND hDeviceWindow;
  1348. BOOL Windowed;
  1349. BOOL EnableAutoDepthStencil;
  1350. D3DFORMAT AutoDepthStencilFormat;
  1351. DWORD Flags;
  1352. /* Following elements must be zero for Windowed mode */
  1353. UINT FullScreen_RefreshRateInHz;
  1354. UINT FullScreen_PresentationInterval;
  1355. } D3DPRESENT_PARAMETERS;
  1356. // Values for D3DPRESENT_PARAMETERS.Flags
  1357. #define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001
  1358. /* Gamma Ramp: Same as DX7 */
  1359. typedef struct _D3DGAMMARAMP
  1360. {
  1361. WORD red [256];
  1362. WORD green[256];
  1363. WORD blue [256];
  1364. } D3DGAMMARAMP;
  1365. /* Back buffer types */
  1366. typedef enum _D3DBACKBUFFER_TYPE
  1367. {
  1368. D3DBACKBUFFER_TYPE_MONO = 0,
  1369. D3DBACKBUFFER_TYPE_LEFT = 1,
  1370. D3DBACKBUFFER_TYPE_RIGHT = 2,
  1371. D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
  1372. } D3DBACKBUFFER_TYPE;
  1373. /* Types */
  1374. typedef enum _D3DRESOURCETYPE {
  1375. D3DRTYPE_SURFACE = 1,
  1376. D3DRTYPE_VOLUME = 2,
  1377. D3DRTYPE_TEXTURE = 3,
  1378. D3DRTYPE_VOLUMETEXTURE = 4,
  1379. D3DRTYPE_CUBETEXTURE = 5,
  1380. D3DRTYPE_VERTEXBUFFER = 6,
  1381. D3DRTYPE_INDEXBUFFER = 7,
  1382. // Internal types numbered backwards from 255 ;internal
  1383. D3DRTYPE_IMAGESURFACE =254, ;internal
  1384. D3DRTYPE_COMMANDBUFFER =255, ;internal
  1385. D3DRTYPE_FORCE_DWORD = 0x7fffffff
  1386. } D3DRESOURCETYPE;
  1387. /* Usages */
  1388. #define D3DUSAGE_RENDERTARGET (0x00000001L)
  1389. #define D3DUSAGE_DEPTHSTENCIL (0x00000002L)
  1390. /* Usages for Vertex/Index buffers */
  1391. #define D3DUSAGE_WRITEONLY (0x00000008L)
  1392. #define D3DUSAGE_SOFTWAREPROCESSING (0x00000010L)
  1393. #define D3DUSAGE_DONOTCLIP (0x00000020L)
  1394. #define D3DUSAGE_POINTS (0x00000040L)
  1395. #define D3DUSAGE_RTPATCHES (0x00000080L)
  1396. #define D3DUSAGE_NPATCHES (0x00000100L)
  1397. #define D3DUSAGE_DYNAMIC (0x00000200L)
  1398. ;begin_internal
  1399. //OR of all publicly visible usage bits. Used in methods like GetDesc to mask off internal flags
  1400. #define D3DUSAGE_EXTERNAL \
  1401. (D3DUSAGE_RENDERTARGET |\
  1402. D3DUSAGE_DEPTHSTENCIL |\
  1403. D3DUSAGE_WRITEONLY |\
  1404. D3DUSAGE_SOFTWAREPROCESSING |\
  1405. D3DUSAGE_DONOTCLIP |\
  1406. D3DUSAGE_POINTS |\
  1407. D3DUSAGE_RTPATCHES |\
  1408. D3DUSAGE_NPATCHES |\
  1409. D3DUSAGE_DYNAMIC)
  1410. ;end_internal
  1411. /* Internal Usages */ ;internal
  1412. // Note: when we turn LoadOnce on again, we should update DPF_EXPLAIN_BAD_LOCK_FLAGS ; internal
  1413. #define D3DUSAGE_LOADONCE (0x00000004L) ;internal
  1414. #define D3DUSAGE_ALPHACHANNEL (0x01000000L) ;internal
  1415. #define D3DUSAGE_DISCARD (0x02000000L) ;internal
  1416. #define D3DUSAGE_LOCK (0x04000000L) ;internal
  1417. #define D3DUSAGE_TEXTURE (0x08000000L) ;internal
  1418. #define D3DUSAGE_BACKBUFFER (0x10000000L) ;internal
  1419. #define D3DUSAGE_INTERNALBUFFER (0x20000000L) ;internal
  1420. #define D3DUSAGE_OFFSCREENPLAIN (0x40000000L) ;internal
  1421. #define D3DUSAGE_PRIMARYSURFACE (0x80000000L) ;internal
  1422. /* Useful masks for usages */ ;internal
  1423. #define D3DUSAGE_TEXTURE_VALID (D3DUSAGE_RENDERTARGET | \ ;internal
  1424. D3DUSAGE_DEPTHSTENCIL | \ ;internal
  1425. D3DUSAGE_DYNAMIC) ;internal
  1426. #define D3DUSAGE_CUBETEXTURE_VALID (D3DUSAGE_TEXTURE_VALID) ;internal
  1427. #define D3DUSAGE_VOLUMETEXTURE_VALID (D3DUSAGE_DYNAMIC) ;internal
  1428. /* Flags valid for render-targets and zbuffers */ ;internal
  1429. #define D3DUSAGE_SURFACE_VALID (D3DUSAGE_RENDERTARGET | \ ;internal
  1430. D3DUSAGE_DEPTHSTENCIL) ;internal
  1431. /* Flags valid for vertexbuffers and indexbuffers */ ;internal
  1432. #define D3DUSAGE_VB_VALID (D3DUSAGE_WRITEONLY | \ ;internal
  1433. D3DUSAGE_SOFTWAREPROCESSING| \ ;internal
  1434. D3DUSAGE_POINTS | \ ;internal
  1435. D3DUSAGE_RTPATCHES | \ ;internal
  1436. D3DUSAGE_NPATCHES | \ ;internal
  1437. D3DUSAGE_DONOTCLIP | \ ;internal
  1438. D3DUSAGE_DYNAMIC) ;internal
  1439. #define D3DUSAGE_IB_VALID (D3DUSAGE_VB_VALID) ;internal
  1440. /* CubeMap Face identifiers */
  1441. typedef enum _D3DCUBEMAP_FACES
  1442. {
  1443. D3DCUBEMAP_FACE_POSITIVE_X = 0,
  1444. D3DCUBEMAP_FACE_NEGATIVE_X = 1,
  1445. D3DCUBEMAP_FACE_POSITIVE_Y = 2,
  1446. D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
  1447. D3DCUBEMAP_FACE_POSITIVE_Z = 4,
  1448. D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
  1449. D3DCUBEMAP_FACE_FORCE_DWORD = 0x7fffffff
  1450. } D3DCUBEMAP_FACES;
  1451. #define VALID_CUBEMAP_FACETYPE(face) ((UINT)face < 6) ;internal
  1452. /* Lock flags */
  1453. /* These values are chosen so that people who pass */ ;internal
  1454. /* DDLOCK_ flags aren't broken; also so we don't have */ ;internal
  1455. /* to translate flags to the driver */ ;internal
  1456. #define D3DLOCK_READONLY 0x00000010L
  1457. #define D3DLOCK_DISCARD 0x00002000L
  1458. #define D3DLOCK_NOOVERWRITE 0x00001000L
  1459. #define D3DLOCK_NOSYSLOCK 0x00000800L
  1460. /* This is a new flag for DX8*/ ;internal
  1461. #define D3DLOCK_NO_DIRTY_UPDATE 0x00008000L
  1462. #define D3DLOCK_VALID (D3DLOCK_READONLY | \ ;internal
  1463. D3DLOCK_DISCARD | \ ;internal
  1464. D3DLOCK_NOOVERWRITE | \ ;internal
  1465. D3DLOCK_NOSYSLOCK | \ ;internal
  1466. D3DLOCK_NO_DIRTY_UPDATE) ;internal
  1467. #define D3DLOCK_SURF_VALID (D3DLOCK_READONLY | \ ;internal
  1468. D3DLOCK_NOSYSLOCK | \ ;internal
  1469. D3DLOCK_NO_DIRTY_UPDATE) ;internal
  1470. #define D3DLOCK_VOL_VALID (D3DLOCK_SURF_VALID) ;internal
  1471. ;begin_internal
  1472. #define DPF_EXPLAIN_BAD_LOCK_FLAGS(level, flags) \
  1473. if (flags & D3DLOCK_NOOVERWRITE) { \
  1474. DPF(level, " D3DLOCK_NOOVERWRITE is only valid for vertex and index buffers."); \
  1475. }
  1476. ;end_internal
  1477. typedef struct _D3DBUFFER_DESC ;internal
  1478. { ;internal
  1479. D3DFORMAT Format; ;internal
  1480. D3DRESOURCETYPE Type; ;internal
  1481. DWORD Usage; ;internal
  1482. D3DPOOL Pool; ;internal
  1483. UINT Size; ;internal
  1484. } D3DBUFFER_DESC; ;internal
  1485. /* Vertex Buffer Description */
  1486. typedef struct _D3DVERTEXBUFFER_DESC
  1487. {
  1488. D3DFORMAT Format;
  1489. D3DRESOURCETYPE Type;
  1490. DWORD Usage;
  1491. D3DPOOL Pool;
  1492. UINT Size;
  1493. DWORD FVF;
  1494. } D3DVERTEXBUFFER_DESC;
  1495. /* Index Buffer Description */
  1496. typedef struct _D3DINDEXBUFFER_DESC
  1497. {
  1498. D3DFORMAT Format;
  1499. D3DRESOURCETYPE Type;
  1500. DWORD Usage;
  1501. D3DPOOL Pool;
  1502. UINT Size;
  1503. } D3DINDEXBUFFER_DESC;
  1504. /* Surface Description */
  1505. typedef struct _D3DSURFACE_DESC
  1506. {
  1507. D3DFORMAT Format;
  1508. D3DRESOURCETYPE Type;
  1509. DWORD Usage;
  1510. D3DPOOL Pool;
  1511. UINT Size;
  1512. D3DMULTISAMPLE_TYPE MultiSampleType;
  1513. UINT Width;
  1514. UINT Height;
  1515. } D3DSURFACE_DESC;
  1516. typedef struct _D3DVOLUME_DESC
  1517. {
  1518. D3DFORMAT Format;
  1519. D3DRESOURCETYPE Type;
  1520. DWORD Usage;
  1521. D3DPOOL Pool;
  1522. UINT Size;
  1523. UINT Width;
  1524. UINT Height;
  1525. UINT Depth;
  1526. } D3DVOLUME_DESC;
  1527. /* Structure for LockRect */
  1528. typedef struct _D3DLOCKED_RECT
  1529. {
  1530. INT Pitch;
  1531. void* pBits;
  1532. } D3DLOCKED_RECT;
  1533. /* Structures for LockBox */
  1534. typedef struct _D3DBOX
  1535. {
  1536. UINT Left;
  1537. UINT Top;
  1538. UINT Right;
  1539. UINT Bottom;
  1540. UINT Front;
  1541. UINT Back;
  1542. } D3DBOX;
  1543. typedef struct _D3DLOCKED_BOX
  1544. {
  1545. INT RowPitch;
  1546. INT SlicePitch;
  1547. void* pBits;
  1548. } D3DLOCKED_BOX;
  1549. /* Structures for LockRange */
  1550. typedef struct _D3DRANGE
  1551. {
  1552. UINT Offset;
  1553. UINT Size;
  1554. } D3DRANGE;
  1555. /* Structures for high order primitives */
  1556. typedef struct _D3DRECTPATCH_INFO
  1557. {
  1558. UINT StartVertexOffsetWidth;
  1559. UINT StartVertexOffsetHeight;
  1560. UINT Width;
  1561. UINT Height;
  1562. UINT Stride;
  1563. D3DBASISTYPE Basis;
  1564. D3DORDERTYPE Order;
  1565. } D3DRECTPATCH_INFO;
  1566. typedef struct _D3DTRIPATCH_INFO
  1567. {
  1568. UINT StartVertexOffset;
  1569. UINT NumVertices;
  1570. D3DBASISTYPE Basis;
  1571. D3DORDERTYPE Order;
  1572. } D3DTRIPATCH_INFO;
  1573. /* Adapter Identifier */
  1574. /* Length must be same as MAX_DDDEVICEID_STRING */ ;internal
  1575. #define MAX_DEVICE_IDENTIFIER_STRING 512
  1576. typedef struct _D3DADAPTER_IDENTIFIER8
  1577. {
  1578. char Driver[MAX_DEVICE_IDENTIFIER_STRING];
  1579. char Description[MAX_DEVICE_IDENTIFIER_STRING];
  1580. #ifdef _WIN32
  1581. LARGE_INTEGER DriverVersion; /* Defined for 32 bit components */
  1582. #else
  1583. DWORD DriverVersionLowPart; /* Defined for 16 bit driver components */
  1584. DWORD DriverVersionHighPart;
  1585. #endif
  1586. DWORD VendorId;
  1587. DWORD DeviceId;
  1588. DWORD SubSysId;
  1589. DWORD Revision;
  1590. GUID DeviceIdentifier;
  1591. DWORD WHQLLevel;
  1592. } D3DADAPTER_IDENTIFIER8;
  1593. /* Raster Status structure returned by GetRasterStatus */
  1594. typedef struct _D3DRASTER_STATUS
  1595. {
  1596. BOOL InVBlank;
  1597. UINT ScanLine;
  1598. } D3DRASTER_STATUS;
  1599. ;begin_internal
  1600. typedef enum
  1601. {
  1602. D3DDDITYPE_NULL = 0, // Unknown/Latest
  1603. D3DDDITYPE_DX3 = 1, // DX3 HAL
  1604. D3DDDITYPE_DX5 = 2, // DX5 HAL
  1605. D3DDDITYPE_DX6 = 3, // DX6 HAL
  1606. D3DDDITYPE_DX7 = 4, // DX7 HAL w/out T&L, with state sets
  1607. D3DDDITYPE_DX7TL = 5,
  1608. D3DDDITYPE_DX8 = 6, // DX8 HAL w/out T&L
  1609. D3DDDITYPE_DX8TL = 7,
  1610. D3DDDITYPE_FORCE_DWORD = 0x7fffffff
  1611. } D3DDDITYPE;
  1612. ;end_internal
  1613. /* Debug monitor tokens (DEBUG only)
  1614. Note that if D3DRS_DEBUGMONITORTOKEN is set, the call is treated as
  1615. passing a token to the debug monitor. For example, if, after passing
  1616. D3DDMT_ENABLE/DISABLE to D3DRS_DEBUGMONITORTOKEN other token values
  1617. are passed in, the enabled/disabled state of the debug
  1618. monitor will still persist.
  1619. The debug monitor defaults to enabled.
  1620. Calling GetRenderState on D3DRS_DEBUGMONITORTOKEN is not of any use.
  1621. */
  1622. typedef enum _D3DDEBUGMONITORTOKENS {
  1623. D3DDMT_ENABLE = 0, // enable debug monitor
  1624. D3DDMT_DISABLE = 1, // disable debug monitor
  1625. D3DDMT_FORCE_DWORD = 0x7fffffff,
  1626. } D3DDEBUGMONITORTOKENS;
  1627. ;begin_internal
  1628. // To be used with GetInfo()
  1629. #define D3DDEVINFOID_VCACHE 4
  1630. typedef struct _D3DDEVINFO_VCACHE {
  1631. DWORD Pattern; /* bit pattern, return value must be FOUR_CC(�C�, �A�, �C�, �H�) */
  1632. DWORD OptMethod; /* optimization method 0 means longest strips, 1 means vertex cache based */
  1633. DWORD CacheSize; /* cache size to optimize for (only required if type is 1) */
  1634. DWORD MagicNumber; /* used to determine when to restart strips (only required if type is 1)*/
  1635. } D3DDEVINFO_VCACHE, *LPD3DDEVINFO_VCACHE;
  1636. ;end_internal
  1637. #pragma pack()
  1638. #pragma warning(default:4201)
  1639. #endif /* (DIRECT3D_VERSION >= 0x0800) */
  1640. #endif /* _D3D8TYPES(P)_H_ */