diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf index b196982c1..a73eaf410 100644 --- a/bindings/bf/bgfx.bf +++ b/bindings/bf/bgfx.bf @@ -2053,6 +2053,7 @@ public static class bgfx public RendererType type; public uint16 vendorId; public uint16 deviceId; + public uint64 capabilities; public uint8 debug; public uint8 profile; public PlatformData platformData; diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs index a6260988b..684afacb5 100644 --- a/bindings/cs/bgfx.cs +++ b/bindings/cs/bgfx.cs @@ -2030,6 +2030,7 @@ public static partial class bgfx public RendererType type; public ushort vendorId; public ushort deviceId; + public ulong capabilities; public byte debug; public byte profile; public PlatformData platformData; diff --git a/bindings/d/types.d b/bindings/d/types.d index 56268fc61..0fbcfb96b 100644 --- a/bindings/d/types.d +++ b/bindings/d/types.d @@ -10,7 +10,7 @@ public import core.stdc.stdarg : va_list; extern(C) @nogc nothrow: -enum uint BGFX_API_VERSION = 113; +enum uint BGFX_API_VERSION = 114; alias bgfx_view_id_t = ushort; @@ -854,6 +854,7 @@ struct bgfx_init_t * matching id. */ ushort deviceId; + ulong capabilities; /// Capabilities initialization mask. bool debug_; /// Enable device for debuging. bool profile; /// Enable device for profiling. bgfx_platform_data_t platformData; /// Platform data. diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 0437289ab..93740a132 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -662,6 +662,8 @@ namespace bgfx /// matching id. uint16_t deviceId; + uint64_t capabilities; //!< Capabilities initialization mask (default: UINT64_MAX). + bool debug; //!< Enable device for debuging. bool profile; //!< Enable device for profiling. diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 656a5b3cf..4517d8a44 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -668,6 +668,7 @@ typedef struct bgfx_init_s * matching id. */ uint16_t deviceId; + uint64_t capabilities; /** Capabilities initialization mask. */ bool debug; /** Enable device for debuging. */ bool profile; /** Enable device for profiling. */ bgfx_platform_data_t platformData; /** Platform data. */ diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index 16e301c02..a8da84907 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -15,7 +15,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(113) +#define BGFX_API_VERSION UINT32_C(114) /** * Color RGB/alpha/depth write. When it's not specified write will be disabled. diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index f474cecfd..621329606 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -1,7 +1,7 @@ -- vim: syntax=lua -- bgfx interface -version(113) +version(114) typedef "bool" typedef "char" @@ -790,7 +790,7 @@ struct.Init { ctor } .deviceId "uint16_t" --- Device id. If set to 0 it will select first device, or device with --- matching id. - + .capabilities "uint64_t" --- Capabilities initialization mask (default: UINT64_MAX). .debug "bool" --- Enable device for debuging. .profile "bool" --- Enable device for profiling. .platformData "PlatformData" --- Platform data. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 0c3be13d9..b38d97a69 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -2001,6 +2001,7 @@ namespace bgfx g_caps.rendererType = m_renderCtx->getRendererType(); initAttribTypeSizeTable(g_caps.rendererType); + g_caps.supported &= _init.capabilities; g_caps.supported |= 0 | (BX_ENABLED(BGFX_CONFIG_MULTITHREADED) && !m_singleThreaded ? BGFX_CAPS_RENDERER_MULTITHREADED : 0) | (isGraphicsDebuggerPresent() ? BGFX_CAPS_GRAPHICS_DEBUGGER : 0) @@ -3424,6 +3425,7 @@ namespace bgfx : type(RendererType::Count) , vendorId(BGFX_PCI_ID_NONE) , deviceId(0) + , capabilities(UINT64_MAX) , debug(BX_ENABLED(BGFX_CONFIG_DEBUG) ) , profile(BX_ENABLED(BGFX_CONFIG_DEBUG_ANNOTATION) ) , callback(NULL)