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.

201 lines
4.5 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 sprite_vs20_Static_Index
  7. {
  8. private:
  9. int m_nVERTEXCOLOR;
  10. #ifdef _DEBUG
  11. bool m_bVERTEXCOLOR;
  12. #endif
  13. public:
  14. void SetVERTEXCOLOR( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nVERTEXCOLOR = i;
  18. #ifdef _DEBUG
  19. m_bVERTEXCOLOR = true;
  20. #endif
  21. }
  22. void SetVERTEXCOLOR( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nVERTEXCOLOR = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bVERTEXCOLOR = true;
  28. #endif
  29. }
  30. private:
  31. int m_nSRGB;
  32. #ifdef _DEBUG
  33. bool m_bSRGB;
  34. #endif
  35. public:
  36. void SetSRGB( int i )
  37. {
  38. Assert( i >= 0 && i <= 1 );
  39. m_nSRGB = i;
  40. #ifdef _DEBUG
  41. m_bSRGB = true;
  42. #endif
  43. }
  44. void SetSRGB( bool i )
  45. {
  46. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  47. m_nSRGB = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bSRGB = true;
  50. #endif
  51. }
  52. private:
  53. int m_nDOPIXELFOG;
  54. #ifdef _DEBUG
  55. bool m_bDOPIXELFOG;
  56. #endif
  57. public:
  58. void SetDOPIXELFOG( int i )
  59. {
  60. Assert( i >= 0 && i <= 1 );
  61. m_nDOPIXELFOG = i;
  62. #ifdef _DEBUG
  63. m_bDOPIXELFOG = true;
  64. #endif
  65. }
  66. void SetDOPIXELFOG( bool i )
  67. {
  68. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  69. m_nDOPIXELFOG = i ? 1 : 0;
  70. #ifdef _DEBUG
  71. m_bDOPIXELFOG = true;
  72. #endif
  73. }
  74. private:
  75. int m_nHARDWAREFOGBLEND;
  76. #ifdef _DEBUG
  77. bool m_bHARDWAREFOGBLEND;
  78. #endif
  79. public:
  80. void SetHARDWAREFOGBLEND( int i )
  81. {
  82. Assert( i >= 0 && i <= 1 );
  83. m_nHARDWAREFOGBLEND = i;
  84. #ifdef _DEBUG
  85. m_bHARDWAREFOGBLEND = true;
  86. #endif
  87. }
  88. void SetHARDWAREFOGBLEND( bool i )
  89. {
  90. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  91. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  92. #ifdef _DEBUG
  93. m_bHARDWAREFOGBLEND = true;
  94. #endif
  95. }
  96. public:
  97. // CONSTRUCTOR
  98. sprite_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  99. {
  100. #ifdef _DEBUG
  101. m_bVERTEXCOLOR = false;
  102. #endif // _DEBUG
  103. m_nVERTEXCOLOR = 0;
  104. #ifdef _DEBUG
  105. m_bSRGB = false;
  106. #endif // _DEBUG
  107. m_nSRGB = 0;
  108. #ifdef _DEBUG
  109. m_bDOPIXELFOG = true;
  110. #endif // _DEBUG
  111. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  112. #ifdef _DEBUG
  113. m_bHARDWAREFOGBLEND = true;
  114. #endif // _DEBUG
  115. m_nHARDWAREFOGBLEND = !g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  116. }
  117. int GetIndex()
  118. {
  119. // Asserts to make sure that we aren't using any skipped combinations.
  120. // Asserts to make sure that we are setting all of the combination vars.
  121. #ifdef _DEBUG
  122. bool bAllStaticVarsDefined = m_bVERTEXCOLOR && m_bSRGB && m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  123. Assert( bAllStaticVarsDefined );
  124. #endif // _DEBUG
  125. return ( 2 * m_nVERTEXCOLOR ) + ( 4 * m_nSRGB ) + ( 8 * m_nDOPIXELFOG ) + ( 16 * m_nHARDWAREFOGBLEND ) + 0;
  126. }
  127. };
  128. #define shaderStaticTest_sprite_vs20 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_SRGB + 0
  129. class sprite_vs20_Dynamic_Index
  130. {
  131. private:
  132. int m_nDOWATERFOG;
  133. #ifdef _DEBUG
  134. bool m_bDOWATERFOG;
  135. #endif
  136. public:
  137. void SetDOWATERFOG( int i )
  138. {
  139. Assert( i >= 0 && i <= 1 );
  140. m_nDOWATERFOG = i;
  141. #ifdef _DEBUG
  142. m_bDOWATERFOG = true;
  143. #endif
  144. }
  145. void SetDOWATERFOG( bool i )
  146. {
  147. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  148. m_nDOWATERFOG = i ? 1 : 0;
  149. #ifdef _DEBUG
  150. m_bDOWATERFOG = true;
  151. #endif
  152. }
  153. public:
  154. // CONSTRUCTOR
  155. sprite_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  156. {
  157. #ifdef _DEBUG
  158. m_bDOWATERFOG = true;
  159. #endif // _DEBUG
  160. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  161. }
  162. int GetIndex()
  163. {
  164. // Asserts to make sure that we aren't using any skipped combinations.
  165. // Asserts to make sure that we are setting all of the combination vars.
  166. #ifdef _DEBUG
  167. bool bAllDynamicVarsDefined = m_bDOWATERFOG;
  168. Assert( bAllDynamicVarsDefined );
  169. #endif // _DEBUG
  170. return ( 1 * m_nDOWATERFOG ) + 0;
  171. }
  172. };
  173. #define shaderDynamicTest_sprite_vs20 0
  174. static const ShaderComboInformation_t s_DynamicComboArray_sprite_vs20[1] =
  175. {
  176. { "DOWATERFOG", 0, 1 },
  177. };
  178. static const ShaderComboInformation_t s_StaticComboArray_sprite_vs20[4] =
  179. {
  180. { "VERTEXCOLOR", 0, 1 },
  181. { "SRGB", 0, 1 },
  182. { "DOPIXELFOG", 0, 1 },
  183. { "HARDWAREFOGBLEND", 0, 1 },
  184. };
  185. static const ShaderComboSemantics_t sprite_vs20_combos =
  186. {
  187. "sprite_vs20", s_DynamicComboArray_sprite_vs20, 1, s_StaticComboArray_sprite_vs20, 4
  188. };
  189. class ConstructMe_sprite_vs20
  190. {
  191. public:
  192. ConstructMe_sprite_vs20()
  193. {
  194. GetShaderDLL()->AddShaderComboInformation( &sprite_vs20_combos );
  195. }
  196. };
  197. static ConstructMe_sprite_vs20 s_ConstructMe_sprite_vs20;