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.

81 lines
2.1 KiB

  1. //========= Copyright � 1996-2004, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include "BaseVSShader.h"
  8. #include "common_hlsl_cpp_consts.h"
  9. #include "HDRCombineTo16Bit_ps20.inc"
  10. #include "HDRCombineTo16Bit_ps20b.inc"
  11. #include "HDRCombineTo16Bit_vs20.inc"
  12. #include "convar.h"
  13. // NOTE: This has to be the last file included!
  14. #include "tier0/memdbgon.h"
  15. BEGIN_VS_SHADER_FLAGS( HDRCombineTo16Bit, "Help for HDRCombineTo16Bit", SHADER_NOT_EDITABLE )
  16. BEGIN_SHADER_PARAMS
  17. SHADER_PARAM( SOURCEMRTRENDERTARGET, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  18. END_SHADER_PARAMS
  19. SHADER_INIT
  20. {
  21. LoadTexture( SOURCEMRTRENDERTARGET );
  22. }
  23. SHADER_FALLBACK
  24. {
  25. return 0;
  26. }
  27. SHADER_DRAW
  28. {
  29. SHADOW_STATE
  30. {
  31. pShaderShadow->EnableDepthWrites( false );
  32. pShaderShadow->EnableAlphaWrites( false );
  33. pShaderShadow->EnableDepthTest( false );
  34. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  35. pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
  36. int fmt = VERTEX_POSITION;
  37. pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 );
  38. DECLARE_STATIC_VERTEX_SHADER( hdrcombineto16bit_vs20 );
  39. SET_STATIC_VERTEX_SHADER( hdrcombineto16bit_vs20 );
  40. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  41. {
  42. DECLARE_STATIC_PIXEL_SHADER( hdrcombineto16bit_ps20b );
  43. SET_STATIC_PIXEL_SHADER( hdrcombineto16bit_ps20b );
  44. }
  45. else
  46. {
  47. DECLARE_STATIC_PIXEL_SHADER( hdrcombineto16bit_ps20 );
  48. SET_STATIC_PIXEL_SHADER( hdrcombineto16bit_ps20 );
  49. }
  50. }
  51. DYNAMIC_STATE
  52. {
  53. BindTexture( SHADER_SAMPLER0, TEXTURE_BINDFLAGS_NONE, SOURCEMRTRENDERTARGET, -1 );
  54. DECLARE_DYNAMIC_VERTEX_SHADER( hdrcombineto16bit_vs20 );
  55. SET_DYNAMIC_VERTEX_SHADER( hdrcombineto16bit_vs20 );
  56. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  57. {
  58. DECLARE_DYNAMIC_PIXEL_SHADER( hdrcombineto16bit_ps20b );
  59. SET_DYNAMIC_PIXEL_SHADER( hdrcombineto16bit_ps20b );
  60. }
  61. else
  62. {
  63. DECLARE_DYNAMIC_PIXEL_SHADER( hdrcombineto16bit_ps20 );
  64. SET_DYNAMIC_PIXEL_SHADER( hdrcombineto16bit_ps20 );
  65. }
  66. }
  67. Draw();
  68. }
  69. END_SHADER