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.

98 lines
2.5 KiB

  1. include(`texaddra.mh')dnl for W divide
  2. dnl need to fix up texaddrasm.mh to have W divide functions
  3. dnl and increment function so both pass and fail can use
  4. dnl the same code. It may be better not to though if I
  5. dnl am mixing code in the pass case.
  6. dnl
  7. dnl d_TestFail
  8. dnl
  9. dnl Macro to build test fail term incrementing routines
  10. dnl
  11. dnl $1 is one of Flat Gouraud
  12. dnl $2 is one of NoTex Tex1 PerspTex1 Tex2 PerspTex2
  13. dnl $3 is one of NoSpecularFog SpecularFog
  14. dnl $4 is one of NotMonolithic Monolithic
  15. dnl
  16. define(`d_TestFail', `
  17. ;void TestFail_$1_$2_$3(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP,
  18. ; PD3DI_RASTSPAN pS)
  19. ;{
  20. ifelse(`$4', `NotMonolithic', `
  21. PUBLIC _MMX_TestFail_$1_$2_$3
  22. _MMX_TestFail_$1_$2_$3:
  23. ')
  24. ifelse(`$1', `Gouraud', `
  25. ;pS->uB += pP->iDBDX; pS->uG += pP->iDGDX;
  26. ;pS->uR += pP->iDRDX; pS->uA += pP->iDADX;
  27. movq mm1, XpS(uB)
  28. paddw mm1, XpP(iDBDX)
  29. movq XpS(uB), mm1
  30. ')
  31. ifelse(eval((d_index(`$2', `Tex1') == 0) || (d_index(`$2', `Tex2') == 0)), `1', `
  32. d_UpdateUoWandVoW(1)
  33. d_UpdateNonPersp(1)
  34. ')
  35. ifelse(`$2', `Tex2', `
  36. d_UpdateUoWandVoW(2)
  37. d_UpdateNonPersp(2)
  38. ')
  39. ifelse(eval((d_index(`$2', `PerspTex1') == 0) || (d_index(`$2', `PerspTex2') == 0)), `1', `
  40. d_UpdateUoWandVoW(1)
  41. d_UpdateLOD()
  42. d_UpdateOoW()
  43. d_WDivide()
  44. d_UoWVoWTimesW(1)
  45. ')
  46. ifelse(`$2', `PerspTex2', `
  47. d_UpdateUoWandVoW(2)
  48. d_UoWVoWTimesW(2)
  49. ')
  50. ifelse(`$3', `SpecularFog', `
  51. ;if (pCtx->pdwRenderState[D3DRENDERSTATE_SPECULARENABLE])
  52. ;{
  53. ; 3 options here.
  54. ; either do masked add
  55. ; or always add
  56. ; or make another bead
  57. ;pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
  58. ;pS->uRS += pP->iDRSDX;
  59. movq mm1, XpS(uBS)
  60. paddw mm1, XpP(iDBSDX)
  61. movq XpS(uBS), mm1
  62. ;}
  63. ;if (pCtx->pdwRenderState[D3DRENDERSTATE_FOGENABLE])
  64. ;{
  65. ; Same options as above for this if statement.
  66. ;pS->uFog += (INT16)pP->iDFogDX;
  67. ; Fog is actually added in above addition
  68. ;pCtx->SI.uFogB += pCtx->SI.iFogBDX;
  69. ;pCtx->SI.uFogG += pCtx->SI.iFogGDX;
  70. ;pCtx->SI.uFogR += pCtx->SI.iFogRDX;
  71. ; there is a forth value that is being added here
  72. ; but it is not begin used.
  73. movq mm1, XpCtxSI(uFogB)
  74. paddw mm1, XpCtxSI(iFogBDX)
  75. movq XpCtxSI(uFogB), mm1
  76. ;}
  77. ')
  78. ifelse(`$4', `NotMonolithic', `
  79. ;ret
  80. jmp dword ptr XpCtx(pfnPixelEnd)
  81. ;}
  82. ')
  83. ')