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.

172 lines
3.9 KiB

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