diff options
Diffstat (limited to '3rdparty/bgfx/src/config.h')
-rw-r--r-- | 3rdparty/bgfx/src/config.h | 139 |
1 files changed, 102 insertions, 37 deletions
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h index d8a1ab97164..a492f0006c0 100644 --- a/3rdparty/bgfx/src/config.h +++ b/3rdparty/bgfx/src/config.h @@ -1,34 +1,52 @@ /* - * Copyright 2011-2018 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + * Copyright 2011-2022 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #ifndef BGFX_CONFIG_H_HEADER_GUARD #define BGFX_CONFIG_H_HEADER_GUARD -#include <bx/bx.h> +#include <bx/bx.h> // bx::isPowerOf2 -#ifndef BGFX_CONFIG_DEBUG -# define BGFX_CONFIG_DEBUG 0 -#endif // BGFX_CONFIG_DEBUG +// # Configuration options for bgfx. +// +// Any of `BGFX_CONFIG_*` options that's inside `#ifndef` block can be configured externally +// via compiler options. +// +// When selecting rendering backends select all backends you want to include in the build. -#if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \ +#ifndef BX_CONFIG_DEBUG +# error "BX_CONFIG_DEBUG must be defined in build script!" +#endif // BX_CONFIG_DEBUG + +#if !defined(BGFX_CONFIG_RENDERER_AGC) \ + && !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \ + && !defined(BGFX_CONFIG_RENDERER_GNM) \ && !defined(BGFX_CONFIG_RENDERER_METAL) \ + && !defined(BGFX_CONFIG_RENDERER_NVN) \ && !defined(BGFX_CONFIG_RENDERER_OPENGL) \ && !defined(BGFX_CONFIG_RENDERER_OPENGLES) \ && !defined(BGFX_CONFIG_RENDERER_VULKAN) \ - && !defined(BGFX_CONFIG_RENDERER_GNM) + && !defined(BGFX_CONFIG_RENDERER_WEBGPU) + +# ifndef BGFX_CONFIG_RENDERER_AGC +# define BGFX_CONFIG_RENDERER_AGC (0 \ + || BX_PLATFORM_PS5 \ + ? 1 : 0) +# endif // BGFX_CONFIG_RENDERER_AGC # ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 # define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \ + || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11 # define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \ + || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ @@ -37,37 +55,60 @@ # ifndef BGFX_CONFIG_RENDERER_DIRECT3D12 # define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \ + || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_DIRECT3D12 +# ifndef BGFX_CONFIG_RENDERER_GNM +# define BGFX_CONFIG_RENDERER_GNM (0 \ + || BX_PLATFORM_PS4 \ + ? 1 : 0) +# endif // BGFX_CONFIG_RENDERER_GNM + # ifndef BGFX_CONFIG_RENDERER_METAL # define BGFX_CONFIG_RENDERER_METAL (0 \ || (BX_PLATFORM_IOS && BX_CPU_ARM) \ + || (BX_PLATFORM_IOS && BX_CPU_X86) \ || (BX_PLATFORM_OSX >= 101100) \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_METAL +# ifndef BGFX_CONFIG_RENDERER_NVN +# define BGFX_CONFIG_RENDERER_NVN (0 \ + || BX_PLATFORM_NX \ + ? 1 : 0) +# endif // BGFX_CONFIG_RENDERER_NVN + +# ifndef BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION +# define BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION 1 +# endif // BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION + # ifndef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL (0 \ || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_OSX \ || BX_PLATFORM_WINDOWS \ - ? 1 : 0) + ? BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION : 0) # endif // BGFX_CONFIG_RENDERER_OPENGL +# ifndef BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION +# define BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION (0 \ + || BX_PLATFORM_ANDROID \ + ? 30 : 1) +# endif // BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION + # ifndef BGFX_CONFIG_RENDERER_OPENGLES # define BGFX_CONFIG_RENDERER_OPENGLES (0 \ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_IOS \ || BX_PLATFORM_RPI \ - || BX_PLATFORM_STEAMLINK \ || BX_PLATFORM_NX \ - ? 1 : 0) + ? BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION : 0) # endif // BGFX_CONFIG_RENDERER_OPENGLES # ifndef BGFX_CONFIG_RENDERER_VULKAN @@ -76,16 +117,19 @@ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_NX \ + || BX_PLATFORM_OSX \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_VULKAN -# ifndef BGFX_CONFIG_RENDERER_GNM -# define BGFX_CONFIG_RENDERER_GNM (0 \ - || BX_PLATFORM_PS4 \ - ? 1 : 0) -# endif // BGFX_CONFIG_RENDERER_GNM +# ifndef BGFX_CONFIG_RENDERER_WEBGPU +# define BGFX_CONFIG_RENDERER_WEBGPU 0 +# endif // BGFX_CONFIG_RENDERER_WEBGPU #else +# ifndef BGFX_CONFIG_RENDERER_AGC +# define BGFX_CONFIG_RENDERER_AGC 0 +# endif // BGFX_CONFIG_RENDERER_AGC + # ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 # define BGFX_CONFIG_RENDERER_DIRECT3D9 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 @@ -98,10 +142,18 @@ # define BGFX_CONFIG_RENDERER_DIRECT3D12 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D12 +# ifndef BGFX_CONFIG_RENDERER_GNM +# define BGFX_CONFIG_RENDERER_GNM 0 +# endif // BGFX_CONFIG_RENDERER_GNM + # ifndef BGFX_CONFIG_RENDERER_METAL # define BGFX_CONFIG_RENDERER_METAL 0 # endif // BGFX_CONFIG_RENDERER_METAL +# ifndef BGFX_CONFIG_RENDERER_NVN +# define BGFX_CONFIG_RENDERER_NVN 0 +# endif // BGFX_CONFIG_RENDERER_NVN + # ifndef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL 0 # endif // BGFX_CONFIG_RENDERER_OPENGL @@ -114,9 +166,9 @@ # define BGFX_CONFIG_RENDERER_VULKAN 0 # endif // BGFX_CONFIG_RENDERER_VULKAN -# ifndef BGFX_CONFIG_RENDERER_GNM -# define BGFX_CONFIG_RENDERER_GNM 0 -# endif // BGFX_CONFIG_RENDERER_GNM +# ifndef BGFX_CONFIG_RENDERER_WEBGPU +# define BGFX_CONFIG_RENDERER_WEBGPU 0 +# endif // BGFX_CONFIG_RENDERER_VULKAN #endif // !defined... #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21 @@ -148,21 +200,16 @@ # define BGFX_CONFIG_DEBUG_PERFHUD 0 #endif // BGFX_CONFIG_DEBUG_NVPERFHUD -/// Enable PIX markers. -#ifndef BGFX_CONFIG_DEBUG_PIX -# define BGFX_CONFIG_DEBUG_PIX BGFX_CONFIG_DEBUG -#endif // BGFX_CONFIG_DEBUG_PIX +/// Enable annotation for graphics debuggers. +#ifndef BGFX_CONFIG_DEBUG_ANNOTATION +# define BGFX_CONFIG_DEBUG_ANNOTATION BGFX_CONFIG_DEBUG +#endif // BGFX_CONFIG_DEBUG_ANNOTATION /// Enable DX11 object names. #ifndef BGFX_CONFIG_DEBUG_OBJECT_NAME -# define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG +# define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG_ANNOTATION #endif // BGFX_CONFIG_DEBUG_OBJECT_NAME -/// 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 @@ -220,9 +267,9 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m # define BGFX_CONFIG_MAX_VIEW_NAME 256 #endif // BGFX_CONFIG_MAX_VIEW_NAME -#ifndef BGFX_CONFIG_MAX_VERTEX_DECLS -# define BGFX_CONFIG_MAX_VERTEX_DECLS 64 -#endif // BGFX_CONFIG_MAX_VERTEX_DECLS +#ifndef BGFX_CONFIG_MAX_VERTEX_LAYOUTS +# define BGFX_CONFIG_MAX_VERTEX_LAYOUTS 64 +#endif // BGFX_CONFIG_MAX_VERTEX_LAYOUTS #ifndef BGFX_CONFIG_MAX_INDEX_BUFFERS # define BGFX_CONFIG_MAX_INDEX_BUFFERS (4<<10) @@ -280,9 +327,9 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m # define BGFX_CONFIG_MAX_OCCLUSION_QUERIES 256 #endif // BGFX_CONFIG_MAX_OCCLUSION_QUERIES -#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_MIN_RESOURCE_COMMAND_BUFFER_SIZE +# define BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE (64<<10) +#endif // BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE #ifndef BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE # define BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20) @@ -296,9 +343,9 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m # define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5 #endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT -#ifndef BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE +#ifndef BGFX_CONFIG_MAX_COLOR_PALETTE # define BGFX_CONFIG_MAX_COLOR_PALETTE 16 -#endif // BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE +#endif // BGFX_CONFIG_MAX_COLOR_PALETTE #define BGFX_CONFIG_DRAW_INDIRECT_STRIDE 32 @@ -330,4 +377,22 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m # define BGFX_CONFIG_MAX_BACK_BUFFERS 4 #endif // BGFX_CONFIG_MAX_BACK_BUFFERS +#ifndef BGFX_CONFIG_MAX_FRAME_LATENCY +# define BGFX_CONFIG_MAX_FRAME_LATENCY 3 +#endif // BGFX_CONFIG_MAX_FRAME_LATENCY + +#ifndef BGFX_CONFIG_PREFER_DISCRETE_GPU +// On laptops with integrated and discrete GPU, prefer selection of discrete GPU. +// nVidia and AMD, on Windows only. +# define BGFX_CONFIG_PREFER_DISCRETE_GPU BX_PLATFORM_WINDOWS +#endif // BGFX_CONFIG_PREFER_DISCRETE_GPU + +#ifndef BGFX_CONFIG_MAX_SCREENSHOTS +# define BGFX_CONFIG_MAX_SCREENSHOTS 4 +#endif // BGFX_CONFIG_MAX_SCREENSHOTS + +#ifndef BGFX_CONFIG_ENCODER_API_ONLY +# define BGFX_CONFIG_ENCODER_API_ONLY 0 +#endif // BGFX_CONFIG_ENCODER_API_ONLY + #endif // BGFX_CONFIG_H_HEADER_GUARD |