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.

168 lines
9.2 KiB

  1. dnl ---------------------------------------------------------------------------
  2. dnl
  3. dnl This file contains ramp bead structure creating macros and produces
  4. dnl the structures themselves.
  5. dnl
  6. dnl Copyright (C) Microsoft Corporation, 1997.
  7. dnl
  8. dnl ---------------------------------------------------------------------------
  9. dnl
  10. define(`d_SpecializedRampRenderSpansBeads', `d_RepStr(`d_RepStr(`$1', `$2', AAAA)', AAAA,
  11. Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_NoTex,
  12. Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_NoTex,
  13. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_NoTex,
  14. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_NoTex,
  15. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_NoTex,
  16. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_NoTex,
  17. Spans_8_ZTest_ZWrite_Dither_NoTrans_Flat_NoTex,
  18. Spans_16_ZTest_ZWrite_Dither_NoTrans_Flat_NoTex,
  19. Spans_8_ZTest_ZWrite_Dither_NoTrans_Gouraud_NoTex,
  20. Spans_16_ZTest_ZWrite_Dither_NoTrans_Gouraud_NoTex,
  21. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_NoTex,
  22. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_NoTex,
  23. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_NoTex,
  24. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_NoTex,
  25. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4ColorKey,
  26. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4ColorKey,
  27. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey,
  28. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey,
  29. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  30. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  31. Spans_8_ZTest_NoZWrite_Dither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey,
  32. Spans_16_ZTest_NoZWrite_Dither_Trans_Flat_TexNoPerspModulatePalette8NoColorKey,
  33. Spans_8_ZTest_NoZWrite_Dither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  34. Spans_16_ZTest_NoZWrite_Dither_Trans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  35. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4NoColorKey,
  36. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4NoColorKey,
  37. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4NoColorKey,
  38. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4NoColorKey,
  39. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4NoColorKey,
  40. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette4NoColorKey,
  41. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette4NoColorKey,
  42. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexNoPerspModulatePalette4NoColorKey,
  43. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey,
  44. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey,
  45. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  46. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  47. Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey,
  48. Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexNoPerspModulatePalette8NoColorKey,
  49. Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  50. Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexNoPerspModulatePalette8NoColorKey,
  51. Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey,
  52. Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey,
  53. Spans_8_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey,
  54. Spans_16_NoZTest_NoZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey,
  55. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey,
  56. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey,
  57. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette8NoColorKey,
  58. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette8NoColorKey,
  59. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4ColorKey,
  60. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspModulatePalette4ColorKey,
  61. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4ColorKey,
  62. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspModulatePalette4ColorKey,
  63. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8NoColorKey,
  64. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8NoColorKey,
  65. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8NoColorKey,
  66. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8NoColorKey,
  67. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspCopyPalette8NoColorKey,
  68. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspCopyPalette8NoColorKey,
  69. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspCopyPalette8NoColorKey,
  70. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspCopyPalette8NoColorKey,
  71. Spans_8_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8ColorKey,
  72. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexPerspCopyPalette8ColorKey,
  73. Spans_8_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8ColorKey,
  74. Spans_16_ZTest_ZWrite_NoDither_Trans_Gouraud_TexPerspCopyPalette8ColorKey,
  75. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey,
  76. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Flat_TexPerspModulatePalette8NoColorKey,
  77. Spans_8_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey,
  78. Spans_16_ZTest_ZWrite_NoDither_NoTrans_Gouraud_TexPerspModulatePalette8NoColorKey,
  79. Spans_16_ZTest_ZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8ColorKey,
  80. Spans_16_NoZTest_NoZWrite_NoDither_Trans_Flat_TexNoPerspModulatePalette8ColorKey,
  81. Spans_16_NoZTest_NoZWrite_NoDither_Trans_Flat_TexPerspModulatePalette8NoColorKey
  82. )')dnl
  83. dnl
  84. define(`d_RRSBFormat',
  85. `ifelse(eval(d_index($1, `_8') >= 0), `1', `0',
  86. eval(d_index($1, `_16') >= 0), `1', `1')')dnl
  87. define(`d_RRSBZTest',
  88. `ifelse(eval(d_index($1, `NoZTest') >= 0), `1', `0', `1')')dnl
  89. define(`d_RRSBZWrite',
  90. `ifelse(eval(d_index($1, `NoZWrite') >= 0), `1', `0', `1')')dnl
  91. define(`d_RRSBDither',
  92. `ifelse(eval(d_index($1, `NoDither') >= 0), `1', `0', `1')')dnl
  93. define(`d_RRSBTrans',
  94. `ifelse(eval(d_index($1, `NoTrans') >= 0), `1', `0', `1')')dnl
  95. define(`d_RRSBShade',
  96. `ifelse(eval(d_index($1, `Flat') >= 0), `1', `0', `1')')dnl
  97. define(`d_RRSBTexIdx',
  98. `eval(ifelse(eval(d_index($1, `Palette8') >= 0), `1', `1', `0') +
  99. ifelse(eval(d_index($1, `NoColorKey') < 0), `1', `2', `0') +
  100. ifelse(eval(d_index($1, `Copy') >= 0), `1', `4', `0') +
  101. ifelse(eval(d_index($1, `NoPersp') < 0), `1', `8', `0'))')dnl
  102. define(`d_RRSBTex',
  103. `ifelse(eval(d_index($1, `NoTex') >= 0), `1', `0',
  104. incr(d_RRSBTexIdx($1)))')dnl
  105. define(`d_RampRenderSpansBeadIndex',
  106. `eval(d_RRSBFormat($1) + d_RRSBZTest($1) * 2 + d_RRSBZWrite($1) * 4 +
  107. d_RRSBDither($1) * 8 + d_RRSBTrans($1) * 16 +
  108. d_RRSBShade($1) * 32 + d_RRSBTex($1) * 64)')dnl
  109. dnl
  110. define(`d_RampBeginBeads', `d_RepStr(`$1', `$2', Loop_Any)')dnl
  111. dnl
  112. define(`d_RampMonoBeads', `d_RepStr(`d_RepStr(`$1', `$2', Mono_AAAA)',
  113. AAAA, Modulate, Copy_8, Copy_16)')dnl
  114. dnl
  115. define(`d_RampTexReadBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexRead_AAAA_BBBB_CCCC)',
  116. AAAA, Palette4, Palette8, 16)',
  117. BBBB, NoColorKey, ColorKey)',
  118. CCCC, Modulate, Copy)')dnl
  119. dnl
  120. dnl
  121. dnl
  122. ifelse(`d_BeadMacrosOnly', d_BeadMacrosOnly, `
  123. // Indices used to access elements of the RenderSpans ramp bead table.
  124. #define RAMPFORMAT_NUM 2
  125. #define RAMPZTEST_NUM 2
  126. #define RAMPZWRITE_NUM 2
  127. #define RAMPDITHER_NUM 2
  128. #define RAMPTRANS_NUM 2
  129. #define RAMPSHADEMODE_NUM 2
  130. #define RAMPTEXTURE_NUM 17
  131. // Mono beads.
  132. #define RAMPMONOTEXTURECOPY_NUM 3
  133. // TexRead.
  134. #define RAMPTEXTURECOPY_NUM 2
  135. #define RAMPTEXTUREFORMAT_NUM 3
  136. #define RAMPCOLORKEY_NUM 2
  137. dnl
  138. // structures for bead organization
  139. dnl
  140. define(`d_MakeBeadStruct', `
  141. typedef struct tagRAMP`'d_UpCase(`$1')`'BEADS
  142. {
  143. $3 pfn`'$1`'$2;
  144. } RAMP`'d_UpCase(`$1')`'BEADS, *PRAMP`'d_UpCase(`$1')`'BEADS;')dnl
  145. dnl
  146. d_MakeBeadStruct(RenderSpans, [RAMPTEXTURE_NUM][RAMPSHADEMODE_NUM][RAMPTRANS_NUM][RAMPDITHER_NUM][RAMPZWRITE_NUM][RAMPZTEST_NUM][RAMPFORMAT_NUM],
  147. PFNRENDERSPANS)
  148. d_MakeBeadStruct(Begin, [1],
  149. PFNSPANLAYER)
  150. d_MakeBeadStruct(Mono, [RAMPMONOTEXTURECOPY_NUM],
  151. PFNSPANLAYER)
  152. d_MakeBeadStruct(TexRead, [RAMPTEXTURECOPY_NUM][RAMPCOLORKEY_NUM][RAMPTEXTUREFORMAT_NUM],
  153. PFNTEXREAD)
  154. // Root structure needed for state validation. Contains pointers to function pointer
  155. // tables
  156. typedef struct tagRAMPBEADTABLE
  157. {
  158. PFNRENDERSPANS pfnRenderSpansAny;
  159. PRAMPRENDERSPANSBEADS pRenderSpansBeads;
  160. PRAMPBEGINBEADS pBeginBeads;
  161. PRAMPMONOBEADS pMonoBeads;
  162. PRAMPTEXREADBEADS pTexReadBeads;
  163. } RAMPBEADTABLE, *PRAMPBEADTABLE;
  164. ')dnl