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.

535 lines
20 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // attrs.cpp
  4. //
  5. // Cross-platform attribute handling functions.
  6. //
  7. // Copyright (C) Microsoft Corporation, 1997.
  8. //
  9. //----------------------------------------------------------------------------
  10. #include "pch.cpp"
  11. #pragma hdrstop
  12. //----------------------------------------------------------------------------
  13. //
  14. // AddFloatAttrs_Any
  15. //
  16. // Adds a set of attribute deltas to an ATTRSET.
  17. // Handles any set of attributes via USED flags.
  18. //
  19. //----------------------------------------------------------------------------
  20. void FASTCALL
  21. AddFloatAttrs_Any(PATTRSET pAttr, PATTRSET pDelta, PSETUPCTX pStpCtx)
  22. {
  23. pAttr->pSurface += pDelta->ipSurface;
  24. pAttr->pZ += pDelta->ipZ;
  25. if (pStpCtx->uFlags & PRIMSF_Z_USED)
  26. {
  27. pAttr->fZ += pDelta->fZ;
  28. }
  29. if (pStpCtx->uFlags & PRIMSF_TEX_USED)
  30. {
  31. pAttr->fOoW += pDelta->fOoW;
  32. pAttr->fUoW[0] += pDelta->fUoW[0];
  33. pAttr->fVoW[0] += pDelta->fVoW[0];
  34. }
  35. if (pStpCtx->uFlags & PRIMSF_TEX2_USED)
  36. {
  37. for (INT32 i = 1; i < (INT32)pStpCtx->pCtx->cActTex; i++)
  38. {
  39. pAttr->fUoW[i] += pDelta->fUoW[i];
  40. pAttr->fVoW[i] += pDelta->fVoW[i];
  41. }
  42. }
  43. if (pStpCtx->uFlags & PRIMSF_DIFF_USED)
  44. {
  45. pAttr->fB += pDelta->fB;
  46. pAttr->fG += pDelta->fG;
  47. pAttr->fR += pDelta->fR;
  48. pAttr->fA += pDelta->fA;
  49. }
  50. else if (pStpCtx->uFlags & PRIMSF_DIDX_USED)
  51. {
  52. pAttr->fDIdx += pDelta->fDIdx;
  53. pAttr->fDIdxA += pDelta->fDIdxA;
  54. }
  55. if (pStpCtx->uFlags & PRIMSF_SPEC_USED)
  56. {
  57. pAttr->fBS += pDelta->fBS;
  58. pAttr->fGS += pDelta->fGS;
  59. pAttr->fRS += pDelta->fRS;
  60. }
  61. if (pStpCtx->uFlags & PRIMSF_LOCAL_FOG_USED)
  62. {
  63. pAttr->fFog += pDelta->fFog;
  64. }
  65. }
  66. //----------------------------------------------------------------------------
  67. //
  68. // AddScaledFloatAttrs_Any_Either
  69. //
  70. // Scales and adds a set of attribute deltas to an ATTRSET.
  71. // Handles any set of attributes via USED flags.
  72. // Uses PWL support.
  73. //
  74. //----------------------------------------------------------------------------
  75. void FASTCALL
  76. AddScaledFloatAttrs_Any_Either(PATTRSET pAttr, PATTRSET pDelta,
  77. PSETUPCTX pStpCtx, INT iScale)
  78. {
  79. FLOAT fScale = (FLOAT)iScale;
  80. pAttr->pSurface += pDelta->ipSurface * iScale;
  81. pAttr->pZ += pDelta->ipZ * iScale;
  82. if (pStpCtx->uFlags & PRIMSF_Z_USED)
  83. {
  84. #ifdef PWL_FOG
  85. if (pStpCtx->uPwlFlags & PWL_NEXT_FOG)
  86. {
  87. pAttr->fZ = pStpCtx->fNextZ;
  88. }
  89. else
  90. #endif
  91. {
  92. pAttr->fZ += pDelta->fZ * fScale;
  93. }
  94. }
  95. if (pStpCtx->uFlags & PRIMSF_TEX_USED)
  96. {
  97. if (pStpCtx->uPwlFlags & PWL_NEXT_LOD)
  98. {
  99. pAttr->fOoW = pStpCtx->fNextOoW;
  100. pAttr->fUoW[0] = pStpCtx->fNextUoW1;
  101. pAttr->fVoW[0] = pStpCtx->fNextVoW1;
  102. }
  103. else
  104. {
  105. pAttr->fOoW += pDelta->fOoW * fScale;
  106. pAttr->fUoW[0] += pDelta->fUoW[0] * fScale;
  107. pAttr->fVoW[0] += pDelta->fVoW[0] * fScale;
  108. }
  109. }
  110. if (pStpCtx->uFlags & PRIMSF_TEX2_USED)
  111. {
  112. for (INT32 i = 1; i < (INT32)pStpCtx->pCtx->cActTex; i++)
  113. {
  114. pAttr->fUoW[i] += pDelta->fUoW[i] * fScale;
  115. pAttr->fVoW[i] += pDelta->fVoW[i] * fScale;
  116. }
  117. }
  118. if (pStpCtx->uFlags & PRIMSF_DIFF_USED)
  119. {
  120. pAttr->fB += pDelta->fB * fScale;
  121. pAttr->fG += pDelta->fG * fScale;
  122. pAttr->fR += pDelta->fR * fScale;
  123. pAttr->fA += pDelta->fA * fScale;
  124. }
  125. else if (pStpCtx->uFlags & PRIMSF_DIDX_USED)
  126. {
  127. pAttr->fDIdx += pDelta->fDIdx * fScale;
  128. pAttr->fDIdxA += pDelta->fDIdxA * fScale;
  129. }
  130. if (pStpCtx->uFlags & PRIMSF_SPEC_USED)
  131. {
  132. pAttr->fBS += pDelta->fBS * fScale;
  133. pAttr->fGS += pDelta->fGS * fScale;
  134. pAttr->fRS += pDelta->fRS * fScale;
  135. }
  136. if (pStpCtx->uFlags & PRIMSF_LOCAL_FOG_USED)
  137. {
  138. pAttr->fFog += pDelta->fFog * fScale;
  139. }
  140. }
  141. //----------------------------------------------------------------------------
  142. //
  143. // FillSpanFloatAttrs_Any_Either
  144. //
  145. // Fills in a span structure with the given attributes.
  146. // Handles any set of attributes via USED flags.
  147. // Uses and updates PWL support.
  148. //
  149. //----------------------------------------------------------------------------
  150. void FASTCALL
  151. FillSpanFloatAttrs_Any_Either(PATTRSET pAttr, PD3DI_RASTSPAN pSpan,
  152. PSETUPCTX pStpCtx, INT cPix)
  153. {
  154. FLOAT fPix = (FLOAT)cPix;
  155. pSpan->pSurface = pAttr->pSurface;
  156. pSpan->pZ = pAttr->pZ;
  157. if (pStpCtx->uFlags & PRIMSF_Z_USED)
  158. {
  159. pSpan->uZ = FTOI(pAttr->fZ);
  160. }
  161. if (pStpCtx->uFlags & PRIMSF_TEX_USED)
  162. {
  163. FLOAT fW;
  164. if (pStpCtx->uPwlFlags & PWL_NEXT_LOD)
  165. {
  166. fW = pStpCtx->fNextW;
  167. }
  168. else if (pStpCtx->uFlags & PRIMSF_PERSP_USED)
  169. {
  170. if (FLOAT_EQZ(pAttr->fOoW))
  171. {
  172. fW = g_fZero;
  173. }
  174. else
  175. {
  176. fW = OOW_SCALE / pAttr->fOoW;
  177. }
  178. }
  179. else
  180. {
  181. fW = g_fOne;
  182. }
  183. pSpan->iW = FTOI(fW * W_SCALE);
  184. if (pStpCtx->uFlags & PRIMSF_LOD_USED)
  185. {
  186. // Mipmapping is enabled so compute texture LOD.
  187. // The span code can do linear LOD interpolation
  188. // so that we can do piecewise-linear approximations
  189. // instead of true per-pixel LOD. In order to make this
  190. // work we need to compute the next LOD and a delta
  191. // value. All of these values can be reused if this
  192. // loop goes around so keep them available for the next
  193. // iteration and set a flag to indicate that they've
  194. // been computed.
  195. if (pStpCtx->uPwlFlags & PWL_NEXT_LOD)
  196. {
  197. pSpan->iLOD = (INT16)pStpCtx->iNextLOD;
  198. }
  199. else
  200. {
  201. pSpan->iLOD =
  202. (INT16)ComputeLOD(pStpCtx->pCtx,
  203. (pAttr->fUoW[0] * OO_TEX_SCALE) * fW,
  204. (pAttr->fVoW[0] * OO_TEX_SCALE) * fW,
  205. fW,
  206. (pStpCtx->DAttrDX.fUoW[0] * OO_TEX_SCALE),
  207. (pStpCtx->DAttrDX.fVoW[0] * OO_TEX_SCALE),
  208. (pStpCtx->DAttrDX.fOoW * OO_OOW_SCALE),
  209. (pStpCtx->DAttrDY.fUoW[0] * OO_TEX_SCALE),
  210. (pStpCtx->DAttrDY.fVoW[0] * OO_TEX_SCALE),
  211. (pStpCtx->DAttrDY.fOoW * OO_OOW_SCALE));
  212. }
  213. if (pStpCtx->uFlags & PRIMSF_PERSP_USED)
  214. {
  215. pStpCtx->fNextOoW = pAttr->fOoW + pStpCtx->DAttrDX.fOoW * fPix;
  216. if (FLOAT_EQZ(pStpCtx->fNextOoW))
  217. {
  218. fW = g_fZero;
  219. }
  220. else
  221. {
  222. fW = OOW_SCALE / pStpCtx->fNextOoW;
  223. }
  224. }
  225. else
  226. {
  227. pStpCtx->fNextOoW = OOW_SCALE;
  228. fW = g_fOne;
  229. }
  230. pStpCtx->fNextW = fW;
  231. pStpCtx->fNextUoW1 = pAttr->fUoW[0] + pStpCtx->DAttrDX.fUoW[0] * fPix;
  232. pStpCtx->fNextVoW1 = pAttr->fVoW[0] + pStpCtx->DAttrDX.fVoW[0] * fPix;
  233. pStpCtx->iNextLOD =
  234. ComputeLOD(pStpCtx->pCtx,
  235. (pStpCtx->fNextUoW1 * OO_TEX_SCALE) * fW,
  236. (pStpCtx->fNextVoW1 * OO_TEX_SCALE) * fW,
  237. fW,
  238. (pStpCtx->DAttrDX.fUoW[0] * OO_TEX_SCALE),
  239. (pStpCtx->DAttrDX.fVoW[0] * OO_TEX_SCALE),
  240. (pStpCtx->DAttrDX.fOoW * OO_OOW_SCALE),
  241. (pStpCtx->DAttrDY.fUoW[0] * OO_TEX_SCALE),
  242. (pStpCtx->DAttrDY.fVoW[0] * OO_TEX_SCALE),
  243. (pStpCtx->DAttrDY.fOoW * OO_OOW_SCALE));
  244. pStpCtx->uPwlFlags |= PWL_NEXT_LOD;
  245. pSpan->iDLOD =
  246. (INT16)(FTOI((FLOAT)(pStpCtx->iNextLOD - pSpan->iLOD) / fPix));
  247. }
  248. else
  249. {
  250. pSpan->iLOD = 0;
  251. pSpan->iDLOD = 0;
  252. }
  253. pSpan->iOoW = FTOI(pAttr->fOoW);
  254. pSpan->UVoW[0].iUoW = FTOI(pAttr->fUoW[0]);
  255. pSpan->UVoW[0].iVoW = FTOI(pAttr->fVoW[0]);
  256. }
  257. if (pStpCtx->uFlags & PRIMSF_TEX2_USED)
  258. {
  259. for (INT32 i = 1; i < (INT32)pStpCtx->pCtx->cActTex; i++)
  260. {
  261. pSpan->UVoW[i].iUoW = FTOI(pAttr->fUoW[i]);
  262. pSpan->UVoW[i].iVoW = FTOI(pAttr->fVoW[i]);
  263. }
  264. }
  265. if (pStpCtx->uFlags & PRIMSF_DIFF_USED)
  266. {
  267. pSpan->uB = (UINT16)(FTOI(pAttr->fB));
  268. pSpan->uG = (UINT16)(FTOI(pAttr->fG));
  269. pSpan->uR = (UINT16)(FTOI(pAttr->fR));
  270. pSpan->uA = (UINT16)(FTOI(pAttr->fA));
  271. }
  272. else if (pStpCtx->uFlags & PRIMSF_DIDX_USED)
  273. {
  274. pSpan->iIdx = FTOI(pAttr->fDIdx);
  275. pSpan->iIdxA = FTOI(pAttr->fDIdxA);
  276. }
  277. if (pStpCtx->uFlags & PRIMSF_SPEC_USED)
  278. {
  279. pSpan->uBS = (UINT16)(FTOI(pAttr->fBS));
  280. pSpan->uGS = (UINT16)(FTOI(pAttr->fGS));
  281. pSpan->uRS = (UINT16)(FTOI(pAttr->fRS));
  282. }
  283. if (pStpCtx->uFlags & PRIMSF_LOCAL_FOG_USED)
  284. {
  285. pSpan->uFog = (UINT16)(FTOI(pAttr->fFog));
  286. pSpan->iDFog = (INT16)(pStpCtx->iDLocalFogDX);
  287. }
  288. #ifdef PWL_FOG
  289. else if (pStpCtx->uFlags & PRIMSF_GLOBAL_FOG_USED)
  290. {
  291. FLOAT fOoZScale;
  292. // The span code doesn't have direct global fog support.
  293. // It's faked by setup doing PWL approximations here
  294. // similarly to how LOD is handled.
  295. if (pStpCtx->pCtx->iZBitCount == 16)
  296. {
  297. fOoZScale = OO_Z16_SCALE;
  298. }
  299. else
  300. {
  301. fOoZScale = OO_Z32_SCALE;
  302. }
  303. if (pStpCtx->uPwlFlags & PWL_NEXT_FOG)
  304. {
  305. pSpan->uFog = pStpCtx->uNextFog;
  306. }
  307. else
  308. {
  309. pSpan->uFog = ComputeTableFog(pStpCtx->pCtx->pdwRenderState,
  310. pAttr->fZ * fOoZScale);
  311. }
  312. if ((pStpCtx->uPwlFlags & PWL_NO_NEXT_FOG) == 0)
  313. {
  314. pStpCtx->fNextZ = pAttr->fZ + pStpCtx->DAttrDX.fZ * fPix;
  315. pStpCtx->uNextFog = ComputeTableFog(pStpCtx->pCtx->pdwRenderState,
  316. pStpCtx->fNextZ * fOoZScale);
  317. pStpCtx->uPwlFlags |= PWL_NEXT_FOG;
  318. pSpan->iDFog =
  319. FTOI((FLOAT)((INT)pStpCtx->uNextFog -
  320. (INT)pSpan->uFog) / fPix);
  321. }
  322. else
  323. {
  324. pSpan->iDFog = 0;
  325. }
  326. }
  327. #endif
  328. }
  329. //
  330. // Tables of attribute handlers.
  331. // Indexing is with the low four PRIMSF_*_USED bits.
  332. //
  333. // Attribute adders.
  334. PFN_ADDATTRS g_pfnAddFloatAttrsTable[] =
  335. {
  336. (PFN_ADDATTRS)DebugBreakFn, /* 0: -2 -1 -S -D */
  337. AddFloatAttrs_Z_Diff, /* 1: -2 -1 -S +D */
  338. (PFN_ADDATTRS)DebugBreakFn, /* 2: -2 -1 +S -D */
  339. AddFloatAttrs_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  340. (PFN_ADDATTRS)DebugBreakFn, /* 4: -2 +1 -S -D */
  341. AddFloatAttrs_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  342. (PFN_ADDATTRS)DebugBreakFn, /* 6: -2 +1 +S -D */
  343. AddFloatAttrs_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  344. (PFN_ADDATTRS)DebugBreakFn, /* 8: +2 -1 -S -D */
  345. (PFN_ADDATTRS)DebugBreakFn, /* 9: +2 -1 -S +D */
  346. (PFN_ADDATTRS)DebugBreakFn, /* A: +2 -1 +S -D */
  347. (PFN_ADDATTRS)DebugBreakFn, /* B: +2 -1 +S +D */
  348. AddFloatAttrs_Z_Tex, /* C: +2 +1 -S -D */
  349. (PFN_ADDATTRS)DebugBreakFn, /* D: +2 +1 -S +D */
  350. (PFN_ADDATTRS)DebugBreakFn, /* E: +2 +1 +S -D */
  351. (PFN_ADDATTRS)DebugBreakFn, /* F: +2 +1 +S +D */
  352. };
  353. #ifdef STEP_FIXED
  354. PFN_ADDATTRS g_pfnAddFixedAttrsTable[] =
  355. {
  356. (PFN_ADDATTRS)DebugBreakFn, /* 0: -2 -1 -S -D */
  357. AddFixedAttrs_Z_Diff, /* 1: -2 -1 -S +D */
  358. (PFN_ADDATTRS)DebugBreakFn, /* 2: -2 -1 +S -D */
  359. AddFixedAttrs_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  360. (PFN_ADDATTRS)DebugBreakFn, /* 4: -2 +1 -S -D */
  361. AddFixedAttrs_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  362. (PFN_ADDATTRS)DebugBreakFn, /* 6: -2 +1 +S -D */
  363. AddFixedAttrs_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  364. (PFN_ADDATTRS)DebugBreakFn, /* 8: +2 -1 -S -D */
  365. (PFN_ADDATTRS)DebugBreakFn, /* 9: +2 -1 -S +D */
  366. (PFN_ADDATTRS)DebugBreakFn, /* A: +2 -1 +S -D */
  367. (PFN_ADDATTRS)DebugBreakFn, /* B: +2 -1 +S +D */
  368. AddFixedAttrs_Z_Tex, /* C: +2 +1 -S -D */
  369. (PFN_ADDATTRS)DebugBreakFn, /* D: +2 +1 -S +D */
  370. (PFN_ADDATTRS)DebugBreakFn, /* E: +2 +1 +S -D */
  371. (PFN_ADDATTRS)DebugBreakFn, /* F: +2 +1 +S +D */
  372. };
  373. #endif
  374. // Scaled attribute adders without PWL support.
  375. PFN_ADDSCALEDATTRS g_pfnAddScaledFloatAttrsTable[] =
  376. {
  377. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 0: -2 -1 -S -D */
  378. AddScaledFloatAttrs_Z_Diff, /* 1: -2 -1 -S +D */
  379. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 2: -2 -1 +S -D */
  380. AddScaledFloatAttrs_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  381. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 4: -2 +1 -S -D */
  382. AddScaledFloatAttrs_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  383. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 6: -2 +1 +S -D */
  384. AddScaledFloatAttrs_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  385. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 8: +2 -1 -S -D */
  386. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 9: +2 -1 -S +D */
  387. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* A: +2 -1 +S -D */
  388. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* B: +2 -1 +S +D */
  389. AddScaledFloatAttrs_Z_Tex, /* C: +2 +1 -S -D */
  390. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* D: +2 +1 -S +D */
  391. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* E: +2 +1 +S -D */
  392. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* F: +2 +1 +S +D */
  393. };
  394. // RASTSPAN filling functions.
  395. PFN_FILLSPANATTRS g_pfnFillSpanFloatAttrsTable[] =
  396. {
  397. (PFN_FILLSPANATTRS)DebugBreakFn, /* 0: -2 -1 -S -D */
  398. FillSpanFloatAttrs_Z_Diff, /* 1: -2 -1 -S +D */
  399. (PFN_FILLSPANATTRS)DebugBreakFn, /* 2: -2 -1 +S -D */
  400. FillSpanFloatAttrs_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  401. (PFN_FILLSPANATTRS)DebugBreakFn, /* 4: -2 +1 -S -D */
  402. FillSpanFloatAttrs_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  403. (PFN_FILLSPANATTRS)DebugBreakFn, /* 6: -2 +1 +S -D */
  404. FillSpanFloatAttrs_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  405. (PFN_FILLSPANATTRS)DebugBreakFn, /* 8: +2 -1 -S -D */
  406. (PFN_FILLSPANATTRS)DebugBreakFn, /* 9: +2 -1 -S +D */
  407. (PFN_FILLSPANATTRS)DebugBreakFn, /* A: +2 -1 +S -D */
  408. (PFN_FILLSPANATTRS)DebugBreakFn, /* B: +2 -1 +S +D */
  409. FillSpanFloatAttrs_Z_Tex, /* C: +2 +1 -S -D */
  410. (PFN_FILLSPANATTRS)DebugBreakFn, /* D: +2 +1 -S +D */
  411. (PFN_FILLSPANATTRS)DebugBreakFn, /* E: +2 +1 +S -D */
  412. (PFN_FILLSPANATTRS)DebugBreakFn, /* F: +2 +1 +S +D */
  413. };
  414. #ifdef STEP_FIXED
  415. PFN_FILLSPANATTRS g_pfnFillSpanFixedAttrsTable[] =
  416. {
  417. (PFN_FILLSPANATTRS)DebugBreakFn, /* 0: -2 -1 -S -D */
  418. FillSpanFixedAttrs_Z_Diff, /* 1: -2 -1 -S +D */
  419. (PFN_FILLSPANATTRS)DebugBreakFn, /* 2: -2 -1 +S -D */
  420. FillSpanFixedAttrs_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  421. (PFN_FILLSPANATTRS)DebugBreakFn, /* 4: -2 +1 -S -D */
  422. FillSpanFixedAttrs_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  423. (PFN_FILLSPANATTRS)DebugBreakFn, /* 6: -2 +1 +S -D */
  424. FillSpanFixedAttrs_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  425. (PFN_FILLSPANATTRS)DebugBreakFn, /* 8: +2 -1 -S -D */
  426. (PFN_FILLSPANATTRS)DebugBreakFn, /* 9: +2 -1 -S +D */
  427. (PFN_FILLSPANATTRS)DebugBreakFn, /* A: +2 -1 +S -D */
  428. (PFN_FILLSPANATTRS)DebugBreakFn, /* B: +2 -1 +S +D */
  429. FillSpanFixedAttrs_Z_Tex, /* C: +2 +1 -S -D */
  430. (PFN_FILLSPANATTRS)DebugBreakFn, /* D: +2 +1 -S +D */
  431. (PFN_FILLSPANATTRS)DebugBreakFn, /* E: +2 +1 +S -D */
  432. (PFN_FILLSPANATTRS)DebugBreakFn, /* F: +2 +1 +S +D */
  433. };
  434. #endif
  435. // Float-to-fixed attribute converters.
  436. #ifdef STEP_FIXED
  437. PFN_FLOATATTRSTOFIXED g_pfnFloatAttrsToFixedTable[] =
  438. {
  439. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 0: -2 -1 -S -D */
  440. FloatAttrsToFixed_Z_Diff, /* 1: -2 -1 -S +D */
  441. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 2: -2 -1 +S -D */
  442. FloatAttrsToFixed_Z_Diff_Spec, /* 3: -2 -1 +S +D */
  443. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 4: -2 +1 -S -D */
  444. FloatAttrsToFixed_Z_Diff_Tex, /* 5: -2 +1 -S +D */
  445. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 6: -2 +1 +S -D */
  446. FloatAttrsToFixed_Z_Diff_Spec_Tex, /* 7: -2 +1 +S +D */
  447. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 8: +2 -1 -S -D */
  448. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* 9: +2 -1 -S +D */
  449. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* A: +2 -1 +S -D */
  450. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* B: +2 -1 +S +D */
  451. FloatAttrsToFixed_Z_Tex, /* C: +2 +1 -S -D */
  452. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* D: +2 +1 -S +D */
  453. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* E: +2 +1 +S -D */
  454. (PFN_FLOATATTRSTOFIXED)DebugBreakFn, /* F: +2 +1 +S +D */
  455. };
  456. #endif
  457. //
  458. // Tables of ramp mode attribute handlers.
  459. // Indexing is with PRIMSF_TEX1_USED and PRIMSF_DIDX_USED.
  460. //
  461. // Attribute adders.
  462. PFN_ADDATTRS g_pfnRampAddFloatAttrsTable[] =
  463. {
  464. (PFN_ADDATTRS)DebugBreakFn, /* 0: -I -1 */
  465. AddFloatAttrs_Z_Tex, /* 1: -I +1 */
  466. AddFloatAttrs_Z_DIdx, /* 2: +I -1 */
  467. AddFloatAttrs_Z_DIdx_Tex, /* 3: +I +1 */
  468. };
  469. // Scaled attribute adders without PWL support.
  470. PFN_ADDSCALEDATTRS g_pfnRampAddScaledFloatAttrsTable[] =
  471. {
  472. (PFN_ADDSCALEDATTRS)DebugBreakFn, /* 0: -I -1 */
  473. AddScaledFloatAttrs_Z_Tex, /* 1: -I +1 */
  474. AddScaledFloatAttrs_Z_DIdx, /* 2: +I -1 */
  475. AddScaledFloatAttrs_Z_DIdx_Tex, /* 3: +I +1 */
  476. };
  477. // RASTSPAN filling functions.
  478. PFN_FILLSPANATTRS g_pfnRampFillSpanFloatAttrsTable[] =
  479. {
  480. (PFN_FILLSPANATTRS)DebugBreakFn, /* 0: -I -1 */
  481. FillSpanFloatAttrs_Z_Tex, /* 1: -I +1 */
  482. FillSpanFloatAttrs_Z_DIdx, /* 2: +I -1 */
  483. FillSpanFloatAttrs_Z_DIdx_Tex, /* 3: +I +1 */
  484. };