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.

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