config.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /*
  2. * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  4. */
  5. #ifndef BGFX_CONFIG_H_HEADER_GUARD
  6. #define BGFX_CONFIG_H_HEADER_GUARD
  7. #include <bx/bx.h> // bx::isPowerOf2
  8. // # Configuration options for bgfx.
  9. //
  10. // Any of `BGFX_CONFIG_*` options that's inside `#ifndef` block can be configured externally
  11. // via compiler options.
  12. //
  13. // When selecting rendering backends select all backends you want to include in the build.
  14. #ifndef BX_CONFIG_DEBUG
  15. # error "BX_CONFIG_DEBUG must be defined in build script!"
  16. #endif // BX_CONFIG_DEBUG
  17. #if !defined(BGFX_CONFIG_RENDERER_AGC) \
  18. && !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \
  19. && !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \
  20. && !defined(BGFX_CONFIG_RENDERER_GNM) \
  21. && !defined(BGFX_CONFIG_RENDERER_METAL) \
  22. && !defined(BGFX_CONFIG_RENDERER_NVN) \
  23. && !defined(BGFX_CONFIG_RENDERER_OPENGL) \
  24. && !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
  25. && !defined(BGFX_CONFIG_RENDERER_VULKAN)
  26. # ifndef BGFX_CONFIG_RENDERER_AGC
  27. # define BGFX_CONFIG_RENDERER_AGC (0 \
  28. || BX_PLATFORM_PS5 \
  29. ? 1 : 0)
  30. # endif // BGFX_CONFIG_RENDERER_AGC
  31. # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
  32. # define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
  33. || BX_PLATFORM_LINUX \
  34. || BX_PLATFORM_WINDOWS \
  35. || BX_PLATFORM_WINRT \
  36. || BX_PLATFORM_XBOXONE \
  37. ? 1 : 0)
  38. # endif // BGFX_CONFIG_RENDERER_DIRECT3D11
  39. # ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
  40. # define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \
  41. || BX_PLATFORM_LINUX \
  42. || BX_PLATFORM_WINDOWS \
  43. || BX_PLATFORM_WINRT \
  44. || BX_PLATFORM_XBOXONE \
  45. ? 1 : 0)
  46. # endif // BGFX_CONFIG_RENDERER_DIRECT3D12
  47. # ifndef BGFX_CONFIG_RENDERER_GNM
  48. # define BGFX_CONFIG_RENDERER_GNM (0 \
  49. || BX_PLATFORM_PS4 \
  50. ? 1 : 0)
  51. # endif // BGFX_CONFIG_RENDERER_GNM
  52. # ifndef BGFX_CONFIG_RENDERER_METAL
  53. # define BGFX_CONFIG_RENDERER_METAL (0 \
  54. || BX_PLATFORM_IOS \
  55. || BX_PLATFORM_OSX \
  56. || BX_PLATFORM_VISIONOS \
  57. ? 1 : 0)
  58. # endif // BGFX_CONFIG_RENDERER_METAL
  59. # ifndef BGFX_CONFIG_RENDERER_NVN
  60. # define BGFX_CONFIG_RENDERER_NVN (0 \
  61. || BX_PLATFORM_NX \
  62. ? 1 : 0)
  63. # endif // BGFX_CONFIG_RENDERER_NVN
  64. # ifndef BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION
  65. # define BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION 1
  66. # endif // BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION
  67. # ifndef BGFX_CONFIG_RENDERER_OPENGL
  68. # define BGFX_CONFIG_RENDERER_OPENGL (0 \
  69. || BX_PLATFORM_LINUX \
  70. || BX_PLATFORM_WINDOWS \
  71. ? BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION : 0)
  72. # endif // BGFX_CONFIG_RENDERER_OPENGL
  73. # ifndef BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION
  74. # define BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION (0 \
  75. || BX_PLATFORM_ANDROID \
  76. ? 30 : 1)
  77. # endif // BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION
  78. # ifndef BGFX_CONFIG_RENDERER_OPENGLES
  79. # define BGFX_CONFIG_RENDERER_OPENGLES (0 \
  80. || BX_PLATFORM_ANDROID \
  81. || BX_PLATFORM_EMSCRIPTEN \
  82. || BX_PLATFORM_RPI \
  83. || BX_PLATFORM_NX \
  84. ? BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION : 0)
  85. # endif // BGFX_CONFIG_RENDERER_OPENGLES
  86. # ifndef BGFX_CONFIG_RENDERER_VULKAN
  87. # define BGFX_CONFIG_RENDERER_VULKAN (0 \
  88. || BX_PLATFORM_ANDROID \
  89. || BX_PLATFORM_LINUX \
  90. || BX_PLATFORM_WINDOWS \
  91. || BX_PLATFORM_NX \
  92. || BX_PLATFORM_OSX \
  93. ? 1 : 0)
  94. # endif // BGFX_CONFIG_RENDERER_VULKAN
  95. #else
  96. # ifndef BGFX_CONFIG_RENDERER_AGC
  97. # define BGFX_CONFIG_RENDERER_AGC 0
  98. # endif // BGFX_CONFIG_RENDERER_AGC
  99. # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
  100. # define BGFX_CONFIG_RENDERER_DIRECT3D11 0
  101. # endif // BGFX_CONFIG_RENDERER_DIRECT3D11
  102. # ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
  103. # define BGFX_CONFIG_RENDERER_DIRECT3D12 0
  104. # endif // BGFX_CONFIG_RENDERER_DIRECT3D12
  105. # ifndef BGFX_CONFIG_RENDERER_GNM
  106. # define BGFX_CONFIG_RENDERER_GNM 0
  107. # endif // BGFX_CONFIG_RENDERER_GNM
  108. # ifndef BGFX_CONFIG_RENDERER_METAL
  109. # define BGFX_CONFIG_RENDERER_METAL 0
  110. # endif // BGFX_CONFIG_RENDERER_METAL
  111. # ifndef BGFX_CONFIG_RENDERER_NVN
  112. # define BGFX_CONFIG_RENDERER_NVN 0
  113. # endif // BGFX_CONFIG_RENDERER_NVN
  114. # ifndef BGFX_CONFIG_RENDERER_OPENGL
  115. # define BGFX_CONFIG_RENDERER_OPENGL 0
  116. # endif // BGFX_CONFIG_RENDERER_OPENGL
  117. # ifndef BGFX_CONFIG_RENDERER_OPENGLES
  118. # define BGFX_CONFIG_RENDERER_OPENGLES 0
  119. # endif // BGFX_CONFIG_RENDERER_OPENGLES
  120. # ifndef BGFX_CONFIG_RENDERER_VULKAN
  121. # define BGFX_CONFIG_RENDERER_VULKAN 0
  122. # endif // BGFX_CONFIG_RENDERER_VULKAN
  123. #endif // !defined...
  124. #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21
  125. # undef BGFX_CONFIG_RENDERER_OPENGL
  126. # define BGFX_CONFIG_RENDERER_OPENGL 21
  127. #endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21
  128. #if BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20
  129. # undef BGFX_CONFIG_RENDERER_OPENGLES
  130. # define BGFX_CONFIG_RENDERER_OPENGLES 20
  131. #endif // BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20
  132. #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES
  133. # error "Can't define both BGFX_CONFIG_RENDERER_OPENGL and BGFX_CONFIG_RENDERER_OPENGLES"
  134. #endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES
  135. /// Enable use of extensions.
  136. #ifndef BGFX_CONFIG_RENDERER_USE_EXTENSIONS
  137. # define BGFX_CONFIG_RENDERER_USE_EXTENSIONS 1
  138. #endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS
  139. #ifndef BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER
  140. # define BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER 0
  141. #endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER
  142. /// Enable use of tinystl.
  143. #ifndef BGFX_CONFIG_USE_TINYSTL
  144. # define BGFX_CONFIG_USE_TINYSTL 1
  145. #endif // BGFX_CONFIG_USE_TINYSTL
  146. /// Debug text maximum scale factor.
  147. #ifndef BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE
  148. # define BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE 4
  149. #endif // BGFX_CONFIG_DEBUG_TEXT_MAX_SCALE
  150. /// Enable nVidia PerfHUD integration.
  151. #ifndef BGFX_CONFIG_DEBUG_PERFHUD
  152. # define BGFX_CONFIG_DEBUG_PERFHUD 0
  153. #endif // BGFX_CONFIG_DEBUG_NVPERFHUD
  154. /// Enable annotation for graphics debuggers.
  155. #ifndef BGFX_CONFIG_DEBUG_ANNOTATION
  156. # define BGFX_CONFIG_DEBUG_ANNOTATION BGFX_CONFIG_DEBUG
  157. #endif // BGFX_CONFIG_DEBUG_ANNOTATION
  158. /// Enable DX11 object names.
  159. #ifndef BGFX_CONFIG_DEBUG_OBJECT_NAME
  160. # define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG_ANNOTATION
  161. #endif // BGFX_CONFIG_DEBUG_OBJECT_NAME
  162. /// Enable uniform debug checks.
  163. #ifndef BGFX_CONFIG_DEBUG_UNIFORM
  164. # define BGFX_CONFIG_DEBUG_UNIFORM BGFX_CONFIG_DEBUG
  165. #endif // BGFX_CONFIG_DEBUG_UNIFORM
  166. /// Enable occlusion debug checks.
  167. #ifndef BGFX_CONFIG_DEBUG_OCCLUSION
  168. # define BGFX_CONFIG_DEBUG_OCCLUSION BGFX_CONFIG_DEBUG
  169. #endif // BGFX_CONFIG_DEBUG_OCCLUSION
  170. #ifndef BGFX_CONFIG_MULTITHREADED
  171. # define BGFX_CONFIG_MULTITHREADED ( (0 == BX_PLATFORM_EMSCRIPTEN) ? 1 : 0)
  172. #endif // BGFX_CONFIG_MULTITHREADED
  173. #ifndef BGFX_CONFIG_MAX_DRAW_CALLS
  174. # define BGFX_CONFIG_MAX_DRAW_CALLS ( (64<<10)-1)
  175. #endif // BGFX_CONFIG_MAX_DRAW_CALLS
  176. #ifndef BGFX_CONFIG_MAX_BLIT_ITEMS
  177. # define BGFX_CONFIG_MAX_BLIT_ITEMS (1<<10)
  178. #endif // BGFX_CONFIG_MAX_BLIT_ITEMS
  179. #ifndef BGFX_CONFIG_MAX_MATRIX_CACHE
  180. # define BGFX_CONFIG_MAX_MATRIX_CACHE (BGFX_CONFIG_MAX_DRAW_CALLS+1)
  181. #endif // BGFX_CONFIG_MAX_MATRIX_CACHE
  182. #ifndef BGFX_CONFIG_MAX_RECT_CACHE
  183. # define BGFX_CONFIG_MAX_RECT_CACHE (4<<10)
  184. #endif // BGFX_CONFIG_MAX_RECT_CACHE
  185. #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH
  186. # define BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH 32
  187. #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH
  188. #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ
  189. # define BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ 20
  190. #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ
  191. #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM
  192. # define BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM 9
  193. #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM
  194. // Cannot be configured via compiler options.
  195. #define BGFX_CONFIG_MAX_PROGRAMS (1<<BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM)
  196. static_assert(bx::isPowerOf2(BGFX_CONFIG_MAX_PROGRAMS), "BGFX_CONFIG_MAX_PROGRAMS must be power of 2.");
  197. #ifndef BGFX_CONFIG_MAX_VIEWS
  198. # define BGFX_CONFIG_MAX_VIEWS 256
  199. #endif // BGFX_CONFIG_MAX_VIEWS
  200. static_assert(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS must be power of 2.");
  201. #define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 6
  202. #ifndef BGFX_CONFIG_MAX_VIEW_NAME
  203. # define BGFX_CONFIG_MAX_VIEW_NAME 256
  204. #endif // BGFX_CONFIG_MAX_VIEW_NAME
  205. #ifndef BGFX_CONFIG_MAX_VERTEX_LAYOUTS
  206. # define BGFX_CONFIG_MAX_VERTEX_LAYOUTS 64
  207. #endif // BGFX_CONFIG_MAX_VERTEX_LAYOUTS
  208. #ifndef BGFX_CONFIG_MAX_INDEX_BUFFERS
  209. # define BGFX_CONFIG_MAX_INDEX_BUFFERS (4<<10)
  210. #endif // BGFX_CONFIG_MAX_INDEX_BUFFERS
  211. #ifndef BGFX_CONFIG_MAX_VERTEX_BUFFERS
  212. # define BGFX_CONFIG_MAX_VERTEX_BUFFERS (4<<10)
  213. #endif // BGFX_CONFIG_MAX_VERTEX_BUFFERS
  214. #ifndef BGFX_CONFIG_MAX_VERTEX_STREAMS
  215. # define BGFX_CONFIG_MAX_VERTEX_STREAMS 4
  216. #endif // BGFX_CONFIG_MAX_VERTEX_STREAMS
  217. #ifndef BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
  218. # define BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS (4<<10)
  219. #endif // BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
  220. #ifndef BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
  221. # define BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS (4<<10)
  222. #endif // BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
  223. #ifndef BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
  224. # define BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE (1<<20)
  225. #endif // BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
  226. #ifndef BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
  227. # define BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE (3<<20)
  228. #endif // BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
  229. #ifndef BGFX_CONFIG_MAX_SHADERS
  230. # define BGFX_CONFIG_MAX_SHADERS 512
  231. #endif // BGFX_CONFIG_MAX_FRAGMENT_SHADERS
  232. #ifndef BGFX_CONFIG_MAX_TEXTURES
  233. # define BGFX_CONFIG_MAX_TEXTURES (4<<10)
  234. #endif // BGFX_CONFIG_MAX_TEXTURES
  235. #ifndef BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
  236. # define BGFX_CONFIG_MAX_TEXTURE_SAMPLERS 16
  237. #endif // BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
  238. #ifndef BGFX_CONFIG_MAX_FRAME_BUFFERS
  239. # define BGFX_CONFIG_MAX_FRAME_BUFFERS 128
  240. #endif // BGFX_CONFIG_MAX_FRAME_BUFFERS
  241. #ifndef BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
  242. # define BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS 8
  243. #endif // BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
  244. #ifndef BGFX_CONFIG_MAX_UNIFORMS
  245. # define BGFX_CONFIG_MAX_UNIFORMS 512
  246. #endif // BGFX_CONFIG_MAX_UNIFORMS
  247. #ifndef BGFX_CONFIG_MAX_OCCLUSION_QUERIES
  248. # define BGFX_CONFIG_MAX_OCCLUSION_QUERIES 256
  249. #endif // BGFX_CONFIG_MAX_OCCLUSION_QUERIES
  250. #ifndef BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE
  251. # define BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE (64<<10)
  252. #endif // BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE
  253. #ifndef BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
  254. # define BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20)
  255. #endif // BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
  256. #ifndef BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
  257. # define BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
  258. #endif // BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
  259. #ifndef BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE
  260. /// Amount of scratch buffer size (per in-flight frame) that will be reserved
  261. /// for staging data for copying to the device (such as vertex buffer data,
  262. /// texture data, etc). This buffer will be used instead of allocating memory
  263. /// on device separately for every data copy.
  264. /// Note: Currently only used by the Vulkan backend.
  265. # define BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE (32<<20)
  266. #endif
  267. #ifndef BGFX_CONFIG_MAX_BYTES_CACHED_DEVICE_MEMORY_ALLOCATIONS
  268. /// Amount of allowed memory allocations left on device to use for recycling during
  269. /// later allocations. This can be beneficial in case the driver is slow allocating memory
  270. /// on the device.
  271. /// Note: Currently only used by the Vulkan backend.
  272. # define BGFX_CONFIG_MAX_BYTES_CACHED_DEVICE_MEMORY_ALLOCATIONS (128 << 20)
  273. #endif
  274. #ifndef BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER
  275. /// The threshold of data size above which the staging scratch buffer will
  276. /// not be used, but instead a separate device memory allocation will take
  277. /// place to stage the data for copying to device.
  278. # define BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER (16 << 20)
  279. #endif
  280. #ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
  281. # define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
  282. #endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
  283. #ifndef BGFX_CONFIG_MAX_COLOR_PALETTE
  284. # define BGFX_CONFIG_MAX_COLOR_PALETTE 16
  285. #endif // BGFX_CONFIG_MAX_COLOR_PALETTE
  286. #define BGFX_CONFIG_DRAW_INDIRECT_STRIDE 32
  287. #ifndef BGFX_CONFIG_PROFILER
  288. # define BGFX_CONFIG_PROFILER 0
  289. #endif // BGFX_CONFIG_PROFILER
  290. #ifndef BGFX_CONFIG_RENDERDOC_LOG_FILEPATH
  291. # define BGFX_CONFIG_RENDERDOC_LOG_FILEPATH "temp/bgfx"
  292. #endif // BGFX_CONFIG_RENDERDOC_LOG_FILEPATH
  293. #ifndef BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS
  294. # define BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS { eRENDERDOC_Key_F11 }
  295. #endif // BGFX_CONFIG_RENDERDOC_CAPTURE_KEYS
  296. #ifndef BGFX_CONFIG_API_SEMAPHORE_TIMEOUT
  297. # define BGFX_CONFIG_API_SEMAPHORE_TIMEOUT (5000)
  298. #endif // BGFX_CONFIG_API_SEMAPHORE_TIMEOUT
  299. #ifndef BGFX_CONFIG_MIP_LOD_BIAS
  300. # define BGFX_CONFIG_MIP_LOD_BIAS 0
  301. #endif // BGFX_CONFIG_MIP_LOD_BIAS
  302. #ifndef BGFX_CONFIG_DEFAULT_MAX_ENCODERS
  303. # define BGFX_CONFIG_DEFAULT_MAX_ENCODERS ( (0 != BGFX_CONFIG_MULTITHREADED) ? 8 : 1)
  304. #endif // BGFX_CONFIG_DEFAULT_MAX_ENCODERS
  305. #ifndef BGFX_CONFIG_MAX_BACK_BUFFERS
  306. # define BGFX_CONFIG_MAX_BACK_BUFFERS 4
  307. #endif // BGFX_CONFIG_MAX_BACK_BUFFERS
  308. #ifndef BGFX_CONFIG_MAX_FRAME_LATENCY
  309. # define BGFX_CONFIG_MAX_FRAME_LATENCY 3
  310. #endif // BGFX_CONFIG_MAX_FRAME_LATENCY
  311. #ifndef BGFX_CONFIG_PREFER_DISCRETE_GPU
  312. // On laptops with integrated and discrete GPU, prefer selection of discrete GPU.
  313. // nVidia and AMD, on Windows only.
  314. # define BGFX_CONFIG_PREFER_DISCRETE_GPU BX_PLATFORM_WINDOWS
  315. #endif // BGFX_CONFIG_PREFER_DISCRETE_GPU
  316. #ifndef BGFX_CONFIG_MAX_SCREENSHOTS
  317. # define BGFX_CONFIG_MAX_SCREENSHOTS 4
  318. #endif // BGFX_CONFIG_MAX_SCREENSHOTS
  319. #ifndef BGFX_CONFIG_ENCODER_API_ONLY
  320. # define BGFX_CONFIG_ENCODER_API_ONLY 0
  321. #endif // BGFX_CONFIG_ENCODER_API_ONLY
  322. #endif // BGFX_CONFIG_H_HEADER_GUARD