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.

101 lines
3.3 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // This file contains Z compare fail functions.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997.
  6. //
  7. // WARNING WARNING WARNING
  8. // This cpp file generated from mcp file.
  9. // EDIT THE MCP FILE.
  10. // I warned you.
  11. // WARNING WARNING WARNING
  12. //
  13. //-----------------------------------------------------------------------------
  14. include(`m4hdr.mh')dnl
  15. #include "rgb_pch.h"
  16. #pragma hdrstop
  17. #include "ctstf_mh.h"
  18. #include "cspnutil.h"
  19. include(`ctexaddr.mh')dnl for W divide
  20. dnl
  21. dnl d_TestFail
  22. dnl
  23. dnl Macro to build test fail term incrementing routines
  24. dnl
  25. dnl $1 is one of Flat Gouraud
  26. dnl $2 is one of NoTex Tex1 PerspTex1 Tex2 PerspTex2
  27. dnl $3 is one of NoSpecularFog SpecularFog
  28. dnl
  29. define(`d_TestFail', `
  30. void C_TestFail_$1_$2_$3(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP,
  31. PD3DI_RASTSPAN pS)
  32. {dnl
  33. ifelse(`$1', `Gouraud', `
  34. pS->uB += pP->iDBDX; pS->uG += pP->iDGDX;
  35. pS->uR += pP->iDRDX; pS->uA += pP->iDADX;')
  36. ifelse(eval((d_index(`$2', `Tex1') == 0)), `1', `
  37. pS->iLOD += pS->iDLOD;
  38. pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
  39. pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
  40. pCtx->SI.TexUV[0].iU = pS->UVoW[0].iUoW>>TEX_TO_FINAL_SHIFT;
  41. pCtx->SI.TexUV[0].iV = pS->UVoW[0].iVoW>>TEX_TO_FINAL_SHIFT;')
  42. ifelse(`$2', `Tex2', `
  43. pS->iLOD += pS->iDLOD;
  44. for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
  45. {
  46. pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
  47. pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
  48. pCtx->SI.TexUV[i].iU = pS->UVoW[i].iUoW>>TEX_TO_FINAL_SHIFT;
  49. pCtx->SI.TexUV[i].iV = pS->UVoW[i].iVoW>>TEX_TO_FINAL_SHIFT;
  50. }')
  51. ifelse(eval((d_index(`$2', `PerspTex1') == 0)), `1', `
  52. pS->iLOD += pS->iDLOD;
  53. pS->iOoW += pP->iDOoWDX;
  54. INT32 iOoW = pS->iOoW>>16; // 1.15
  55. d_WDivide()
  56. pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
  57. pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
  58. pCtx->SI.TexUV[0].iU = d_WTimesUVoW(pS->iW,pS->UVoW[0].iUoW);
  59. pCtx->SI.TexUV[0].iV = d_WTimesUVoW(pS->iW,pS->UVoW[0].iVoW);')
  60. ifelse(`$2', `PerspTex2', `
  61. pS->iLOD += pS->iDLOD;
  62. pS->iOoW += pP->iDOoWDX;
  63. INT32 iOoW = pS->iOoW>>16; // 1.15
  64. d_WDivide()
  65. for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
  66. {
  67. pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
  68. pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
  69. pCtx->SI.TexUV[i].iU = d_WTimesUVoW(pS->iW,pS->UVoW[i].iUoW);
  70. pCtx->SI.TexUV[i].iV = d_WTimesUVoW(pS->iW,pS->UVoW[i].iVoW);
  71. }')
  72. ifelse(`$3', `SpecularFog', `
  73. if (pCtx->pdwRenderState[D3DRS_SPECULARENABLE])
  74. {
  75. pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
  76. pS->uRS += pP->iDRSDX;
  77. }
  78. if (pCtx->pdwRenderState[D3DRS_FOGENABLE])
  79. {
  80. pS->uFog += (INT16)pS->iDFog;
  81. pCtx->SI.uFogB += pCtx->SI.iFogBDX;
  82. pCtx->SI.uFogG += pCtx->SI.iFogGDX;
  83. pCtx->SI.uFogR += pCtx->SI.iFogRDX;
  84. }')
  85. // just returns for C, since we really can not loop with function calls
  86. }')
  87. d_RepStr(`d_RepStr(`d_RepStr(`d_TestFail(AA, BB, CC)',
  88. `AA', `Flat', `Gouraud')',
  89. `BB', `NoTex', `Tex1', `PerspTex1', `Tex2', `PerspTex2')',
  90. `CC', `NoSpecularFog', `SpecularFog')