Leaked source code of windows server 2003
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.

379 lines
18 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  4. * !! !!
  5. * !! WARNING: NOT DDK SAMPLE CODE !!
  6. * !! !!
  7. * !! This source code is provided for completeness only and should not be !!
  8. * !! used as sample code for display driver development. Only those sources !!
  9. * !! marked as sample code for a given driver component should be used for !!
  10. * !! development purposes. !!
  11. * !! !!
  12. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  13. *
  14. * Module Name: p3rxdef.h
  15. *
  16. * Content:
  17. *
  18. * Copyright (c) 1994-1999 3Dlabs Inc. Ltd. All rights reserved.
  19. * Copyright (c) 1995-2003 Microsoft Corporation. All rights reserved.
  20. \*****************************************************************************/
  21. // This file containes defines for values that are filled into fields on P3/RX
  22. // The file glintdef.h is the equivalent for glint chips.
  23. // These defines are typically used in conjunction with the macros in bitmac2.h,
  24. // which shift the values to their correct locations.
  25. #ifdef __P3RXDEF
  26. #pragma message ("FILE : "__FILE__" : Multiple Inclusion")
  27. #endif
  28. #define __P3RXDEF
  29. // Dither unit.
  30. // these COLORFORMATs are used in various other places too,
  31. // e.g. the alpha blend unit.
  32. #define P3RX_DITHERMODE_COLORFORMAT_8888 0
  33. #define P3RX_DITHERMODE_COLORFORMAT_4444 1
  34. #define P3RX_DITHERMODE_COLORFORMAT_5551 2
  35. #define P3RX_DITHERMODE_COLORFORMAT_565 3
  36. #define P3RX_DITHERMODE_COLORFORMAT_332 4
  37. #define P3RX_DITHERMODE_COLORFORMAT_CI 15
  38. #define P3RX_DITHERMODE_COLORFORMAT_ILLEGAL -1
  39. // Usually use the COLOR_MODE macro for the default order.
  40. #define P3RX_DITHERMODE_COLORORDER_BGR 0
  41. #define P3RX_DITHERMODE_COLORORDER_RGB 1
  42. // Careful! These are not the way round you would expect.
  43. #define P3RX_DITHERMODE_ALPHADITHER_DITHER 0
  44. #define P3RX_DITHERMODE_ALPHADITHER_ROUND 1
  45. #define P3RX_DITHERMODE_ROUNDINGMODE_TRUNCATE 0
  46. #define P3RX_DITHERMODE_ROUNDINGMODE_ROUNDUP 1
  47. #define P3RX_DITHERMODE_ROUNDINGMODE_ROUNDDOWN 2
  48. // Texture unit bit fields
  49. // Texture Read Mode
  50. #define P3RX_TEXREADMODE_TEXELSIZE_8 0
  51. #define P3RX_TEXREADMODE_TEXELSIZE_16 1
  52. #define P3RX_TEXREADMODE_TEXELSIZE_32 2
  53. #define P3RX_TEXREADMODE_TEXELSIZE_64 3
  54. #define P3RX_TEXREADMODE_TEXTURETYPE_NORMAL 0
  55. #define P3RX_TEXREADMODE_TEXTURETYPE_8BITINDEXED 1
  56. #define P3RX_TEXREADMODE_TEXTURETYPE_422_YVYU 2
  57. #define P3RX_TEXREADMODE_TEXTURETYPE_422_VYUY 3
  58. // Texture index mode
  59. #define P3RX_TEXINDEXMODE_WRAP_CLAMP 0
  60. #define P3RX_TEXINDEXMODE_WRAP_REPEAT 1
  61. #define P3RX_TEXINDEXMODE_WRAP_MIRROR 2
  62. #define P3RX_TEXINDEXMODE_WRAP_CLAMPEDGE 3
  63. #define P3RX_TEXINDEXMODE_MAPTYPE_1D 0
  64. #define P3RX_TEXINDEXMODE_MAPTYPE_2D 1
  65. #define P3RX_TEXINDEXMODE_FILTER_NEAREST 0
  66. #define P3RX_TEXINDEXMODE_FILTER_LINEAR 1
  67. #define P3RX_TEXINDEXMODE_FILTER_NEARESTMIPNEAREST 2
  68. #define P3RX_TEXINDEXMODE_FILTER_NEARESTMIPLINEAR 3
  69. #define P3RX_TEXINDEXMODE_FILTER_LINEARMIPNEAREST 4
  70. #define P3RX_TEXINDEXMODE_FILTER_LINEARMIPLINEAR 5
  71. #define P3RX_TEXINDEXMODE_BIAS_MINUSHALF 0
  72. #define P3RX_TEXINDEXMODE_BIAS_ZERO 1
  73. #define P3RX_TEXINDEXMODE_BIAS_PLUSHALF 2
  74. // Texture read unit
  75. #define P3RX_TEXREADMODE_TEXELSIZE_8 0
  76. #define P3RX_TEXREADMODE_TEXELSIZE_16 1
  77. #define P3RX_TEXREADMODE_TEXELSIZE_32 2
  78. #define P3RX_TEXREADMODE_TEXELSIZE_64SPAN 3
  79. #define P3RX_TEXREADMODE_ORIGIN_TOPLEFT 0
  80. #define P3RX_TEXREADMODE_ORIGIN_BOTTOMLEFT 1
  81. #define P3RX_TEXREADMODE_TEXTURETYPE_NORMAL 0
  82. #define P3RX_TEXREADMODE_TEXTURETYPE_8BITINDEXED 1
  83. #define P3RX_TEXREADMODE_TEXTURETYPE_YVYU422 2
  84. #define P3RX_TEXREADMODE_TEXTURETYPE_VYUY422 3
  85. #define P3RX_TEXREADMODE_BYTESWAP_NONE 0
  86. #define P3RX_TEXREADMODE_BYTESWAP_ABCDEFGH 0
  87. #define P3RX_TEXREADMODE_BYTESWAP_BADCFEHG 1
  88. #define P3RX_TEXREADMODE_BYTESWAP_CDABGHEF 2
  89. #define P3RX_TEXREADMODE_BYTESWAP_DCBAHGFE 3
  90. #define P3RX_TEXREADMODE_BYTESWAP_EFGHABCD 4
  91. #define P3RX_TEXREADMODE_BYTESWAP_FEHGBADC 5
  92. #define P3RX_TEXREADMODE_BYTESWAP_GHEFCDAB 6
  93. #define P3RX_TEXREADMODE_BYTESWAP_HGFEDCBA 7
  94. // Texture Application
  95. #define P3RX_TEXAPP_A_CC 0
  96. #define P3RX_TEXAPP_A_CA 1
  97. #define P3RX_TEXAPP_A_KC 2
  98. #define P3RX_TEXAPP_A_KA 3
  99. #define P3RX_TEXAPP_B_TC 0
  100. #define P3RX_TEXAPP_B_TA 1
  101. #define P3RX_TEXAPP_B_KC 2
  102. #define P3RX_TEXAPP_B_KA 3
  103. #define P3RX_TEXAPP_I_CA 0
  104. #define P3RX_TEXAPP_I_KA 1
  105. #define P3RX_TEXAPP_I_TC 2
  106. #define P3RX_TEXAPP_I_TA 3
  107. #define P3RX_TEXAPP_OPERATION_PASS_A 0
  108. #define P3RX_TEXAPP_OPERATION_PASS_B 1
  109. #define P3RX_TEXAPP_OPERATION_ADD_AB 2
  110. #define P3RX_TEXAPP_OPERATION_MODULATE_AB 3
  111. #define P3RX_TEXAPP_OPERATION_LERP_ABI 4
  112. #define P3RX_TEXAPP_OPERATION_MODULATE_AB_ADD_I 5
  113. #define P3RX_TEXAPP_OPERATION_MODULATE_AI_ADD_B 6
  114. #define P3RX_TEXAPP_OPERATION_MODULATE_BI_ADD_A 7
  115. // Texture composite
  116. // 0 and 1 are the current colour on the second stage,
  117. // and the heightfield emboss mode on the first.
  118. // Note that HEIGHTC=HEIGHTA
  119. #define P3RX_TEXCOMP_OC 0
  120. #define P3RX_TEXCOMP_OA 1
  121. #define P3RX_TEXCOMP_HEIGHTC 0
  122. #define P3RX_TEXCOMP_HEIGHTA 1
  123. #define P3RX_TEXCOMP_CC 2
  124. #define P3RX_TEXCOMP_CA 3
  125. #define P3RX_TEXCOMP_FC 4
  126. #define P3RX_TEXCOMP_FA 5
  127. #define P3RX_TEXCOMP_T0C 6
  128. #define P3RX_TEXCOMP_T0A 7
  129. #define P3RX_TEXCOMP_T1C 8
  130. #define P3RX_TEXCOMP_T1A 9
  131. #define P3RX_TEXCOMP_SUM 10
  132. // HA = height. Same as output.a on first stage.
  133. #define P3RX_TEXCOMP_I_OA 0
  134. #define P3RX_TEXCOMP_I_HA 0
  135. #define P3RX_TEXCOMP_I_CA 1
  136. #define P3RX_TEXCOMP_I_FA 2
  137. #define P3RX_TEXCOMP_I_T0A 3
  138. #define P3RX_TEXCOMP_I_T1A 4
  139. // These need to be renamed to P3RX_TEXCOMP_AB_ARGx for consistency.
  140. #define P3RX_TEXCOMP_ARG1 0
  141. #define P3RX_TEXCOMP_ARG2 1
  142. #define P3RX_TEXCOMP_OPERATION_PASS_A 0
  143. #define P3RX_TEXCOMP_OPERATION_ADD_AB 1
  144. #define P3RX_TEXCOMP_OPERATION_ADDSIGNED_AB 2
  145. #define P3RX_TEXCOMP_OPERATION_SUBTRACT_AB 3
  146. #define P3RX_TEXCOMP_OPERATION_MODULATE_AB 4
  147. #define P3RX_TEXCOMP_OPERATION_LERP_ABI 5
  148. #define P3RX_TEXCOMP_OPERATION_MODULATE_AB_ADD_I 6
  149. #define P3RX_TEXCOMP_OPERATION_MODULATE_AI_ADD_B 7
  150. #define P3RX_TEXCOMP_OPERATION_ADD_AB_SUB_MODULATE_AB 8
  151. #define P3RX_TEXCOMP_OPERATION_MODULATE_SIGNED_AB 9
  152. // These need to be renamed P3RX_TEXCOMP_SCALE_xxx
  153. #define P3RX_TEXCOMP_OPERATION_SCALE_HALF 0
  154. #define P3RX_TEXCOMP_OPERATION_SCALE_ONE 1
  155. #define P3RX_TEXCOMP_OPERATION_SCALE_TWO 2
  156. #define P3RX_TEXCOMP_OPERATION_SCALE_FOUR 3
  157. // Render
  158. #define P3RX_RENDER_PRIMITIVETYPE_LINE 0
  159. #define P3RX_RENDER_PRIMITIVETYPE_TRAPEZOID 1
  160. #define P3RX_RENDER_PRIMITIVETYPE_POINT 2
  161. #define P3RX_RENDER_ANTIALIASINGQUALITY_4X4 0
  162. #define P3RX_RENDER_ANTIALIASINGQUALITY_8X8 1
  163. // 2D Render operations.
  164. #define P3RX_RENDER2D_OPERATION_NORMAL 0
  165. #define P3RX_RENDER2D_OPERATION_SYNC_ON_HOST_DATA 1
  166. #define P3RX_RENDER2D_OPERATION_SYNC_ON_BIT_MASK 2
  167. #define P3RX_RENDER2D_OPERATION_PATCH_ORDER_RENDERING 3
  168. #define P3RX_RENDER2D_SPAN_CONSTANT 0
  169. #define P3RX_RENDER2D_SPAN_VARIABLE 1
  170. // For P3RX_ALPHABLENDxxxMODE
  171. #define P3RX_ALPHABLENDMODE_SRCBLEND_ZERO 0
  172. #define P3RX_ALPHABLENDMODE_SRCBLEND_ONE 1
  173. #define P3RX_ALPHABLENDMODE_SRCBLEND_DSTCOLOR 2
  174. #define P3RX_ALPHABLENDMODE_SRCBLEND_INVDSTCOLOR 3
  175. #define P3RX_ALPHABLENDMODE_SRCBLEND_SRCALPHA 4
  176. #define P3RX_ALPHABLENDMODE_SRCBLEND_INVSRCALPHA 5
  177. #define P3RX_ALPHABLENDMODE_SRCBLEND_DSTALPHA 6
  178. #define P3RX_ALPHABLENDMODE_SRCBLEND_INVDSTALPHA 7
  179. #define P3RX_ALPHABLENDMODE_SRCBLEND_SRCALPHASAT 8
  180. #define P3RX_ALPHABLENDMODE_DSTBLEND_ZERO 0
  181. #define P3RX_ALPHABLENDMODE_DSTBLEND_ONE 1
  182. #define P3RX_ALPHABLENDMODE_DSTBLEND_SRCCOLOR 2
  183. #define P3RX_ALPHABLENDMODE_DSTBLEND_INVSRCCOLOR 3
  184. #define P3RX_ALPHABLENDMODE_DSTBLEND_SRCALPHA 4
  185. #define P3RX_ALPHABLENDMODE_DSTBLEND_INVSRCALPHA 5
  186. #define P3RX_ALPHABLENDMODE_DSTBLEND_DSTALPHA 6
  187. #define P3RX_ALPHABLENDMODE_DSTBLEND_INVDSTALPHA 7
  188. #define P3RX_ALPHABLENDMODE_COLORORDER_BGR 0
  189. #define P3RX_ALPHABLENDMODE_COLORORDER_RGB 1
  190. #define P3RX_ALPHABLENDMODE_ALPHATYPE_OGL 0
  191. #define P3RX_ALPHABLENDMODE_ALPHATYPE_APPLE 1
  192. // Both colour and alpha channels.
  193. #define P3RX_ALPHABLENDMODE_CONVERT_SCALE 0
  194. #define P3RX_ALPHABLENDMODE_CONVERT_SHIFT 1
  195. #define P3RX_ALPHABLENDMODE_OPERATION_ADD 0
  196. #define P3RX_ALPHABLENDMODE_OPERATION_SSUBD 1
  197. #define P3RX_ALPHABLENDMODE_OPERATION_DSUBS 2
  198. #define P3RX_ALPHABLENDMODE_OPERATION_MIN 3
  199. #define P3RX_ALPHABLENDMODE_OPERATION_MAX 4
  200. // Alpha Blending
  201. #define P3RX_ALPHABLENDMODE_COLORFORMAT_8888 P3RX_DITHERMODE_COLORFORMAT_8888
  202. #define P3RX_ALPHABLENDMODE_COLORFORMAT_4444 P3RX_DITHERMODE_COLORFORMAT_4444
  203. #define P3RX_ALPHABLENDMODE_COLORFORMAT_5551 P3RX_DITHERMODE_COLORFORMAT_5551
  204. #define P3RX_ALPHABLENDMODE_COLORFORMAT_565 P3RX_DITHERMODE_COLORFORMAT_565
  205. #define P3RX_ALPHABLENDMODE_COLORFORMAT_332 P3RX_DITHERMODE_COLORFORMAT_332
  206. #define P3RX_ALPHABLENDMODE_COLORFORMAT_CI P3RX_DITHERMODE_COLORFORMAT_CI
  207. #define P3RX_ALPHABLENDMODE_COLORFORMAT_ILLEGAL P3RX_DITHERMODE_COLORFORMAT_ILLEGAL
  208. // For P3RX_CHROMATESTMODE_SOURCE
  209. #define P3RX_CHROMATESTMODE_SOURCE_FBSOURCEDATA 0
  210. #define P3RX_CHROMATESTMODE_SOURCE_FBDATA 1
  211. #define P3RX_CHROMATESTMODE_SOURCE_INPUTCOLOR 2
  212. #define P3RX_CHROMATESTMODE_SOURCE_OUTPUTCOLOR 3
  213. // For P3RX_CHROMATESTMODE_FAILACTION and P3_CHROMATESTMODE_PASSACTION
  214. #define P3RX_CHROMATESTMODE_ACTION_PASS 0
  215. #define P3RX_CHROMATESTMODE_ACTION_REJECT 1
  216. #define P3RX_CHROMATESTMODE_ACTION_SUBSTITUTEPASSCOLOR 2
  217. #define P3RX_CHROMATESTMODE_ACTION_SUBSTITUTEFAILCOLOR 3
  218. // For P3RX_TEXFILTERMODE_ALPHAMAPSENSEx
  219. #define P3RX_ALPHAMAPSENSE_OUTOFRANGE 0
  220. #define P3RX_ALPHAMAPSENSE_INRANGE 1
  221. // For P3RX_TEXCOORDMODE_ WRAPS, WRAPT, WRAPS1, WRAPT1
  222. #define P3RX_TEXCOORDMODE_WRAP_CLAMP 0
  223. #define P3RX_TEXCOORDMODE_WRAP_REPEAT 1
  224. #define P3RX_TEXCOORDMODE_WRAP_MIRROR 2
  225. #define P3RX_TEXCOORDMODE_OPERATION_2D 0
  226. #define P3RX_TEXCOORDMODE_OPERATION_3D 1
  227. #define P3RX_TEXCOORDMODE_TEXTUREMAPTYPE_1D 0
  228. #define P3RX_TEXCOORDMODE_TEXTUREMAPTYPE_2D 1
  229. // LUT Mode
  230. #define P3RX_LUTMODE_INCOLORORDER_BGR 0
  231. #define P3RX_LUTMODE_INCOLORORDER_RGB 1
  232. #define P3RX_LUTMODE_LOADFORMAT_COPY 0
  233. #define P3RX_LUTMODE_LOADFORMAT_565REPLICATE 1
  234. #define P3RX_LUTMODE_LOADFORMAT_5551REPLICATE 2
  235. #define P3RX_LUTMODE_LOADCOLORORDER_BGR 0
  236. #define P3RX_LUTMODE_LOADCOLORORDER_RGB 1
  237. #define P3RX_LUTMODE_FRAGMENTOP_NONE 0
  238. #define P3RX_LUTMODE_FRAGMENTOP_INDEXEDTEXTURE 1
  239. #define P3RX_LUTMODE_FRAGMENTOP_TRANSLATE8TO32 2
  240. #define P3RX_LUTMODE_FRAGMENTOP_TRANSLATE32TO32 3
  241. #define P3RX_LUTMODE_FRAGMENTOP_MOTIONCOMP 4
  242. #define P3RX_LUTMODE_FRAGMENTOP_PATTERN 5
  243. #define P3RX_LUTMODE_SPANOP_NONE 0
  244. #define P3RX_LUTMODE_SPANOP_SPANPATTERN 1
  245. #define P3RX_LUTMODE_SPANOP_TRANSLATE8TO8 2
  246. #define P3RX_LUTMODE_SPANOP_TRANSLATE8TO16 3
  247. #define P3RX_LUTMODE_SPANOP_TRANSLATE8TO32 4
  248. #define P3RX_LUTMODE_SPANOP_TRANSLATE32TO32 5
  249. // Used for P3RX_LUTMODE_SPAN[V|C]CXALIGN
  250. #define P3RX_LUTMODE_ALIGNMENT_ABSOLOUTE 0
  251. #define P3RX_LUTMODE_ALIGNMENT_RELATIVE 1
  252. // Alpha test unit
  253. #define P3RX_ANTIALIASMODE_COLORMODE_RGBA 0
  254. #define P3RX_ANTIALIASMODE_COLORMODE_CI 1
  255. #define P3RX_ALPHATESTMODE_COMPARE_NEVER 0
  256. #define P3RX_ALPHATESTMODE_COMPARE_LESS 1
  257. #define P3RX_ALPHATESTMODE_COMPARE_EQUAL 2
  258. #define P3RX_ALPHATESTMODE_COMPARE_LESSEQUAL 3
  259. #define P3RX_ALPHATESTMODE_COMPARE_GREATER 4
  260. #define P3RX_ALPHATESTMODE_COMPARE_NOTEQUAL 5
  261. #define P3RX_ALPHATESTMODE_COMPARE_GREATEREQUAL 6
  262. #define P3RX_ALPHATESTMODE_COMPARE_ALWAYS 7
  263. // Fogging
  264. #define P3RX_FOGMODE_COLORMODE_RGB 0
  265. #define P3RX_FOGMODE_COLORMODE_CI 1
  266. // Framebuffer write mode
  267. #define P3RX_FBWRITEMODE_ORIGIN_TOPLEFT 0
  268. #define P3RX_FBWRITEMODE_ORIGIN_BOTTOMLEFT 1
  269. // Shared
  270. #define P3RX_STRIPE_1 0
  271. #define P3RX_STRIPE_2 1
  272. #define P3RX_STRIPE_4 2
  273. #define P3RX_STRIPE_8 3
  274. #define P3RX_STRIPE_16 4
  275. #define P3RX_STRIPE_32 5
  276. #define P3RX_STRIPE_64 6
  277. #define P3RX_STRIPE_128 7
  278. #define P3RX_LAYOUT_LINEAR 0
  279. #define P3RX_LAYOUT_PATCH64 1
  280. #define P3RX_LAYOUT_PATCH32_2 2
  281. #define P3RX_LAYOUT_PATCH2 3
  282. // Color DDA fields
  283. #define P3RX_COLORDDA_FLATSHADE 0
  284. #define P3RX_COLORDDA_GOURAUDSHADE 1
  285. #define P3RX_DEPTH_WIDTH_16 0
  286. #define P3RX_DEPTH_WIDTH_24 1
  287. #define P3RX_DEPTH_WIDTH_32 2
  288. #define P3RX_DEPTH_WIDTH_15 3
  289. #define P3RX_STENCIL_WIDTH_0 0
  290. #define P3RX_STENCIL_WIDTH_1 1
  291. #define P3RX_STENCIL_WIDTH_2 2
  292. #define P3RX_STENCIL_WIDTH_3 3
  293. #define P3RX_STENCIL_WIDTH_4 4
  294. #define P3RX_STENCIL_WIDTH_5 5
  295. #define P3RX_STENCIL_WIDTH_6 6
  296. #define P3RX_STENCIL_WIDTH_7 7
  297. #define P3RX_STENCIL_WIDTH_8 8
  298. #define P3RX_STENCIL_POSITION_16 0
  299. #define P3RX_STENCIL_POSITION_17 1
  300. #define P3RX_STENCIL_POSITION_18 2
  301. #define P3RX_STENCIL_POSITION_19 3
  302. #define P3RX_STENCIL_POSITION_20 4
  303. #define P3RX_STENCIL_POSITION_21 5
  304. #define P3RX_STENCIL_POSITION_22 6
  305. #define P3RX_STENCIL_POSITION_23 7
  306. #define P3RX_STENCIL_POSITION_24 8
  307. #define P3RX_STENCIL_POSITION_25 9
  308. #define P3RX_STENCIL_POSITION_26 10
  309. #define P3RX_STENCIL_POSITION_27 11
  310. #define P3RX_STENCIL_POSITION_28 12
  311. #define P3RX_STENCIL_POSITION_29 13
  312. #define P3RX_STENCIL_POSITION_30 14
  313. #define P3RX_STENCIL_POSITION_31 15
  314. #define P3RX_STENCIL_POSITION_32 16
  315. #define P3RX_STENCIL_POSITION_33 17
  316. #define P3RX_STENCIL_POSITION_34 18
  317. #define P3RX_STENCIL_POSITION_35 19
  318. #define P3RX_STENCIL_POSITION_36 20
  319. #define P3RX_STENCIL_POSITION_37 21
  320. #define P3RX_STENCIL_POSITION_38 22
  321. #define P3RX_STENCIL_POSITION_39 23
  322. // FilterMode
  323. #define P3RX_FILTERMODE_BYTESWAP_ABCD 0
  324. #define P3RX_FILTERMODE_BYTESWAP_BADC 1
  325. #define P3RX_FILTERMODE_BYTESWAP_CDAB 2
  326. #define P3RX_FILTERMODE_BYTESWAP_DCBA 3