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.

135 lines
3.1 KiB

  1. #include "shaderlib/cshader.h"
  2. class engine_post_ps20_Static_Index
  3. {
  4. public:
  5. engine_post_ps20_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_engine_post_ps20 0
  18. class engine_post_ps20_Dynamic_Index
  19. {
  20. private:
  21. int m_nAA_ENABLE;
  22. #ifdef _DEBUG
  23. bool m_bAA_ENABLE;
  24. #endif
  25. public:
  26. void SetAA_ENABLE( int i )
  27. {
  28. Assert( i >= 0 && i <= 1 );
  29. m_nAA_ENABLE = i;
  30. #ifdef _DEBUG
  31. m_bAA_ENABLE = true;
  32. #endif
  33. }
  34. void SetAA_ENABLE( bool i )
  35. {
  36. m_nAA_ENABLE = i ? 1 : 0;
  37. #ifdef _DEBUG
  38. m_bAA_ENABLE = true;
  39. #endif
  40. }
  41. private:
  42. int m_nAA_QUALITY_MODE;
  43. #ifdef _DEBUG
  44. bool m_bAA_QUALITY_MODE;
  45. #endif
  46. public:
  47. void SetAA_QUALITY_MODE( int i )
  48. {
  49. Assert( i >= 0 && i <= 0 );
  50. m_nAA_QUALITY_MODE = i;
  51. #ifdef _DEBUG
  52. m_bAA_QUALITY_MODE = true;
  53. #endif
  54. }
  55. void SetAA_QUALITY_MODE( bool i )
  56. {
  57. m_nAA_QUALITY_MODE = i ? 1 : 0;
  58. #ifdef _DEBUG
  59. m_bAA_QUALITY_MODE = true;
  60. #endif
  61. }
  62. private:
  63. int m_nAA_REDUCE_ONE_PIXEL_LINE_BLUR;
  64. #ifdef _DEBUG
  65. bool m_bAA_REDUCE_ONE_PIXEL_LINE_BLUR;
  66. #endif
  67. public:
  68. void SetAA_REDUCE_ONE_PIXEL_LINE_BLUR( int i )
  69. {
  70. Assert( i >= 0 && i <= 0 );
  71. m_nAA_REDUCE_ONE_PIXEL_LINE_BLUR = i;
  72. #ifdef _DEBUG
  73. m_bAA_REDUCE_ONE_PIXEL_LINE_BLUR = true;
  74. #endif
  75. }
  76. void SetAA_REDUCE_ONE_PIXEL_LINE_BLUR( bool i )
  77. {
  78. m_nAA_REDUCE_ONE_PIXEL_LINE_BLUR = i ? 1 : 0;
  79. #ifdef _DEBUG
  80. m_bAA_REDUCE_ONE_PIXEL_LINE_BLUR = true;
  81. #endif
  82. }
  83. private:
  84. int m_nCOL_CORRECT_NUM_LOOKUPS;
  85. #ifdef _DEBUG
  86. bool m_bCOL_CORRECT_NUM_LOOKUPS;
  87. #endif
  88. public:
  89. void SetCOL_CORRECT_NUM_LOOKUPS( int i )
  90. {
  91. Assert( i >= 0 && i <= 4 );
  92. m_nCOL_CORRECT_NUM_LOOKUPS = i;
  93. #ifdef _DEBUG
  94. m_bCOL_CORRECT_NUM_LOOKUPS = true;
  95. #endif
  96. }
  97. void SetCOL_CORRECT_NUM_LOOKUPS( bool i )
  98. {
  99. m_nCOL_CORRECT_NUM_LOOKUPS = i ? 1 : 0;
  100. #ifdef _DEBUG
  101. m_bCOL_CORRECT_NUM_LOOKUPS = true;
  102. #endif
  103. }
  104. public:
  105. engine_post_ps20_Dynamic_Index()
  106. {
  107. #ifdef _DEBUG
  108. m_bAA_ENABLE = false;
  109. #endif // _DEBUG
  110. m_nAA_ENABLE = 0;
  111. #ifdef _DEBUG
  112. m_bAA_QUALITY_MODE = false;
  113. #endif // _DEBUG
  114. m_nAA_QUALITY_MODE = 0;
  115. #ifdef _DEBUG
  116. m_bAA_REDUCE_ONE_PIXEL_LINE_BLUR = false;
  117. #endif // _DEBUG
  118. m_nAA_REDUCE_ONE_PIXEL_LINE_BLUR = 0;
  119. #ifdef _DEBUG
  120. m_bCOL_CORRECT_NUM_LOOKUPS = false;
  121. #endif // _DEBUG
  122. m_nCOL_CORRECT_NUM_LOOKUPS = 0;
  123. }
  124. int GetIndex()
  125. {
  126. // Asserts to make sure that we aren't using any skipped combinations.
  127. // Asserts to make sure that we are setting all of the combination vars.
  128. #ifdef _DEBUG
  129. bool bAllDynamicVarsDefined = m_bAA_ENABLE && m_bAA_QUALITY_MODE && m_bAA_REDUCE_ONE_PIXEL_LINE_BLUR && m_bCOL_CORRECT_NUM_LOOKUPS;
  130. Assert( bAllDynamicVarsDefined );
  131. #endif // _DEBUG
  132. return ( 1 * m_nAA_ENABLE ) + ( 2 * m_nAA_QUALITY_MODE ) + ( 2 * m_nAA_REDUCE_ONE_PIXEL_LINE_BLUR ) + ( 2 * m_nCOL_CORRECT_NUM_LOOKUPS ) + 0;
  133. }
  134. };
  135. #define shaderDynamicTest_engine_post_ps20 psh_forgot_to_set_dynamic_AA_ENABLE + psh_forgot_to_set_dynamic_AA_QUALITY_MODE + psh_forgot_to_set_dynamic_AA_REDUCE_ONE_PIXEL_LINE_BLUR + psh_forgot_to_set_dynamic_COL_CORRECT_NUM_LOOKUPS + 0