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.

150 lines
3.7 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // $ISCUBEMAP && $ISVOLUME
  3. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  6. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  7. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  8. #include "shaderlib/cshader.h"
  9. class debugtextureview_ps20b_Static_Index
  10. {
  11. private:
  12. int m_nSHOWALPHA;
  13. #ifdef _DEBUG
  14. bool m_bSHOWALPHA;
  15. #endif
  16. public:
  17. void SetSHOWALPHA( int i )
  18. {
  19. Assert( i >= 0 && i <= 1 );
  20. m_nSHOWALPHA = i;
  21. #ifdef _DEBUG
  22. m_bSHOWALPHA = true;
  23. #endif
  24. }
  25. void SetSHOWALPHA( bool i )
  26. {
  27. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  28. m_nSHOWALPHA = i ? 1 : 0;
  29. #ifdef _DEBUG
  30. m_bSHOWALPHA = true;
  31. #endif
  32. }
  33. public:
  34. // CONSTRUCTOR
  35. debugtextureview_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  36. {
  37. #ifdef _DEBUG
  38. m_bSHOWALPHA = false;
  39. #endif // _DEBUG
  40. m_nSHOWALPHA = 0;
  41. }
  42. int GetIndex()
  43. {
  44. // Asserts to make sure that we aren't using any skipped combinations.
  45. // Asserts to make sure that we are setting all of the combination vars.
  46. #ifdef _DEBUG
  47. bool bAllStaticVarsDefined = m_bSHOWALPHA;
  48. Assert( bAllStaticVarsDefined );
  49. #endif // _DEBUG
  50. return ( 4 * m_nSHOWALPHA ) + 0;
  51. }
  52. };
  53. #define shaderStaticTest_debugtextureview_ps20b psh_forgot_to_set_static_SHOWALPHA + 0
  54. class debugtextureview_ps20b_Dynamic_Index
  55. {
  56. private:
  57. int m_nISCUBEMAP;
  58. #ifdef _DEBUG
  59. bool m_bISCUBEMAP;
  60. #endif
  61. public:
  62. void SetISCUBEMAP( int i )
  63. {
  64. Assert( i >= 0 && i <= 1 );
  65. m_nISCUBEMAP = i;
  66. #ifdef _DEBUG
  67. m_bISCUBEMAP = true;
  68. #endif
  69. }
  70. void SetISCUBEMAP( bool i )
  71. {
  72. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  73. m_nISCUBEMAP = i ? 1 : 0;
  74. #ifdef _DEBUG
  75. m_bISCUBEMAP = true;
  76. #endif
  77. }
  78. private:
  79. int m_nISVOLUME;
  80. #ifdef _DEBUG
  81. bool m_bISVOLUME;
  82. #endif
  83. public:
  84. void SetISVOLUME( int i )
  85. {
  86. Assert( i >= 0 && i <= 1 );
  87. m_nISVOLUME = i;
  88. #ifdef _DEBUG
  89. m_bISVOLUME = true;
  90. #endif
  91. }
  92. void SetISVOLUME( bool i )
  93. {
  94. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  95. m_nISVOLUME = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bISVOLUME = true;
  98. #endif
  99. }
  100. public:
  101. // CONSTRUCTOR
  102. debugtextureview_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  103. {
  104. #ifdef _DEBUG
  105. m_bISCUBEMAP = false;
  106. #endif // _DEBUG
  107. m_nISCUBEMAP = 0;
  108. #ifdef _DEBUG
  109. m_bISVOLUME = false;
  110. #endif // _DEBUG
  111. m_nISVOLUME = 0;
  112. }
  113. int GetIndex()
  114. {
  115. // Asserts to make sure that we aren't using any skipped combinations.
  116. // Asserts to make sure that we are setting all of the combination vars.
  117. #ifdef _DEBUG
  118. bool bAllDynamicVarsDefined = m_bISCUBEMAP && m_bISVOLUME;
  119. Assert( bAllDynamicVarsDefined );
  120. #endif // _DEBUG
  121. return ( 1 * m_nISCUBEMAP ) + ( 2 * m_nISVOLUME ) + 0;
  122. }
  123. };
  124. #define shaderDynamicTest_debugtextureview_ps20b psh_forgot_to_set_dynamic_ISCUBEMAP + psh_forgot_to_set_dynamic_ISVOLUME + 0
  125. static const ShaderComboInformation_t s_DynamicComboArray_DebugTextureView_ps20b[2] =
  126. {
  127. { "ISCUBEMAP", 0, 1 },
  128. { "ISVOLUME", 0, 1 },
  129. };
  130. static const ShaderComboInformation_t s_StaticComboArray_DebugTextureView_ps20b[1] =
  131. {
  132. { "SHOWALPHA", 0, 1 },
  133. };
  134. static const ShaderComboSemantics_t DebugTextureView_ps20b_combos =
  135. {
  136. "DebugTextureView_ps20b", s_DynamicComboArray_DebugTextureView_ps20b, 2, s_StaticComboArray_DebugTextureView_ps20b, 1
  137. };
  138. class ConstructMe_DebugTextureView_ps20b
  139. {
  140. public:
  141. ConstructMe_DebugTextureView_ps20b()
  142. {
  143. GetShaderDLL()->AddShaderComboInformation( &DebugTextureView_ps20b_combos );
  144. }
  145. };
  146. static ConstructMe_DebugTextureView_ps20b s_ConstructMe_DebugTextureView_ps20b;