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.

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