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.

253 lines
5.8 KiB

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