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.

227 lines
5.1 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. public:
  52. // CONSTRUCTOR
  53. depthwrite_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  54. {
  55. #ifdef _DEBUG
  56. m_bONLY_PROJECT_POSITION = false;
  57. #endif // _DEBUG
  58. m_nONLY_PROJECT_POSITION = 0;
  59. #ifdef _DEBUG
  60. m_bTREESWAY = false;
  61. #endif // _DEBUG
  62. m_nTREESWAY = 0;
  63. }
  64. int GetIndex()
  65. {
  66. // Asserts to make sure that we aren't using any skipped combinations.
  67. // Asserts to make sure that we are setting all of the combination vars.
  68. #ifdef _DEBUG
  69. bool bAllStaticVarsDefined = m_bONLY_PROJECT_POSITION && m_bTREESWAY;
  70. Assert( bAllStaticVarsDefined );
  71. #endif // _DEBUG
  72. return ( 4 * m_nONLY_PROJECT_POSITION ) + ( 4 * m_nTREESWAY ) + 0;
  73. }
  74. };
  75. #define shaderStaticTest_depthwrite_vs20 vsh_forgot_to_set_static_ONLY_PROJECT_POSITION + vsh_forgot_to_set_static_TREESWAY + 0
  76. class depthwrite_vs20_Dynamic_Index
  77. {
  78. private:
  79. int m_nCOMPRESSED_VERTS;
  80. #ifdef _DEBUG
  81. bool m_bCOMPRESSED_VERTS;
  82. #endif
  83. public:
  84. void SetCOMPRESSED_VERTS( int i )
  85. {
  86. Assert( i >= 0 && i <= 1 );
  87. m_nCOMPRESSED_VERTS = i;
  88. #ifdef _DEBUG
  89. m_bCOMPRESSED_VERTS = true;
  90. #endif
  91. }
  92. void SetCOMPRESSED_VERTS( bool i )
  93. {
  94. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  95. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bCOMPRESSED_VERTS = true;
  98. #endif
  99. }
  100. private:
  101. int m_nSKINNING;
  102. #ifdef _DEBUG
  103. bool m_bSKINNING;
  104. #endif
  105. public:
  106. void SetSKINNING( int i )
  107. {
  108. Assert( i >= 0 && i <= 1 );
  109. m_nSKINNING = i;
  110. #ifdef _DEBUG
  111. m_bSKINNING = true;
  112. #endif
  113. }
  114. void SetSKINNING( bool i )
  115. {
  116. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  117. m_nSKINNING = i ? 1 : 0;
  118. #ifdef _DEBUG
  119. m_bSKINNING = true;
  120. #endif
  121. }
  122. private:
  123. int m_nMORPHING;
  124. #ifdef _DEBUG
  125. bool m_bMORPHING;
  126. #endif
  127. public:
  128. void SetMORPHING( int i )
  129. {
  130. Assert( i >= 0 && i <= 0 );
  131. m_nMORPHING = i;
  132. #ifdef _DEBUG
  133. m_bMORPHING = true;
  134. #endif
  135. }
  136. void SetMORPHING( bool i )
  137. {
  138. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  139. m_nMORPHING = i ? 1 : 0;
  140. #ifdef _DEBUG
  141. m_bMORPHING = true;
  142. #endif
  143. }
  144. private:
  145. int m_nTESSELLATION;
  146. #ifdef _DEBUG
  147. bool m_bTESSELLATION;
  148. #endif
  149. public:
  150. void SetTESSELLATION( int i )
  151. {
  152. Assert( i >= 0 && i <= 0 );
  153. m_nTESSELLATION = i;
  154. #ifdef _DEBUG
  155. m_bTESSELLATION = true;
  156. #endif
  157. }
  158. void SetTESSELLATION( bool i )
  159. {
  160. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  161. m_nTESSELLATION = i ? 1 : 0;
  162. #ifdef _DEBUG
  163. m_bTESSELLATION = true;
  164. #endif
  165. }
  166. public:
  167. // CONSTRUCTOR
  168. depthwrite_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  169. {
  170. #ifdef _DEBUG
  171. m_bCOMPRESSED_VERTS = false;
  172. #endif // _DEBUG
  173. m_nCOMPRESSED_VERTS = 0;
  174. #ifdef _DEBUG
  175. m_bSKINNING = false;
  176. #endif // _DEBUG
  177. m_nSKINNING = 0;
  178. #ifdef _DEBUG
  179. m_bMORPHING = true;
  180. #endif // _DEBUG
  181. m_nMORPHING = false ;
  182. #ifdef _DEBUG
  183. m_bTESSELLATION = false;
  184. #endif // _DEBUG
  185. m_nTESSELLATION = 0;
  186. }
  187. int GetIndex()
  188. {
  189. // Asserts to make sure that we aren't using any skipped combinations.
  190. // Asserts to make sure that we are setting all of the combination vars.
  191. #ifdef _DEBUG
  192. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bMORPHING && m_bTESSELLATION;
  193. Assert( bAllDynamicVarsDefined );
  194. #endif // _DEBUG
  195. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nMORPHING ) + ( 4 * m_nTESSELLATION ) + 0;
  196. }
  197. };
  198. #define shaderDynamicTest_depthwrite_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_TESSELLATION + 0
  199. static const ShaderComboInformation_t s_DynamicComboArray_depthwrite_vs20[4] =
  200. {
  201. { "COMPRESSED_VERTS", 0, 1 },
  202. { "SKINNING", 0, 1 },
  203. { "MORPHING", 0, 0 },
  204. { "TESSELLATION", 0, 0 },
  205. };
  206. static const ShaderComboInformation_t s_StaticComboArray_depthwrite_vs20[2] =
  207. {
  208. { "ONLY_PROJECT_POSITION", 0, 0 },
  209. { "TREESWAY", 0, 2 },
  210. };
  211. static const ShaderComboSemantics_t depthwrite_vs20_combos =
  212. {
  213. "depthwrite_vs20", s_DynamicComboArray_depthwrite_vs20, 4, s_StaticComboArray_depthwrite_vs20, 2
  214. };
  215. class ConstructMe_depthwrite_vs20
  216. {
  217. public:
  218. ConstructMe_depthwrite_vs20()
  219. {
  220. GetShaderDLL()->AddShaderComboInformation( &depthwrite_vs20_combos );
  221. }
  222. };
  223. static ConstructMe_depthwrite_vs20 s_ConstructMe_depthwrite_vs20;