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.

200 lines
4.7 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 treeleaf_vs20_Static_Index
  6. {
  7. private:
  8. int m_nHALFLAMBERT;
  9. #ifdef _DEBUG
  10. bool m_bHALFLAMBERT;
  11. #endif
  12. public:
  13. void SetHALFLAMBERT( int i )
  14. {
  15. Assert( i >= 0 && i <= 1 );
  16. m_nHALFLAMBERT = i;
  17. #ifdef _DEBUG
  18. m_bHALFLAMBERT = true;
  19. #endif
  20. }
  21. void SetHALFLAMBERT( bool i )
  22. {
  23. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  24. m_nHALFLAMBERT = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bHALFLAMBERT = 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. treeleaf_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  54. {
  55. #ifdef _DEBUG
  56. m_bHALFLAMBERT = false;
  57. #endif // _DEBUG
  58. m_nHALFLAMBERT = 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_bHALFLAMBERT && m_bFLATTEN_STATIC_CONTROL_FLOW;
  70. Assert( bAllStaticVarsDefined );
  71. #endif // _DEBUG
  72. return ( 12 * m_nHALFLAMBERT ) + ( 24 * m_nFLATTEN_STATIC_CONTROL_FLOW ) + 0;
  73. }
  74. };
  75. #define shaderStaticTest_treeleaf_vs20 vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLATTEN_STATIC_CONTROL_FLOW + 0
  76. class treeleaf_vs20_Dynamic_Index
  77. {
  78. private:
  79. int m_nDYNAMIC_LIGHT;
  80. #ifdef _DEBUG
  81. bool m_bDYNAMIC_LIGHT;
  82. #endif
  83. public:
  84. void SetDYNAMIC_LIGHT( int i )
  85. {
  86. Assert( i >= 0 && i <= 1 );
  87. m_nDYNAMIC_LIGHT = i;
  88. #ifdef _DEBUG
  89. m_bDYNAMIC_LIGHT = true;
  90. #endif
  91. }
  92. void SetDYNAMIC_LIGHT( bool i )
  93. {
  94. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  95. m_nDYNAMIC_LIGHT = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bDYNAMIC_LIGHT = true;
  98. #endif
  99. }
  100. private:
  101. int m_nSTATIC_LIGHT;
  102. #ifdef _DEBUG
  103. bool m_bSTATIC_LIGHT;
  104. #endif
  105. public:
  106. void SetSTATIC_LIGHT( int i )
  107. {
  108. Assert( i >= 0 && i <= 1 );
  109. m_nSTATIC_LIGHT = i;
  110. #ifdef _DEBUG
  111. m_bSTATIC_LIGHT = true;
  112. #endif
  113. }
  114. void SetSTATIC_LIGHT( bool i )
  115. {
  116. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  117. m_nSTATIC_LIGHT = i ? 1 : 0;
  118. #ifdef _DEBUG
  119. m_bSTATIC_LIGHT = true;
  120. #endif
  121. }
  122. private:
  123. int m_nNUM_LIGHTS;
  124. #ifdef _DEBUG
  125. bool m_bNUM_LIGHTS;
  126. #endif
  127. public:
  128. void SetNUM_LIGHTS( int i )
  129. {
  130. Assert( i >= 0 && i <= 2 );
  131. m_nNUM_LIGHTS = i;
  132. #ifdef _DEBUG
  133. m_bNUM_LIGHTS = true;
  134. #endif
  135. }
  136. void SetNUM_LIGHTS( bool i )
  137. {
  138. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  139. m_nNUM_LIGHTS = i ? 1 : 0;
  140. #ifdef _DEBUG
  141. m_bNUM_LIGHTS = true;
  142. #endif
  143. }
  144. public:
  145. // CONSTRUCTOR
  146. treeleaf_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  147. {
  148. #ifdef _DEBUG
  149. m_bDYNAMIC_LIGHT = false;
  150. #endif // _DEBUG
  151. m_nDYNAMIC_LIGHT = 0;
  152. #ifdef _DEBUG
  153. m_bSTATIC_LIGHT = false;
  154. #endif // _DEBUG
  155. m_nSTATIC_LIGHT = 0;
  156. #ifdef _DEBUG
  157. m_bNUM_LIGHTS = false;
  158. #endif // _DEBUG
  159. m_nNUM_LIGHTS = 0;
  160. }
  161. int GetIndex()
  162. {
  163. // Asserts to make sure that we aren't using any skipped combinations.
  164. // Asserts to make sure that we are setting all of the combination vars.
  165. #ifdef _DEBUG
  166. bool bAllDynamicVarsDefined = m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bNUM_LIGHTS;
  167. Assert( bAllDynamicVarsDefined );
  168. #endif // _DEBUG
  169. return ( 1 * m_nDYNAMIC_LIGHT ) + ( 2 * m_nSTATIC_LIGHT ) + ( 4 * m_nNUM_LIGHTS ) + 0;
  170. }
  171. };
  172. #define shaderDynamicTest_treeleaf_vs20 vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  173. static const ShaderComboInformation_t s_DynamicComboArray_TreeLeaf_vs20[3] =
  174. {
  175. { "DYNAMIC_LIGHT", 0, 1 },
  176. { "STATIC_LIGHT", 0, 1 },
  177. { "NUM_LIGHTS", 0, 2 },
  178. };
  179. static const ShaderComboInformation_t s_StaticComboArray_TreeLeaf_vs20[2] =
  180. {
  181. { "HALFLAMBERT", 0, 1 },
  182. { "FLATTEN_STATIC_CONTROL_FLOW", 0, 1 },
  183. };
  184. static const ShaderComboSemantics_t TreeLeaf_vs20_combos =
  185. {
  186. "TreeLeaf_vs20", s_DynamicComboArray_TreeLeaf_vs20, 3, s_StaticComboArray_TreeLeaf_vs20, 2
  187. };
  188. class ConstructMe_TreeLeaf_vs20
  189. {
  190. public:
  191. ConstructMe_TreeLeaf_vs20()
  192. {
  193. GetShaderDLL()->AddShaderComboInformation( &TreeLeaf_vs20_combos );
  194. }
  195. };
  196. static ConstructMe_TreeLeaf_vs20 s_ConstructMe_TreeLeaf_vs20;