Преглед изворни кода

Added bgfx::Init capabilities mask.

Бранимир Караџић пре 4 година
родитељ
комит
117c999d6e
8 измењених фајлова са 12 додато и 4 уклоњено
  1. 1 0
      bindings/bf/bgfx.bf
  2. 1 0
      bindings/cs/bgfx.cs
  3. 2 1
      bindings/d/types.d
  4. 2 0
      include/bgfx/bgfx.h
  5. 1 0
      include/bgfx/c99/bgfx.h
  6. 1 1
      include/bgfx/defines.h
  7. 2 2
      scripts/bgfx.idl
  8. 2 0
      src/bgfx.cpp

+ 1 - 0
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;

+ 1 - 0
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;

+ 2 - 1
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.

+ 2 - 0
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.
 

+ 1 - 0
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.                           */

+ 1 - 1
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.

+ 2 - 2
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.

+ 2 - 0
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)