Added bgfx::Init capabilities mask.

This commit is contained in:
Бранимир Караџић 2021-04-22 20:18:48 -07:00
parent 87855128bb
commit 117c999d6e
8 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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. */

View File

@ -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.

View File

@ -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.

View File

@ -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)