ProjectDefines.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Description : to get some defines available in every CryEngine project
  9. #pragma once
  10. #include "BaseTypes.h"
  11. #include <AzCore/PlatformDef.h>
  12. // Section dictionary
  13. #if defined(AZ_RESTRICTED_PLATFORM)
  14. #define PROJECTDEFINES_H_SECTION_STATS_AGENT 1
  15. #define PROJECTDEFINES_H_SECTION_TRAITS 2
  16. #define PROJECTDEFINES_H_SECTION_VTX_IDX 3
  17. #endif
  18. #if defined(AZ_RESTRICTED_PLATFORM)
  19. #define AZ_RESTRICTED_SECTION PROJECTDEFINES_H_SECTION_STATS_AGENT
  20. #include AZ_RESTRICTED_FILE(ProjectDefines_h)
  21. #elif defined(WIN32) || defined(WIN64)
  22. #if !defined(_RELEASE)
  23. #define ENABLE_STATS_AGENT
  24. #endif
  25. #endif
  26. // Type used for vertex indices
  27. // WARNING: If you change this typedef, you need to update AssetProcessorPlatformConfig.ini to convert cgf and abc files to the proper index format.
  28. #if defined(MOBILE)
  29. typedef uint16 vtx_idx;
  30. #define AZ_RESTRICTED_SECTION_IMPLEMENTED
  31. #elif defined(AZ_RESTRICTED_PLATFORM)
  32. #define AZ_RESTRICTED_SECTION PROJECTDEFINES_H_SECTION_VTX_IDX
  33. #include AZ_RESTRICTED_FILE(ProjectDefines_h)
  34. #endif
  35. #if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
  36. #undef AZ_RESTRICTED_SECTION_IMPLEMENTED
  37. #else
  38. // Uncomment one of the two following typedefs:
  39. typedef uint32 vtx_idx;
  40. //typedef uint16 vtx_idx;
  41. #endif
  42. // When non-zero, const cvar accesses (by name) are logged in release-mode on consoles.
  43. // This can be used to find non-optimal usage scenario's, where the constant should be used directly instead.
  44. // Since read accesses tend to be used in flow-control logic, constants allow for better optimization by the compiler.
  45. #define LOG_CONST_CVAR_ACCESS 0
  46. #if defined(WIN32) || defined(WIN64) || LOG_CONST_CVAR_ACCESS
  47. #define RELEASE_LOGGING
  48. #endif
  49. #if defined(_RELEASE) && !defined(RELEASE_LOGGING)
  50. #define EXCLUDE_NORMAL_LOG
  51. #endif
  52. // Add the "REMOTE_ASSET_PROCESSOR" define except in release
  53. // this makes it so that asset processor functions. Without this, all assets must be present and on local media
  54. // with this, the asset processor can be used to remotely process assets.
  55. #if !defined(_RELEASE)
  56. #define REMOTE_ASSET_PROCESSOR
  57. #endif
  58. #if !defined(_RELEASE)
  59. #define USE_HTTP_WEBSOCKETS 0
  60. #endif
  61. #if defined(AZ_RESTRICTED_PLATFORM)
  62. #define AZ_RESTRICTED_SECTION PROJECTDEFINES_H_SECTION_TRAITS
  63. #include AZ_RESTRICTED_FILE(ProjectDefines_h)
  64. #else
  65. #define PROJECTDEFINES_H_TRAIT_DISABLE_MONOLITHIC_PROFILING_MARKERS 1
  66. #if defined(WIN32) || defined(WIN64) || defined(LINUX) || defined(APPLE)
  67. #define PROJECTDEFINES_H_TRAIT_USE_GPU_PARTICLES 1
  68. #endif
  69. #define PROJECTDEFINES_H_TRAIT_USE_MESH_TESSELLATION 1
  70. #if defined(WIN32)
  71. #define PROJECTDEFINES_H_TRAIT_USE_SVO_GI 1
  72. #endif
  73. #if defined(APPLE) || defined(LINUX)
  74. #define AZ_LEGACY_CRYCOMMON_TRAIT_USE_PTHREADS 1
  75. #define AZ_LEGACY_CRYCOMMON_TRAIT_USE_UNIX_PATHS 1
  76. #endif
  77. #endif
  78. #if !defined(_RELEASE)
  79. #ifndef ENABLE_PROFILING_CODE
  80. #define ENABLE_PROFILING_CODE
  81. #endif
  82. //lightweight profilers, disable for submissions, disables displayinfo inside 3dengine as well
  83. #ifndef ENABLE_LW_PROFILERS
  84. #define ENABLE_LW_PROFILERS
  85. #endif
  86. #endif
  87. // Reflect texture slot information - only used in the editor
  88. #if defined(WIN32) || defined(WIN64) || defined(AZ_PLATFORM_MAC)
  89. #define SHADER_REFLECT_TEXTURE_SLOTS 1
  90. #else
  91. #define SHADER_REFLECT_TEXTURE_SLOTS 0
  92. #endif
  93. #if !defined(MOBILE)
  94. //---------------------------------------------------------------------
  95. // Enable Tessellation Features
  96. // (displacement mapping, subdivision, water tessellation)
  97. //---------------------------------------------------------------------
  98. // Modules : 3DEngine, Renderer
  99. // Depends on: DX11
  100. // Global tessellation feature flag
  101. #define TESSELLATION
  102. #ifdef TESSELLATION
  103. // Specific features flags
  104. #define WATER_TESSELLATION
  105. #define PARTICLES_TESSELLATION
  106. #if PROJECTDEFINES_H_TRAIT_USE_MESH_TESSELLATION
  107. // Mesh tessellation (displacement, smoothing, subd)
  108. #define MESH_TESSELLATION
  109. // Mesh tessellation also in motion blur passes
  110. #define MOTIONBLUR_TESSELLATION
  111. #endif
  112. // Dependencies
  113. #ifdef MESH_TESSELLATION
  114. #define MESH_TESSELLATION_ENGINE
  115. #endif
  116. #ifndef NULL_RENDERER
  117. #ifdef WATER_TESSELLATION
  118. #define WATER_TESSELLATION_RENDERER
  119. #endif
  120. #ifdef PARTICLES_TESSELLATION
  121. #define PARTICLES_TESSELLATION_RENDERER
  122. #endif
  123. #ifdef MESH_TESSELLATION_ENGINE
  124. #define MESH_TESSELLATION_RENDERER
  125. #endif
  126. #if defined(WATER_TESSELLATION_RENDERER) || defined(PARTICLES_TESSELLATION_RENDERER) || defined(MESH_TESSELLATION_RENDERER)
  127. // Common tessellation flag enabling tessellation stages in renderer
  128. #define TESSELLATION_RENDERER
  129. #endif
  130. #endif // !NULL_RENDERER
  131. #endif // TESSELLATION
  132. #endif // !defined(MOBILE)
  133. //------------------------------------------------------
  134. // SVO GI
  135. //------------------------------------------------------
  136. // Modules : Renderer, Engine
  137. // Platform : DX11
  138. #if !defined(RENDERNODES_LEAN_AND_MEAN)
  139. #if PROJECTDEFINES_H_TRAIT_USE_SVO_GI
  140. #define FEATURE_SVO_GI
  141. #endif
  142. #endif
  143. #if defined(ENABLE_PROFILING_CODE)
  144. #define USE_DISK_PROFILER
  145. #endif
  146. // The maximum number of joints in an animation
  147. #define MAX_JOINT_AMOUNT 1024