Team Fortress 2 Source Code as on 22/4/2020
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.

160 lines
3.2 KiB

  1. #include "shaderlib/cshader.h"
  2. class example_model_vs20_Static_Index
  3. {
  4. public:
  5. example_model_vs20_Static_Index( )
  6. {
  7. }
  8. int GetIndex()
  9. {
  10. // Asserts to make sure that we aren't using any skipped combinations.
  11. // Asserts to make sure that we are setting all of the combination vars.
  12. #ifdef _DEBUG
  13. #endif // _DEBUG
  14. return 0;
  15. }
  16. };
  17. #define shaderStaticTest_example_model_vs20 0
  18. class example_model_vs20_Dynamic_Index
  19. {
  20. private:
  21. int m_nCOMPRESSED_VERTS;
  22. #ifdef _DEBUG
  23. bool m_bCOMPRESSED_VERTS;
  24. #endif
  25. public:
  26. void SetCOMPRESSED_VERTS( int i )
  27. {
  28. Assert( i >= 0 && i <= 1 );
  29. m_nCOMPRESSED_VERTS = i;
  30. #ifdef _DEBUG
  31. m_bCOMPRESSED_VERTS = true;
  32. #endif
  33. }
  34. void SetCOMPRESSED_VERTS( bool i )
  35. {
  36. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  37. #ifdef _DEBUG
  38. m_bCOMPRESSED_VERTS = true;
  39. #endif
  40. }
  41. private:
  42. int m_nDOWATERFOG;
  43. #ifdef _DEBUG
  44. bool m_bDOWATERFOG;
  45. #endif
  46. public:
  47. void SetDOWATERFOG( int i )
  48. {
  49. Assert( i >= 0 && i <= 1 );
  50. m_nDOWATERFOG = i;
  51. #ifdef _DEBUG
  52. m_bDOWATERFOG = true;
  53. #endif
  54. }
  55. void SetDOWATERFOG( bool i )
  56. {
  57. m_nDOWATERFOG = i ? 1 : 0;
  58. #ifdef _DEBUG
  59. m_bDOWATERFOG = true;
  60. #endif
  61. }
  62. private:
  63. int m_nSKINNING;
  64. #ifdef _DEBUG
  65. bool m_bSKINNING;
  66. #endif
  67. public:
  68. void SetSKINNING( int i )
  69. {
  70. Assert( i >= 0 && i <= 1 );
  71. m_nSKINNING = i;
  72. #ifdef _DEBUG
  73. m_bSKINNING = true;
  74. #endif
  75. }
  76. void SetSKINNING( bool i )
  77. {
  78. m_nSKINNING = i ? 1 : 0;
  79. #ifdef _DEBUG
  80. m_bSKINNING = true;
  81. #endif
  82. }
  83. private:
  84. int m_nLIGHTING_PREVIEW;
  85. #ifdef _DEBUG
  86. bool m_bLIGHTING_PREVIEW;
  87. #endif
  88. public:
  89. void SetLIGHTING_PREVIEW( int i )
  90. {
  91. Assert( i >= 0 && i <= 1 );
  92. m_nLIGHTING_PREVIEW = i;
  93. #ifdef _DEBUG
  94. m_bLIGHTING_PREVIEW = true;
  95. #endif
  96. }
  97. void SetLIGHTING_PREVIEW( bool i )
  98. {
  99. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  100. #ifdef _DEBUG
  101. m_bLIGHTING_PREVIEW = true;
  102. #endif
  103. }
  104. private:
  105. int m_nNUM_LIGHTS;
  106. #ifdef _DEBUG
  107. bool m_bNUM_LIGHTS;
  108. #endif
  109. public:
  110. void SetNUM_LIGHTS( int i )
  111. {
  112. Assert( i >= 0 && i <= 4 );
  113. m_nNUM_LIGHTS = i;
  114. #ifdef _DEBUG
  115. m_bNUM_LIGHTS = true;
  116. #endif
  117. }
  118. void SetNUM_LIGHTS( bool i )
  119. {
  120. m_nNUM_LIGHTS = i ? 1 : 0;
  121. #ifdef _DEBUG
  122. m_bNUM_LIGHTS = true;
  123. #endif
  124. }
  125. public:
  126. example_model_vs20_Dynamic_Index()
  127. {
  128. #ifdef _DEBUG
  129. m_bCOMPRESSED_VERTS = false;
  130. #endif // _DEBUG
  131. m_nCOMPRESSED_VERTS = 0;
  132. #ifdef _DEBUG
  133. m_bDOWATERFOG = false;
  134. #endif // _DEBUG
  135. m_nDOWATERFOG = 0;
  136. #ifdef _DEBUG
  137. m_bSKINNING = false;
  138. #endif // _DEBUG
  139. m_nSKINNING = 0;
  140. #ifdef _DEBUG
  141. m_bLIGHTING_PREVIEW = false;
  142. #endif // _DEBUG
  143. m_nLIGHTING_PREVIEW = 0;
  144. #ifdef _DEBUG
  145. m_bNUM_LIGHTS = false;
  146. #endif // _DEBUG
  147. m_nNUM_LIGHTS = 0;
  148. }
  149. int GetIndex()
  150. {
  151. // Asserts to make sure that we aren't using any skipped combinations.
  152. // Asserts to make sure that we are setting all of the combination vars.
  153. #ifdef _DEBUG
  154. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS;
  155. Assert( bAllDynamicVarsDefined );
  156. #endif // _DEBUG
  157. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nLIGHTING_PREVIEW ) + ( 16 * m_nNUM_LIGHTS ) + 0;
  158. }
  159. };
  160. #define shaderDynamicTest_example_model_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_NUM_LIGHTS + 0