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.

133 lines
3.5 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: NOTE: This file is for backward compat!
  4. // We'll get rid of it soon. Most of the contents of this file were moved
  5. // into shaderpi/ishadershadow.h, shaderapi/ishaderdynamic.h, or
  6. // shaderapi/shareddefs.h
  7. //
  8. // $NoKeywords: $
  9. //
  10. //===========================================================================//
  11. #ifndef SHADERAPI_SHAREDDEFS_H
  12. #define SHADERAPI_SHAREDDEFS_H
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16. //-----------------------------------------------------------------------------
  17. // Important enumerations
  18. //-----------------------------------------------------------------------------
  19. enum ShaderShadeMode_t
  20. {
  21. SHADER_FLAT = 0,
  22. SHADER_SMOOTH
  23. };
  24. enum ShaderTexCoordComponent_t
  25. {
  26. SHADER_TEXCOORD_S = 0,
  27. SHADER_TEXCOORD_T,
  28. SHADER_TEXCOORD_U
  29. };
  30. enum ShaderTexFilterMode_t
  31. {
  32. SHADER_TEXFILTERMODE_NEAREST,
  33. SHADER_TEXFILTERMODE_LINEAR,
  34. SHADER_TEXFILTERMODE_NEAREST_MIPMAP_NEAREST,
  35. SHADER_TEXFILTERMODE_LINEAR_MIPMAP_NEAREST,
  36. SHADER_TEXFILTERMODE_NEAREST_MIPMAP_LINEAR,
  37. SHADER_TEXFILTERMODE_LINEAR_MIPMAP_LINEAR,
  38. SHADER_TEXFILTERMODE_ANISOTROPIC
  39. };
  40. enum ShaderTexWrapMode_t
  41. {
  42. SHADER_TEXWRAPMODE_CLAMP,
  43. SHADER_TEXWRAPMODE_REPEAT,
  44. SHADER_TEXWRAPMODE_BORDER
  45. // MIRROR? - probably don't need it.
  46. };
  47. //-----------------------------------------------------------------------------
  48. // Sampler identifiers
  49. // Samplers are used to enable and bind textures + by programmable shading algorithms
  50. //-----------------------------------------------------------------------------
  51. enum Sampler_t
  52. {
  53. SHADER_SAMPLER_INVALID = -1,
  54. SHADER_SAMPLER0 = 0,
  55. SHADER_SAMPLER1,
  56. SHADER_SAMPLER2,
  57. SHADER_SAMPLER3,
  58. SHADER_SAMPLER4,
  59. SHADER_SAMPLER5,
  60. SHADER_SAMPLER6,
  61. SHADER_SAMPLER7,
  62. SHADER_SAMPLER8,
  63. SHADER_SAMPLER9,
  64. SHADER_SAMPLER10,
  65. SHADER_SAMPLER11,
  66. SHADER_SAMPLER12,
  67. SHADER_SAMPLER13,
  68. SHADER_SAMPLER14,
  69. SHADER_SAMPLER15,
  70. SHADER_SAMPLER_COUNT,
  71. };
  72. //----------------------------------------------------------------------
  73. // texture binding options
  74. //----------------------------------------------------------------------
  75. enum TextureBindFlags_t
  76. {
  77. // these flags are OR'd into the sampler index for texture binding commands
  78. TEXTURE_BINDFLAGS_SRGBREAD = ( 1 << 31 ),
  79. // Enables shadow filtering or ATI Fetch4 depending on the platform/device caps.
  80. TEXTURE_BINDFLAGS_SHADOWDEPTH = ( 1 << 30 ),
  81. // Disables mipmapping
  82. TEXTURE_BINDFLAGS_NOMIP = ( 1 << 29 ),
  83. TEXTURE_BINDFLAGS_NONE = 0,
  84. };
  85. #define TEXTURE_BINDFLAGS_VALID_MASK ( TEXTURE_BINDFLAGS_SRGBREAD | TEXTURE_BINDFLAGS_SHADOWDEPTH | TEXTURE_BINDFLAGS_NOMIP )
  86. // return the appropriate bindflags based upon a bool which reflects whether srgbread is desired.
  87. static inline TextureBindFlags_t SRGBReadMask( bool bSRGBRead )
  88. {
  89. return ( bSRGBRead ) ? TEXTURE_BINDFLAGS_SRGBREAD : TEXTURE_BINDFLAGS_NONE;
  90. }
  91. //-----------------------------------------------------------------------------
  92. // Vertex texture sampler identifiers
  93. //-----------------------------------------------------------------------------
  94. enum VertexTextureSampler_t
  95. {
  96. SHADER_VERTEXTEXTURE_SAMPLER0 = 0,
  97. SHADER_VERTEXTEXTURE_SAMPLER1,
  98. SHADER_VERTEXTEXTURE_SAMPLER2,
  99. SHADER_VERTEXTEXTURE_SAMPLER3,
  100. };
  101. #if defined( _X360 )
  102. #define REVERSE_DEPTH_ON_X360 //uncomment to use D3DFMT_D24FS8 with an inverted depth viewport for better performance. Keep this in sync with the same named #define in materialsystem/stdshaders/common_fxc.h
  103. #endif
  104. #if defined( REVERSE_DEPTH_ON_X360 )
  105. #define ReverseDepthOnX360() true
  106. #else
  107. #define ReverseDepthOnX360() false
  108. #endif
  109. #endif // SHADERAPI_SHAREDDEFS_H