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.

122 lines
3.3 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $MODE == 1 )
  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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  11. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  12. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  13. #include "shaderlib/cshader.h"
  14. class embroider_ps30_Static_Index
  15. {
  16. private:
  17. int m_nMODE;
  18. #ifdef _DEBUG
  19. bool m_bMODE;
  20. #endif
  21. public:
  22. void SetMODE( int i )
  23. {
  24. Assert( i >= 0 && i <= 3 );
  25. m_nMODE = i;
  26. #ifdef _DEBUG
  27. m_bMODE = true;
  28. #endif
  29. }
  30. void SetMODE( bool i )
  31. {
  32. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 3 );
  33. m_nMODE = i ? 1 : 0;
  34. #ifdef _DEBUG
  35. m_bMODE = true;
  36. #endif
  37. }
  38. private:
  39. int m_nPALETTIZE;
  40. #ifdef _DEBUG
  41. bool m_bPALETTIZE;
  42. #endif
  43. public:
  44. void SetPALETTIZE( int i )
  45. {
  46. Assert( i >= 0 && i <= 1 );
  47. m_nPALETTIZE = i;
  48. #ifdef _DEBUG
  49. m_bPALETTIZE = true;
  50. #endif
  51. }
  52. void SetPALETTIZE( bool i )
  53. {
  54. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  55. m_nPALETTIZE = i ? 1 : 0;
  56. #ifdef _DEBUG
  57. m_bPALETTIZE = true;
  58. #endif
  59. }
  60. public:
  61. // CONSTRUCTOR
  62. embroider_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  63. {
  64. #ifdef _DEBUG
  65. m_bMODE = false;
  66. #endif // _DEBUG
  67. m_nMODE = 0;
  68. #ifdef _DEBUG
  69. m_bPALETTIZE = false;
  70. #endif // _DEBUG
  71. m_nPALETTIZE = 0;
  72. }
  73. int GetIndex()
  74. {
  75. // Asserts to make sure that we aren't using any skipped combinations.
  76. // Asserts to make sure that we are setting all of the combination vars.
  77. #ifdef _DEBUG
  78. bool bAllStaticVarsDefined = m_bMODE && m_bPALETTIZE;
  79. Assert( bAllStaticVarsDefined );
  80. #endif // _DEBUG
  81. return ( 1 * m_nMODE ) + ( 4 * m_nPALETTIZE ) + 0;
  82. }
  83. };
  84. #define shaderStaticTest_embroider_ps30 psh_forgot_to_set_static_MODE + psh_forgot_to_set_static_PALETTIZE + 0
  85. class embroider_ps30_Dynamic_Index
  86. {
  87. public:
  88. // CONSTRUCTOR
  89. embroider_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  90. {
  91. }
  92. int GetIndex()
  93. {
  94. // Asserts to make sure that we aren't using any skipped combinations.
  95. // Asserts to make sure that we are setting all of the combination vars.
  96. #ifdef _DEBUG
  97. #endif // _DEBUG
  98. return 0;
  99. }
  100. };
  101. #define shaderDynamicTest_embroider_ps30 0
  102. static const ShaderComboInformation_t s_StaticComboArray_embroider_ps30[2] =
  103. {
  104. { "MODE", 0, 3 },
  105. { "PALETTIZE", 0, 1 },
  106. };
  107. static const ShaderComboSemantics_t embroider_ps30_combos =
  108. {
  109. "embroider_ps30", NULL, 0, s_StaticComboArray_embroider_ps30, 2
  110. };
  111. class ConstructMe_embroider_ps30
  112. {
  113. public:
  114. ConstructMe_embroider_ps30()
  115. {
  116. GetShaderDLL()->AddShaderComboInformation( &embroider_ps30_combos );
  117. }
  118. };
  119. static ConstructMe_embroider_ps30 s_ConstructMe_embroider_ps30;