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.8 KiB

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