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.

87 lines
2.1 KiB

  1. #include "shaderlib/cshader.h"
  2. class sky_hdr_compressed_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. public:
  26. sky_hdr_compressed_ps20b_Static_Index( )
  27. {
  28. #ifdef _DEBUG
  29. m_bCONVERT_TO_SRGB = true;
  30. #endif // _DEBUG
  31. m_nCONVERT_TO_SRGB = g_pHardwareConfig->NeedsShaderSRGBConversion();
  32. }
  33. int GetIndex()
  34. {
  35. // Asserts to make sure that we aren't using any skipped combinations.
  36. // Asserts to make sure that we are setting all of the combination vars.
  37. #ifdef _DEBUG
  38. bool bAllStaticVarsDefined = m_bCONVERT_TO_SRGB;
  39. Assert( bAllStaticVarsDefined );
  40. #endif // _DEBUG
  41. return ( 2 * m_nCONVERT_TO_SRGB ) + 0;
  42. }
  43. };
  44. #define shaderStaticTest_sky_hdr_compressed_ps20b 0
  45. class sky_hdr_compressed_ps20b_Dynamic_Index
  46. {
  47. private:
  48. int m_nWRITE_DEPTH_TO_DESTALPHA;
  49. #ifdef _DEBUG
  50. bool m_bWRITE_DEPTH_TO_DESTALPHA;
  51. #endif
  52. public:
  53. void SetWRITE_DEPTH_TO_DESTALPHA( int i )
  54. {
  55. Assert( i >= 0 && i <= 1 );
  56. m_nWRITE_DEPTH_TO_DESTALPHA = i;
  57. #ifdef _DEBUG
  58. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  59. #endif
  60. }
  61. void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
  62. {
  63. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  64. #ifdef _DEBUG
  65. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  66. #endif
  67. }
  68. public:
  69. sky_hdr_compressed_ps20b_Dynamic_Index()
  70. {
  71. #ifdef _DEBUG
  72. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  73. #endif // _DEBUG
  74. m_nWRITE_DEPTH_TO_DESTALPHA = 0;
  75. }
  76. int GetIndex()
  77. {
  78. // Asserts to make sure that we aren't using any skipped combinations.
  79. // Asserts to make sure that we are setting all of the combination vars.
  80. #ifdef _DEBUG
  81. bool bAllDynamicVarsDefined = m_bWRITE_DEPTH_TO_DESTALPHA;
  82. Assert( bAllDynamicVarsDefined );
  83. #endif // _DEBUG
  84. return ( 1 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
  85. }
  86. };
  87. #define shaderDynamicTest_sky_hdr_compressed_ps20b psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0