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.

124 lines
3.5 KiB

  1. //===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef SHADERAPIDX8_GLOBAL_H
  9. #define SHADERAPIDX8_GLOBAL_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier0/dbg.h"
  14. #include "tier0/memalloc.h"
  15. #include "shaderapi_global.h"
  16. #include "tier2/tier2.h"
  17. #include "shaderdevicedx8.h"
  18. //-----------------------------------------------------------------------------
  19. // Use this to fill in structures with the current board state
  20. //-----------------------------------------------------------------------------
  21. #ifdef _DEBUG
  22. #define DEBUG_BOARD_STATE 0
  23. #endif
  24. #if !defined( _GAMECONSOLE )
  25. #include "d3d_async.h"
  26. typedef D3DDeviceWrapper D3DDev_t;
  27. D3DDev_t *Dx9Device();
  28. IDirect3D9 *D3D();
  29. #else
  30. #define SHADERAPI_NO_D3DDeviceWrapper 1
  31. typedef IDirect3DDevice D3DDeviceWrapper;
  32. #endif
  33. //-----------------------------------------------------------------------------
  34. // Measures driver allocations
  35. //-----------------------------------------------------------------------------
  36. //#define MEASURE_DRIVER_ALLOCATIONS 1
  37. //-----------------------------------------------------------------------------
  38. // Forward declarations
  39. //-----------------------------------------------------------------------------
  40. class IShaderUtil;
  41. class IVertexBufferDX8;
  42. class IShaderShadowDX8;
  43. class IMeshMgr;
  44. class IShaderAPIDX8;
  45. class IFileSystem;
  46. class IShaderManager;
  47. //-----------------------------------------------------------------------------
  48. // A new shader draw flag we need to workaround dx8
  49. //-----------------------------------------------------------------------------
  50. enum
  51. {
  52. SHADER_HAS_CONSTANT_COLOR = 0x80000000
  53. };
  54. //-----------------------------------------------------------------------------
  55. // The main shader API
  56. //-----------------------------------------------------------------------------
  57. extern IShaderAPIDX8 *g_pShaderAPIDX8;
  58. #ifdef _PS3
  59. class CPs3NonVirt_IShaderAPIDX8;
  60. inline CPs3NonVirt_IShaderAPIDX8* ShaderAPI()
  61. {
  62. return ( CPs3NonVirt_IShaderAPIDX8 * ) 1;
  63. }
  64. #else
  65. inline IShaderAPIDX8* ShaderAPI()
  66. {
  67. return g_pShaderAPIDX8;
  68. }
  69. #endif
  70. //-----------------------------------------------------------------------------
  71. // The shader shadow
  72. //-----------------------------------------------------------------------------
  73. IShaderShadowDX8* ShaderShadow();
  74. //-----------------------------------------------------------------------------
  75. // Manager of all vertex + pixel shaders
  76. //-----------------------------------------------------------------------------
  77. inline IShaderManager *ShaderManager()
  78. {
  79. extern IShaderManager *g_pShaderManager;
  80. return g_pShaderManager;
  81. }
  82. //-----------------------------------------------------------------------------
  83. // The mesh manager
  84. //-----------------------------------------------------------------------------
  85. IMeshMgr* MeshMgr();
  86. //-----------------------------------------------------------------------------
  87. // The main hardware config interface
  88. //-----------------------------------------------------------------------------
  89. #ifdef _PS3
  90. #include "shaderapidx9/hardwareconfig_ps3nonvirt.h"
  91. #elif defined( _OSX )
  92. // @wge: Moved from materialsystem_global.h, since we include shaderapidx8 headers in material system
  93. inline IHardwareConfigInternal *HardwareConfig()
  94. {
  95. extern IHardwareConfigInternal* g_pHWConfig;
  96. return g_pHWConfig;
  97. }
  98. #else
  99. inline IMaterialSystemHardwareConfig* HardwareConfig()
  100. {
  101. return g_pMaterialSystemHardwareConfig;
  102. }
  103. #endif
  104. #endif // SHADERAPIDX8_GLOBAL_H