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.

282 lines
6.2 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // ( $DOWATERFOG == 0 ) && ( $HARDWAREFOGBLEND == 0 ) && ( $DOPIXELFOG == 0 )
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  5. #include "shaderlib/cshader.h"
  6. class cloak_vs20_Static_Index
  7. {
  8. private:
  9. int m_nMODEL;
  10. #ifdef _DEBUG
  11. bool m_bMODEL;
  12. #endif
  13. public:
  14. void SetMODEL( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nMODEL = i;
  18. #ifdef _DEBUG
  19. m_bMODEL = true;
  20. #endif
  21. }
  22. void SetMODEL( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nMODEL = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bMODEL = true;
  28. #endif
  29. }
  30. private:
  31. int m_nFLATTEN_STATIC_CONTROL_FLOW;
  32. #ifdef _DEBUG
  33. bool m_bFLATTEN_STATIC_CONTROL_FLOW;
  34. #endif
  35. public:
  36. void SetFLATTEN_STATIC_CONTROL_FLOW( int i )
  37. {
  38. Assert( i >= 0 && i <= 0 );
  39. m_nFLATTEN_STATIC_CONTROL_FLOW = i;
  40. #ifdef _DEBUG
  41. m_bFLATTEN_STATIC_CONTROL_FLOW = true;
  42. #endif
  43. }
  44. void SetFLATTEN_STATIC_CONTROL_FLOW( bool i )
  45. {
  46. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  47. m_nFLATTEN_STATIC_CONTROL_FLOW = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bFLATTEN_STATIC_CONTROL_FLOW = true;
  50. #endif
  51. }
  52. private:
  53. int m_nDOPIXELFOG;
  54. #ifdef _DEBUG
  55. bool m_bDOPIXELFOG;
  56. #endif
  57. public:
  58. void SetDOPIXELFOG( int i )
  59. {
  60. Assert( i >= 0 && i <= 1 );
  61. m_nDOPIXELFOG = i;
  62. #ifdef _DEBUG
  63. m_bDOPIXELFOG = true;
  64. #endif
  65. }
  66. void SetDOPIXELFOG( bool i )
  67. {
  68. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  69. m_nDOPIXELFOG = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bDOPIXELFOG = true;
  72. #endif
  73. }
  74. public:
  75. // CONSTRUCTOR
  76. cloak_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  77. {
  78. #ifdef _DEBUG
  79. m_bMODEL = false;
  80. #endif // _DEBUG
  81. m_nMODEL = 0;
  82. #ifdef _DEBUG
  83. m_bFLATTEN_STATIC_CONTROL_FLOW = false;
  84. #endif // _DEBUG
  85. m_nFLATTEN_STATIC_CONTROL_FLOW = 0;
  86. #ifdef _DEBUG
  87. m_bDOPIXELFOG = true;
  88. #endif // _DEBUG
  89. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  90. }
  91. int GetIndex()
  92. {
  93. // Asserts to make sure that we aren't using any skipped combinations.
  94. // Asserts to make sure that we are setting all of the combination vars.
  95. #ifdef _DEBUG
  96. bool bAllStaticVarsDefined = m_bMODEL && m_bFLATTEN_STATIC_CONTROL_FLOW && m_bDOPIXELFOG;
  97. Assert( bAllStaticVarsDefined );
  98. #endif // _DEBUG
  99. return ( 8 * m_nMODEL ) + ( 16 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + ( 16 * m_nDOPIXELFOG ) + 0;
  100. }
  101. };
  102. #define shaderStaticTest_cloak_vs20 vsh_forgot_to_set_static_MODEL + vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  103. class cloak_vs20_Dynamic_Index
  104. {
  105. private:
  106. int m_nCOMPRESSED_VERTS;
  107. #ifdef _DEBUG
  108. bool m_bCOMPRESSED_VERTS;
  109. #endif
  110. public:
  111. void SetCOMPRESSED_VERTS( int i )
  112. {
  113. Assert( i >= 0 && i <= 1 );
  114. m_nCOMPRESSED_VERTS = i;
  115. #ifdef _DEBUG
  116. m_bCOMPRESSED_VERTS = true;
  117. #endif
  118. }
  119. void SetCOMPRESSED_VERTS( bool i )
  120. {
  121. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  122. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  123. #ifdef _DEBUG
  124. m_bCOMPRESSED_VERTS = true;
  125. #endif
  126. }
  127. private:
  128. int m_nDOWATERFOG;
  129. #ifdef _DEBUG
  130. bool m_bDOWATERFOG;
  131. #endif
  132. public:
  133. void SetDOWATERFOG( int i )
  134. {
  135. Assert( i >= 0 && i <= 1 );
  136. m_nDOWATERFOG = i;
  137. #ifdef _DEBUG
  138. m_bDOWATERFOG = true;
  139. #endif
  140. }
  141. void SetDOWATERFOG( bool i )
  142. {
  143. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  144. m_nDOWATERFOG = i ? 1 : 0;
  145. #ifdef _DEBUG
  146. m_bDOWATERFOG = true;
  147. #endif
  148. }
  149. private:
  150. int m_nSKINNING;
  151. #ifdef _DEBUG
  152. bool m_bSKINNING;
  153. #endif
  154. public:
  155. void SetSKINNING( int i )
  156. {
  157. Assert( i >= 0 && i <= 1 );
  158. m_nSKINNING = i;
  159. #ifdef _DEBUG
  160. m_bSKINNING = true;
  161. #endif
  162. }
  163. void SetSKINNING( bool i )
  164. {
  165. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  166. m_nSKINNING = i ? 1 : 0;
  167. #ifdef _DEBUG
  168. m_bSKINNING = true;
  169. #endif
  170. }
  171. private:
  172. int m_nMORPHING;
  173. #ifdef _DEBUG
  174. bool m_bMORPHING;
  175. #endif
  176. public:
  177. void SetMORPHING( int i )
  178. {
  179. Assert( i >= 0 && i <= 0 );
  180. m_nMORPHING = i;
  181. #ifdef _DEBUG
  182. m_bMORPHING = true;
  183. #endif
  184. }
  185. void SetMORPHING( bool i )
  186. {
  187. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  188. m_nMORPHING = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bMORPHING = true;
  191. #endif
  192. }
  193. private:
  194. int m_nNUM_LIGHTS;
  195. #ifdef _DEBUG
  196. bool m_bNUM_LIGHTS;
  197. #endif
  198. public:
  199. void SetNUM_LIGHTS( int i )
  200. {
  201. Assert( i >= 0 && i <= 0 );
  202. m_nNUM_LIGHTS = i;
  203. #ifdef _DEBUG
  204. m_bNUM_LIGHTS = true;
  205. #endif
  206. }
  207. void SetNUM_LIGHTS( bool i )
  208. {
  209. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  210. m_nNUM_LIGHTS = i ? 1 : 0;
  211. #ifdef _DEBUG
  212. m_bNUM_LIGHTS = true;
  213. #endif
  214. }
  215. public:
  216. // CONSTRUCTOR
  217. cloak_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  218. {
  219. #ifdef _DEBUG
  220. m_bCOMPRESSED_VERTS = false;
  221. #endif // _DEBUG
  222. m_nCOMPRESSED_VERTS = 0;
  223. #ifdef _DEBUG
  224. m_bDOWATERFOG = true;
  225. #endif // _DEBUG
  226. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  227. #ifdef _DEBUG
  228. m_bSKINNING = false;
  229. #endif // _DEBUG
  230. m_nSKINNING = 0;
  231. #ifdef _DEBUG
  232. m_bMORPHING = true;
  233. #endif // _DEBUG
  234. m_nMORPHING = false ;
  235. #ifdef _DEBUG
  236. m_bNUM_LIGHTS = false;
  237. #endif // _DEBUG
  238. m_nNUM_LIGHTS = 0;
  239. }
  240. int GetIndex()
  241. {
  242. // Asserts to make sure that we aren't using any skipped combinations.
  243. // Asserts to make sure that we are setting all of the combination vars.
  244. #ifdef _DEBUG
  245. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bMORPHING && m_bNUM_LIGHTS;
  246. Assert( bAllDynamicVarsDefined );
  247. #endif // _DEBUG
  248. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nMORPHING ) + ( 8 * m_nNUM_LIGHTS ) + 0;
  249. }
  250. };
  251. #define shaderDynamicTest_cloak_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  252. static const ShaderComboInformation_t s_DynamicComboArray_cloak_vs20[5] =
  253. {
  254. { "COMPRESSED_VERTS", 0, 1 },
  255. { "DOWATERFOG", 0, 1 },
  256. { "SKINNING", 0, 1 },
  257. { "MORPHING", 0, 0 },
  258. { "NUM_LIGHTS", 0, 0 },
  259. };
  260. static const ShaderComboInformation_t s_StaticComboArray_cloak_vs20[3] =
  261. {
  262. { "MODEL", 0, 1 },
  263. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 0 },
  264. { "DOPIXELFOG", 0, 1 },
  265. };
  266. static const ShaderComboSemantics_t cloak_vs20_combos =
  267. {
  268. "cloak_vs20", s_DynamicComboArray_cloak_vs20, 5, s_StaticComboArray_cloak_vs20, 3
  269. };
  270. class ConstructMe_cloak_vs20
  271. {
  272. public:
  273. ConstructMe_cloak_vs20()
  274. {
  275. GetShaderDLL()->AddShaderComboInformation( &cloak_vs20_combos );
  276. }
  277. };
  278. static ConstructMe_cloak_vs20 s_ConstructMe_cloak_vs20;