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.

174 lines
3.9 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( ( $PREVIEW == 0 ) && ( $SKINNING == 1 ) )
  3. // ( ( $NUM_LIGHTS != 0 ) && ( $PREVIEW == 0 ) )
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  5. #include "shaderlib/cshader.h"
  6. class customweapon_vs20_Static_Index
  7. {
  8. private:
  9. int m_nPREVIEW;
  10. #ifdef _DEBUG
  11. bool m_bPREVIEW;
  12. #endif
  13. public:
  14. void SetPREVIEW( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nPREVIEW = i;
  18. #ifdef _DEBUG
  19. m_bPREVIEW = true;
  20. #endif
  21. }
  22. void SetPREVIEW( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nPREVIEW = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bPREVIEW = true;
  28. #endif
  29. }
  30. public:
  31. // CONSTRUCTOR
  32. customweapon_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  33. {
  34. #ifdef _DEBUG
  35. m_bPREVIEW = false;
  36. #endif // _DEBUG
  37. m_nPREVIEW = 0;
  38. }
  39. int GetIndex()
  40. {
  41. // Asserts to make sure that we aren't using any skipped combinations.
  42. // Asserts to make sure that we are setting all of the combination vars.
  43. #ifdef _DEBUG
  44. bool bAllStaticVarsDefined = m_bPREVIEW;
  45. Assert( bAllStaticVarsDefined );
  46. #endif // _DEBUG
  47. return ( 20 * m_nPREVIEW ) + 0;
  48. }
  49. };
  50. #define shaderStaticTest_customweapon_vs20 vsh_forgot_to_set_static_PREVIEW + 0
  51. class customweapon_vs20_Dynamic_Index
  52. {
  53. private:
  54. int m_nSKINNING;
  55. #ifdef _DEBUG
  56. bool m_bSKINNING;
  57. #endif
  58. public:
  59. void SetSKINNING( int i )
  60. {
  61. Assert( i >= 0 && i <= 1 );
  62. m_nSKINNING = i;
  63. #ifdef _DEBUG
  64. m_bSKINNING = true;
  65. #endif
  66. }
  67. void SetSKINNING( bool i )
  68. {
  69. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  70. m_nSKINNING = i ? 1 : 0;
  71. #ifdef _DEBUG
  72. m_bSKINNING = true;
  73. #endif
  74. }
  75. private:
  76. int m_nCOMPRESSED_VERTS;
  77. #ifdef _DEBUG
  78. bool m_bCOMPRESSED_VERTS;
  79. #endif
  80. public:
  81. void SetCOMPRESSED_VERTS( int i )
  82. {
  83. Assert( i >= 0 && i <= 1 );
  84. m_nCOMPRESSED_VERTS = i;
  85. #ifdef _DEBUG
  86. m_bCOMPRESSED_VERTS = true;
  87. #endif
  88. }
  89. void SetCOMPRESSED_VERTS( bool i )
  90. {
  91. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  92. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  93. #ifdef _DEBUG
  94. m_bCOMPRESSED_VERTS = true;
  95. #endif
  96. }
  97. private:
  98. int m_nNUM_LIGHTS;
  99. #ifdef _DEBUG
  100. bool m_bNUM_LIGHTS;
  101. #endif
  102. public:
  103. void SetNUM_LIGHTS( int i )
  104. {
  105. Assert( i >= 0 && i <= 4 );
  106. m_nNUM_LIGHTS = i;
  107. #ifdef _DEBUG
  108. m_bNUM_LIGHTS = true;
  109. #endif
  110. }
  111. void SetNUM_LIGHTS( bool i )
  112. {
  113. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 4 );
  114. m_nNUM_LIGHTS = i ? 1 : 0;
  115. #ifdef _DEBUG
  116. m_bNUM_LIGHTS = true;
  117. #endif
  118. }
  119. public:
  120. // CONSTRUCTOR
  121. customweapon_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  122. {
  123. #ifdef _DEBUG
  124. m_bSKINNING = false;
  125. #endif // _DEBUG
  126. m_nSKINNING = 0;
  127. #ifdef _DEBUG
  128. m_bCOMPRESSED_VERTS = false;
  129. #endif // _DEBUG
  130. m_nCOMPRESSED_VERTS = 0;
  131. #ifdef _DEBUG
  132. m_bNUM_LIGHTS = false;
  133. #endif // _DEBUG
  134. m_nNUM_LIGHTS = 0;
  135. }
  136. int GetIndex()
  137. {
  138. // Asserts to make sure that we aren't using any skipped combinations.
  139. // Asserts to make sure that we are setting all of the combination vars.
  140. #ifdef _DEBUG
  141. bool bAllDynamicVarsDefined = m_bSKINNING && m_bCOMPRESSED_VERTS && m_bNUM_LIGHTS;
  142. Assert( bAllDynamicVarsDefined );
  143. #endif // _DEBUG
  144. return ( 1 * m_nSKINNING ) + ( 2 * m_nCOMPRESSED_VERTS ) + ( 4 * m_nNUM_LIGHTS ) + 0;
  145. }
  146. };
  147. #define shaderDynamicTest_customweapon_vs20 vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_customweapon_vs20[3] =
  149. {
  150. { "SKINNING", 0, 1 },
  151. { "COMPRESSED_VERTS", 0, 1 },
  152. { "NUM_LIGHTS", 0, 4 },
  153. };
  154. static const ShaderComboInformation_t s_StaticComboArray_customweapon_vs20[1] =
  155. {
  156. { "PREVIEW", 0, 1 },
  157. };
  158. static const ShaderComboSemantics_t customweapon_vs20_combos =
  159. {
  160. "customweapon_vs20", s_DynamicComboArray_customweapon_vs20, 3, s_StaticComboArray_customweapon_vs20, 1
  161. };
  162. class ConstructMe_customweapon_vs20
  163. {
  164. public:
  165. ConstructMe_customweapon_vs20()
  166. {
  167. GetShaderDLL()->AddShaderComboInformation( &customweapon_vs20_combos );
  168. }
  169. };
  170. static ConstructMe_customweapon_vs20 s_ConstructMe_customweapon_vs20;