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.

86 lines
2.1 KiB

  1. //===== Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #include "BaseVSShader.h"
  9. #include "debugmrttexture_ps20.inc"
  10. #include "debugmrttexture_ps20b.inc"
  11. #include "debugmrttexture_vs20.inc"
  12. // NOTE: This has to be the last file included!
  13. #include "tier0/memdbgon.h"
  14. BEGIN_VS_SHADER_FLAGS( DebugMRTTexture, "Help for DebugMRTTexture", SHADER_NOT_EDITABLE )
  15. BEGIN_SHADER_PARAMS
  16. SHADER_PARAM( MRTINDEX, SHADER_PARAM_TYPE_INTEGER, "", "" )
  17. END_SHADER_PARAMS
  18. SHADER_FALLBACK
  19. {
  20. return 0;
  21. }
  22. SHADER_INIT_PARAMS()
  23. {
  24. }
  25. SHADER_INIT
  26. {
  27. LoadTexture( BASETEXTURE );
  28. }
  29. SHADER_DRAW
  30. {
  31. SHADOW_STATE
  32. {
  33. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  34. pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
  35. DECLARE_STATIC_VERTEX_SHADER( debugmrttexture_vs20 );
  36. SET_STATIC_VERTEX_SHADER( debugmrttexture_vs20 );
  37. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  38. {
  39. DECLARE_STATIC_PIXEL_SHADER( debugmrttexture_ps20b );
  40. SET_STATIC_PIXEL_SHADER_COMBO( MRTINDEX, params[MRTINDEX]->GetIntValue() );
  41. SET_STATIC_PIXEL_SHADER( debugmrttexture_ps20b );
  42. }
  43. else
  44. {
  45. DECLARE_STATIC_PIXEL_SHADER( debugmrttexture_ps20 );
  46. SET_STATIC_PIXEL_SHADER_COMBO( MRTINDEX, params[MRTINDEX]->GetIntValue() );
  47. SET_STATIC_PIXEL_SHADER( debugmrttexture_ps20 );
  48. }
  49. int numTexCoords = 2;
  50. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, numTexCoords, 0, 0 );
  51. }
  52. DYNAMIC_STATE
  53. {
  54. BindTexture( SHADER_SAMPLER0, TEXTURE_BINDFLAGS_NONE, BASETEXTURE, FRAME );
  55. DECLARE_DYNAMIC_VERTEX_SHADER( debugmrttexture_vs20 );
  56. SET_DYNAMIC_VERTEX_SHADER( debugmrttexture_vs20 );
  57. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  58. {
  59. DECLARE_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20b );
  60. SET_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20b );
  61. }
  62. else
  63. {
  64. DECLARE_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20 );
  65. SET_DYNAMIC_PIXEL_SHADER( debugmrttexture_ps20 );
  66. }
  67. }
  68. Draw();
  69. }
  70. END_SHADER