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.

142 lines
4.4 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // getcaps.h
  4. //
  5. // Legacy caps as pulled from mustard\direct3d\d3d\ddraw\getcaps.c
  6. //
  7. // This file is included from swprov.cpp with BUILD_RAMP set and not set,
  8. // to pick up exactly the caps reported by the software rasterizers in DX5.
  9. //
  10. // Copyright (C) Microsoft Corporation, 1997.
  11. //
  12. //----------------------------------------------------------------------------
  13. #define MAX_CLIPPING_PLANES 12
  14. /* Space for vertices generated/copied while clipping one triangle */
  15. #define MAX_CLIP_VERTICES (( 2 * MAX_CLIPPING_PLANES ) + 3 )
  16. #define MAX_VERTEX_COUNT 2048
  17. #define BASE_VERTEX_COUNT (MAX_VERTEX_COUNT - MAX_CLIP_VERTICES)
  18. #define transformCaps { sizeof(D3DTRANSFORMCAPS), D3DTRANSFORMCAPS_CLIP }
  19. #ifdef BUILD_RAMP
  20. #define THIS_MODEL D3DLIGHTINGMODEL_MONO
  21. #define THIS_COLOR_MODEL D3DCOLOR_MONO
  22. #else
  23. #define THIS_MODEL D3DLIGHTINGMODEL_RGB
  24. #define THIS_COLOR_MODEL D3DCOLOR_RGB
  25. #endif
  26. #define lightingCaps { \
  27. sizeof(D3DLIGHTINGCAPS), \
  28. D3DLIGHTCAPS_POINT | \
  29. D3DLIGHTCAPS_SPOT | \
  30. D3DLIGHTCAPS_DIRECTIONAL | \
  31. D3DLIGHTCAPS_PARALLELPOINT, \
  32. THIS_MODEL, /* dwLightingModel */ \
  33. 0, /* dwNumLights (infinite) */ \
  34. }
  35. /*
  36. * Software Driver caps
  37. */
  38. #ifdef BUILD_RAMP
  39. #define TRISHADECAPS \
  40. D3DPSHADECAPS_COLORFLATMONO | \
  41. D3DPSHADECAPS_COLORGOURAUDMONO | \
  42. D3DPSHADECAPS_SPECULARFLATMONO | \
  43. D3DPSHADECAPS_SPECULARGOURAUDMONO | \
  44. D3DPSHADECAPS_ALPHAFLATSTIPPLED | \
  45. D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED
  46. #else
  47. #define TRISHADECAPS \
  48. D3DPSHADECAPS_COLORFLATRGB | \
  49. D3DPSHADECAPS_COLORGOURAUDRGB | \
  50. D3DPSHADECAPS_SPECULARFLATRGB | \
  51. D3DPSHADECAPS_SPECULARGOURAUDRGB | \
  52. D3DPSHADECAPS_ALPHAFLATSTIPPLED | \
  53. D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED | \
  54. D3DPSHADECAPS_FOGFLAT | \
  55. D3DPSHADECAPS_FOGGOURAUD
  56. #endif
  57. #ifdef BUILD_RAMP
  58. #define TRIFILTERCAPS \
  59. D3DPTFILTERCAPS_NEAREST | \
  60. D3DPTFILTERCAPS_MIPNEAREST
  61. #else
  62. #define TRIFILTERCAPS \
  63. D3DPTFILTERCAPS_NEAREST | \
  64. D3DPTFILTERCAPS_LINEAR | \
  65. D3DPTFILTERCAPS_MIPNEAREST | \
  66. D3DPTFILTERCAPS_MIPLINEAR | \
  67. D3DPTFILTERCAPS_LINEARMIPNEAREST
  68. #endif
  69. #ifndef BUILD_RAMP
  70. #define TRIRASTERCAPS \
  71. D3DPRASTERCAPS_DITHER | \
  72. D3DPRASTERCAPS_SUBPIXELX | \
  73. D3DPRASTERCAPS_FOGVERTEX | \
  74. D3DPRASTERCAPS_FOGTABLE | \
  75. D3DPRASTERCAPS_ZTEST
  76. #else
  77. #define TRIRASTERCAPS \
  78. D3DPRASTERCAPS_DITHER | \
  79. D3DPRASTERCAPS_SUBPIXELX | \
  80. D3DPRASTERCAPS_ZTEST
  81. #endif
  82. #define triCaps { \
  83. sizeof(D3DPRIMCAPS), \
  84. D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLNONE, /* miscCaps */ \
  85. TRIRASTERCAPS, /* rasterCaps */ \
  86. D3DPCMPCAPS_NEVER | D3DPCMPCAPS_LESS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_NOTEQUAL | D3DPCMPCAPS_GREATEREQUAL | D3DPCMPCAPS_ALWAYS, /* zCmpCaps */ \
  87. 0, /* sourceBlendCaps */ \
  88. 0, /* destBlendCaps */ \
  89. 0, /* alphaBlendCaps */ \
  90. TRISHADECAPS, /* shadeCaps */ \
  91. D3DPTEXTURECAPS_PERSPECTIVE |/* textureCaps */ \
  92. D3DPTEXTURECAPS_POW2 | \
  93. D3DPTEXTURECAPS_TRANSPARENCY, \
  94. TRIFILTERCAPS, /* textureFilterCaps */ \
  95. D3DPTBLENDCAPS_COPY | /* textureBlendCaps */ \
  96. D3DPTBLENDCAPS_MODULATE, \
  97. D3DPTADDRESSCAPS_WRAP, /* textureAddressCaps */\
  98. 4, /* stippleWidth */ \
  99. 4 /* stippleHeight */ \
  100. } \
  101. static D3DDEVICEDESC devDesc = {
  102. sizeof(D3DDEVICEDESC), /* dwSize */
  103. D3DDD_COLORMODEL | /* dwFlags */
  104. D3DDD_DEVCAPS |
  105. D3DDD_TRANSFORMCAPS |
  106. D3DDD_LIGHTINGCAPS |
  107. D3DDD_BCLIPPING |
  108. D3DDD_TRICAPS |
  109. D3DDD_DEVICERENDERBITDEPTH |
  110. D3DDD_DEVICEZBUFFERBITDEPTH |
  111. D3DDD_MAXBUFFERSIZE |
  112. D3DDD_MAXVERTEXCOUNT,
  113. THIS_COLOR_MODEL, /* dcmColorModel */
  114. D3DDEVCAPS_FLOATTLVERTEX |
  115. D3DDEVCAPS_SORTINCREASINGZ |
  116. D3DDEVCAPS_SORTEXACT |
  117. D3DDEVCAPS_EXECUTESYSTEMMEMORY |
  118. D3DDEVCAPS_TLVERTEXSYSTEMMEMORY |
  119. D3DDEVCAPS_TEXTURESYSTEMMEMORY |
  120. D3DDEVCAPS_DRAWPRIMTLVERTEX,
  121. transformCaps, /* transformCaps */
  122. TRUE, /* bClipping */
  123. lightingCaps, /* lightingCaps */
  124. triCaps, /* lineCaps */
  125. triCaps, /* triCaps */
  126. DDBD_8 | DDBD_16 | DDBD_24 | DDBD_32, /* dwDeviceRenderBitDepth */
  127. DDBD_16, /* dwDeviceZBufferBitDepth */
  128. 0, /* dwMaxBufferSize */
  129. BASE_VERTEX_COUNT /* dwMaxVertexCount */
  130. };