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.

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