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.

593 lines
16 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // This file contains C span loops.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997.
  6. //
  7. //-----------------------------------------------------------------------------
  8. include(`m4hdr.mh')dnl
  9. define(`d_BeadMacrosOnly', `')dnl
  10. include(`rampbead.mh')dnl
  11. include(`rtexaddr.mh')dnl
  12. include(`ramppix.mh')dnl
  13. include(`rtexread.mh')dnl
  14. #include "pch.cpp"
  15. #pragma hdrstop
  16. #include <rloop_mh.h>
  17. // PWL perspective correction chunk.
  18. #define PWL_PERSP_STEP_SHIFT 4
  19. #define PWL_PERSP_STEP (1 << PWL_PERSP_STEP_SHIFT)
  20. dnl
  21. dnl d_RlDither
  22. dnl
  23. dnl Loop initialization for dithering.
  24. dnl
  25. define(`d_RlDither',
  26. `// Keep dither pattern up to date directly, so keeping SI.uX up
  27. // to date is not necessary, except for debug
  28. pCtx->SI.uDitherOffset = (pS->uY & 3) | ((pS->uX & 3)<<2);')dnl
  29. dnl
  30. dnl d_RlPwlPerspTex
  31. dnl
  32. dnl Loop intialization for perspective correct texturing.
  33. dnl Uses PWL approximation.
  34. dnl
  35. dnl $1 is one of NoStep Step.
  36. dnl
  37. define(`d_RlPwlPerspTex',
  38. `FLOAT fW;
  39. INT32 iUoW, iVoW;
  40. INT32 iDUDX, iDVDX;
  41. FLOAT fNextOoW, fDOoWDS;
  42. ifelse($1, `Step', `
  43. INT32 iPerspStep;
  44. ')dnl
  45. fW = (FLOAT)pS->iW * TEX_UVW_TO_FINAL_SCALE;
  46. iUoW = pS->iUoW1;
  47. iVoW = pS->iVoW1;
  48. pCtx->SI.iU2 = FTOI((FLOAT)iUoW * fW);
  49. pCtx->SI.iV2 = FTOI((FLOAT)iVoW * fW);
  50. // The PWL step is computed regardless of the actual span size
  51. // so overflows of the integer form are common. Keep intermediates
  52. // as FP to avoid this.
  53. fDOoWDS = (FLOAT)(pP->iDOoWDX << PWL_PERSP_STEP_SHIFT);
  54. fNextOoW = (FLOAT)pS->iOoW + fDOoWDS;
  55. FLD_BEGIN_DIVIDE(TEX_OOW_TO_FINAL_SCALE, fNextOoW, fW);
  56. ifelse($1, `Step', `
  57. // Force the first check to compute a linear block.
  58. iPerspStep = 1;
  59. ')dnl
  60. ')dnl
  61. dnl
  62. dnl d_RpPwlPerspCheck
  63. dnl
  64. dnl Checks if a new linear perspective correction segment needs to be
  65. dnl computed.
  66. dnl
  67. dnl $1 is one of NoStep Step.
  68. dnl
  69. define(`d_RpPwlPerspCheck',
  70. `ifelse($1, `Step', `
  71. if (--iPerspStep <= 0)
  72. ')dnl
  73. {
  74. pCtx->SI.iU1 = pCtx->SI.iU2;
  75. pCtx->SI.iV1 = pCtx->SI.iV2;
  76. iUoW += pP->iDUoW1DX << PWL_PERSP_STEP_SHIFT;
  77. iVoW += pP->iDVoW1DX << PWL_PERSP_STEP_SHIFT;
  78. FSTP_END_DIVIDE(fW);
  79. // Use the second texture coordinate to hold the next step.
  80. pCtx->SI.iU2 = FTOI((FLOAT)iUoW * fW);
  81. pCtx->SI.iV2 = FTOI((FLOAT)iVoW * fW);
  82. // Compute linear steps.
  83. iDUDX = (pCtx->SI.iU2 - pCtx->SI.iU1) >> PWL_PERSP_STEP_SHIFT;
  84. iDVDX = (pCtx->SI.iV2 - pCtx->SI.iV1) >> PWL_PERSP_STEP_SHIFT;
  85. ifelse($1, `Step', `
  86. iPerspStep = PWL_PERSP_STEP;
  87. ')dnl
  88. fNextOoW += fDOoWDS;
  89. FLD_BEGIN_DIVIDE(TEX_OOW_TO_FINAL_SCALE, fNextOoW, fW);
  90. }')dnl
  91. dnl
  92. dnl d_RpPwlPerspStepTexNoLOD
  93. dnl
  94. define(`d_RpPwlPerspStepTexNoLOD',
  95. `pCtx->SI.iU1 += iDUDX;
  96. pCtx->SI.iV1 += iDVDX;')dnl
  97. dnl
  98. dnl d_RlPwlPerspEnd
  99. dnl
  100. dnl Clears overlapped divide.
  101. dnl
  102. define(`d_RlPwlPerspEnd',
  103. `FSTP_END_DIVIDE(fW);')dnl
  104. dnl
  105. dnl d_RlSpecialWPerspTex
  106. dnl
  107. dnl Loop intialization for perspective correct texturing.
  108. dnl Uses special W interpolation.
  109. dnl
  110. define(`d_RlSpecialWPerspTex',
  111. `pCtx->SI.iU1 = d_WTimesUVoW(pS->iW,pS->iUoW1);
  112. pCtx->SI.iV1 = d_WTimesUVoW(pS->iW,pS->iVoW1);
  113. pCtx->SI.iU2 = d_WTimesUVoW(pS->iW,pS->iUoW2);
  114. pCtx->SI.iV2 = d_WTimesUVoW(pS->iW,pS->iVoW2);
  115. pCtx->SI.iDW = 0x0;
  116. if (pP->iDOoWDX > 0)
  117. {
  118. // iSpecialW should be negative for the first 3 pixels of span
  119. pCtx->SI.iSpecialW = -3;
  120. }
  121. else
  122. {
  123. // iSpecialW should be negative for the last 3 pixels of span
  124. pCtx->SI.iSpecialW = 0x7fff - uPix;
  125. pCtx->SI.iSpecialW += 5; // this may wrap, but it should
  126. }')dnl
  127. dnl
  128. dnl d_RlAffineTex
  129. dnl
  130. dnl Loop intialization for affine texturing.
  131. dnl
  132. define(`d_RlAffineTex',
  133. `pCtx->SI.iU1 = pS->iUoW1>>TEX_TO_FINAL_SHIFT; // 1.11.20 >> 4 == 1.15.16
  134. pCtx->SI.iV1 = pS->iVoW1>>TEX_TO_FINAL_SHIFT;
  135. pCtx->SI.iU2 = pS->iUoW2>>TEX_TO_FINAL_SHIFT;
  136. pCtx->SI.iV2 = pS->iVoW2>>TEX_TO_FINAL_SHIFT;
  137. pCtx->SI.iDW = 0x0;
  138. pCtx->SI.iSpecialW = 0;')dnl
  139. dnl
  140. dnl d_RlTexelAddrNoLOD
  141. dnl
  142. dnl Sets up for use of RpTexelAddrNoLOD.
  143. dnl Assumes pTex is set to the current texture.
  144. dnl
  145. define(`d_RlTexelAddrNoLOD',
  146. `INT16 iShiftU0;
  147. iShiftU0 = TEX_FINAL_SHIFT - pTex->iShiftU;
  148. INT16 iShiftV0;
  149. iShiftV0 = TEX_FINAL_SHIFT - pTex->iShiftV;
  150. UINT16 uMaskU0;
  151. uMaskU0 = pTex->uMaskU;
  152. UINT16 uMaskV0;
  153. uMaskV0 = pTex->uMaskV;
  154. PUINT8 pTexBits = pTex->pBits[0];
  155. INT16 iTexShiftPitch = pTex->iShiftPitch[0];')dnl
  156. //-----------------------------------------------------------------------------
  157. //
  158. // Loop_Any
  159. //
  160. // Loops over the pixels of a span, calling processing routines at each one.
  161. // Handles any pixel-to-pixel step.
  162. //
  163. //-----------------------------------------------------------------------------
  164. void Ramp_Loop_Any(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  165. {
  166. // get values to iterate
  167. UINT16 uPix = pS->uPix;
  168. d_RlDither
  169. // don't need to do this if not texture mapping
  170. if (pCtx->pdwRenderState[D3DRENDERSTATE_TEXTUREPERSPECTIVE])
  171. {
  172. d_RlSpecialWPerspTex
  173. }
  174. else
  175. {
  176. d_RlAffineTex
  177. }
  178. INT iSurfaceStep;
  179. INT iZStep;
  180. if (pP->uFlags & D3DI_RASTPRIM_X_DEC)
  181. {
  182. iZStep = -pCtx->iZStep;
  183. iSurfaceStep = -pCtx->iSurfaceStep;
  184. pCtx->SI.iXStep = -1; // for dithering
  185. }
  186. else
  187. {
  188. iZStep = pCtx->iZStep;
  189. iSurfaceStep = pCtx->iSurfaceStep;
  190. pCtx->SI.iXStep = 1;
  191. }
  192. while (1)
  193. {
  194. #if 0
  195. // for debug, since breakpoints with conditions are really really slow
  196. if ((pS->uX == 56) && ((pS->uY == 26) || (pS->uY == 26)))
  197. {
  198. D3D_ERR("Look at this");
  199. }
  200. #endif
  201. pCtx->pfnLoopEnd(pCtx, pP, pS);
  202. if (--uPix <= 0)
  203. break;
  204. pS->pZ += iZStep;
  205. pS->pSurface += iSurfaceStep;
  206. // don't update this in dithered write functions because of alpha test
  207. pCtx->SI.uDitherOffset =
  208. (pCtx->SI.uDitherOffset + (pCtx->SI.iXStep<<2)) & 0xf;
  209. #ifdef DBG
  210. // handy for debug to see where we are
  211. pS->uX += (INT16)pCtx->SI.iXStep;
  212. #endif
  213. }
  214. }
  215. dnl
  216. dnl d_Ramp_Modulate
  217. dnl
  218. dnl Produces a specialized pixel processor for modulated texture.
  219. dnl
  220. dnl $1 is the specialization name.
  221. dnl $2 is the no-pixel target name to use.
  222. dnl
  223. define(`d_Ramp_Modulate', `
  224. INT32 iMapIdx;
  225. INT32 iIIdx = iIdx >> INDEX_COLOR_SHIFT;
  226. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  227. ifelse(eval(d_index($1, `NoPersp') < 0), `1', `
  228. d_RpPwlPerspCheck(`Step')
  229. ')dnl
  230. ')dnl
  231. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  232. d_RpZInit16
  233. d_RpZTest16LE($2)
  234. ifelse(eval((d_index($1, `NoTrans') >= 0 || d_index($1, `NoColorKey') >= 0) &&
  235. d_index($1, `NoZWrite') < 0), `1', `
  236. d_RpZWrite16(`ZWrite')
  237. ')dnl
  238. ')dnl
  239. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  240. d_RpTexelAddrNoLOD
  241. d_RampTexelReadNoPixel($1, `iU00', `iV00',
  242. `pTexBits', `iTexShiftPitch', $2)
  243. iMapIdx = Color;
  244. ')dnl
  245. ifelse(eval(d_index($1, `NoDither') < 0), `1', `
  246. d_RpDither
  247. ')dnl
  248. ifelse(eval(d_index($1, `NoTrans') < 0 && d_index($1, `NoTex') >= 0), `1', `
  249. d_RpAlphaTest(`NoTex', $2)
  250. ')dnl
  251. ifelse(eval((d_index($1, `NoTrans') < 0 && d_index($1, `NoColorKey') < 0) &&
  252. d_index($1, `NoZWrite') < 0), `1', `
  253. d_RpZWrite16(`ZWrite')
  254. ')dnl
  255. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  256. iMapIdx &= 0xffffff; // mask off texture alpha
  257. iMapIdx += iIIdx;
  258. ', `
  259. iMapIdx = iIIdx;
  260. ')dnl
  261. #if DBG
  262. if (iMapIdx < 0 || iMapIdx > 0x7fff)
  263. {
  264. D3D_WARN(0, "Ramp index out of range: 0x%X", iMapIdx);
  265. iMapIdx &= 0x7fff;
  266. }
  267. #endif
  268. ifelse(eval(d_index($1, `_32') >= 0), `1', `
  269. *(PUINT32)pSurf = (UINT32)(pCtx->pRampMap[iMapIdx]);
  270. ')dnl
  271. ifelse(eval(d_index($1, `_16') >= 0), `1', `
  272. *(PUINT16)pSurf = (UINT16)(pCtx->pRampMap[iMapIdx]);
  273. ')dnl
  274. ifelse(eval(d_index($1, `_8') >= 0), `1', `
  275. *(PUINT8)pSurf = (UINT8)(pCtx->pRampMap[iMapIdx]);
  276. ')dnl
  277. ifelse(eval(d_index($1, `NoZTest') < 0 || (d_index($1, `NoTrans') < 0 && d_index($1, `NoColorKey') < 0)), `1', `
  278. $2:
  279. NULL;
  280. ')dnl
  281. ')dnl
  282. dnl
  283. dnl d_Ramp_Copy
  284. dnl
  285. dnl Produces a specialized pixel processor for copy texture.
  286. dnl
  287. dnl $1 is the specialization name.
  288. dnl $2 is the no-pixel target name to use.
  289. dnl $3 is one of NoPack Pack.
  290. dnl $4 is one of NoStep Step.
  291. dnl
  292. define(`d_Ramp_Copy', `
  293. {
  294. INT32 iMapIdx;
  295. ifelse(eval(d_index($1, `NoZTest') < 0 || d_index($1, `NoTrans') < 0), `1', `
  296. ifelse(eval(d_index($3, `NoPack') < 0 && d_index($1, `_8') >= 0), `1', `
  297. iMapIdx = (uOldPacked >> iPackPos) & 0xff;
  298. ')dnl
  299. ')dnl
  300. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  301. ifelse(eval(d_index($1, `NoPersp') < 0 && d_index($4, `NoStep') < 0), `1', `
  302. d_RpPwlPerspCheck(`Step')
  303. ')dnl
  304. ')dnl
  305. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  306. d_RpZInit16
  307. d_RpZTest16LE($2)
  308. ifelse(eval((d_index($1, `NoTrans') >= 0 || d_index($1, `NoColorKey') >= 0) &&
  309. d_index($1, `NoZWrite') < 0), `1', `
  310. d_RpZWrite16(`ZWrite')
  311. ')dnl
  312. ')dnl
  313. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  314. d_RpTexelAddrNoLOD
  315. d_RampTexelReadNoPixel($1, `iU00', `iV00',
  316. `pTexBits', `iTexShiftPitch', $2)
  317. iMapIdx = Color;
  318. ')dnl
  319. ifelse(eval(d_index($1, `NoTrans') < 0 && d_index($1, `NoTex') >= 0), `1', `
  320. d_RpAlphaTest(`NoTex', $2)
  321. ')dnl
  322. ifelse(eval((d_index($1, `NoTrans') < 0 && d_index($1, `NoColorKey') < 0) &&
  323. d_index($1, `NoZWrite') < 0), `1', `
  324. d_RpZWrite16(`ZWrite')
  325. ')dnl
  326. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  327. ifelse(eval(d_index($1, `_32') >= 0), `1', `
  328. iMapIdx &= 0xffffff; // mask off texture alpha
  329. ')dnl
  330. ', `
  331. // This case should never be used.
  332. iMapIdx = 0;
  333. ')dnl
  334. ifelse(eval(d_index($1, `_32') >= 0), `1', `
  335. *(PUINT32)pSurf = (UINT32)iMapIdx;
  336. ')dnl
  337. ifelse(eval(d_index($1, `_16') >= 0), `1', `
  338. *(PUINT16)pSurf = (UINT16)iMapIdx;
  339. ')dnl
  340. ifelse(eval(d_index($1, `_8') >= 0), `1', `
  341. ifelse(eval(d_index($3, `NoPack') >= 0), `1', `
  342. *(PUINT8)pSurf = (UINT8)iMapIdx;
  343. ')dnl
  344. ')dnl
  345. ifelse(eval(d_index($1, `NoZTest') < 0 || (d_index($1, `NoTrans') < 0 && d_index($1, `NoColorKey') < 0)), `1', `
  346. $2:
  347. NULL;
  348. ')dnl
  349. ifelse(eval(d_index($3, `NoPack') < 0 && d_index($1, `_8') >= 0), `1', `
  350. uPacked |= (iMapIdx & 0xff) << iPackPos;
  351. iPackPos += iPackPosStep;
  352. ')dnl
  353. }
  354. ')dnl
  355. dnl
  356. dnl d_Ramp_Pixel
  357. dnl
  358. dnl Produces pixel processing code for either texture type.
  359. dnl
  360. dnl $1 is the specialization name. Specifically look for copy
  361. dnl and default to modulate so that untextured cases go to modulate,
  362. dnl which handles them.
  363. dnl $2 is the no-pixel target name to use.
  364. dnl $3 is one of NoPack Pack.
  365. dnl
  366. define(`d_Ramp_Pixel',
  367. `ifelse(eval(d_index($1, `Copy') >= 0), `1',
  368. `d_Ramp_Copy($1, $2, $3, $4)',
  369. `d_Ramp_Modulate($1, $2, $3, $4)')dnl
  370. ')dnl
  371. dnl
  372. dnl d_Ramp_Pixel_Step
  373. dnl
  374. dnl Produces a post-pixel step.
  375. dnl
  376. dnl $1 is the specialization name.
  377. dnl
  378. define(`d_Ramp_Pixel_Step',
  379. `ifelse(eval(d_index($1, `Gouraud') >= 0 && d_index($1, `Copy') < 0), `1', `
  380. iIdx += iDIdxDX;
  381. ifelse(eval(d_index($1, `NoTex') >= 0 && d_index($1, `NoTrans') < 0), `1', `
  382. pS->iIdxA += pP->iDIdxADX;
  383. ')dnl
  384. ')dnl
  385. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  386. ifelse(eval(d_index($1, `NoPersp') < 0), `1', `
  387. d_RpPwlPerspStepTexNoLOD
  388. ', `
  389. d_RpAffineStepTexNoLOD
  390. ')dnl
  391. ')dnl
  392. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  393. pZ += iZStep;
  394. ')dnl
  395. pSurf += iSurfaceStep;
  396. ifelse(eval(d_index($1, `NoDither') < 0 ||
  397. (d_index($1, `NoTex') >= 0 && d_index($1, `NoTrans') < 0)), `1', `
  398. // dont update this in dithered write functions because of alpha test
  399. pCtx->SI.uDitherOffset =
  400. (pCtx->SI.uDitherOffset + (pCtx->SI.iXStep<<2)) & 0xf;
  401. ')dnl
  402. #if 0
  403. // for debug, since breakpoints with conditions are really really slow
  404. if ((pS->uX == 150) && (pS->uY == 135))
  405. {
  406. D3D_ERR("Look at this, too");
  407. }
  408. #endif
  409. #ifdef DBG
  410. // handy for debug to see where we are
  411. pS->uX += (INT16)pCtx->SI.iXStep;
  412. #endif
  413. ')dnl
  414. //-----------------------------------------------------------------------------
  415. //
  416. // Specialized RenderSpans loops.
  417. //
  418. // Loops over the pixels of every span, calling processing routines at
  419. // eah one. Handles any pixel-to-pixel step.
  420. //
  421. //-----------------------------------------------------------------------------
  422. define(`d_Ramp_Spans', `
  423. ifelse(eval(d_index($1, `Copy') >= 0), `1', `
  424. #ifndef _X86_
  425. ')dnl
  426. HRESULT Ramp_$1(PD3DI_RASTCTX pCtx)
  427. {
  428. // get values to iterate
  429. PD3DI_RASTPRIM pP = pCtx->pPrim;
  430. if (pCtx->pTexture[0])
  431. {
  432. pCtx->pTexture[0]->pRampmap = pCtx->pTexRampMap;
  433. }
  434. while (pP != NULL)
  435. {
  436. UINT16 uSpans = pP->uSpans;
  437. PD3DI_RASTSPAN pS = (PD3DI_RASTSPAN)(pP + 1);
  438. while (uSpans-- > 0)
  439. {
  440. UINT16 uPix = pS->uPix;
  441. PUINT8 pSurf = pS->pSurface;
  442. ifelse(eval(d_index($1, `Copy') < 0), `1', `
  443. INT32 iIdx = pS->iIdx;
  444. ifelse(eval(d_index($1, `Gouraud') >= 0), `1', `
  445. INT32 iDIdxDX = pP->iDIdxDX;
  446. ')dnl
  447. ')dnl
  448. ifelse(eval(d_index($1, `NoDither') < 0 ||
  449. (d_index($1, `NoTex') >= 0 && d_index($1, `NoTrans') < 0)), `1', `
  450. d_RlDither
  451. ')dnl
  452. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  453. PD3DI_SPANTEX pTex;
  454. pTex = pCtx->pTexture[0];
  455. d_RlTexelAddrNoLOD
  456. ifelse(eval(d_index($1, `NoPersp') < 0), `1', `
  457. ifelse(eval(d_index($1, `SplitCopy') >= 0), `1', `
  458. d_RlPwlPerspTex(`NoStep')
  459. ', `
  460. d_RlPwlPerspTex(`Step')
  461. ')dnl
  462. ', `
  463. d_RlAffineTex
  464. ')dnl
  465. ')dnl
  466. INT iSurfaceStep;
  467. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  468. INT iZStep;
  469. PUINT8 pZ = pS->pZ;
  470. UINT32 uZ = pS->uZ;
  471. INT32 iDZDX = pP->iDZDX;
  472. ')dnl
  473. if (pP->uFlags & D3DI_RASTPRIM_X_DEC)
  474. {
  475. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  476. iZStep = -pCtx->iZStep;
  477. ')dnl
  478. iSurfaceStep = -pCtx->iSurfaceStep;
  479. ifelse(eval(d_index($1, `NoDither') < 0 ||
  480. (d_index($1, `NoTex') >= 0 && d_index($1, `NoTrans') < 0)), `1', `
  481. pCtx->SI.iXStep = -1; // for dithering
  482. ', `
  483. #if DBG
  484. pCtx->SI.iXStep = -1; // for debug X step
  485. #endif
  486. ')dnl
  487. }
  488. else
  489. {
  490. ifelse(eval(d_index($1, `NoZTest') < 0), `1', `
  491. iZStep = pCtx->iZStep;
  492. ')dnl
  493. iSurfaceStep = pCtx->iSurfaceStep;
  494. ifelse(eval(d_index($1, `NoDither') < 0 ||
  495. (d_index($1, `NoTex') >= 0 && d_index($1, `NoTrans') < 0)), `1', `
  496. pCtx->SI.iXStep = 1;
  497. ', `
  498. #if DBG
  499. pCtx->SI.iXStep = 1;
  500. #endif
  501. ')dnl
  502. }
  503. ifelse(eval(d_index($1, `SplitCopy') >= 0), `1', `
  504. while (uPix >= PWL_PERSP_STEP)
  505. {
  506. INT32 cLocalPix;
  507. d_RpPwlPerspCheck(`NoStep')
  508. cLocalPix = PWL_PERSP_STEP;
  509. while (cLocalPix-- > 0)
  510. {
  511. d_Ramp_Pixel($1, `NoPixelPwl', `NoPack', `NoStep')dnl
  512. d_Ramp_Pixel_Step($1)dnl
  513. }
  514. uPix -= PWL_PERSP_STEP;
  515. }
  516. if (uPix > 0)
  517. {
  518. d_RpPwlPerspCheck(`NoStep')
  519. while (uPix-- > 0)
  520. {
  521. d_Ramp_Pixel($1, `NoPixel', `NoPack', `NoStep')dnl
  522. d_Ramp_Pixel_Step($1)dnl
  523. }
  524. }
  525. ', `
  526. while (1)
  527. {
  528. d_Ramp_Pixel($1, `NoPixel', `NoPack', `Step')dnl
  529. if (--uPix <= 0)
  530. break;
  531. d_Ramp_Pixel_Step($1)dnl
  532. }
  533. ')dnl
  534. ifelse(eval(d_index($1, `NoTex') < 0), `1', `
  535. ifelse(eval(d_index($1, `NoPersp') < 0), `1', `
  536. d_RlPwlPerspEnd
  537. ')dnl
  538. ')dnl
  539. pS++;
  540. }
  541. pP = pP->pNext;
  542. }
  543. return S_OK;
  544. }
  545. ifelse(eval(d_index($1, `Copy') >= 0), `1', `
  546. #endif // ifndef _X86_
  547. ')dnl
  548. ')dnl
  549. d_SpecializedRampRenderSpansBeads(`d_Ramp_Spans(XX)', `XX')dnl