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
4.0 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 writez_vs20_Static_Index
  7. {
  8. private:
  9. int m_nDOPIXELFOG;
  10. #ifdef _DEBUG
  11. bool m_bDOPIXELFOG;
  12. #endif
  13. public:
  14. void SetDOPIXELFOG( int i )
  15. {
  16. Assert( i >= 0 && i <= 1 );
  17. m_nDOPIXELFOG = i;
  18. #ifdef _DEBUG
  19. m_bDOPIXELFOG = true;
  20. #endif
  21. }
  22. void SetDOPIXELFOG( bool i )
  23. {
  24. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  25. m_nDOPIXELFOG = i ? 1 : 0;
  26. #ifdef _DEBUG
  27. m_bDOPIXELFOG = true;
  28. #endif
  29. }
  30. public:
  31. // CONSTRUCTOR
  32. writez_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  33. {
  34. #ifdef _DEBUG
  35. m_bDOPIXELFOG = true;
  36. #endif // _DEBUG
  37. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  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_bDOPIXELFOG;
  45. Assert( bAllStaticVarsDefined );
  46. #endif // _DEBUG
  47. return ( 8 * m_nDOPIXELFOG ) + 0;
  48. }
  49. };
  50. #define shaderStaticTest_writez_vs20 0
  51. class writez_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_nDOWATERFOG;
  99. #ifdef _DEBUG
  100. bool m_bDOWATERFOG;
  101. #endif
  102. public:
  103. void SetDOWATERFOG( int i )
  104. {
  105. Assert( i >= 0 && i <= 1 );
  106. m_nDOWATERFOG = i;
  107. #ifdef _DEBUG
  108. m_bDOWATERFOG = true;
  109. #endif
  110. }
  111. void SetDOWATERFOG( bool i )
  112. {
  113. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  114. m_nDOWATERFOG = i ? 1 : 0;
  115. #ifdef _DEBUG
  116. m_bDOWATERFOG = true;
  117. #endif
  118. }
  119. public:
  120. // CONSTRUCTOR
  121. writez_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_bDOWATERFOG = true;
  133. #endif // _DEBUG
  134. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  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_bDOWATERFOG;
  142. Assert( bAllDynamicVarsDefined );
  143. #endif // _DEBUG
  144. return ( 1 * m_nSKINNING ) + ( 2 * m_nCOMPRESSED_VERTS ) + ( 4 * m_nDOWATERFOG ) + 0;
  145. }
  146. };
  147. #define shaderDynamicTest_writez_vs20 vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_writez_vs20[3] =
  149. {
  150. { "SKINNING", 0, 1 },
  151. { "COMPRESSED_VERTS", 0, 1 },
  152. { "DOWATERFOG", 0, 1 },
  153. };
  154. static const ShaderComboInformation_t s_StaticComboArray_writez_vs20[1] =
  155. {
  156. { "DOPIXELFOG", 0, 1 },
  157. };
  158. static const ShaderComboSemantics_t writez_vs20_combos =
  159. {
  160. "writez_vs20", s_DynamicComboArray_writez_vs20, 3, s_StaticComboArray_writez_vs20, 1
  161. };
  162. class ConstructMe_writez_vs20
  163. {
  164. public:
  165. ConstructMe_writez_vs20()
  166. {
  167. GetShaderDLL()->AddShaderComboInformation( &writez_vs20_combos );
  168. }
  169. };
  170. static ConstructMe_writez_vs20 s_ConstructMe_writez_vs20;