Counter Strike : Global Offensive Source Code
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.

254 lines
5.6 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $MORPHING || $SKINNING || $COMPRESSED_VERTS ) && $TESSELLATION
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  4. #include "shaderlib/cshader.h"
  5. class depthwrite_vs20_Static_Index
  6. {
  7. private:
  8. int m_nONLY_PROJECT_POSITION;
  9. #ifdef _DEBUG
  10. bool m_bONLY_PROJECT_POSITION;
  11. #endif
  12. public:
  13. void SetONLY_PROJECT_POSITION( int i )
  14. {
  15. Assert( i >= 0 && i <= 0 );
  16. m_nONLY_PROJECT_POSITION = i;
  17. #ifdef _DEBUG
  18. m_bONLY_PROJECT_POSITION = true;
  19. #endif
  20. }
  21. void SetONLY_PROJECT_POSITION( bool i )
  22. {
  23. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  24. m_nONLY_PROJECT_POSITION = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bONLY_PROJECT_POSITION = true;
  27. #endif
  28. }
  29. private:
  30. int m_nTREESWAY;
  31. #ifdef _DEBUG
  32. bool m_bTREESWAY;
  33. #endif
  34. public:
  35. void SetTREESWAY( int i )
  36. {
  37. Assert( i >= 0 && i <= 2 );
  38. m_nTREESWAY = i;
  39. #ifdef _DEBUG
  40. m_bTREESWAY = true;
  41. #endif
  42. }
  43. void SetTREESWAY( bool i )
  44. {
  45. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  46. m_nTREESWAY = i ? 1 : 0;
  47. #ifdef _DEBUG
  48. m_bTREESWAY = true;
  49. #endif
  50. }
  51. private:
  52. int m_nCOLOR_DEPTH;
  53. #ifdef _DEBUG
  54. bool m_bCOLOR_DEPTH;
  55. #endif
  56. public:
  57. void SetCOLOR_DEPTH( int i )
  58. {
  59. Assert( i >= 0 && i <= 1 );
  60. m_nCOLOR_DEPTH = i;
  61. #ifdef _DEBUG
  62. m_bCOLOR_DEPTH = true;
  63. #endif
  64. }
  65. void SetCOLOR_DEPTH( bool i )
  66. {
  67. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  68. m_nCOLOR_DEPTH = i ? 1 : 0;
  69. #ifdef _DEBUG
  70. m_bCOLOR_DEPTH = true;
  71. #endif
  72. }
  73. public:
  74. // CONSTRUCTOR
  75. depthwrite_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  76. {
  77. #ifdef _DEBUG
  78. m_bONLY_PROJECT_POSITION = false;
  79. #endif // _DEBUG
  80. m_nONLY_PROJECT_POSITION = 0;
  81. #ifdef _DEBUG
  82. m_bTREESWAY = false;
  83. #endif // _DEBUG
  84. m_nTREESWAY = 0;
  85. #ifdef _DEBUG
  86. m_bCOLOR_DEPTH = false;
  87. #endif // _DEBUG
  88. m_nCOLOR_DEPTH = 0;
  89. }
  90. int GetIndex()
  91. {
  92. // Asserts to make sure that we aren't using any skipped combinations.
  93. // Asserts to make sure that we are setting all of the combination vars.
  94. #ifdef _DEBUG
  95. bool bAllStaticVarsDefined = m_bONLY_PROJECT_POSITION && m_bTREESWAY && m_bCOLOR_DEPTH;
  96. Assert( bAllStaticVarsDefined );
  97. #endif // _DEBUG
  98. return ( 4 * m_nONLY_PROJECT_POSITION ) + ( 4 * m_nTREESWAY ) + ( 12 * m_nCOLOR_DEPTH ) + 0;
  99. }
  100. };
  101. #define shaderStaticTest_depthwrite_vs20 vsh_forgot_to_set_static_ONLY_PROJECT_POSITION + vsh_forgot_to_set_static_TREESWAY + vsh_forgot_to_set_static_COLOR_DEPTH + 0
  102. class depthwrite_vs20_Dynamic_Index
  103. {
  104. private:
  105. int m_nCOMPRESSED_VERTS;
  106. #ifdef _DEBUG
  107. bool m_bCOMPRESSED_VERTS;
  108. #endif
  109. public:
  110. void SetCOMPRESSED_VERTS( int i )
  111. {
  112. Assert( i >= 0 && i <= 1 );
  113. m_nCOMPRESSED_VERTS = i;
  114. #ifdef _DEBUG
  115. m_bCOMPRESSED_VERTS = true;
  116. #endif
  117. }
  118. void SetCOMPRESSED_VERTS( bool i )
  119. {
  120. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  121. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  122. #ifdef _DEBUG
  123. m_bCOMPRESSED_VERTS = true;
  124. #endif
  125. }
  126. private:
  127. int m_nSKINNING;
  128. #ifdef _DEBUG
  129. bool m_bSKINNING;
  130. #endif
  131. public:
  132. void SetSKINNING( int i )
  133. {
  134. Assert( i >= 0 && i <= 1 );
  135. m_nSKINNING = i;
  136. #ifdef _DEBUG
  137. m_bSKINNING = true;
  138. #endif
  139. }
  140. void SetSKINNING( bool i )
  141. {
  142. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  143. m_nSKINNING = i ? 1 : 0;
  144. #ifdef _DEBUG
  145. m_bSKINNING = true;
  146. #endif
  147. }
  148. private:
  149. int m_nMORPHING;
  150. #ifdef _DEBUG
  151. bool m_bMORPHING;
  152. #endif
  153. public:
  154. void SetMORPHING( int i )
  155. {
  156. Assert( i >= 0 && i <= 0 );
  157. m_nMORPHING = i;
  158. #ifdef _DEBUG
  159. m_bMORPHING = true;
  160. #endif
  161. }
  162. void SetMORPHING( bool i )
  163. {
  164. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  165. m_nMORPHING = i ? 1 : 0;
  166. #ifdef _DEBUG
  167. m_bMORPHING = true;
  168. #endif
  169. }
  170. private:
  171. int m_nTESSELLATION;
  172. #ifdef _DEBUG
  173. bool m_bTESSELLATION;
  174. #endif
  175. public:
  176. void SetTESSELLATION( int i )
  177. {
  178. Assert( i >= 0 && i <= 0 );
  179. m_nTESSELLATION = i;
  180. #ifdef _DEBUG
  181. m_bTESSELLATION = true;
  182. #endif
  183. }
  184. void SetTESSELLATION( bool i )
  185. {
  186. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  187. m_nTESSELLATION = i ? 1 : 0;
  188. #ifdef _DEBUG
  189. m_bTESSELLATION = true;
  190. #endif
  191. }
  192. public:
  193. // CONSTRUCTOR
  194. depthwrite_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  195. {
  196. #ifdef _DEBUG
  197. m_bCOMPRESSED_VERTS = false;
  198. #endif // _DEBUG
  199. m_nCOMPRESSED_VERTS = 0;
  200. #ifdef _DEBUG
  201. m_bSKINNING = false;
  202. #endif // _DEBUG
  203. m_nSKINNING = 0;
  204. #ifdef _DEBUG
  205. m_bMORPHING = true;
  206. #endif // _DEBUG
  207. m_nMORPHING = false ;
  208. #ifdef _DEBUG
  209. m_bTESSELLATION = false;
  210. #endif // _DEBUG
  211. m_nTESSELLATION = 0;
  212. }
  213. int GetIndex()
  214. {
  215. // Asserts to make sure that we aren't using any skipped combinations.
  216. // Asserts to make sure that we are setting all of the combination vars.
  217. #ifdef _DEBUG
  218. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bMORPHING && m_bTESSELLATION;
  219. Assert( bAllDynamicVarsDefined );
  220. #endif // _DEBUG
  221. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nMORPHING ) + ( 4 * m_nTESSELLATION ) + 0;
  222. }
  223. };
  224. #define shaderDynamicTest_depthwrite_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_TESSELLATION + 0
  225. static const ShaderComboInformation_t s_DynamicComboArray_depthwrite_vs20[4] =
  226. {
  227. { "COMPRESSED_VERTS", 0, 1 },
  228. { "SKINNING", 0, 1 },
  229. { "MORPHING", 0, 0 },
  230. { "TESSELLATION", 0, 0 },
  231. };
  232. static const ShaderComboInformation_t s_StaticComboArray_depthwrite_vs20[3] =
  233. {
  234. { "ONLY_PROJECT_POSITION", 0, 0 },
  235. { "TREESWAY", 0, 2 },
  236. { "COLOR_DEPTH", 0, 1 },
  237. };
  238. static const ShaderComboSemantics_t depthwrite_vs20_combos =
  239. {
  240. "depthwrite_vs20", s_DynamicComboArray_depthwrite_vs20, 4, s_StaticComboArray_depthwrite_vs20, 3
  241. };
  242. class ConstructMe_depthwrite_vs20
  243. {
  244. public:
  245. ConstructMe_depthwrite_vs20()
  246. {
  247. GetShaderDLL()->AddShaderComboInformation( &depthwrite_vs20_combos );
  248. }
  249. };
  250. static ConstructMe_depthwrite_vs20 s_ConstructMe_depthwrite_vs20;