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.

132 lines
4.4 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #ifndef IRENDERHARDWARECONFIG_H
  9. #define IRENDERHARDWARECONFIG_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier1/interface.h"
  14. #include "bitmap/imageformat.h"
  15. // use DEFCONFIGMETHOD to define time-critical methods that we want to make just return constants
  16. // on the 360, so that the checks will happen at compile time. Not all methods are defined this way
  17. // - just the ones that I perceive as being called often in the frame interval.
  18. #ifdef _X360
  19. #define DEFCONFIGMETHOD( ret_type, method, xbox_return_value ) \
  20. FORCEINLINE ret_type method const \
  21. { \
  22. return xbox_return_value; \
  23. }
  24. #else
  25. #define DEFCONFIGMETHOD( ret_type, method, xbox_return_value ) \
  26. virtual ret_type method const = 0;
  27. #endif
  28. //-----------------------------------------------------------------------------
  29. // Render system configuration
  30. //-----------------------------------------------------------------------------
  31. class IRenderHardwareConfig
  32. {
  33. public:
  34. virtual int GetFrameBufferColorDepth() const = 0;
  35. virtual int GetSamplerCount() const = 0;
  36. virtual bool HasSetDeviceGammaRamp() const = 0;
  37. DEFCONFIGMETHOD( bool, SupportsNormalMapCompression(), true );
  38. virtual int MaximumAnisotropicLevel() const = 0; // 0 means no anisotropic filtering
  39. virtual int MaxTextureWidth() const = 0;
  40. virtual int MaxTextureHeight() const = 0;
  41. virtual int TextureMemorySize() const = 0;
  42. virtual bool SupportsMipmappedCubemaps() const = 0;
  43. virtual int NumVertexShaderConstants() const = 0;
  44. virtual int NumPixelShaderConstants() const = 0;
  45. virtual int MaxNumLights() const = 0;
  46. virtual int MaxTextureAspectRatio() const = 0;
  47. virtual int MaxVertexShaderBlendMatrices() const = 0;
  48. virtual int MaxUserClipPlanes() const = 0;
  49. virtual bool UseFastClipping() const = 0;
  50. // This here should be the major item looked at when checking for compat
  51. // from anywhere other than the material system shaders
  52. DEFCONFIGMETHOD( int, GetDXSupportLevel(), 98 );
  53. virtual const char *GetShaderDLLName() const = 0;
  54. virtual bool ReadPixelsFromFrontBuffer() const = 0;
  55. // Are dx dynamic textures preferred?
  56. virtual bool PreferDynamicTextures() const = 0;
  57. virtual bool NeedsAAClamp() const = 0;
  58. virtual bool NeedsATICentroidHack() const = 0;
  59. // This is the max dx support level supported by the card
  60. virtual int GetMaxDXSupportLevel() const = 0;
  61. // Does the card specify fog color in linear space when sRGBWrites are enabled?
  62. virtual bool SpecifiesFogColorInLinearSpace() const = 0;
  63. // Does the card support sRGB reads/writes?
  64. DEFCONFIGMETHOD( bool, SupportsSRGB(), true );
  65. virtual bool IsAAEnabled() const = 0; // Is antialiasing being used?
  66. // NOTE: Anything after this was added after shipping HL2.
  67. virtual int GetVertexTextureCount() const = 0;
  68. virtual int GetMaxVertexTextureDimension() const = 0;
  69. virtual int MaxTextureDepth() const = 0;
  70. virtual bool SupportsStreamOffset() const = 0;
  71. virtual int StencilBufferBits() const = 0;
  72. virtual int MaxViewports() const = 0;
  73. virtual void OverrideStreamOffsetSupport( bool bOverrideEnabled, bool bEnableSupport ) = 0;
  74. virtual ShadowFilterMode_t GetShadowFilterMode( bool bForceLowQualityShadows, bool bPS30 ) const = 0;
  75. virtual int NeedsShaderSRGBConversion() const = 0;
  76. DEFCONFIGMETHOD( bool, UsesSRGBCorrectBlending(), true );
  77. virtual bool HasFastVertexTextures() const = 0;
  78. virtual int MaxHWMorphBatchCount() const = 0;
  79. virtual bool SupportsBorderColor( void ) const = 0;
  80. virtual bool SupportsFetch4( void ) const = 0;
  81. virtual float GetShadowDepthBias() const = 0;
  82. virtual float GetShadowSlopeScaleDepthBias() const = 0;
  83. virtual bool PreferZPrepass() const = 0;
  84. virtual bool SuppressPixelShaderCentroidHackFixup() const = 0;
  85. virtual bool PreferTexturesInHWMemory() const = 0;
  86. virtual bool PreferHardwareSync() const = 0;
  87. virtual bool ActualHasFastVertexTextures() const = 0;
  88. virtual bool SupportsShadowDepthTextures( void ) const = 0;
  89. virtual ImageFormat GetShadowDepthTextureFormat( void ) const = 0;
  90. virtual ImageFormat GetNullTextureFormat( void ) const = 0;
  91. virtual int GetMinDXSupportLevel() const = 0;
  92. virtual bool IsUnsupported() const = 0;
  93. // Necessary on the 360 to improve performance of hierarchical Z
  94. virtual bool ReverseDepth() const = 0;
  95. };
  96. #endif // IRENDERHARDWARECONFIG_H