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.

63 lines
3.2 KiB

  1. //========= Copyright (c) 1996-2008, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef PHONG_DX9_HELPER_H
  8. #define PHONG_DX9_HELPER_H
  9. #include <string.h>
  10. #include "vertexlitgeneric_dx9_helper.h"
  11. //-----------------------------------------------------------------------------
  12. // Forward declarations
  13. //-----------------------------------------------------------------------------
  14. class CBaseVSShader;
  15. class IMaterialVar;
  16. class IShaderDynamicAPI;
  17. class IShaderShadow;
  18. void InitParamsPhong_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, VertexLitGeneric_DX9_Vars_t &info );
  19. void InitPhong_DX9( CBaseVSShader *pShader, IMaterialVar** params, VertexLitGeneric_DX9_Vars_t &info );
  20. void DrawPhong_DX9( CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI *pShaderAPI, IShaderShadow* pShaderShadow,
  21. VertexLitGeneric_DX9_Vars_t &info, VertexCompressionType_t vertexCompression, CBasePerMaterialContextData **pContextDataPtr );
  22. void DrawPhong_DX9_ExecuteFastPath( int *vsDynIndex, int *psDynIndex,
  23. CBaseVSShader *pShader, IMaterialVar** params, IShaderDynamicAPI * pShaderAPI,
  24. VertexLitGeneric_DX9_Vars_t &info,
  25. VertexCompressionType_t vertexCompression,
  26. CBasePerMaterialContextData **pContextDataPtr, BOOL bCSMEnabled );
  27. inline void ClampDetailBlendModeAndWarn( int &nDetailBlendMode, int nMin, int nMax )
  28. {
  29. if ( nDetailBlendMode < nMin || nDetailBlendMode > nMax )
  30. {
  31. Warning( "========================================================================\n" );
  32. Warning( "========================================================================\n" );
  33. Warning( "========================================================================\n" );
  34. Warning( "Material uses an out of range $detailblendmode of %d. Should be in [%d,%d].\nGive a programmer a repro case, or look at your modified vmt files\n", nDetailBlendMode, nMin, nMax );
  35. Warning( "========================================================================\n" );
  36. Warning( "========================================================================\n" );
  37. Warning( "========================================================================\n" );
  38. nDetailBlendMode = 0;
  39. }
  40. }
  41. inline void ClampDecalBlendModeAndWarn( int &nDecalBlendMode, int nMin, int nMax )
  42. {
  43. if ( nDecalBlendMode < nMin || nDecalBlendMode > nMax )
  44. {
  45. Warning( "========================================================================\n" );
  46. Warning( "========================================================================\n" );
  47. Warning( "========================================================================\n" );
  48. Warning( "Material uses an out of range $decalblendmode of %d. Should be in [%d,%d].\nGive a programmer a repro case, or look at your modified vmt files\n", nDecalBlendMode, nMin, nMax );
  49. Warning( "========================================================================\n" );
  50. Warning( "========================================================================\n" );
  51. Warning( "========================================================================\n" );
  52. nDecalBlendMode = 0;
  53. }
  54. }
  55. #endif // PHONG_DX9_HELPER_H