bgfx/src/config.h

306 lines
9.5 KiB
C
Raw Normal View History

2013-02-22 09:07:31 +04:00
/*
2016-01-01 11:11:04 +03:00
* Copyright 2011-2016 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
2013-02-22 09:07:31 +04:00
*/
#ifndef BGFX_CONFIG_H_HEADER_GUARD
#define BGFX_CONFIG_H_HEADER_GUARD
2013-02-22 09:07:31 +04:00
2014-08-24 01:01:52 +04:00
#include <bx/config.h>
2014-08-22 09:05:02 +04:00
#ifndef BGFX_CONFIG_DEBUG
# define BGFX_CONFIG_DEBUG 0
#endif // BGFX_CONFIG_DEBUG
2013-02-22 09:07:31 +04:00
#if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \
2014-10-11 22:24:37 +04:00
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \
2015-06-11 19:38:17 +03:00
&& !defined(BGFX_CONFIG_RENDERER_METAL) \
2013-02-22 09:07:31 +04:00
&& !defined(BGFX_CONFIG_RENDERER_OPENGL) \
&& !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
2015-03-06 07:34:39 +03:00
&& !defined(BGFX_CONFIG_RENDERER_VULKAN) \
2013-02-22 09:07:31 +04:00
&& !defined(BGFX_CONFIG_RENDERER_NULL)
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
2015-08-20 04:33:56 +03:00
|| BX_PLATFORM_WINDOWS \
2014-05-28 07:05:13 +04:00
|| BX_PLATFORM_XBOX360 \
? 1 : 0)
2013-02-22 09:07:31 +04:00
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
2015-08-20 04:33:56 +03:00
|| BX_PLATFORM_WINDOWS \
2014-12-05 06:56:19 +03:00
|| BX_PLATFORM_WINRT \
2014-05-28 07:05:13 +04:00
? 1 : 0)
2013-02-22 09:07:31 +04:00
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
2014-10-11 22:24:37 +04:00
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
# define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \
2015-08-20 04:33:56 +03:00
|| BX_PLATFORM_WINDOWS \
2014-10-11 22:24:37 +04:00
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D12
2015-06-11 19:38:17 +03:00
# ifndef BGFX_CONFIG_RENDERER_METAL
2015-08-14 16:12:44 +03:00
# define BGFX_CONFIG_RENDERER_METAL (0 \
|| BX_PLATFORM_IOS \
|| (BX_PLATFORM_OSX >= 101100) \
2015-08-14 16:12:44 +03:00
? 1 : 0)
2015-06-11 19:38:17 +03:00
# endif // BGFX_CONFIG_RENDERER_METAL
2013-02-22 09:07:31 +04:00
# ifndef BGFX_CONFIG_RENDERER_OPENGL
# define BGFX_CONFIG_RENDERER_OPENGL (0 \
|| BX_PLATFORM_BSD \
2015-04-10 18:33:20 +03:00
|| BX_PLATFORM_LINUX \
2014-05-28 07:05:13 +04:00
|| BX_PLATFORM_OSX \
2015-04-10 18:33:20 +03:00
|| BX_PLATFORM_WINDOWS \
2014-05-28 07:05:13 +04:00
? 1 : 0)
2013-02-22 09:07:31 +04:00
# endif // BGFX_CONFIG_RENDERER_OPENGL
# ifndef BGFX_CONFIG_RENDERER_OPENGLES
# define BGFX_CONFIG_RENDERER_OPENGLES (0 \
2014-05-28 07:05:13 +04:00
|| BX_PLATFORM_ANDROID \
2015-04-10 18:33:20 +03:00
|| BX_PLATFORM_EMSCRIPTEN \
2014-05-28 07:05:13 +04:00
|| BX_PLATFORM_IOS \
2015-04-10 18:33:20 +03:00
|| BX_PLATFORM_NACL \
2014-05-28 07:05:13 +04:00
|| BX_PLATFORM_QNX \
2014-08-25 04:41:41 +04:00
|| BX_PLATFORM_RPI \
2014-05-28 07:05:13 +04:00
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_OPENGLES
2013-02-22 09:07:31 +04:00
2015-03-06 07:34:39 +03:00
# ifndef BGFX_CONFIG_RENDERER_VULKAN
# define BGFX_CONFIG_RENDERER_VULKAN 0
# endif // BGFX_CONFIG_RENDERER_VULKAN
2013-02-22 09:07:31 +04:00
# ifndef BGFX_CONFIG_RENDERER_NULL
# define BGFX_CONFIG_RENDERER_NULL (!(0 \
2014-05-28 07:05:13 +04:00
|| BGFX_CONFIG_RENDERER_DIRECT3D9 \
|| BGFX_CONFIG_RENDERER_DIRECT3D11 \
2014-10-11 22:24:37 +04:00
|| BGFX_CONFIG_RENDERER_DIRECT3D12 \
2016-01-14 22:43:31 +03:00
|| BGFX_CONFIG_RENDERER_METAL \
2014-05-28 07:05:13 +04:00
|| BGFX_CONFIG_RENDERER_OPENGL \
|| BGFX_CONFIG_RENDERER_OPENGLES \
2016-01-14 22:43:31 +03:00
|| BGFX_CONFIG_RENDERER_VULKAN \
2014-05-28 07:05:13 +04:00
? 1 : 0) )
2013-02-22 09:07:31 +04:00
# endif // BGFX_CONFIG_RENDERER_NULL
#else
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 0
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
# define BGFX_CONFIG_RENDERER_DIRECT3D11 0
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
2014-10-11 22:24:37 +04:00
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
# define BGFX_CONFIG_RENDERER_DIRECT3D12 0
# endif // BGFX_CONFIG_RENDERER_DIRECT3D12
2015-06-11 19:38:17 +03:00
# ifndef BGFX_CONFIG_RENDERER_METAL
# define BGFX_CONFIG_RENDERER_METAL 0
# endif // BGFX_CONFIG_RENDERER_METAL
2013-02-22 09:07:31 +04:00
# ifndef BGFX_CONFIG_RENDERER_OPENGL
# define BGFX_CONFIG_RENDERER_OPENGL 0
# endif // BGFX_CONFIG_RENDERER_OPENGL
# ifndef BGFX_CONFIG_RENDERER_OPENGLES
# define BGFX_CONFIG_RENDERER_OPENGLES 0
# endif // BGFX_CONFIG_RENDERER_OPENGLES
2013-02-22 09:07:31 +04:00
2015-03-06 07:34:39 +03:00
# ifndef BGFX_CONFIG_RENDERER_VULKAN
# define BGFX_CONFIG_RENDERER_VULKAN 0
# endif // BGFX_CONFIG_RENDERER_VULKAN
2013-02-22 09:07:31 +04:00
# ifndef BGFX_CONFIG_RENDERER_NULL
# define BGFX_CONFIG_RENDERER_NULL 0
# endif // BGFX_CONFIG_RENDERER_NULL
#endif // !defined...
2013-12-21 09:42:24 +04:00
#if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21
# undef BGFX_CONFIG_RENDERER_OPENGL
# define BGFX_CONFIG_RENDERER_OPENGL 21
#endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21
#if BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20
# undef BGFX_CONFIG_RENDERER_OPENGLES
# define BGFX_CONFIG_RENDERER_OPENGLES 20
#endif // BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20
#if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES
# error "Can't define both BGFX_CONFIG_RENDERER_OPENGL and BGFX_CONFIG_RENDERER_OPENGLES"
#endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES
2014-10-14 07:05:23 +04:00
/// Enable use of extensions.
#ifndef BGFX_CONFIG_RENDERER_USE_EXTENSIONS
2014-03-19 09:50:24 +04:00
# define BGFX_CONFIG_RENDERER_USE_EXTENSIONS 1
#endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS
2014-10-14 07:05:23 +04:00
/// Enable use of tinystl.
#ifndef BGFX_CONFIG_USE_TINYSTL
# define BGFX_CONFIG_USE_TINYSTL 1
#endif // BGFX_CONFIG_USE_TINYSTL
2014-10-29 08:08:55 +03:00
/// Enable OculusVR integration.
#ifndef BGFX_CONFIG_USE_OVR
# define BGFX_CONFIG_USE_OVR 0
#endif // BGFX_CONFIG_USE_OVR
2014-10-14 07:05:23 +04:00
/// Enable nVidia PerfHUD integration.
#ifndef BGFX_CONFIG_DEBUG_PERFHUD
# define BGFX_CONFIG_DEBUG_PERFHUD 0
#endif // BGFX_CONFIG_DEBUG_NVPERFHUD
/// Enable PIX markers.
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_DEBUG_PIX
# define BGFX_CONFIG_DEBUG_PIX BGFX_CONFIG_DEBUG
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_DEBUG_PIX
2014-10-14 07:05:23 +04:00
/// Enable DX11 object names.
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_DEBUG_OBJECT_NAME
# define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG
#endif // BGFX_CONFIG_DEBUG_OBJECT_NAME
2015-08-14 16:12:44 +03:00
/// Enable Metal markers.
#ifndef BGFX_CONFIG_DEBUG_MTL
# define BGFX_CONFIG_DEBUG_MTL BGFX_CONFIG_DEBUG
#endif // BGFX_CONFIG_DEBUG_MTL
/// Enable uniform debug checks.
#ifndef BGFX_CONFIG_DEBUG_UNIFORM
# define BGFX_CONFIG_DEBUG_UNIFORM BGFX_CONFIG_DEBUG
#endif // BGFX_CONFIG_DEBUG_UNIFORM
/// Enable occlusion debug checks.
#ifndef BGFX_CONFIG_DEBUG_OCCLUSION
# define BGFX_CONFIG_DEBUG_OCCLUSION BGFX_CONFIG_DEBUG
#endif // BGFX_CONFIG_DEBUG_OCCLUSION
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MULTITHREADED
2016-01-14 22:43:31 +03:00
# define BGFX_CONFIG_MULTITHREADED ( (0 == BX_PLATFORM_EMSCRIPTEN) ? 1 : 0)
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_MULTITHREADED
#ifndef BGFX_CONFIG_MAX_DRAW_CALLS
# define BGFX_CONFIG_MAX_DRAW_CALLS ( (64<<10)-1)
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_MAX_DRAW_CALLS
2015-10-16 02:38:59 +03:00
#ifndef BGFX_CONFIG_MAX_BLIT_ITEMS
2015-11-06 09:10:32 +03:00
# define BGFX_CONFIG_MAX_BLIT_ITEMS (1<<10)
2015-10-16 02:38:59 +03:00
#endif // BGFX_CONFIG_MAX_BLIT_ITEMS
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MAX_MATRIX_CACHE
2015-04-10 03:36:36 +03:00
# define BGFX_CONFIG_MAX_MATRIX_CACHE (BGFX_CONFIG_MAX_DRAW_CALLS+1)
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_MAX_MATRIX_CACHE
#ifndef BGFX_CONFIG_MAX_RECT_CACHE
2014-05-20 09:08:35 +04:00
# define BGFX_CONFIG_MAX_RECT_CACHE (4<<10)
#endif // BGFX_CONFIG_MAX_RECT_CACHE
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MAX_VIEWS
2014-07-21 07:27:13 +04:00
// Do not change. Must be power of 2.
# define BGFX_CONFIG_MAX_VIEWS 256
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_MAX_VIEWS
2015-04-02 21:57:53 +03:00
#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 6
#ifndef BGFX_CONFIG_MAX_VIEW_NAME
# define BGFX_CONFIG_MAX_VIEW_NAME 256
#endif // BGFX_CONFIG_MAX_VIEW_NAME
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MAX_VERTEX_DECLS
# define BGFX_CONFIG_MAX_VERTEX_DECLS 64
#endif // BGFX_CONFIG_MAX_VERTEX_DECLS
#ifndef BGFX_CONFIG_MAX_INDEX_BUFFERS
# define BGFX_CONFIG_MAX_INDEX_BUFFERS (4<<10)
#endif // BGFX_CONFIG_MAX_INDEX_BUFFERS
#ifndef BGFX_CONFIG_MAX_VERTEX_BUFFERS
# define BGFX_CONFIG_MAX_VERTEX_BUFFERS (4<<10)
#endif // BGFX_CONFIG_MAX_VERTEX_BUFFERS
#ifndef BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
# define BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS (4<<10)
#endif // BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
#ifndef BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
# define BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS (4<<10)
#endif // BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
#ifndef BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
# define BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE (1<<20)
#endif // BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
#ifndef BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
# define BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE (3<<20)
#endif // BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
#ifndef BGFX_CONFIG_MAX_SHADERS
# define BGFX_CONFIG_MAX_SHADERS 512
2013-02-22 09:07:31 +04:00
#endif // BGFX_CONFIG_MAX_FRAGMENT_SHADERS
#ifndef BGFX_CONFIG_MAX_PROGRAMS
2014-07-21 07:27:13 +04:00
// Must be power of 2.
2013-02-22 09:07:31 +04:00
# define BGFX_CONFIG_MAX_PROGRAMS 512
#endif // BGFX_CONFIG_MAX_PROGRAMS
#ifndef BGFX_CONFIG_MAX_TEXTURES
# define BGFX_CONFIG_MAX_TEXTURES (4<<10)
#endif // BGFX_CONFIG_MAX_TEXTURES
2014-07-31 07:37:54 +04:00
#ifndef BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
# define BGFX_CONFIG_MAX_TEXTURE_SAMPLERS 16
#endif // BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
2014-02-06 11:07:11 +04:00
#ifndef BGFX_CONFIG_MAX_FRAME_BUFFERS
# define BGFX_CONFIG_MAX_FRAME_BUFFERS 64
#endif // BGFX_CONFIG_MAX_FRAME_BUFFERS
#ifndef BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
2014-09-01 22:24:51 +04:00
# define BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS 8
2014-02-06 11:07:11 +04:00
#endif // BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MAX_UNIFORMS
# define BGFX_CONFIG_MAX_UNIFORMS 512
2015-09-15 01:53:33 +03:00
#endif // BGFX_CONFIG_MAX_UNIFORMS
2013-02-22 09:07:31 +04:00
2015-11-02 04:28:23 +03:00
#ifndef BGFX_CONFIG_MAX_OCCUSION_QUERIES
# define BGFX_CONFIG_MAX_OCCUSION_QUERIES 256
#endif // BGFX_CONFIG_MAX_OCCUSION_QUERIES
2013-02-22 09:07:31 +04:00
#ifndef BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE
# define BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE (64<<10)
#endif // BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE
#ifndef BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
# define BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20)
#endif // BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
#ifndef BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
# define BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
#endif // BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
#ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
#endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
2014-09-01 22:24:51 +04:00
#ifndef BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
2015-09-17 03:21:28 +03:00
# define BGFX_CONFIG_MAX_COLOR_PALETTE 16
2014-09-01 22:24:51 +04:00
#endif // BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
2013-03-24 03:02:34 +04:00
2015-05-02 00:54:23 +03:00
#define BGFX_CONFIG_DRAW_INDIRECT_STRIDE 32
2015-11-10 06:18:42 +03:00
#ifndef BGFX_CONFIG_PROFILER_MICROPROFILE
# define BGFX_CONFIG_PROFILER_MICROPROFILE 0
#endif // BGFX_CONFIG_PROFILER_MICROPROFILE
#ifndef BGFX_CONFIG_PROFILER_REMOTERY
# define BGFX_CONFIG_PROFILER_REMOTERY 0
#endif // BGFX_CONFIG_PROFILER_REMOTERY
2015-11-16 22:02:41 +03:00
#ifndef BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB
# define BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB BGFX_CONFIG_PROFILER_REMOTERY
#endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB
#endif // BGFX_CONFIG_H_HEADER_GUARD