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.

1453 lines
56 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: d3dnthal.h
  6. * Content: Direct3D HAL include file for NT
  7. *
  8. ***************************************************************************/
  9. #ifndef _D3DNTHAL_H_
  10. #define _D3DNTHAL_H_
  11. #include <ddrawint.h>
  12. #ifndef _WINDOWS_
  13. #define _WINDOWS_
  14. #include <d3dtypes.h>
  15. #include <d3dcaps.h>
  16. #undef _WINDOWS_
  17. #else
  18. #include <d3dtypes.h>
  19. #include <d3dcaps.h>
  20. #endif
  21. /*
  22. * If the HAL driver does not implement clipping, it must reserve at least
  23. * this much space at the end of the LocalVertexBuffer for use by the HEL
  24. * clipping. I.e. the vertex buffer contain dwNumVertices+dwNumClipVertices
  25. * vertices. No extra space is needed by the HEL clipping in the
  26. * LocalHVertexBuffer.
  27. */
  28. #define D3DNTHAL_NUMCLIPVERTICES 20
  29. /*
  30. * If no dwNumVertices is given, this is what will be used.
  31. */
  32. #define D3DNTHAL_DEFAULT_TL_NUM ((32 * 1024) / sizeof (D3DTLVERTEX))
  33. #define D3DNTHAL_DEFAULT_H_NUM ((32 * 1024) / sizeof (D3DHVERTEX))
  34. /*
  35. * Description for a device.
  36. * This is used to describe a device that is to be created or to query
  37. * the current device.
  38. *
  39. * For DX5 and subsequent runtimes, D3DNTDEVICEDESC is a user-visible
  40. * structure that is not seen by the device drivers. The runtime
  41. * stitches a D3DNTDEVICEDESC together using the D3DNTDEVICEDESC_V1
  42. * embedded in the GLOBALDRIVERDATA and the extended caps queried
  43. * from the driver using GetDriverInfo.
  44. */
  45. typedef struct _D3DNTHALDeviceDesc_V1 {
  46. DWORD dwSize; // Size of D3DNTHALDEVICEDESC_V1 structure
  47. DWORD dwFlags; // Indicates which fields have valid data
  48. D3DCOLORMODEL dcmColorModel; // Color model of device
  49. DWORD dwDevCaps; // Capabilities of device
  50. D3DTRANSFORMCAPS dtcTransformCaps; // Capabilities of transform
  51. BOOL bClipping; // Device can do 3D clipping
  52. D3DLIGHTINGCAPS dlcLightingCaps; // Capabilities of lighting
  53. D3DPRIMCAPS dpcLineCaps;
  54. D3DPRIMCAPS dpcTriCaps;
  55. DWORD dwDeviceRenderBitDepth; // One of DDBB_8, 16, etc..
  56. DWORD dwDeviceZBufferBitDepth; // One of DDBD_16, 32, etc..
  57. DWORD dwMaxBufferSize; // Maximum execute buffer size
  58. DWORD dwMaxVertexCount; // Maximum vertex count
  59. } D3DNTHALDEVICEDESC_V1, *LPD3DNTHALDEVICEDESC_V1;
  60. #define D3DNTHALDEVICEDESCSIZE_V1 (sizeof(D3DNTHALDEVICEDESC_V1))
  61. /*
  62. * This is equivalent to the D3DNTDEVICEDESC understood by DX5, available only
  63. * from DX6. It is the same as D3DNTDEVICEDESC structure in DX5.
  64. * D3DNTDEVICEDESC is still the user-visible structure that is not seen by the
  65. * device drivers. The runtime stitches a D3DNTDEVICEDESC together using the
  66. * D3DNTDEVICEDESC_V1 embedded in the GLOBALDRIVERDATA and the extended caps
  67. * queried from the driver using GetDriverInfo.
  68. */
  69. typedef struct _D3DNTHALDeviceDesc_V2 {
  70. DWORD dwSize; // Size of D3DNTDEVICEDESC structure
  71. DWORD dwFlags; // Indicates which fields have valid data
  72. D3DCOLORMODEL dcmColorModel; // Color model of device
  73. DWORD dwDevCaps; // Capabilities of device
  74. D3DTRANSFORMCAPS dtcTransformCaps; // Capabilities of transform
  75. BOOL bClipping; // Device can do 3D clipping
  76. D3DLIGHTINGCAPS dlcLightingCaps; // Capabilities of lighting
  77. D3DPRIMCAPS dpcLineCaps;
  78. D3DPRIMCAPS dpcTriCaps;
  79. DWORD dwDeviceRenderBitDepth; // One of DDBD_16, etc..
  80. DWORD dwDeviceZBufferBitDepth; // One of DDBD_16, 32, etc..
  81. DWORD dwMaxBufferSize; // Maximum execute buffer size
  82. DWORD dwMaxVertexCount; // Maximum vertex count
  83. DWORD dwMinTextureWidth, dwMinTextureHeight;
  84. DWORD dwMaxTextureWidth, dwMaxTextureHeight;
  85. DWORD dwMinStippleWidth, dwMaxStippleWidth;
  86. DWORD dwMinStippleHeight, dwMaxStippleHeight;
  87. } D3DNTHALDEVICEDESC_V2, *LPD3DNTHALDEVICEDESC_V2;
  88. #define D3DNTHALDEVICEDESCSIZE_V2 (sizeof(D3DNTHALDEVICEDESC_V2))
  89. #if(DIRECT3D_VERSION >= 0x0700)
  90. /*
  91. * This is equivalent to the D3DNTDEVICEDESC understood by DX6, available only
  92. * from DX6. It is the same as D3DNTDEVICEDESC structure in DX6.
  93. * D3DNTDEVICEDESC is still the user-visible structure that is not seen by the
  94. * device drivers. The runtime stitches a D3DNTDEVICEDESC together using the
  95. * D3DNTDEVICEDESC_V1 embedded in the GLOBALDRIVERDATA and the extended caps
  96. * queried from the driver using GetDriverInfo.
  97. */
  98. typedef struct _D3DNTDeviceDesc_V3 {
  99. DWORD dwSize; // Size of D3DNTDEVICEDESC structure
  100. DWORD dwFlags; // Indicates which fields have valid data
  101. D3DCOLORMODEL dcmColorModel; // Color model of device
  102. DWORD dwDevCaps; // Capabilities of device
  103. D3DTRANSFORMCAPS dtcTransformCaps; // Capabilities of transform
  104. BOOL bClipping; // Device can do 3D clipping
  105. D3DLIGHTINGCAPS dlcLightingCaps; // Capabilities of lighting
  106. D3DPRIMCAPS dpcLineCaps;
  107. D3DPRIMCAPS dpcTriCaps;
  108. DWORD dwDeviceRenderBitDepth; // One of DDBD_16, etc..
  109. DWORD dwDeviceZBufferBitDepth; // One of DDBD_16, 32, etc..
  110. DWORD dwMaxBufferSize; // Maximum execute buffer size
  111. DWORD dwMaxVertexCount; // Maximum vertex count
  112. DWORD dwMinTextureWidth, dwMinTextureHeight;
  113. DWORD dwMaxTextureWidth, dwMaxTextureHeight;
  114. DWORD dwMinStippleWidth, dwMaxStippleWidth;
  115. DWORD dwMinStippleHeight, dwMaxStippleHeight;
  116. DWORD dwMaxTextureRepeat;
  117. DWORD dwMaxTextureAspectRatio;
  118. DWORD dwMaxAnisotropy;
  119. D3DVALUE dvGuardBandLeft;
  120. D3DVALUE dvGuardBandTop;
  121. D3DVALUE dvGuardBandRight;
  122. D3DVALUE dvGuardBandBottom;
  123. D3DVALUE dvExtentsAdjust;
  124. DWORD dwStencilCaps;
  125. DWORD dwFVFCaps; // low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware
  126. DWORD dwTextureOpCaps;
  127. WORD wMaxTextureBlendStages;
  128. WORD wMaxSimultaneousTextures;
  129. } D3DNTDEVICEDESC_V3, *LPD3DNTDEVICEDESC_V3;
  130. #define D3DNTDEVICEDESCSIZE_V3 (sizeof(D3DNTDEVICEDESC_V3))
  131. #endif /* DIRECT3D_VERSION >= 0x0700 */
  132. /* --------------------------------------------------------------
  133. * Instantiated by the HAL driver on driver connection.
  134. *
  135. * Regarding dwNumVertices, specify 0 if you are relying on the HEL to do
  136. * everything and you do not need the resultant TLVertex buffer to reside
  137. * in device memory.
  138. * The HAL driver will be asked to allocate dwNumVertices + dwNumClipVertices
  139. * in the case described above.
  140. */
  141. typedef struct _D3DNTHAL_GLOBALDRIVERDATA {
  142. DWORD dwSize; // Size of this structure
  143. D3DNTHALDEVICEDESC_V1 hwCaps; // Capabilities of the hardware
  144. DWORD dwNumVertices; // see following comment
  145. DWORD dwNumClipVertices; // see following comment
  146. DWORD dwNumTextureFormats; // Number of texture formats
  147. LPDDSURFACEDESC lpTextureFormats; // Pointer to texture formats
  148. } D3DNTHAL_GLOBALDRIVERDATA;
  149. typedef D3DNTHAL_GLOBALDRIVERDATA *LPD3DNTHAL_GLOBALDRIVERDATA;
  150. #define D3DNTHAL_GLOBALDRIVERDATASIZE (sizeof(D3DNTHAL_GLOBALDRIVERDATA))
  151. #if(DIRECT3D_VERSION >= 0x0700)
  152. /* --------------------------------------------------------------
  153. * Extended caps introduced with DX5 and queried with
  154. * GetDriverInfo (GUID_D3DExtendedCaps).
  155. */
  156. typedef struct _D3DNTHAL_D3DDX6EXTENDEDCAPS {
  157. DWORD dwSize; // Size of this structure
  158. DWORD dwMinTextureWidth, dwMaxTextureWidth;
  159. DWORD dwMinTextureHeight, dwMaxTextureHeight;
  160. DWORD dwMinStippleWidth, dwMaxStippleWidth;
  161. DWORD dwMinStippleHeight, dwMaxStippleHeight;
  162. // fields added for DX6
  163. DWORD dwMaxTextureRepeat;
  164. DWORD dwMaxTextureAspectRatio;
  165. DWORD dwMaxAnisotropy;
  166. D3DVALUE dvGuardBandLeft;
  167. D3DVALUE dvGuardBandTop;
  168. D3DVALUE dvGuardBandRight;
  169. D3DVALUE dvGuardBandBottom;
  170. D3DVALUE dvExtentsAdjust;
  171. DWORD dwStencilCaps;
  172. DWORD dwFVFCaps; // low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware
  173. DWORD dwTextureOpCaps;
  174. WORD wMaxTextureBlendStages;
  175. WORD wMaxSimultaneousTextures;
  176. } D3DNTHAL_D3DDX6EXTENDEDCAPS;
  177. #endif /* DIRECT3D_VERSION >= 0x0700 */
  178. /* --------------------------------------------------------------
  179. * Extended caps introduced with DX5 and queried with
  180. * GetDriverInfo (GUID_D3DExtendedCaps).
  181. */
  182. typedef struct _D3DNTHAL_D3DEXTENDEDCAPS {
  183. DWORD dwSize; // Size of this structure
  184. DWORD dwMinTextureWidth, dwMaxTextureWidth;
  185. DWORD dwMinTextureHeight, dwMaxTextureHeight;
  186. DWORD dwMinStippleWidth, dwMaxStippleWidth;
  187. DWORD dwMinStippleHeight, dwMaxStippleHeight;
  188. // fields added for DX6
  189. DWORD dwMaxTextureRepeat;
  190. DWORD dwMaxTextureAspectRatio;
  191. DWORD dwMaxAnisotropy;
  192. D3DVALUE dvGuardBandLeft;
  193. D3DVALUE dvGuardBandTop;
  194. D3DVALUE dvGuardBandRight;
  195. D3DVALUE dvGuardBandBottom;
  196. D3DVALUE dvExtentsAdjust;
  197. DWORD dwStencilCaps;
  198. DWORD dwFVFCaps; // 0 implies TLVERTEX only, 1..8 imply full FVF aware
  199. DWORD dwTextureOpCaps;
  200. WORD wMaxTextureBlendStages;
  201. WORD wMaxSimultaneousTextures;
  202. #if(DIRECT3D_VERSION >= 0x0700)
  203. // fields added for DX7
  204. DWORD dwMaxActiveLights;
  205. D3DVALUE dvMaxVertexW;
  206. WORD wMaxUserClipPlanes;
  207. WORD wMaxVertexBlendMatrices;
  208. DWORD dwVertexProcessingCaps;
  209. DWORD dwReserved1;
  210. DWORD dwReserved2;
  211. DWORD dwReserved3;
  212. DWORD dwReserved4;
  213. #endif /* DIRECT3D_VERSION >= 0x0700 */
  214. } D3DNTHAL_D3DEXTENDEDCAPS;
  215. typedef D3DNTHAL_D3DEXTENDEDCAPS *LPD3DNTHAL_D3DEXTENDEDCAPS;
  216. #define D3DNTHAL_D3DEXTENDEDCAPSSIZE (sizeof(D3DNTHAL_D3DEXTENDEDCAPS))
  217. // This is a temporary fix to make older NT drivers to compile
  218. #define dvVertexProcessingCaps dwVertexProcessingCaps
  219. #if(DIRECT3D_VERSION >= 0x0700)
  220. typedef D3DNTHAL_D3DDX6EXTENDEDCAPS *LPD3DNTHAL_D3DDX6EXTENDEDCAPS;
  221. #define D3DNTHAL_D3DDX6EXTENDEDCAPSSIZE (sizeof(D3DNTHAL_D3DDX6EXTENDEDCAPS))
  222. #endif /* DIRECT3D_VERSION >= 0x0700 */
  223. /* --------------------------------------------------------------
  224. * Argument to the HAL functions.
  225. */
  226. typedef ULONG_PTR D3DINTHAL_BUFFERHANDLE, *LPD3DINTHAL_BUFFERHANDLE;
  227. typedef struct _D3DNTHAL_CONTEXTCREATEDATA {
  228. union
  229. {
  230. PDD_DIRECTDRAW_GLOBAL lpDDGbl; // in: obsolete
  231. PDD_DIRECTDRAW_LOCAL lpDDLcl; // in: Driver struct
  232. };
  233. union
  234. {
  235. PDD_SURFACE_LOCAL lpDDS; // in: obsolete
  236. PDD_SURFACE_LOCAL lpDDSLcl; // in: Surface to be used as target
  237. };
  238. union
  239. {
  240. PDD_SURFACE_LOCAL lpDDSZ; // in: obsolete
  241. PDD_SURFACE_LOCAL lpDDSZLcl; // in: Surface to be used as Z
  242. };
  243. DWORD dwPID; // in: Current process id
  244. ULONG_PTR dwhContext; // in/out: Context handle
  245. HRESULT ddrval; // out: Return value
  246. } D3DNTHAL_CONTEXTCREATEDATA;
  247. typedef D3DNTHAL_CONTEXTCREATEDATA *LPD3DNTHAL_CONTEXTCREATEDATA;
  248. typedef struct _D3DNTHAL_CONTEXTDESTROYDATA {
  249. ULONG_PTR dwhContext; // in: Context handle
  250. HRESULT ddrval; // out: Return value
  251. } D3DNTHAL_CONTEXTDESTROYDATA;
  252. typedef D3DNTHAL_CONTEXTDESTROYDATA *LPD3DNTHAL_CONTEXTDESTROYDATA;
  253. typedef struct _D3DNTHAL_CONTEXTDESTROYALLDATA {
  254. DWORD dwPID; // in: Process id to destroy contexts for
  255. HRESULT ddrval; // out: Return value
  256. } D3DNTHAL_CONTEXTDESTROYALLDATA;
  257. typedef D3DNTHAL_CONTEXTDESTROYALLDATA *LPD3DNTHAL_CONTEXTDESTROYALLDATA;
  258. typedef struct _D3DNTHAL_SCENECAPTUREDATA {
  259. ULONG_PTR dwhContext; // in: Context handle
  260. DWORD dwFlag; // in: Indicates beginning or end
  261. HRESULT ddrval; // out: Return value
  262. } D3DNTHAL_SCENECAPTUREDATA;
  263. typedef D3DNTHAL_SCENECAPTUREDATA *LPD3DNTHAL_SCENECAPTUREDATA;
  264. typedef struct _D3DNTHAL_TEXTURECREATEDATA {
  265. ULONG_PTR dwhContext; // in: Context handle
  266. HANDLE hDDS; // in: Handle to surface object
  267. ULONG_PTR dwHandle; // out: Handle to texture
  268. HRESULT ddrval; // out: Return value
  269. } D3DNTHAL_TEXTURECREATEDATA;
  270. typedef D3DNTHAL_TEXTURECREATEDATA *LPD3DNTHAL_TEXTURECREATEDATA;
  271. typedef struct _D3DNTHAL_TEXTUREDESTROYDATA {
  272. ULONG_PTR dwhContext; // in: Context handle
  273. ULONG_PTR dwHandle; // in: Handle to texture
  274. HRESULT ddrval; // out: Return value
  275. } D3DNTHAL_TEXTUREDESTROYDATA;
  276. typedef D3DNTHAL_TEXTUREDESTROYDATA *LPD3DNTHAL_TEXTUREDESTROYDATA;
  277. typedef struct _D3DNTHAL_TEXTURESWAPDATA {
  278. ULONG_PTR dwhContext; // in: Context handle
  279. ULONG_PTR dwHandle1; // in: Handle to texture 1
  280. ULONG_PTR dwHandle2; // in: Handle to texture 2
  281. HRESULT ddrval; // out: Return value
  282. } D3DNTHAL_TEXTURESWAPDATA;
  283. typedef D3DNTHAL_TEXTURESWAPDATA *LPD3DNTHAL_TEXTURESWAPDATA;
  284. typedef struct _D3DNTHAL_TEXTUREGETSURFDATA {
  285. ULONG_PTR dwhContext; // in: Context handle
  286. HANDLE hDDS; // out: Handle to surface object
  287. ULONG_PTR dwHandle; // in: Handle to texture
  288. HRESULT ddrval; // out: Return value
  289. } D3DNTHAL_TEXTUREGETSURFDATA;
  290. typedef D3DNTHAL_TEXTUREGETSURFDATA *LPD3DNTHAL_TEXTUREGETSURFDATA;
  291. /* --------------------------------------------------------------
  292. * Flags for the data parameters.
  293. */
  294. /*
  295. * SceneCapture()
  296. * This is used as an indication to the driver that a scene is about to
  297. * start or end, and that it should capture data if required.
  298. */
  299. #define D3DNTHAL_SCENE_CAPTURE_START 0x00000000L
  300. #define D3DNTHAL_SCENE_CAPTURE_END 0x00000001L
  301. /* --------------------------------------------------------------
  302. * Return values from HAL functions.
  303. */
  304. /*
  305. * The context passed in was bad.
  306. */
  307. #define D3DNTHAL_CONTEXT_BAD 0x000000200L
  308. /*
  309. * No more contexts left.
  310. */
  311. #define D3DNTHAL_OUTOFCONTEXTS 0x000000201L
  312. /* --------------------------------------------------------------
  313. * Direct3D HAL Table.
  314. * Instantiated by the HAL driver on connection.
  315. *
  316. * Calls take the form of:
  317. * retcode = HalCall(HalCallData* lpData);
  318. */
  319. typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTCREATECB) (LPD3DNTHAL_CONTEXTCREATEDATA);
  320. typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYCB) (LPD3DNTHAL_CONTEXTDESTROYDATA);
  321. typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYALLCB) (LPD3DNTHAL_CONTEXTDESTROYALLDATA);
  322. typedef DWORD (APIENTRY *LPD3DNTHAL_SCENECAPTURECB) (LPD3DNTHAL_SCENECAPTUREDATA);
  323. typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURECREATECB) (LPD3DNTHAL_TEXTURECREATEDATA);
  324. typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREDESTROYCB) (LPD3DNTHAL_TEXTUREDESTROYDATA);
  325. typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURESWAPCB) (LPD3DNTHAL_TEXTURESWAPDATA);
  326. typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREGETSURFCB) (LPD3DNTHAL_TEXTUREGETSURFDATA);
  327. typedef struct _D3DNTHAL_CALLBACKS {
  328. DWORD dwSize;
  329. // Device context
  330. LPD3DNTHAL_CONTEXTCREATECB ContextCreate;
  331. LPD3DNTHAL_CONTEXTDESTROYCB ContextDestroy;
  332. LPD3DNTHAL_CONTEXTDESTROYALLCB ContextDestroyAll;
  333. // Scene Capture
  334. LPD3DNTHAL_SCENECAPTURECB SceneCapture;
  335. // Execution
  336. LPVOID dwReserved10; // Must be zero (was Execute)
  337. LPVOID dwReserved11; // Must be zero (was ExecuteClipped)
  338. LPVOID dwReserved22; // Must be zero (was RenderState)
  339. LPVOID dwReserved23; // Must be zero (was RenderPrimitive)
  340. ULONG_PTR dwReserved; // Must be zero
  341. // Textures
  342. LPD3DNTHAL_TEXTURECREATECB TextureCreate;
  343. LPD3DNTHAL_TEXTUREDESTROYCB TextureDestroy;
  344. LPD3DNTHAL_TEXTURESWAPCB TextureSwap;
  345. LPD3DNTHAL_TEXTUREGETSURFCB TextureGetSurf;
  346. LPVOID dwReserved12; // Must be zero
  347. LPVOID dwReserved13; // Must be zero
  348. LPVOID dwReserved14; // Must be zero
  349. LPVOID dwReserved15; // Must be zero
  350. LPVOID dwReserved16; // Must be zero
  351. LPVOID dwReserved17; // Must be zero
  352. LPVOID dwReserved18; // Must be zero
  353. LPVOID dwReserved19; // Must be zero
  354. LPVOID dwReserved20; // Must be zero
  355. LPVOID dwReserved21; // Must be zero
  356. // Pipeline state
  357. LPVOID dwReserved24; // Was GetState;
  358. ULONG_PTR dwReserved0; // Must be zero
  359. ULONG_PTR dwReserved1; // Must be zero
  360. ULONG_PTR dwReserved2; // Must be zero
  361. ULONG_PTR dwReserved3; // Must be zero
  362. ULONG_PTR dwReserved4; // Must be zero
  363. ULONG_PTR dwReserved5; // Must be zero
  364. ULONG_PTR dwReserved6; // Must be zero
  365. ULONG_PTR dwReserved7; // Must be zero
  366. ULONG_PTR dwReserved8; // Must be zero
  367. ULONG_PTR dwReserved9; // Must be zero
  368. } D3DNTHAL_CALLBACKS;
  369. typedef D3DNTHAL_CALLBACKS *LPD3DNTHAL_CALLBACKS;
  370. #define D3DNTHAL_SIZE_V1 sizeof( D3DNTHAL_CALLBACKS )
  371. typedef struct _D3DNTHAL_SETRENDERTARGETDATA {
  372. ULONG_PTR dwhContext; // in: Context handle
  373. PDD_SURFACE_LOCAL lpDDS; // in: new render target
  374. PDD_SURFACE_LOCAL lpDDSZ; // in: new Z buffer
  375. HRESULT ddrval; // out: Return value
  376. } D3DNTHAL_SETRENDERTARGETDATA;
  377. typedef D3DNTHAL_SETRENDERTARGETDATA *LPD3DNTHAL_SETRENDERTARGETDATA;
  378. typedef DWORD (APIENTRY *LPD3DNTHAL_SETRENDERTARGETCB) (LPD3DNTHAL_SETRENDERTARGETDATA);
  379. typedef struct _D3DNTHAL_CALLBACKS2
  380. {
  381. DWORD dwSize; // size of struct
  382. DWORD dwFlags; // flags for callbacks
  383. LPD3DNTHAL_SETRENDERTARGETCB SetRenderTarget;
  384. LPVOID dwReserved1; // was Clear
  385. LPVOID dwReserved2; // was DrawOnePrimitive
  386. LPVOID dwReserved3; // was DrawOneIndexedPrimitive
  387. LPVOID dwReserved4; // was DrawPrimitives
  388. } D3DNTHAL_CALLBACKS2;
  389. typedef D3DNTHAL_CALLBACKS2 *LPD3DNTHAL_CALLBACKS2;
  390. #define D3DNTHAL2_CB32_SETRENDERTARGET 0x00000001L
  391. typedef struct _D3DNTHAL_CLEAR2DATA
  392. {
  393. ULONG_PTR dwhContext; // in: Context handle
  394. // dwFlags can contain D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER
  395. DWORD dwFlags; // in: surfaces to clear
  396. DWORD dwFillColor; // in: Color value for rtarget
  397. D3DVALUE dvFillDepth; // in: Depth value for
  398. // Z-buffer (0.0-1.0)
  399. DWORD dwFillStencil; // in: value used to clear stencil buffer
  400. LPD3DRECT lpRects; // in: Rectangles to clear
  401. DWORD dwNumRects; // in: Number of rectangles
  402. HRESULT ddrval; // out: Return value
  403. } D3DNTHAL_CLEAR2DATA;
  404. typedef D3DNTHAL_CLEAR2DATA FAR *LPD3DNTHAL_CLEAR2DATA;
  405. typedef struct _D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA
  406. {
  407. ULONG_PTR dwhContext; // in: Context handle
  408. DWORD dwFlags; // in: Flags, currently set to 0
  409. ULONG_PTR dwReserved; //
  410. DWORD dwNumPasses; // out: Number of passes the hardware
  411. // can perform the operation in
  412. HRESULT ddrval; // out: return value
  413. } D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA;
  414. typedef D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA FAR *LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA;
  415. //-----------------------------------------------------------------------------
  416. // DrawPrimitives2 DDI
  417. //-----------------------------------------------------------------------------
  418. //
  419. // Command structure for vertex buffer rendering
  420. //
  421. typedef struct _D3DNTHAL_DP2COMMAND
  422. {
  423. BYTE bCommand; // vertex command
  424. BYTE bReserved;
  425. union
  426. {
  427. WORD wPrimitiveCount; // primitive count for unconnected primitives
  428. WORD wStateCount; // count of render states to follow
  429. };
  430. } D3DNTHAL_DP2COMMAND, *LPDNT3DHAL_DP2COMMAND;
  431. //
  432. // DrawPrimitives2 commands:
  433. //
  434. typedef enum _D3DNTHAL_DP2OPERATION
  435. {
  436. D3DNTDP2OP_POINTS = 1,
  437. D3DNTDP2OP_INDEXEDLINELIST = 2,
  438. D3DNTDP2OP_INDEXEDTRIANGLELIST = 3,
  439. D3DNTDP2OP_RESERVED0 = 4,
  440. D3DNTDP2OP_RENDERSTATE = 8,
  441. D3DNTDP2OP_LINELIST = 15,
  442. D3DNTDP2OP_LINESTRIP = 16,
  443. D3DNTDP2OP_INDEXEDLINESTRIP = 17,
  444. D3DNTDP2OP_TRIANGLELIST = 18,
  445. D3DNTDP2OP_TRIANGLESTRIP = 19,
  446. D3DNTDP2OP_INDEXEDTRIANGLESTRIP = 20,
  447. D3DNTDP2OP_TRIANGLEFAN = 21,
  448. D3DNTDP2OP_INDEXEDTRIANGLEFAN = 22,
  449. D3DNTDP2OP_TRIANGLEFAN_IMM = 23,
  450. D3DNTDP2OP_LINELIST_IMM = 24,
  451. D3DNTDP2OP_TEXTURESTAGESTATE = 25,
  452. D3DNTDP2OP_INDEXEDTRIANGLELIST2 = 26,
  453. D3DNTDP2OP_INDEXEDLINELIST2 = 27,
  454. D3DNTDP2OP_VIEWPORTINFO = 28,
  455. D3DNTDP2OP_WINFO = 29,
  456. D3DNTDP2OP_SETPALETTE = 30,
  457. D3DNTDP2OP_UPDATEPALETTE = 31,
  458. #if(DIRECT3D_VERSION >= 0x0700)
  459. //new for DX7
  460. D3DNTDP2OP_ZRANGE = 32,
  461. D3DNTDP2OP_SETMATERIAL = 33,
  462. D3DNTDP2OP_SETLIGHT = 34,
  463. D3DNTDP2OP_CREATELIGHT = 35,
  464. D3DNTDP2OP_SETTRANSFORM = 36,
  465. D3DNTDP2OP_EXT = 37,
  466. D3DNTDP2OP_TEXBLT = 38,
  467. D3DNTDP2OP_STATESET = 39,
  468. D3DNTDP2OP_SETPRIORITY = 40,
  469. #endif /* DIRECT3D_VERSION >= 0x0700 */
  470. D3DNTDP2OP_SETRENDERTARGET = 41,
  471. D3DNTDP2OP_CLEAR = 42,
  472. #if(DIRECT3D_VERSION >= 0x0700)
  473. D3DNTDP2OP_SETTEXLOD = 43,
  474. D3DNTDP2OP_SETCLIPPLANE = 44,
  475. #endif /* DIRECT3D_VERSION >= 0x0700 */
  476. #if(DIRECT3D_VERSION >= 0x0800)
  477. D3DNTDP2OP_CREATEVERTEXSHADER = 45,
  478. D3DNTDP2OP_DELETEVERTEXSHADER = 46,
  479. D3DNTDP2OP_SETVERTEXSHADER = 47,
  480. D3DNTDP2OP_SETVERTEXSHADERCONST = 48,
  481. D3DNTDP2OP_SETSTREAMSOURCE = 49,
  482. D3DNTDP2OP_SETSTREAMSOURCEUM = 50,
  483. D3DNTDP2OP_SETINDICES = 51,
  484. D3DNTDP2OP_DRAWPRIMITIVE = 52,
  485. D3DNTDP2OP_DRAWINDEXEDPRIMITIVE = 53,
  486. D3DNTDP2OP_CREATEPIXELSHADER = 54,
  487. D3DNTDP2OP_DELETEPIXELSHADER = 55,
  488. D3DNTDP2OP_SETPIXELSHADER = 56,
  489. D3DNTDP2OP_SETPIXELSHADERCONST = 57,
  490. D3DNTDP2OP_CLIPPEDTRIANGLEFAN = 58,
  491. D3DNTDP2OP_DRAWPRIMITIVE2 = 59,
  492. D3DNTDP2OP_DRAWINDEXEDPRIMITIVE2= 60,
  493. D3DNTDP2OP_DRAWRECTPATCH = 61,
  494. D3DNTDP2OP_DRAWTRIPATCH = 62,
  495. D3DNTDP2OP_VOLUMEBLT = 63,
  496. D3DNTDP2OP_BUFFERBLT = 64,
  497. D3DNTDP2OP_MULTIPLYTRANSFORM = 65,
  498. D3DNTDP2OP_ADDDIRTYRECT = 66,
  499. D3DNTDP2OP_ADDDIRTYBOX = 67,
  500. #endif /* DIRECT3D_VERSION >= 0x0800 */
  501. } D3DNTHAL_DP2OPERATION;
  502. //
  503. // DrawPrimitives2 point primitives
  504. //
  505. typedef struct _D3DNTHAL_DP2POINTS
  506. {
  507. WORD wCount;
  508. WORD wVStart;
  509. } D3DNTHAL_DP2POINTS;
  510. //
  511. // DrawPrimitives2 line primitives
  512. //
  513. typedef struct _D3DNTHAL_DP2STARTVERTEX {
  514. WORD wVStart;
  515. } D3DNTHAL_DP2STARTVERTEX, *LPD3DNTHAL_DP2STARTVERTEX;
  516. typedef struct _D3DNTHAL_DP2LINELIST
  517. {
  518. WORD wVStart;
  519. } D3DNTHAL_DP2LINELIST;
  520. typedef struct _D3DNTHAL_DP2INDEXEDLINELIST
  521. {
  522. WORD wV1;
  523. WORD wV2;
  524. } D3DNTHAL_DP2INDEXEDLINELIST;
  525. typedef struct _D3DNTHAL_DP2LINESTRIP
  526. {
  527. WORD wVStart;
  528. } D3DNTHAL_DP2LINESTRIP;
  529. typedef struct _D3DNTHAL_DP2INDEXEDLINESTRIP
  530. {
  531. WORD wV[2];
  532. } D3DNTHAL_DP2INDEXEDLINESTRIP;
  533. //
  534. // DrawPrimitives2 triangle primitives
  535. //
  536. typedef struct _D3DNTHAL_DP2TRIANGLELIST
  537. {
  538. WORD wVStart;
  539. } D3DNTHAL_DP2TRIANGLELIST;
  540. typedef struct _D3DNTHAL_DP2INDEXEDTRIANGLELIST
  541. {
  542. WORD wV1;
  543. WORD wV2;
  544. WORD wV3;
  545. WORD wFlags;
  546. } D3DNTHAL_DP2INDEXEDTRIANGLELIST;
  547. typedef struct _D3DNTHAL_DP2INDEXEDTRIANGLELIST2 {
  548. WORD wV1;
  549. WORD wV2;
  550. WORD wV3;
  551. } D3DNTHAL_DP2INDEXEDTRIANGLELIST2, *LPD3DNTHAL_DP2INDEXEDTRIANGLELIST2;
  552. typedef struct _D3DNTHAL_DP2TRIANGLESTRIP
  553. {
  554. WORD wVStart;
  555. } D3DNTHAL_DP2TRIANGLESTRIP;
  556. typedef struct _D3DNTHAL_DP2INDEXEDTRIANGLESTRIP
  557. {
  558. WORD wV[3];
  559. } D3DNTHAL_DP2INDEXEDTRIANGLESTRIP;
  560. typedef struct _D3DNTHAL_DP2TRIANGLEFAN
  561. {
  562. WORD wVStart;
  563. } D3DNTHAL_DP2TRIANGLEFAN;
  564. typedef struct _D3DNTHAL_DP2INDEXEDTRIANGLEFAN
  565. {
  566. WORD wV[3];
  567. } D3DNTHAL_DP2INDEXEDTRIANGLEFAN;
  568. typedef struct _D3DNTHAL_DP2TRIANGLEFAN_IMM {
  569. DWORD dwEdgeFlags;
  570. } D3DNTHAL_DP2TRIANGLEFAN_IMM, *LPD3DNTHAL_DP2TRIANGLEFAN_IMM;
  571. //
  572. // DrawPrimitives2 Renderstate changes
  573. //
  574. typedef struct _D3DNTHAL_DP2RENDERSTATE
  575. {
  576. D3DRENDERSTATETYPE RenderState;
  577. union
  578. {
  579. D3DVALUE fState;
  580. DWORD dwState;
  581. };
  582. } D3DNTHAL_DP2RENDERSTATE;
  583. typedef D3DNTHAL_DP2RENDERSTATE * LPD3DNTHAL_DP2RENDERSTATE;
  584. typedef struct _D3DNTHAL_DP2TEXTURESTAGESTATE
  585. {
  586. WORD wStage;
  587. WORD TSState;
  588. DWORD dwValue;
  589. } D3DNTHAL_DP2TEXTURESTAGESTATE;
  590. typedef D3DNTHAL_DP2TEXTURESTAGESTATE *LPD3DNTHAL_DP2TEXTURESTAGESTATE;
  591. typedef struct _D3DNTHAL_DP2VIEWPORTINFO {
  592. DWORD dwX;
  593. DWORD dwY;
  594. DWORD dwWidth;
  595. DWORD dwHeight;
  596. } D3DNTHAL_DP2VIEWPORTINFO;
  597. typedef D3DNTHAL_DP2VIEWPORTINFO *LPD3DNTHAL_DP2VIEWPORTINFO;
  598. typedef struct _D3DNTHAL_DP2WINFO {
  599. D3DVALUE dvWNear;
  600. D3DVALUE dvWFar;
  601. } D3DNTHAL_DP2WINFO;
  602. typedef D3DNTHAL_DP2WINFO *LPD3DNTHAL_DP2WINFO;
  603. typedef struct _D3DNTHAL_DP2SETPALETTE
  604. {
  605. DWORD dwPaletteHandle;
  606. DWORD dwPaletteFlags;
  607. DWORD dwSurfaceHandle;
  608. } D3DNTHAL_DP2SETPALETTE;
  609. typedef D3DNTHAL_DP2SETPALETTE *LPD3DNTHAL_DP2SETPALETTE;
  610. typedef struct _D3DNTHAL_DP2UPDATEPALETTE
  611. {
  612. DWORD dwPaletteHandle;
  613. WORD wStartIndex;
  614. WORD wNumEntries;
  615. } D3DNTHAL_DP2UPDATEPALETTE;
  616. typedef D3DNTHAL_DP2UPDATEPALETTE *LPD3DNTHAL_DP2UPDATEPALETTE;
  617. typedef struct _D3DNTHAL_DP2SETRENDERTARGET
  618. {
  619. DWORD hRenderTarget;
  620. DWORD hZBuffer;
  621. } D3DNTHAL_DP2SETRENDERTARGET;
  622. typedef D3DNTHAL_DP2SETRENDERTARGET *LPD3DNTHAL_DP2SETRENDERTARGET;
  623. #if(DIRECT3D_VERSION >= 0x0700)
  624. // Values for dwOperations in the D3DHAL_DP2STATESET
  625. #define D3DHAL_STATESETBEGIN 0
  626. #define D3DHAL_STATESETEND 1
  627. #define D3DHAL_STATESETDELETE 2
  628. #define D3DHAL_STATESETEXECUTE 3
  629. #define D3DHAL_STATESETCAPTURE 4
  630. typedef struct _D3DNTHAL_DP2STATESET
  631. {
  632. DWORD dwOperation;
  633. DWORD dwParam; // State set handle passed with D3DHAL_STATESETBEGIN,
  634. // D3DHAL_STATESETEXECUTE, D3DHAL_STATESETDELETE
  635. // D3DHAL_STATESETCAPTURE
  636. D3DSTATEBLOCKTYPE sbType; // Type use with D3DHAL_STATESETBEGIN/END
  637. } D3DNTHAL_DP2STATESET;
  638. typedef D3DNTHAL_DP2STATESET *LPD3DNTHAL_DP2STATESET;
  639. //
  640. // T&L Hal specific stuff
  641. //
  642. typedef struct _D3DNTHAL_DP2ZRANGE
  643. {
  644. D3DVALUE dvMinZ;
  645. D3DVALUE dvMaxZ;
  646. } D3DNTHAL_DP2ZRANGE;
  647. typedef D3DNTHAL_DP2ZRANGE *LPD3DNTHAL_DP2ZRANGE;
  648. typedef D3DMATERIAL7 D3DNTHAL_DP2SETMATERIAL, *LPD3DNTHAL_DP2SETMATERIAL;
  649. typedef struct _D3DNTHAL_DP2SETLIGHT
  650. {
  651. DWORD dwIndex;
  652. union {
  653. DWORD lightData;
  654. DWORD dwDataType;
  655. };
  656. } D3DNTHAL_DP2SETLIGHT;
  657. typedef D3DNTHAL_DP2SETLIGHT *LPD3DNTHAL_DP2SETLIGHT;
  658. typedef struct _D3DNTHAL_DP2SETCLIPPLANE
  659. {
  660. DWORD dwIndex;
  661. D3DVALUE plane[4];
  662. } D3DNTHAL_DP2SETCLIPPLANE;
  663. typedef D3DNTHAL_DP2SETCLIPPLANE *LPD3DNTHAL_DP2SETCLIPPLANE;
  664. typedef struct _D3DNTHAL_DP2CREATELIGHT
  665. {
  666. DWORD dwIndex;
  667. } D3DNTHAL_DP2CREATELIGHT;
  668. typedef D3DNTHAL_DP2CREATELIGHT *LPD3DNTHAL_DP2CREATELIGHT;
  669. typedef struct _D3DNTHAL_DP2SETTRANSFORM
  670. {
  671. D3DTRANSFORMSTATETYPE xfrmType;
  672. D3DMATRIX matrix;
  673. } D3DNTHAL_DP2SETTRANSFORM;
  674. typedef D3DNTHAL_DP2SETTRANSFORM *LPD3DNTHAL_DP2SETTRANSFORM;
  675. typedef struct _D3DNTHAL_DP2EXT
  676. {
  677. DWORD dwExtToken;
  678. DWORD dwSize;
  679. } D3DNTHAL_DP2EXT;
  680. typedef D3DNTHAL_DP2EXT *LPD3DNTHAL_DP2EXT;
  681. typedef struct _D3DNTHAL_DP2TEXBLT
  682. {
  683. DWORD dwDDDestSurface;// dest surface
  684. DWORD dwDDSrcSurface; // src surface
  685. POINT pDest;
  686. RECTL rSrc; // src rect
  687. DWORD dwFlags; // blt flags
  688. } D3DNTHAL_DP2TEXBLT;
  689. typedef D3DNTHAL_DP2TEXBLT *LPD3DNTHAL_DP2TEXBLT;
  690. typedef struct _D3DNTHAL_DP2SETPRIORITY
  691. {
  692. DWORD dwDDDestSurface;// dest surface
  693. DWORD dwPriority;
  694. } D3DNTHAL_DP2SETPRIORITY;
  695. typedef D3DNTHAL_DP2SETPRIORITY *LPD3DNTHAL_DP2SETPRIORITY;
  696. typedef struct _D3DNTHAL_DP2CLEAR
  697. {
  698. // dwFlags can contain D3DCLEAR_TARGET, D3DCLEAR_ZBUFFER, and/or D3DCLEAR_STENCIL
  699. DWORD dwFlags; // in: surfaces to clear
  700. DWORD dwFillColor; // in: Color value for rtarget
  701. D3DVALUE dvFillDepth; // in: Depth value for Z buffer (0.0-1.0)
  702. DWORD dwFillStencil; // in: value used to clear stencil buffer
  703. RECT Rects[1]; // in: Rectangles to clear
  704. } D3DNTHAL_DP2CLEAR;
  705. typedef D3DNTHAL_DP2CLEAR *LPD3DNTHAL_DP2CLEAR;
  706. typedef struct _D3DNTHAL_DP2SETTEXLOD
  707. {
  708. DWORD dwDDSurface;
  709. DWORD dwLOD;
  710. } D3DNTHAL_DP2SETTEXLOD;
  711. typedef D3DNTHAL_DP2SETTEXLOD *LPD3DNTHAL_DP2SETTEXLOD;
  712. #endif /* DIRECT3D_VERSION >= 0x0700 */
  713. typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA
  714. {
  715. ULONG_PTR dwhContext; // in: Context handle
  716. DWORD dwFlags; // in: flags (look below)
  717. DWORD dwVertexType; // in: vertex type
  718. PDD_SURFACE_LOCAL lpDDCommands; // in: vertex buffer command data
  719. DWORD dwCommandOffset; // in: offset to start of vb commands
  720. DWORD dwCommandLength; // in: number of bytes of command data
  721. union
  722. {
  723. PDD_SURFACE_LOCAL lpDDVertex; // in: surface containing vertex data
  724. LPVOID lpVertices; // in: User mode pointer to vertices
  725. };
  726. DWORD dwVertexOffset; // in: offset to start of vertex data
  727. DWORD dwVertexLength; // in: number of vertices of vertex data
  728. DWORD dwReqVertexBufSize; // in: number of bytes required for
  729. // the next vertex buffer
  730. DWORD dwReqCommandBufSize; // in: number if bytes required for
  731. // the next commnand buffer
  732. LPDWORD lpdwRStates; // in: Pointer to the array where render states are updated
  733. union
  734. {
  735. DWORD dwVertexSize; // in: Size of each vertex in bytes
  736. HRESULT ddrval; // out: return value
  737. };
  738. DWORD dwErrorOffset; // out: offset in LPDDVBCOMMAND to
  739. // first failed D3DNTHAL_VBCOMMAND
  740. } D3DNTHAL_DRAWPRIMITIVES2DATA;
  741. typedef D3DNTHAL_DRAWPRIMITIVES2DATA FAR *LPD3DNTHAL_DRAWPRIMITIVES2DATA;
  742. // Indicates that the lpVertices field in the DrawPrimitives2 data is
  743. // valid, i.e. user allocated memory.
  744. #define D3DNTHALDP2_USERMEMVERTICES 0x00000001L
  745. // Indicates that the command buffer and vertex buffer are a system memory execute buffer
  746. // resulting from the use of the Execute buffer API.
  747. #define D3DNTHALDP2_EXECUTEBUFFER 0x00000002L
  748. // The swap flags indicate if it is OK for the driver to swap the submitted buffers with new
  749. // buffers and asyncronously work on the submitted buffers.
  750. #define D3DNTHALDP2_SWAPVERTEXBUFFER 0x00000004L
  751. #define D3DNTHALDP2_SWAPCOMMANDBUFFER 0x00000008L
  752. // The requested flags are present if the new buffers which the driver can allocate need to be
  753. // of atleast a given size. If any of these flags are set, the corresponding dwReq* field in
  754. // D3DNTHAL_DRAWPRIMITIVES2DATA will also be set with the requested size in bytes.
  755. #define D3DNTHALDP2_REQVERTEXBUFSIZE 0x00000010L
  756. #define D3DNTHALDP2_REQCOMMANDBUFSIZE 0x00000020L
  757. // These flags are set by the driver upon return from DrawPrimitives2 indicating if the new
  758. // buffers are not in system memory.
  759. #define D3DNTHALDP2_VIDMEMVERTEXBUF 0x00000040L
  760. #define D3DNTHALDP2_VIDMEMCOMMANDBUF 0x00000080L
  761. // Return values for the driver callback used in DP2 implementations
  762. // Used by the driver to ask runtime to parse the execute buffer
  763. #define D3DNTERR_COMMAND_UNPARSED MAKE_DDHRESULT(3000)
  764. typedef DWORD (APIENTRY *LPD3DNTHAL_CLEAR2CB) (LPD3DNTHAL_CLEAR2DATA);
  765. typedef DWORD (APIENTRY *LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB) (LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA);
  766. typedef DWORD (APIENTRY *LPD3DNTHAL_DRAWPRIMITIVES2CB) (LPD3DNTHAL_DRAWPRIMITIVES2DATA);
  767. typedef struct _D3DNTHAL_CALLBACKS3
  768. {
  769. DWORD dwSize; // Size of struct
  770. DWORD dwFlags; // Flags for callbacks
  771. LPD3DNTHAL_CLEAR2CB Clear2;
  772. LPVOID lpvReserved;
  773. LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState;
  774. LPD3DNTHAL_DRAWPRIMITIVES2CB DrawPrimitives2;
  775. } D3DNTHAL_CALLBACKS3;
  776. typedef D3DNTHAL_CALLBACKS3 *LPD3DNTHAL_CALLBACKS3;
  777. #define D3DNTHAL3_CB32_CLEAR2 0x00000001L
  778. #define D3DNTHAL3_CB32_RESERVED 0x00000002L
  779. #define D3DNTHAL3_CB32_VALIDATETEXTURESTAGESTATE 0x00000004L
  780. #define D3DNTHAL3_CB32_DRAWPRIMITIVES2 0x00000008L
  781. // typedef for the Callback that the drivers can use to parse unknown commands
  782. // passed to them via the DrawPrimitives2 callback. The driver obtains this
  783. // callback thru a GetDriverInfo call with GUID_D3DParseUnknownCommandCallback
  784. // made by ddraw somewhere around the initialization time.
  785. typedef HRESULT (CALLBACK *PFND3DNTPARSEUNKNOWNCOMMAND) (LPVOID lpvCommands,
  786. LPVOID *lplpvReturnedCommand);
  787. /* --------------------------------------------------------------
  788. * Texture stage renderstate mapping definitions.
  789. *
  790. * 256 renderstate slots [256, 511] are reserved for texture processing
  791. * stage controls, which provides for 8 texture processing stages each
  792. * with 32 DWORD controls.
  793. *
  794. * The renderstates within each stage are indexed by the
  795. * D3DTEXTURESTAGESTATETYPE enumerants by adding the appropriate
  796. * enumerant to the base for a given texture stage.
  797. *
  798. * Note, "state overrides" bias the renderstate by 256, so the two
  799. * ranges overlap. Overrides are enabled for exebufs only, so all
  800. * this means is that Texture3 cannot be used with exebufs.
  801. */
  802. /*
  803. * Base of all texture stage state values in renderstate array.
  804. */
  805. #define D3DNTHAL_TSS_RENDERSTATEBASE 256UL
  806. /*
  807. * Maximum number of stages allowed.
  808. */
  809. #define D3DNTHAL_TSS_MAXSTAGES 8
  810. /*
  811. * Number of state DWORDS per stage.
  812. */
  813. #define D3DNTHAL_TSS_STATESPERSTAGE 64
  814. /*
  815. * Texture handle's offset into the 32-DWORD cascade state vector
  816. */
  817. #ifndef D3DTSS_TEXTUREMAP
  818. #define D3DTSS_TEXTUREMAP 0
  819. #endif
  820. #define D3DRENDERSTATE_EVICTMANAGEDTEXTURES 61 // DDI render state only to Evict textures
  821. #define D3DRENDERSTATE_SCENECAPTURE 62 // DDI only to replace SceneCapture
  822. #if(DIRECT3D_VERSION >= 0x0800 )
  823. // New values for dwOperations in the D3DHAL_DP2STATESET
  824. #define D3DNTHAL_STATESETCREATE 5
  825. // This bit is the same as D3DCLEAR_RESERVED0 in d3d8types.h
  826. // When set it means that driver has to cull rects against current viewport.
  827. // The bit is set only for pure devices
  828. //
  829. #define D3DNTCLEAR_COMPUTERECTS 0x00000008l
  830. typedef struct _D3DNTHAL_DP2MULTIPLYTRANSFORM
  831. {
  832. D3DTRANSFORMSTATETYPE xfrmType;
  833. D3DMATRIX matrix;
  834. } D3DNTHAL_DP2MULTIPLYTRANSFORM;
  835. typedef D3DNTHAL_DP2MULTIPLYTRANSFORM *LPD3DNTHAL_DP2MULTIPLYTRANSFORM;
  836. // Used by SetVertexShader and DeleteVertexShader
  837. typedef struct _D3DNTHAL_DP2VERTEXSHADER
  838. {
  839. // Vertex shader handle.
  840. // The handle could be 0, meaning that the current vertex shader is invalid
  841. // (not set). When driver recieves handle 0, it should invalidate all
  842. // streams pointer
  843. DWORD dwHandle;
  844. } D3DNTHAL_DP2VERTEXSHADER;
  845. typedef D3DNTHAL_DP2VERTEXSHADER *LPD3DNTHAL_DP2VERTEXSHADER;
  846. typedef struct _D3DNTHAL_DP2CREATEVERTEXSHADER
  847. {
  848. DWORD dwHandle; // Shader handle
  849. DWORD dwDeclSize; // Shader declaration size in bytes
  850. DWORD dwCodeSize; // Shader code size in bytes
  851. // Declaration follows
  852. // Shader code follows
  853. } D3DNTHAL_DP2CREATEVERTEXSHADER;
  854. typedef D3DNTHAL_DP2CREATEVERTEXSHADER *LPD3DNTHAL_DP2CREATEVERTEXSHADER;
  855. typedef struct _D3DNTHAL_DP2SETVERTEXSHADERCONST
  856. {
  857. DWORD dwRegister; // Const register to start copying
  858. DWORD dwCount; // Number of 4-float vectors to copy
  859. // Data follows
  860. } D3DNTHAL_DP2SETVERTEXSHADERCONST;
  861. typedef D3DNTHAL_DP2SETVERTEXSHADERCONST *LPD3DNTHAL_DP2SETVERTEXSHADERCONST;
  862. typedef struct _D3DNTHAL_DP2SETSTREAMSOURCE
  863. {
  864. DWORD dwStream; // Stream index, starting from zero
  865. DWORD dwVBHandle; // Vertex buffer handle
  866. DWORD dwStride; // Vertex size in bytes
  867. } D3DNTHAL_DP2SETSTREAMSOURCE;
  868. typedef D3DNTHAL_DP2SETSTREAMSOURCE *LPD3DNTHAL_DP2SETSTREAMSOURCE;
  869. typedef struct _D3DNTHAL_DP2SETSTREAMSOURCEUM
  870. {
  871. DWORD dwStream; // Stream index, starting from zero
  872. DWORD dwStride; // Vertex size in bytes
  873. } D3DNTHAL_DP2SETSTREAMSOURCEUM;
  874. typedef D3DNTHAL_DP2SETSTREAMSOURCEUM *LPD3DNTHAL_DP2SETSTREAMSOURCEUM;
  875. typedef struct _D3DNTHAL_DP2SETINDICES
  876. {
  877. DWORD dwVBHandle; // Index buffer handle
  878. DWORD dwStride; // Index size in bytes (2 or 4)
  879. } D3DNTHAL_DP2SETINDICES;
  880. typedef D3DNTHAL_DP2SETINDICES *LPD3DNTHAL_DP2SETINDICES;
  881. typedef struct _D3DNTHAL_DP2DRAWPRIMITIVE
  882. {
  883. D3DPRIMITIVETYPE primType;
  884. DWORD VStart;
  885. DWORD PrimitiveCount;
  886. } D3DNTHAL_DP2DRAWPRIMITIVE;
  887. typedef D3DNTHAL_DP2DRAWPRIMITIVE *LPD3DNTHAL_DP2DRAWPRIMITIVE;
  888. typedef struct _D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE
  889. {
  890. D3DPRIMITIVETYPE primType;
  891. INT BaseVertexIndex; // Vertex which corresponds to index 0
  892. DWORD MinIndex; // Min vertex index in the vertex buffer
  893. DWORD NumVertices; // Number of vertices starting from MinIndex
  894. DWORD StartIndex; // Start index in the index buffer
  895. DWORD PrimitiveCount;
  896. } D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE;
  897. typedef D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE *LPD3DNTHAL_DP2DRAWINDEXEDPRIMITIVE;
  898. typedef struct _D3DNTHAL_CLIPPEDTRIANGLEFAN
  899. {
  900. DWORD FirstVertexOffset; // Offset in bytes in the current stream 0
  901. DWORD dwEdgeFlags;
  902. DWORD PrimitiveCount;
  903. } D3DNTHAL_CLIPPEDTRIANGLEFAN;
  904. typedef D3DNTHAL_CLIPPEDTRIANGLEFAN *LPD3DNTHAL_CLIPPEDTRIANGLEFAN;
  905. typedef struct _D3DNTHAL_DP2DRAWPRIMITIVE2
  906. {
  907. D3DPRIMITIVETYPE primType;
  908. DWORD FirstVertexOffset; // Offset in bytes in the stream 0
  909. DWORD PrimitiveCount;
  910. } D3DNTHAL_DP2DRAWPRIMITIVE2;
  911. typedef D3DNTHAL_DP2DRAWPRIMITIVE2 *LPD3DNTHAL_DP2DRAWPRIMITIVE2;
  912. typedef struct _D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE2
  913. {
  914. D3DPRIMITIVETYPE primType;
  915. INT BaseVertexOffset; // Stream 0 offset of the vertex which
  916. // corresponds to index 0. This offset could be
  917. // negative, but when an index is added to the
  918. // offset the result is positive
  919. DWORD MinIndex; // Min vertex index in the vertex buffer
  920. DWORD NumVertices; // Number of vertices starting from MinIndex
  921. DWORD StartIndexOffset; // Offset of the start index in the index buffer
  922. DWORD PrimitiveCount; // Number of triangles (points, lines)
  923. } D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE2;
  924. typedef D3DNTHAL_DP2DRAWINDEXEDPRIMITIVE2 *LPD3DNTHAL_DP2DRAWINDEXEDPRIMITIVE2;
  925. // Used by SetPixelShader and DeletePixelShader
  926. typedef struct _D3DNTHAL_DP2PIXELSHADER
  927. {
  928. // Pixel shader handle.
  929. // The handle could be 0, meaning that the current pixel shader is invalid
  930. // (not set).
  931. DWORD dwHandle;
  932. } D3DNTHAL_DP2PIXELSHADER;
  933. typedef D3DNTHAL_DP2PIXELSHADER *LPD3DNTHAL_DP2PIXELSHADER;
  934. typedef struct _D3DNTHAL_DP2CREATEPIXELSHADER
  935. {
  936. DWORD dwHandle; // Shader handle
  937. DWORD dwCodeSize; // Shader code size in bytes
  938. // Shader code follows
  939. } D3DNTHAL_DP2CREATEPIXELSHADER;
  940. typedef D3DNTHAL_DP2CREATEPIXELSHADER *LPD3DNTHAL_DP2CREATEPIXELSHADER;
  941. typedef struct _D3DNTHAL_DP2SETPIXELSHADERCONST
  942. {
  943. DWORD dwRegister; // Const register to start copying
  944. DWORD dwCount; // Number of 4-float vectors to copy
  945. // Data follows
  946. } D3DNTHAL_DP2SETPIXELSHADERCONST;
  947. typedef D3DNTHAL_DP2SETPIXELSHADERCONST *LPD3DNTHAL_DP2SETPIXELSHADERCONST;
  948. // Flags that can be supplied to DRAWRECTPATCH and DRAWTRIPATCH
  949. #define _NT_RTPATCHFLAG_HASSEGS 0x00000001L
  950. #define _NT_RTPATCHFLAG_HASINFO 0x00000002L
  951. typedef struct _D3DNTHAL_DP2DRAWRECTPATCH
  952. {
  953. DWORD Handle;
  954. DWORD Flags;
  955. // Optionally followed by D3DFLOAT[4] NumSegments and/or D3DRECTPATCH_INFO
  956. } D3DNTHAL_DP2DRAWRECTPATCH;
  957. typedef D3DNTHAL_DP2DRAWRECTPATCH *LPD3DNTHAL_DP2DRAWRECTPATCH;
  958. typedef struct _D3DNTHAL_DP2DRAWTRIPATCH
  959. {
  960. DWORD Handle;
  961. DWORD Flags;
  962. // Optionally followed by D3DFLOAT[3] NumSegments and/or D3DTRIPATCH_INFO
  963. } D3DNTHAL_DP2DRAWTRIPATCH;
  964. typedef D3DNTHAL_DP2DRAWTRIPATCH *LPD3DNTHAL_DP2DRAWTRIPATCH;
  965. typedef struct _D3DNTHAL_DP2VOLUMEBLT
  966. {
  967. DWORD dwDDDestSurface;// dest surface
  968. DWORD dwDDSrcSurface; // src surface
  969. DWORD dwDestX; // dest X (width)
  970. DWORD dwDestY; // dest Y (height)
  971. DWORD dwDestZ; // dest Z (depth)
  972. D3DBOX srcBox; // src box
  973. DWORD dwFlags; // blt flags
  974. } D3DNTHAL_DP2VOLUMEBLT;
  975. typedef D3DNTHAL_DP2VOLUMEBLT *LPD3DNTHAL_DP2VOLUMEBLT;
  976. typedef struct _D3DNTHAL_DP2BUFFERBLT
  977. {
  978. DWORD dwDDDestSurface; // dest surface
  979. DWORD dwDDSrcSurface; // src surface
  980. DWORD dwOffset; // Offset in the dest surface (in BYTES)
  981. D3DRANGE rSrc; // src range
  982. DWORD dwFlags; // blt flags
  983. } D3DNTHAL_DP2BUFFERBLT;
  984. typedef D3DNTHAL_DP2BUFFERBLT *LPD3DNTHAL_DP2BUFFERBLT;
  985. typedef struct _D3DNTHAL_DP2ADDDIRTYRECT
  986. {
  987. DWORD dwSurface; // Driver managed surface
  988. RECTL rDirtyArea; // Area marked dirty
  989. } D3DNTHAL_DP2ADDDIRTYRECT;
  990. typedef D3DNTHAL_DP2ADDDIRTYRECT *LPD3DNTHAL_DP2ADDDIRTYRECT;
  991. typedef struct _D3DNTHAL_DP2ADDDIRTYBOX
  992. {
  993. DWORD dwSurface; // Driver managed volume
  994. D3DBOX DirtyBox; // Box marked dirty
  995. } D3DNTHAL_DP2ADDDIRTYBOX;
  996. typedef D3DNTHAL_DP2ADDDIRTYBOX *LPD3DNTHAL_DP2ADDDIRTYBOX;
  997. // Macros to access vertex shader binary code
  998. #define _NT_D3DSI_GETREGTYPE(token) (token & D3DSP_REGTYPE_MASK)
  999. #define _NT_D3DSI_GETREGNUM(token) (token & D3DSP_REGNUM_MASK)
  1000. #define _NT_D3DSI_GETOPCODE(command) (command & D3DSI_OPCODE_MASK)
  1001. #define _NT_D3DSI_GETWRITEMASK(token) (token & D3DSP_WRITEMASK_ALL)
  1002. #define _NT_D3DVS_GETSWIZZLECOMP(source, component) (source >> ((component << 1) + 16) & 0x3)
  1003. #define _NT_D3DVS_GETSWIZZLE(token) (token & D3DVS_SWIZZLE_MASK)
  1004. #define _NT_D3DVS_GETSRCMODIFIER(token) (token & D3DSP_SRCMOD_MASK)
  1005. #define _NT_D3DVS_GETADDRESSMODE(token) (token & D3DVS_ADDRESSMODE_MASK)
  1006. #define _NT_D3DRS_DELETERTPATCH 169 // DDI only to delete high order patch
  1007. //-----------------------------------------------------------------------------
  1008. //
  1009. // DirectX 8.0's new driver info querying mechanism.
  1010. //
  1011. // How to handle the new driver info query mechanism.
  1012. //
  1013. // DirectX 8.0 utilizes an extension to GetDriverInfo() to query for
  1014. // additional information from the driver. Currently this mechanism is only
  1015. // used for querying for DX8 style D3D caps but it may be used for other
  1016. // information over time.
  1017. //
  1018. // This extension to GetDriverInfo takes the form of a GetDriverInfo call
  1019. // with the GUID GUID_GetDriverInfo2. When a GetDriverInfo call with this
  1020. // GUID is received by the driver the driver must check the data passed
  1021. // in the lpvData field of the DD_GETDRIVERINFODATA data structure to see
  1022. // what information is being requested.
  1023. //
  1024. // It is important to note that the GUID GUID_GetDriverInfo2 is, in fact,
  1025. // the same as the GUID_DDStereoMode. If you driver doesn't handle
  1026. // GUID_DDStereoMode this is not an issue. However, if you wish your driver
  1027. // to handle GUID_DDStereoMode as well as GUID_GetDriverInfo2 special action
  1028. // must be taken. When a call tp GetDriverInfo with the GUID
  1029. // GUID_GetDriverInfo2/GUID_DDStereoMode is made the runtime sets the
  1030. // dwHeight field of the DD_STEREOMODE structure to the special value
  1031. // D3DGDI2_MAGIC. In this way you can determine when the request is a
  1032. // stereo mode call or a GetDriverInfo2 call. The dwHeight field of
  1033. // DD_STEREOMODE corresponds to the dwMagic field of the
  1034. // DD_GETDRIVERINFO2DATA structure.
  1035. //
  1036. // The dwExpectedSize field of the DD_GETDRIVERINFODATA structure is not
  1037. // used by when a GetDriverInfo2 request is being made and should be
  1038. // ignored. The actual expected size of the data is found in the
  1039. // dwExpectedSize of the DD_GETDRIVERINFO2DATA structure.
  1040. //
  1041. // Once the driver has determined that this is a call to
  1042. // GetDriverInfo2 it must then determine the type of information being
  1043. // requested by the runtime. This type is contained in the dwType field
  1044. // of the DD_GETDRIVERINFO2DATA data structure.
  1045. //
  1046. // Finally, once the driver knows this is a GetDriverInfo2 request of a
  1047. // particular type it can copy the requested data into the data buffer.
  1048. // It is important to note that the lpvData field of the DD_GETDRIVERINFODATA
  1049. // data structure points to data buffer in which to copy your data. lpvData
  1050. // also points to the DD_GETDRIVERINFO2DATA structure. This means that the
  1051. // data returned by the driver will overwrite the DD_GETDRIVERINFO2DATA
  1052. // structure and, hence, the DD_GETDRIVERINFO2DATA structure occupies the
  1053. // first few DWORDs of the buffer.
  1054. //
  1055. // The following code fragment demonstrates how to handle GetDriverInfo2.
  1056. //
  1057. // D3DCAPS8 myD3DCaps8;
  1058. //
  1059. // DWORD CALLBACK
  1060. // DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA lpData)
  1061. // {
  1062. // if (MATCH_GUID((lpData->guidInfo), GUID_GetDriverInfo2) )
  1063. // {
  1064. // ASSERT(NULL != lpData);
  1065. // ASSERT(NULL != lpData->lpvData);
  1066. //
  1067. // // Is this a call to GetDriverInfo2 or DDStereoMode?
  1068. // if (((DD_GETDRIVERINFO2DATA*)(lpData->lpvData))->dwMagic == D3DGDI2_MAGIC)
  1069. // {
  1070. // // Yes, its a call to GetDriverInfo2, fetch the
  1071. // // DD_GETDRIVERINFO2DATA data structure.
  1072. // DD_GETDRIVERINFO2DATA* pgdi2 = lpData->lpvData;
  1073. // ASSERT(NULL != pgdi2);
  1074. //
  1075. // // What type of request is this?
  1076. // switch (pgdi2->dwType)
  1077. // {
  1078. // case D3DGDI2_TYPE_GETD3DCAPS8:
  1079. // {
  1080. // // The runtime is requesting the DX8 D3D caps so
  1081. // // copy them over now.
  1082. //
  1083. // // It should be noted that the dwExpectedSize field
  1084. // // of DD_GETDRIVERINFODATA is not used for
  1085. // // GetDriverInfo2 calls and should be ignored.
  1086. // size_t copySize = min(sizeof(myD3DCaps8), pgdi2->dwExpectedSize);
  1087. // memcpy(lpData->lpvData, &myD3DCaps8, copySize);
  1088. // lpData->dwActualSize = copySize;
  1089. // lpData->ddRVal = DD_OK;
  1090. // return DDHAL_DRIVER_HANDLED;
  1091. // }
  1092. // default:
  1093. // // For any other GetDriverInfo2 types not handled
  1094. // // or understood by the driver set an ddRVal of
  1095. // // DDERR_CURRENTLYNOTAVAIL and return
  1096. // // DDHAL_DRIVER_HANDLED.
  1097. // return DDHAL_DRIVER_HANDLED;
  1098. // }
  1099. // }
  1100. // else
  1101. // {
  1102. // // It must be a call a request for stereo mode support.
  1103. // // Fetch the stereo mode data
  1104. // DD_STEREOMODE* pStereoMode = lpData->lpvData;
  1105. // ASSERT(NULL != pStereoMode);
  1106. //
  1107. // // Process the stereo mode request...
  1108. // lpData->dwActualSize = sizeof(DD_STEREOMODE);
  1109. // lpData->ddRVal = DD_OK;
  1110. // return DDHAL_DRIVER_HANDLED;
  1111. // }
  1112. // }
  1113. //
  1114. // // Handle any other device GUIDs...
  1115. //
  1116. // } // DdGetDriverInfo
  1117. //
  1118. //-----------------------------------------------------------------------------
  1119. //
  1120. // The data structure which is passed to the driver when GetDriverInfo is
  1121. // called with a GUID of GUID_GetDriverInfo2.
  1122. //
  1123. // NOTE: Although the fields listed below are all read only this data
  1124. // structure is actually the first four DWORDs of the data buffer into
  1125. // which the driver writes the requested infomation. As such, these fields
  1126. // (and the entire data structure) are overwritten by the data returned by
  1127. // the driver.
  1128. //
  1129. typedef struct _DDNT_GETDRIVERINFO2DATA
  1130. {
  1131. DWORD dwReserved; // Reserved Field.
  1132. // Driver should not read or write this field.
  1133. DWORD dwMagic; // Magic Number. Has the value D3DGDI2_MAGIC if
  1134. // this is a GetDriverInfo2 call. Otherwise
  1135. // this structure is, in fact, a DD_STEREOMODE
  1136. // call.
  1137. // Driver should only read this field.
  1138. DWORD dwType; // Type of information requested. This field
  1139. // contains one of the DDGDI2_TYPE_ #defines
  1140. // listed below.
  1141. // Driver should only read (not write) this
  1142. // field.
  1143. DWORD dwExpectedSize; // Expected size of the information requested.
  1144. // Driver should only read (not write) this
  1145. // field.
  1146. // The remainder of the data buffer (beyond the first four DWORDs)
  1147. // follows here.
  1148. } DDNT_GETDRIVERINFO2DATA;
  1149. //
  1150. // IMPORTANT NOTE: This GUID has exactly the same value as GUID_DDStereoMode
  1151. // and as such you must be very careful when using it. If your driver needs
  1152. // to handle both GetDriverInfo2 and DDStereoMode it must have a single
  1153. // check for the shared GUID and then distinguish between which use of that
  1154. // GUID is being requested.
  1155. //
  1156. #define _NT_GUID_GetDriverInfo2 (GUID_DDStereoMode)
  1157. //
  1158. // Magic value used to determine whether a GetDriverInfo call with the
  1159. // GUID GUID_GetDriverInfo2/GUID_DDStereoMode is a GetDriverInfo2 request
  1160. // or a query about stereo capabilities. This magic number is stored in
  1161. // the dwHeight field of the DD_STEREOMODE data structure.
  1162. //
  1163. #define _NT_D3DGDI2_MAGIC (0xFFFFFFFFul)
  1164. //
  1165. // The types of information which can be requested from the driver via
  1166. // GetDriverInfo2.
  1167. //
  1168. #define _NT_D3DGDI2_TYPE_GETD3DCAPS8 (0x00000001ul) // Return the D3DCAPS8 data
  1169. #define _NT_D3DGDI2_TYPE_GETFORMATCOUNT (0x00000002ul) // Return the number of supported formats
  1170. #define _NT_D3DGDI2_TYPE_GETFORMAT (0x00000003ul) // Return a particular format
  1171. #define _NT_D3DGDI2_TYPE_DXVERSION (0x00000004ul) // Notify driver of current DX Version
  1172. #define _NT_D3DGDI2_TYPE_DEFERRED_AGP_AWARE (0x00000018ul) // Runtime is aware of deferred AGP frees, and will send following
  1173. #define _NT_D3DGDI2_TYPE_FREE_DEFERRED_AGP (0x00000019ul) // Free any deferred-freed AGP allocations for this process
  1174. #define _NT_D3DGDI2_TYPE_DEFER_AGP_FREES (0x00000020ul) // Start Deferring AGP frees for this process
  1175. //
  1176. // This data structure is returned by the driver in response to a
  1177. // GetDriverInfo2 query with the type D3DGDI2_TYPE_GETFORMATCOUNT. It simply
  1178. // gives the number of surface formats supported by the driver. Currently this
  1179. // structure consists of a single member giving the number of supported
  1180. // surface formats.
  1181. //
  1182. typedef struct _DDNT_GETFORMATCOUNTDATA
  1183. {
  1184. DDNT_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  1185. DWORD dwFormatCount; // [out] Number of supported surface formats
  1186. DWORD dwReserved; // Reserved
  1187. } DDNT_GETFORMATCOUNTDATA;
  1188. //
  1189. // This data structure is used to request a specific surface format from the
  1190. // driver. It is guaranteed that the requested format will be greater than or
  1191. // equal to zero and less that the format count reported by the driver from
  1192. // the preceeding D3DGDI2_TYPE_GETFORMATCOUNT request.
  1193. //
  1194. typedef struct _DDNT_GETFORMATDATA
  1195. {
  1196. DDNT_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  1197. DWORD dwFormatIndex; // [in] The format to return
  1198. DDPIXELFORMAT format; // [out] The actual format
  1199. } DDNT_GETFORMATDATA;
  1200. //
  1201. // This data structure is used to notify drivers about the DirectX version
  1202. // number. This is the value that is denoted as DD_RUNTIME_VERSION in the
  1203. // DDK headers.
  1204. //
  1205. typedef struct _DDNT_DXVERSION
  1206. {
  1207. DDNT_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  1208. DWORD dwDXVersion; // [in] The Version of DX
  1209. DWORD dwReserved; // Reserved
  1210. } DDNT_DXVERSION;
  1211. // Informs driver that runtime will send a notification after last outstanding AGP
  1212. // lock has been released.
  1213. typedef struct _DDNT_DEFERRED_AGP_AWARE_DATA
  1214. {
  1215. DDNT_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  1216. } DDNT_DEFERRED_AGP_AWARE_DATA;
  1217. // Notification that the last AGP lock has been released. Driver can free all deferred AGP
  1218. // allocations for this process.
  1219. typedef struct _DDNT_FREE_DEFERRED_AGP_DATA
  1220. {
  1221. DDNT_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  1222. DWORD dwProcessId; // [in] Process ID for whom to free deferred AGP
  1223. } DDNT_FREE_DEFERRED_AGP_DATA;
  1224. // New Caps that are not API visible that the driver exposes.
  1225. #define _NT_D3DDEVCAPS_HWVERTEXBUFFER 0x02000000L /* Device supports Driver Allocated Vertex Buffers*/
  1226. #define _NT_D3DDEVCAPS_HWINDEXBUFFER 0x04000000L /* Device supports Driver Allocated Index Buffers*/
  1227. #define _NT_D3DDEVCAPS_SUBVOLUMELOCK 0x08000000L /* Device supports locking a part of volume texture */
  1228. #define _NT_D3DPMISCCAPS_FOGINFVF 0x00002000L // Device supports separate fog value in the FVF
  1229. // New FVF flags that are not API visible but accessed by the driver
  1230. // Note, that D3DFVF_RESERVED2 includes this flag and should not be used for validation
  1231. #define _NT_D3DFVF_FOG 0x00002000L // There is a separate fog value in the FVF vertex
  1232. //
  1233. // This stuff is not API visible but should be DDI visible.
  1234. // Should be in Sync with d3d8types.h
  1235. //
  1236. #define _NT_D3DFMT_D32 (D3DFORMAT)71
  1237. #define _NT_D3DFMT_S1D15 (D3DFORMAT)72
  1238. #define _NT_D3DFMT_D15S1 (D3DFORMAT)73
  1239. #define _NT_D3DFMT_S8D24 (D3DFORMAT)74
  1240. #define _NT_D3DFMT_D24S8 (D3DFORMAT)75
  1241. #define _NT_D3DFMT_X8D24 (D3DFORMAT)76
  1242. #define _NT_D3DFMT_D24X8 (D3DFORMAT)77
  1243. #define _NT_D3DFMT_X4S4D24 (D3DFORMAT)78
  1244. #define _NT_D3DFMT_D24X4S4 (D3DFORMAT)79
  1245. // Vertex Shader 1.1 register limits. D3D device must provide at least
  1246. // specified number of registers
  1247. //
  1248. #define _NT_D3DVS_INPUTREG_MAX_V1_1 16
  1249. #define _NT_D3DVS_TEMPREG_MAX_V1_1 12
  1250. // This max required number. Device could have more registers. Check caps.
  1251. #define _NT_D3DVS_CONSTREG_MAX_V1_1 96
  1252. #define _NT_D3DVS_TCRDOUTREG_MAX_V1_1 8
  1253. #define _NT_D3DVS_ADDRREG_MAX_V1_1 1
  1254. #define _NT_D3DVS_ATTROUTREG_MAX_V1_1 2
  1255. #define _NT_D3DVS_MAXINSTRUCTIONCOUNT_V1_1 128
  1256. // Pixel Shader DX8 register limits. D3D device will have at most these
  1257. // specified number of registers
  1258. //
  1259. #define _NT_D3DPS_INPUTREG_MAX_DX8 8
  1260. #define _NT_D3DPS_TEMPREG_MAX_DX8 8
  1261. #define _NT_D3DPS_CONSTREG_MAX_DX8 8
  1262. #define _NT_D3DPS_TEXTUREREG_MAX_DX8 8
  1263. #endif // (DIRECT3D_VERSION >= 0x0800 )
  1264. #endif /* _D3DNTHAL_H */