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.

445 lines
20 KiB

  1. DirectX 8.1 Driver Development Kit - Release Notes
  2. Overview
  3. --------
  4. This release of the DirectX Driver Development kit was assembled to aid in developing DirectX8 display drivers for the Win2K family of operating systems This kit contains sample code for 3DLabs' Permedia3 based display adapters, and demonstrates as many DirectX8 features as could be implemented with this hardware. Our focus is on DirectX related features. The sample code also includes non-DirectX related code which is needed to complete the driver so it can be installed and run.
  5. Microsoft wishes to thank 3DLabs for allowing us to use the Permedia3 as a basis for sample driver code.
  6. Tools
  7. -----
  8. The sample code in this DDK was built and tested using the following Microsoft products.
  9. Windows 2000 Platform DDK
  10. Notes: 1. can be downloaded at http://www.microsoft.com/ddk
  11. 2. Be sure to check "Samples" group in addition to "Build Environment"
  12. DirectX 8.0 SDK
  13. Visual C++ 32-bit Compiler (Version 6.0, Compiler Version 12.00.8168) (typical / default installation will suffice)
  14. Building driver sample source
  15. -----------------------------
  16. The following is a brief summary of the commands to build the various display driver samples. These commands
  17. assume that the required tools and related DDK materials are installed and the appropriate commands have been
  18. run from the platform DDK to choose a retail or debug build enviroment
  19. i.e.
  20. Start -> Programs -> Development Kits -> Windows 2000 DDK -> Checked Build Environment
  21. or
  22. Start -> Programs -> Development Kits -> Windows 2000 DDK -> Free Build Environment
  23. Building samples for Win2K
  24. Permedia3 sample
  25. display driver
  26. <dxddk root>\src\video\displays\p3samp> build -cZ
  27. miniport driver
  28. <dxddk root>\src\video\miniport\p3samp> build -cZ
  29. Dx8 reference
  30. <dxddk root>\src\video\displays\d3dref8> build -cZ daytona
  31. Building samples for Win9x
  32. To build the win9x components of the sample driver:
  33. ..\src\win_me\display\mini\p3samp\drv
  34. ..\src\win_me\display\minivdd\p3samp
  35. ..\src\video\display\p3samp\dx\win9x
  36. start the debug Win ME command shell
  37. Start -> Programs -> Development Kits -> Windows ME DDK -> Checked Build Environment for Win ME
  38. ..\src\win_me\display\mini\p3samp\drv> nmake debug
  39. ..\src\win_me\display\minivdd\p3samp> nmake debug
  40. start the debug Windows 2000 command shell
  41. Start -> Programs -> Development Kits -> Windows 2000 DDK -> Checked Build Environment
  42. ..\src\video\display\p3samp\dx\win9x> build
  43. or
  44. start the retail Win ME command shell:
  45. Start -> Programs -> Development Kits -> Windows ME DDK -> Free Build Environment for Win ME
  46. ..\src\win_me\display\mini\p3samp\drv> nmake retail
  47. ..\src\win_me\display\minivdd\p3samp> nmake retail
  48. start the retail Win 2000 command shell
  49. Start -> Programs -> Development Kits -> Windows 2000 DDK -> Free Build Environment
  50. ..\src\video\display\p3samp\dx\win9x> build
  51. refrast
  52. <dxddk root>\src\video\displays\d3dref8> build -cZ win9x
  53. Driver Version Numbers
  54. ----------------------
  55. Windows Hardware Quality Labs has recommendations on version numbering schemes. Please refer to
  56. http://microsoft.com/hwdev/devdes/dll_dx5.htm
  57. for general details regarding driver versioning. Specifically regarding version number ranges for
  58. DX8 drivers the following version number ranges should be used for DX8 drivers.
  59. Windows 95/98 DirectX 8.0 compatible drivers 4.13.01.0000 through 4.13.01.9999
  60. Windows 2000 DirectX 8.0 compatible drivers 5.13.01.0000 through 5.13.01.9999
  61. Please note that earlier versions of this DDK were not setting these version numbers correctly. Please
  62. verify that the version numbers of your drivers comply with the rules given above and with the sample
  63. drivers built from this release of the DDK or later.
  64. Maximum number of queued presentation blts
  65. ------------------------------------------
  66. Note: DX8 drivers must not queue more than 3 presentation blts. Queueing more than 3 presentation blts
  67. may result in DCT failures and prohibit drivers from logo certification.
  68. Clarification of lockable Z buffer function
  69. -------------------------------------------
  70. A DX8 driver is not required to support a lockable z-buffer, but if it does, functionality must be
  71. consistent with REF.
  72. Setting D3DPTEXTURECAPS_MIPMAP
  73. ------------------------------
  74. Beginning with DX8 runtimes drivers are required to set D3DPTEXTURECAPS_MIPMAP if the device supports
  75. mip-mapped textures. This differs from DX7 runtimes which set this cap based on legacy caps.
  76. Additionally the actual texture filter caps passed to the driver via TSS_MIPFILTER etc. have changed
  77. with DX8. The texture filter values passed to the driver for DX8 are defined by the enumerated type
  78. D3DTEXTUREFILTERTYPE and not the legacy enumerated types D3DTEXTUREMAGFITLER, D3DTEXTUREMINFILTER and
  79. D3DTEXTUREMIPFILTER. The driver must, therefore, use the runtime type of the call to identify the type
  80. of value for texture filters. The driver has the option to handle this condition by mapping the new filter
  81. enum to the old ones. Code to do this can be found in the DKD sample driver function
  82. __TXT_MapDX8toDX6TexFilter.
  83. Lightweight surface and caching of surface local/global/more pointers
  84. ---------------------------------------------------------------------------------------------------
  85. Caching surface related pointers passed down by runtime such as LPDDRAWI_DDRAWSURFACE_LCL,
  86. LPDDRAWI_DDRAWSURFACE_GBL and LPDDRAWI_DDRAWSURFACE_MORE is strongly discouraged in previous DX DDK releases.
  87. In DX8, the "Lightweight" surface was introduced on Win9x platform to reduce memory consumption by the DX
  88. runtime. A characteristic to consider is that "lightweight" surface local/global/more pointers for the same
  89. surface may change between each DDI call during the surface's lifetime. Cached surface related pointers will
  90. very likely cause various kinds of crashes or problems in your driver. Please reference to Permedia 3 sample
  91. driver for additional information on how to save the necessary information into a driver specific data
  92. structure during D3DCreateSurfaceEx call and then use it later in other DDI entry points.
  93. Changes in ref since DX7 release - known and suspected issues
  94. ---------------------------------------------------
  95. The following is a brief summary of the changes made to ref since the last DX7 DDk release
  96. 1. DXT4/5 alpha decoding problem - ramp of alpha values was inverted (refs3tc.cpp)
  97. 2. Cube Environment Map Filtering - incorrect texel indexing when minimizing (texture.cpp)
  98. 3. Flat shading and fog - incorrectly flat shading fog intensity when clipping (clipping.cpp)
  99. 4. D3DTA_SPECULAR always had 1.0 alpha channel (refrasti.hpp; scancnv.cpp; setup.cpp)
  100. 5. Changed function for computing texture coverage for cube maps (texture.cpp)
  101. Setting MaxPrinitiveCount Field in D3DCAPS8 Structure
  102. -----------------------------------------------------
  103. "For DirectX 8.0 drivers it is a requirement that the driver report the MaxPrimitiveCount field of D3DCAPS8
  104. to a value larger than 0x0000FFFFul but smaller than than 0x00FFFFFFul. The value of this field is used
  105. to indicate the number of vertices that can be specified for a single primitive in the DP2 stream. DirectX
  106. 8.0 drivers are required to support an arbitrary number vertices for a single DP2 primitive and hence must
  107. set the value of this field to range specified. A DirectX 8.0 driver is not permited to fail a DP2 drawing
  108. token because the number of vertices if that primitive exceeds 65535."
  109. Caps Reporting Requirements of the new D3DCAPS8 Structure
  110. ---------------------------------------------------------
  111. The new D3DCAPS8 structure is an aggregate of certain DirectDraw capabilities, pre-DirectX 8.0 Direct3D
  112. capabilities and new DirectX 8.0 capabilities. Although the DirectDraw related capabilities and older
  113. Direct3D capabilities are reported to the runtime through other mechanisms the runtime will not automatically
  114. propogate those capabilities to the D3DCAPS8 structure. It is, therefore, required that the driver fill
  115. in these capabilities (Caps, Caps2 and DevCaps) in the D3DCAPS8 data structure."
  116. world Transform Initialization Considerations
  117. ---------------------------------------------
  118. The DX8 runtime sends down a larger number of world transform initializations (256) when an app starts up.
  119. These are sent even if the driver doesn't support that many world transforms (it is highly unlikely that a
  120. driver will support 256 world matrices). Drivers should ignore any world transforms sets that it doesn't
  121. understand. Its also important to note that the world transforms in DX8 start at 0x0100 and go up to 0x01ff.
  122. These values are not part of the transform type enum so values of transform type in the DP2 stream of 0x0103
  123. etc. are perfectly legal.
  124. Sample Driver issues when used with VIA AGP chipsets
  125. ----------------------------------------------------
  126. There are currently known issues when attempting to use the Permedia III sample driver on systems using
  127. VIA AGP chipsets. The VIA AGP GART drivers in some circumstances can cause failures when using the DDK
  128. sample driver. No current work around exists. Please us the sample driver on systems with other than VIA
  129. AGP chipsets.
  130. Change in DX8 headers that may effect DX7 drivers
  131. -------------------------------------------------
  132. Please note that the following define
  133. D3DTRANSFORMSTATE_WORLD
  134. has changed from DX7 to DX8. Drivers using the DX7 version of the define should be updated to use
  135. D3DTRANSFORMSTATE_WORLD_DX7
  136. Failure to make this change will adversely effect DX7 T&L enabled apps when running on DX7 hardware T&L enabled
  137. drivers.
  138. winnt/win9x Differences in driver context information in DD*_GETDRIVERINFODATA
  139. -------------------------------------------------------------------------------
  140. Please note that there are minor differences in the definitions of DD*_GETDRIVERINFODATA between Windows 9x
  141. and Windows 2000.
  142. As defined in ddrawint.h:
  143. typedef struct _DD_GETDRIVERINFODATA {
  144. // Input fields filled in by DirectDraw
  145. VOID* dhpdev; // Driver context
  146. DWORD dwSize; // Size of this structure
  147. DWORD dwFlags; // Flags
  148. GUID guidInfo; // GUID that DirectX is querying for
  149. DWORD dwExpectedSize; // Size of callbacks structure expected by DirectDraw.
  150. PVOID lpvData; // Buffer that will receive the requested data
  151. // Output fields filled in by driver
  152. DWORD dwActualSize; // Size of callbacks structure expected by driver
  153. HRESULT ddRVal; // Return value from driver
  154. } DD_GETDRIVERINFODATA;
  155. As defined in ddrawi.h:
  156. typedef struct _DDHAL_GETDRIVERINFODATA {
  157. // Input fields filled in by DirectDraw
  158. DWORD dwSize; // Size of this structure
  159. DWORD dwFlags; // Flags
  160. GUID guidInfo; // GUID that DirectX is querying for
  161. DWORD dwExpectedSize; // Size of callbacks structure expected by DirectDraw.
  162. LPVOID lpvData; // Buffer that will receive the requested data
  163. // Output fields filled in by driver
  164. DWORD dwActualSize; // Size of callbacks structure expected by driver
  165. HRESULT ddRVal; // Return value from driver
  166. // Input field: Context information for driver
  167. // On Win95, this is the dwReserved3 field of the DIRECTDRAW_GBL
  168. // On NT, this is the hDD field of DIRECTDRAW_GBL
  169. ULONG_PTR dwContext; // Context Information
  170. } DDHAL_GETDRIVERINFODATA;
  171. The dhpdev and dwContext serve the same purpose, they are used by the driver to find the per card
  172. information.
  173. Clarification of dwReqCommandBufferSizeusage
  174. --------------------------------------------
  175. The dwReqCommandBufferSize field indicates that the amount the buffer should grow by. It is not the
  176. size the buffer is expected to grow to.
  177. DDSCAPS2_OPAQUE used to indicate lockability of flipping chain
  178. --------------------------------------------------------------
  179. DX8 runtimes now set DDSCAPS2_OPAQUE on the primary and the backbuffers if the flipping chain is not lockable.
  180. This allows drivers to do behind the scenes optimization. One misnomer: It is still possible for us to lock
  181. the primary surface so the driver will need to handle these cases, but such locks will be very infrequent
  182. and are not expected to be fast.
  183. Clarification of caps requirement for driver support of multi-sampling
  184. ----------------------------------------------------------------------
  185. Drivers supporting multisampling must fill in the multisample caps in the DpethStencil formats for which
  186. multi-sampling can be supported. This allows the runtime to detect if a driver supports multisample for
  187. combinations of render target and Z buffer formats. For additional information about the restrictions related
  188. to stretch blt multi-sampling please see the description of D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE cap in the
  189. rastercaps contained in the D3DCAPS8 struct in the SDK documentation.
  190. Please note: new rules for ops lists
  191. ------------------------------------
  192. The runtime now imposes some rules on the op list. The current rules are:
  193. a. Only One Endian-ness for any DS format is allowed i.e. D15S1 OR S1D15, not both
  194. independent of other bits.
  195. b. A list should only include D3DFORMAT_OP_DISPLAYMODE for exactly one 16bpp format
  196. (i.e. shouldn�t enumerate 5:5:5 and 5:6:5).
  197. c. A list should not any alpha formats with D3DFORMAT_OP_DISPLAYMODE or D3DFORMAT_OP_3DACCEL set.
  198. d. Make sure no mode has OP_3DACCEL set that doesn�t also have OP_DISPLAYMODE set.
  199. Clarification of use of D3DFMT_D16_LOCKABLE flag in op list
  200. -----------------------------------------------------------
  201. DX8 runtimes no longer us the D3DFORMAT_OP_D16_LOCKABLE flag with the introduction of a new format
  202. D3DFMT_D16_LOCKABLE. If the driver supports a lockable D16, it should report D3DFMT_D16_LOCKABLE in
  203. the op list; otherwise, it should report D3DFMT_D16.
  204. Clarification of D3DFORMAT_OP_DISPLAYMODE and D3DFORMAT_OP_3DACCELERATION
  205. -------------------------------------------------------------------------
  206. DX8 runtimes no longer support the D3DFORMAT_OP_BACKBUFFER flag as it was ambigious. In it's place are two
  207. new flags: D3DFORMAT_OP_DISPLAYMODE and D3DFORMAT_OP_3DACCELERATION. D3DFORMAT_OP_DISPLAYMODE indicates that
  208. the display format is supported by DirectDraw. D3DFORMAT_OP_3DACCELERATION means that D3D is also supported
  209. in this mode.
  210. Use of D3DGDI2_TYPE_DXVERSION to determine DX runtime version
  211. -------------------------------------------------------------
  212. The DX8 runtimes now support a way for a driver on NT to find out the DX-Runtime version.
  213. (This functionality exists on 9x but not on NT). This information is provided to a new driver
  214. (i.e. one that exposes GETDRIVERINFO2) for DX7 applications and DX8 applications.
  215. Here's the relevant snippets of header:
  216. #define D3DGDI2_TYPE_DXVERSION (0x00000004ul) // Notify driver of current DX Version
  217. //
  218. // This data structure is used to notify drivers about the DirectX version
  219. // number. This is the value that is denoted as DD_RUNTIME_VERSION in the
  220. // DDK headers.
  221. //
  222. typedef struct _DD_DXVERSION
  223. {
  224. DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data
  225. DWORD dwDXVersion; // [in] The Version of DX
  226. DWORD dwReserved; // Reserved
  227. } DD_DXVERSION;
  228. would result in x0000800 for dwDXVersion; or more accurately, you should DD_RUNTIME_VERSION which is defined
  229. in ddrawi.h.
  230. Compatibility note when using Millenium DDK
  231. -------------------------------------------
  232. Please note that in order to allow a single driver binary to load on Windows 95, through Millenium you must
  233. make sure that the DDK version is 4.0 This value in stored in DDK_VERSION. The Win9x kernel (VMM) will only load
  234. a VXD with the same or earlier version. VXDs with newer (numerically bigger) ddk version will fail to load.
  235. For a VXD to load on from Win95 to Millennium, an DDK version of 4.0 should be used. This can be controlled
  236. by macro as shown below : (it is part of the VMM.H)
  237. #ifndef DDK_VERSION
  238. #ifdef WIN31COMPAT
  239. #define DDK_VERSION 0x30A /* 3.10 */
  240. #else // WIN31COMPAT
  241. #ifdef WIN40COMPAT
  242. #define DDK_VERSION 0x400 /* 4.00 */
  243. #else // WIN40COMPAT
  244. #ifdef WIN41COMPAT
  245. #define DDK_VERSION 0x40A /*Memphis is 4.1 */
  246. #else // WIN41COMPAT
  247. #define DDK_VERSION 0x45A /*Millennium is 4.90 */
  248. #endif // WIN41COMPAT
  249. #endif // WIN40COMPAT
  250. #endif // WIN31COMPAT
  251. #endif // DDK_VERSION
  252. Developers should use WIN41COMPAT (WIN40COMPAT) if they can and want to use the same binary for ME,
  253. WIN98 (and WIN95)
  254. Driver Managed Resource Support
  255. -----------------------------------------------
  256. As DX7 allowed the driver to perform texture management, the current version allows us to manage plain textures, volume textures,
  257. cube textures, index buffers and vertex buffers. In order to enable a DX8.1 driver for resource management it is necessary for the driver
  258. to set the DDCAPS2_CANMANAGERESOURCE bit (in addition to DDCAPS2_CANMANAGETEXTURE) in the ddCaps.dwCaps field of the
  259. DDHALINFO when getting the DrvGetDirectDrawInfo callback.
  260. Two new DP2 command tokens that may appear also in the command buffer are
  261. D3DDP2OP_ADDDIRTYRECT: followed by a D3DHAL_DP2ADDDIRTYRECT structure. Indicates that a specific portion of a 2D resource
  262. (2D Texture or cube texture) has been dirtied in system memory, so it has to be reloaded into video memory before being used.
  263. typedef struct _D3DHAL_DP2ADDDIRTYRECT
  264. {
  265. DWORD dwSurface;
  266. RECTL rDirtyArea;
  267. } D3DHAL_DP2ADDDIRTYRECT, *LPD3DHAL_DP2ADDDIRTYRECT;
  268. Members
  269. dwSurface Is the surface handle to the managed dirtied surface
  270. rDirtyArea Rectangular area marked dirty
  271. Comments
  272. Used only for driver managed resources/surfaces. Never sent unless the driver effectively declares it manages resources.
  273. D3DDP2OP_ADDDIRTYBOX: followed by a D3DDP2OP_ADDDIRTYBOX structure. Indicates that a specific portion of a 3D resource
  274. (volume texture) has been dirtied in system memory, so it has to be reloaded into video memory before being used.
  275. typedef struct _D3DHAL_DP2ADDDIRTYBOX
  276. {
  277. DWORD dwSurface; // Driver managed volume
  278. D3DBOX DirtyBox; // Box marked dirty
  279. } D3DHAL_DP2ADDDIRTYBOX, *LPD3DHAL_DP2ADDDIRTYBOX;
  280. Members
  281. dwSurface Is the surface handle to the managed dirtied surface
  282. DirtyBox Box marked dirty
  283. Comments
  284. Used only for driver managed resources/surfaces. Never sent unless the driver effectively declares it manages resources.
  285. See the p3samp sample driver that ships with this DDK for more implementation details. Observe specifically code marked as
  286. DX7_TEXMANAGEMENT (DX7 style texture management) and also DX8_DDI (DX8 style resource management specializations).
  287. In the DdLock callback the dwFlags field of the DD_LOCKDATA structure should be watched for the new bit DDLOCK_NODIRTYUPDATE
  288. set when the an app does a lock with D3DLOCK_NO_DIRTY_UPDATE.
  289. WDM AVStream class
  290. -----------------------------
  291. AVSTest is a sample that demonstrates how to implement an AVStream filter driver. An inf file is supplied
  292. to install the driver. Once installed, use graphedt to use the sample by inserting the AVSTest filter from
  293. WDM Streaming Capture Devices. Render the 'Output' pin to a DShow Video Renderer.
  294. Location: <dxddk root>\src\wdm\dxva
  295. Feedback
  296. --------
  297. Please use the bug reporting form of the DirectX 8.0 DDK betaplace web page to report all issues related to the
  298. DirectX 8.0 DDK. Include include the DDK version number when reporting issues. The version number can be found
  299. in the dxddkver.txt file installed in the root directory of the DirectX 8.0 DDK.