mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 13:32:59 +01:00
Added ability to select GPU.
This commit is contained in:
@@ -272,6 +272,15 @@ typedef struct bgfx_texture_info
|
||||
|
||||
} bgfx_texture_info_t;
|
||||
|
||||
/**
|
||||
*/
|
||||
typedef struct bgfx_caps_gpu
|
||||
{
|
||||
uint16_t vendorId;
|
||||
uint16_t deviceId;
|
||||
|
||||
} bgfx_caps_gpu_t;
|
||||
|
||||
/**
|
||||
* Renderer capabilities.
|
||||
*/
|
||||
@@ -293,6 +302,11 @@ typedef struct bgfx_caps
|
||||
uint16_t maxViews; /* < Maximum views. */
|
||||
uint16_t maxDrawCalls; /* < Maximum draw calls. */
|
||||
uint8_t maxFBAttachments; /* < Maximum frame buffer attachments. */
|
||||
uint8_t numGPUs; /* < */
|
||||
|
||||
uint16_t vendorId; /* < */
|
||||
uint16_t deviceId; /* < */
|
||||
bgfx_caps_gpu_t gpu[4]; /* < */
|
||||
|
||||
/**
|
||||
* Supported texture formats.
|
||||
|
||||
@@ -315,6 +315,18 @@ namespace bgfx
|
||||
uint16_t maxViews; ///< Maximum views.
|
||||
uint16_t maxDrawCalls; ///< Maximum draw calls.
|
||||
uint8_t maxFBAttachments; ///< Maximum frame buffer attachments.
|
||||
uint8_t numGPUs; ///<
|
||||
|
||||
uint16_t vendorId; ///<
|
||||
uint16_t deviceId; ///<
|
||||
|
||||
struct GPU
|
||||
{
|
||||
uint16_t vendorId;
|
||||
uint16_t deviceId;
|
||||
};
|
||||
|
||||
GPU gpu[4]; ///<
|
||||
|
||||
/// Supported texture formats.
|
||||
/// - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported
|
||||
@@ -517,7 +529,7 @@ namespace bgfx
|
||||
///
|
||||
/// @attention C99 equivalent is `bgfx_init`.
|
||||
///
|
||||
void init(RendererType::Enum _type = RendererType::Count, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL);
|
||||
void init(RendererType::Enum _type = RendererType::Count, uint16_t _vendorId = BGFX_PCI_ID_NONE, uint16_t _deviceId = 0, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL);
|
||||
|
||||
/// Shutdown bgfx library.
|
||||
///
|
||||
|
||||
@@ -333,4 +333,10 @@
|
||||
#define BGFX_SUBMIT_EYE_MASK UINT8_C(0x03)
|
||||
#define BGFX_SUBMIT_EYE_FIRST BGFX_SUBMIT_EYE_LEFT
|
||||
|
||||
///
|
||||
#define BGFX_PCI_ID_NONE UINT16_C(0x0000)
|
||||
#define BGFX_PCI_ID_AMD UINT16_C(0x1002)
|
||||
#define BGFX_PCI_ID_INTEL UINT16_C(0x8086)
|
||||
#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de)
|
||||
|
||||
#endif // BGFX_DEFINES_H_HEADER_GUARD
|
||||
|
||||
Reference in New Issue
Block a user