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.

262 lines
5.1 KiB

  1. #include "shaderlib/cshader.h"
  2. class watercheap_ps20b_Static_Index
  3. {
  4. private:
  5. int m_nCONVERT_TO_SRGB;
  6. #ifdef _DEBUG
  7. bool m_bCONVERT_TO_SRGB;
  8. #endif
  9. public:
  10. void SetCONVERT_TO_SRGB( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nCONVERT_TO_SRGB = i;
  14. #ifdef _DEBUG
  15. m_bCONVERT_TO_SRGB = true;
  16. #endif
  17. }
  18. void SetCONVERT_TO_SRGB( bool i )
  19. {
  20. m_nCONVERT_TO_SRGB = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bCONVERT_TO_SRGB = true;
  23. #endif
  24. }
  25. private:
  26. int m_nMULTITEXTURE;
  27. #ifdef _DEBUG
  28. bool m_bMULTITEXTURE;
  29. #endif
  30. public:
  31. void SetMULTITEXTURE( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nMULTITEXTURE = i;
  35. #ifdef _DEBUG
  36. m_bMULTITEXTURE = true;
  37. #endif
  38. }
  39. void SetMULTITEXTURE( bool i )
  40. {
  41. m_nMULTITEXTURE = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bMULTITEXTURE = true;
  44. #endif
  45. }
  46. private:
  47. int m_nFRESNEL;
  48. #ifdef _DEBUG
  49. bool m_bFRESNEL;
  50. #endif
  51. public:
  52. void SetFRESNEL( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nFRESNEL = i;
  56. #ifdef _DEBUG
  57. m_bFRESNEL = true;
  58. #endif
  59. }
  60. void SetFRESNEL( bool i )
  61. {
  62. m_nFRESNEL = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bFRESNEL = true;
  65. #endif
  66. }
  67. private:
  68. int m_nBLEND;
  69. #ifdef _DEBUG
  70. bool m_bBLEND;
  71. #endif
  72. public:
  73. void SetBLEND( int i )
  74. {
  75. Assert( i >= 0 && i <= 1 );
  76. m_nBLEND = i;
  77. #ifdef _DEBUG
  78. m_bBLEND = true;
  79. #endif
  80. }
  81. void SetBLEND( bool i )
  82. {
  83. m_nBLEND = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bBLEND = true;
  86. #endif
  87. }
  88. private:
  89. int m_nREFRACTALPHA;
  90. #ifdef _DEBUG
  91. bool m_bREFRACTALPHA;
  92. #endif
  93. public:
  94. void SetREFRACTALPHA( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nREFRACTALPHA = i;
  98. #ifdef _DEBUG
  99. m_bREFRACTALPHA = true;
  100. #endif
  101. }
  102. void SetREFRACTALPHA( bool i )
  103. {
  104. m_nREFRACTALPHA = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bREFRACTALPHA = true;
  107. #endif
  108. }
  109. private:
  110. int m_nHDRTYPE;
  111. #ifdef _DEBUG
  112. bool m_bHDRTYPE;
  113. #endif
  114. public:
  115. void SetHDRTYPE( int i )
  116. {
  117. Assert( i >= 0 && i <= 2 );
  118. m_nHDRTYPE = i;
  119. #ifdef _DEBUG
  120. m_bHDRTYPE = true;
  121. #endif
  122. }
  123. void SetHDRTYPE( bool i )
  124. {
  125. m_nHDRTYPE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bHDRTYPE = true;
  128. #endif
  129. }
  130. private:
  131. int m_nNORMAL_DECODE_MODE;
  132. #ifdef _DEBUG
  133. bool m_bNORMAL_DECODE_MODE;
  134. #endif
  135. public:
  136. void SetNORMAL_DECODE_MODE( int i )
  137. {
  138. Assert( i >= 0 && i <= 0 );
  139. m_nNORMAL_DECODE_MODE = i;
  140. #ifdef _DEBUG
  141. m_bNORMAL_DECODE_MODE = true;
  142. #endif
  143. }
  144. void SetNORMAL_DECODE_MODE( bool i )
  145. {
  146. m_nNORMAL_DECODE_MODE = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bNORMAL_DECODE_MODE = true;
  149. #endif
  150. }
  151. public:
  152. watercheap_ps20b_Static_Index( )
  153. {
  154. #ifdef _DEBUG
  155. m_bCONVERT_TO_SRGB = true;
  156. #endif // _DEBUG
  157. m_nCONVERT_TO_SRGB = g_pHardwareConfig->NeedsShaderSRGBConversion();
  158. #ifdef _DEBUG
  159. m_bMULTITEXTURE = false;
  160. #endif // _DEBUG
  161. m_nMULTITEXTURE = 0;
  162. #ifdef _DEBUG
  163. m_bFRESNEL = false;
  164. #endif // _DEBUG
  165. m_nFRESNEL = 0;
  166. #ifdef _DEBUG
  167. m_bBLEND = false;
  168. #endif // _DEBUG
  169. m_nBLEND = 0;
  170. #ifdef _DEBUG
  171. m_bREFRACTALPHA = false;
  172. #endif // _DEBUG
  173. m_nREFRACTALPHA = 0;
  174. #ifdef _DEBUG
  175. m_bHDRTYPE = false;
  176. #endif // _DEBUG
  177. m_nHDRTYPE = 0;
  178. #ifdef _DEBUG
  179. m_bNORMAL_DECODE_MODE = false;
  180. #endif // _DEBUG
  181. m_nNORMAL_DECODE_MODE = 0;
  182. }
  183. int GetIndex()
  184. {
  185. // Asserts to make sure that we aren't using any skipped combinations.
  186. // Asserts to make sure that we are setting all of the combination vars.
  187. #ifdef _DEBUG
  188. bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB && m_bMULTITEXTURE && m_bFRESNEL && m_bBLEND && m_bREFRACTALPHA && m_bHDRTYPE && m_bNORMAL_DECODE_MODE;
  189. Assert( bAllStaticVarsDefined );
  190. #endif // _DEBUG
  191. return ( 4 * m_nCONVERT_TO_SRGB ) + ( 8 * m_nMULTITEXTURE ) + ( 16 * m_nFRESNEL ) + ( 32 * m_nBLEND ) + ( 64 * m_nREFRACTALPHA ) + ( 128 * m_nHDRTYPE ) + ( 384 * m_nNORMAL_DECODE_MODE ) + 0;
  192. }
  193. };
  194. #define shaderStaticTest_watercheap_ps20b psh_forgot_to_set_static_MULTITEXTURE + psh_forgot_to_set_static_FRESNEL + psh_forgot_to_set_static_BLEND + psh_forgot_to_set_static_REFRACTALPHA + psh_forgot_to_set_static_HDRTYPE + psh_forgot_to_set_static_NORMAL_DECODE_MODE + 0
  195. class watercheap_ps20b_Dynamic_Index
  196. {
  197. private:
  198. int m_nHDRENABLED;
  199. #ifdef _DEBUG
  200. bool m_bHDRENABLED;
  201. #endif
  202. public:
  203. void SetHDRENABLED( int i )
  204. {
  205. Assert( i >= 0 && i <= 1 );
  206. m_nHDRENABLED = i;
  207. #ifdef _DEBUG
  208. m_bHDRENABLED = true;
  209. #endif
  210. }
  211. void SetHDRENABLED( bool i )
  212. {
  213. m_nHDRENABLED = i ? 1 : 0;
  214. #ifdef _DEBUG
  215. m_bHDRENABLED = true;
  216. #endif
  217. }
  218. private:
  219. int m_nPIXELFOGTYPE;
  220. #ifdef _DEBUG
  221. bool m_bPIXELFOGTYPE;
  222. #endif
  223. public:
  224. void SetPIXELFOGTYPE( int i )
  225. {
  226. Assert( i >= 0 && i <= 1 );
  227. m_nPIXELFOGTYPE = i;
  228. #ifdef _DEBUG
  229. m_bPIXELFOGTYPE = true;
  230. #endif
  231. }
  232. void SetPIXELFOGTYPE( bool i )
  233. {
  234. m_nPIXELFOGTYPE = i ? 1 : 0;
  235. #ifdef _DEBUG
  236. m_bPIXELFOGTYPE = true;
  237. #endif
  238. }
  239. public:
  240. watercheap_ps20b_Dynamic_Index()
  241. {
  242. #ifdef _DEBUG
  243. m_bHDRENABLED = false;
  244. #endif // _DEBUG
  245. m_nHDRENABLED = 0;
  246. #ifdef _DEBUG
  247. m_bPIXELFOGTYPE = false;
  248. #endif // _DEBUG
  249. m_nPIXELFOGTYPE = 0;
  250. }
  251. int GetIndex()
  252. {
  253. // Asserts to make sure that we aren't using any skipped combinations.
  254. // Asserts to make sure that we are setting all of the combination vars.
  255. #ifdef _DEBUG
  256. bool bAllDynamicVarsDefined = m_bHDRENABLED && m_bPIXELFOGTYPE;
  257. Assert( bAllDynamicVarsDefined );
  258. #endif // _DEBUG
  259. return ( 1 * m_nHDRENABLED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  260. }
  261. };
  262. #define shaderDynamicTest_watercheap_ps20b psh_forgot_to_set_dynamic_HDRENABLED + psh_forgot_to_set_dynamic_PIXELFOGTYPE + 0