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.

193 lines
4.1 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // ( $DOWATERFOG == 0 ) && ( $HARDWAREFOGBLEND == 0 ) && ( $DOPIXELFOG == 0 )
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  5. #include "shaderlib/cshader.h"
  6. class ui_vs20_Static_Index
  7. {
  8. private:
  9. int m_nMODEL;
  10. #ifdef _DEBUG
  11. bool m_bMODEL;
  12. #endif
  13. public:
  14. void SetMODEL( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nMODEL = i;
  18. #ifdef _DEBUG
  19. m_bMODEL = true;
  20. #endif
  21. }
  22. void SetMODEL( bool i )
  23. {
  24. m_nMODEL = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bMODEL = true;
  27. #endif
  28. }
  29. private:
  30. int m_nDOPIXELFOG;
  31. #ifdef _DEBUG
  32. bool m_bDOPIXELFOG;
  33. #endif
  34. public:
  35. void SetDOPIXELFOG( int i )
  36. {
  37. Assert( i >= 0 && i <= 1 );
  38. m_nDOPIXELFOG = i;
  39. #ifdef _DEBUG
  40. m_bDOPIXELFOG = true;
  41. #endif
  42. }
  43. void SetDOPIXELFOG( bool i )
  44. {
  45. m_nDOPIXELFOG = i ? 1 : 0;
  46. #ifdef _DEBUG
  47. m_bDOPIXELFOG = true;
  48. #endif
  49. }
  50. private:
  51. int m_nHARDWAREFOGBLEND;
  52. #ifdef _DEBUG
  53. bool m_bHARDWAREFOGBLEND;
  54. #endif
  55. public:
  56. void SetHARDWAREFOGBLEND( int i )
  57. {
  58. Assert( i >= 0 && i <= 1 );
  59. m_nHARDWAREFOGBLEND = i;
  60. #ifdef _DEBUG
  61. m_bHARDWAREFOGBLEND = true;
  62. #endif
  63. }
  64. void SetHARDWAREFOGBLEND( bool i )
  65. {
  66. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  67. #ifdef _DEBUG
  68. m_bHARDWAREFOGBLEND = true;
  69. #endif
  70. }
  71. public:
  72. // CONSTRUCTOR
  73. ui_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  74. {
  75. #ifdef _DEBUG
  76. m_bMODEL = false;
  77. #endif // _DEBUG
  78. m_nMODEL = 0;
  79. #ifdef _DEBUG
  80. m_bDOPIXELFOG = true;
  81. #endif // _DEBUG
  82. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  83. #ifdef _DEBUG
  84. m_bHARDWAREFOGBLEND = true;
  85. #endif // _DEBUG
  86. m_nHARDWAREFOGBLEND = !g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  87. }
  88. int GetIndex()
  89. {
  90. // Asserts to make sure that we aren't using any skipped combinations.
  91. // Asserts to make sure that we are setting all of the combination vars.
  92. #ifdef _DEBUG
  93. bool bAllStaticVarsDefined = m_bMODEL && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  94. Assert( bAllStaticVarsDefined );
  95. #endif // _DEBUG
  96. return ( 8 * m_nMODEL ) + ( 16 * m_nDOPIXELFOG ) + ( 32 * m_nHARDWAREFOGBLEND ) + 0;
  97. }
  98. };
  99. #define shaderStaticTest_ui_vs20 vsh_forgot_to_set_static_MODEL + 0
  100. class ui_vs20_Dynamic_Index
  101. {
  102. private:
  103. int m_nCOMPRESSED_VERTS;
  104. #ifdef _DEBUG
  105. bool m_bCOMPRESSED_VERTS;
  106. #endif
  107. public:
  108. void SetCOMPRESSED_VERTS( int i )
  109. {
  110. Assert( i >= 0 && i <= 1 );
  111. m_nCOMPRESSED_VERTS = i;
  112. #ifdef _DEBUG
  113. m_bCOMPRESSED_VERTS = true;
  114. #endif
  115. }
  116. void SetCOMPRESSED_VERTS( bool i )
  117. {
  118. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  119. #ifdef _DEBUG
  120. m_bCOMPRESSED_VERTS = true;
  121. #endif
  122. }
  123. private:
  124. int m_nSKINNING;
  125. #ifdef _DEBUG
  126. bool m_bSKINNING;
  127. #endif
  128. public:
  129. void SetSKINNING( int i )
  130. {
  131. Assert( i >= 0 && i <= 1 );
  132. m_nSKINNING = i;
  133. #ifdef _DEBUG
  134. m_bSKINNING = true;
  135. #endif
  136. }
  137. void SetSKINNING( bool i )
  138. {
  139. m_nSKINNING = i ? 1 : 0;
  140. #ifdef _DEBUG
  141. m_bSKINNING = true;
  142. #endif
  143. }
  144. private:
  145. int m_nDOWATERFOG;
  146. #ifdef _DEBUG
  147. bool m_bDOWATERFOG;
  148. #endif
  149. public:
  150. void SetDOWATERFOG( int i )
  151. {
  152. Assert( i >= 0 && i <= 1 );
  153. m_nDOWATERFOG = i;
  154. #ifdef _DEBUG
  155. m_bDOWATERFOG = true;
  156. #endif
  157. }
  158. void SetDOWATERFOG( bool i )
  159. {
  160. m_nDOWATERFOG = i ? 1 : 0;
  161. #ifdef _DEBUG
  162. m_bDOWATERFOG = true;
  163. #endif
  164. }
  165. public:
  166. // CONSTRUCTOR
  167. ui_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  168. {
  169. #ifdef _DEBUG
  170. m_bCOMPRESSED_VERTS = false;
  171. #endif // _DEBUG
  172. m_nCOMPRESSED_VERTS = 0;
  173. #ifdef _DEBUG
  174. m_bSKINNING = false;
  175. #endif // _DEBUG
  176. m_nSKINNING = 0;
  177. #ifdef _DEBUG
  178. m_bDOWATERFOG = true;
  179. #endif // _DEBUG
  180. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  181. }
  182. int GetIndex()
  183. {
  184. // Asserts to make sure that we aren't using any skipped combinations.
  185. // Asserts to make sure that we are setting all of the combination vars.
  186. #ifdef _DEBUG
  187. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bSKINNING && m_bDOWATERFOG;
  188. Assert( bAllDynamicVarsDefined );
  189. #endif // _DEBUG
  190. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nDOWATERFOG ) + 0;
  191. }
  192. };
  193. #define shaderDynamicTest_ui_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + 0