Added AGC renderer stub.
This commit is contained in:
parent
ec7cb7608e
commit
ee0fbea726
@ -1334,6 +1334,11 @@ public static class bgfx
|
||||
/// </summary>
|
||||
Noop,
|
||||
|
||||
/// <summary>
|
||||
/// AGC
|
||||
/// </summary>
|
||||
Agc,
|
||||
|
||||
/// <summary>
|
||||
/// Direct3D 9.0
|
||||
/// </summary>
|
||||
|
@ -1331,6 +1331,11 @@ public static partial class bgfx
|
||||
/// </summary>
|
||||
Noop,
|
||||
|
||||
/// <summary>
|
||||
/// AGC
|
||||
/// </summary>
|
||||
Agc,
|
||||
|
||||
/// <summary>
|
||||
/// Direct3D 9.0
|
||||
/// </summary>
|
||||
|
@ -427,6 +427,7 @@ enum bgfx_fatal_t
|
||||
enum bgfx_renderer_type_t
|
||||
{
|
||||
BGFX_RENDERER_TYPE_NOOP, /// No rendering.
|
||||
BGFX_RENDERER_TYPE_AGC, /// AGC
|
||||
BGFX_RENDERER_TYPE_DIRECT3D9, /// Direct3D 9.0
|
||||
BGFX_RENDERER_TYPE_DIRECT3D11, /// Direct3D 11.0
|
||||
BGFX_RENDERER_TYPE_DIRECT3D12, /// Direct3D 12.0
|
||||
|
@ -108,6 +108,7 @@ static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const char* _name
|
||||
case bgfx::RendererType::Direct3D9: shaderPath = "shaders/dx9/"; break;
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12: shaderPath = "shaders/dx11/"; break;
|
||||
case bgfx::RendererType::Agc:
|
||||
case bgfx::RendererType::Gnm: shaderPath = "shaders/pssl/"; break;
|
||||
case bgfx::RendererType::Metal: shaderPath = "shaders/metal/"; break;
|
||||
case bgfx::RendererType::Nvn: shaderPath = "shaders/nvn/"; break;
|
||||
|
@ -52,6 +52,7 @@ namespace bgfx
|
||||
enum Enum
|
||||
{
|
||||
Noop, //!< No rendering.
|
||||
Agc, //!< AGC
|
||||
Direct3D9, //!< Direct3D 9.0
|
||||
Direct3D11, //!< Direct3D 11.0
|
||||
Direct3D12, //!< Direct3D 12.0
|
||||
|
@ -81,16 +81,17 @@ typedef enum bgfx_fatal
|
||||
typedef enum bgfx_renderer_type
|
||||
{
|
||||
BGFX_RENDERER_TYPE_NOOP, /** ( 0) No rendering. */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D9, /** ( 1) Direct3D 9.0 */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D11, /** ( 2) Direct3D 11.0 */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D12, /** ( 3) Direct3D 12.0 */
|
||||
BGFX_RENDERER_TYPE_GNM, /** ( 4) GNM */
|
||||
BGFX_RENDERER_TYPE_METAL, /** ( 5) Metal */
|
||||
BGFX_RENDERER_TYPE_NVN, /** ( 6) NVN */
|
||||
BGFX_RENDERER_TYPE_OPENGLES, /** ( 7) OpenGL ES 2.0+ */
|
||||
BGFX_RENDERER_TYPE_OPENGL, /** ( 8) OpenGL 2.1+ */
|
||||
BGFX_RENDERER_TYPE_VULKAN, /** ( 9) Vulkan */
|
||||
BGFX_RENDERER_TYPE_WEBGPU, /** (10) WebGPU */
|
||||
BGFX_RENDERER_TYPE_AGC, /** ( 1) AGC */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D9, /** ( 2) Direct3D 9.0 */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D11, /** ( 3) Direct3D 11.0 */
|
||||
BGFX_RENDERER_TYPE_DIRECT3D12, /** ( 4) Direct3D 12.0 */
|
||||
BGFX_RENDERER_TYPE_GNM, /** ( 5) GNM */
|
||||
BGFX_RENDERER_TYPE_METAL, /** ( 6) Metal */
|
||||
BGFX_RENDERER_TYPE_NVN, /** ( 7) NVN */
|
||||
BGFX_RENDERER_TYPE_OPENGLES, /** ( 8) OpenGL ES 2.0+ */
|
||||
BGFX_RENDERER_TYPE_OPENGL, /** ( 9) OpenGL 2.1+ */
|
||||
BGFX_RENDERER_TYPE_VULKAN, /** (10) Vulkan */
|
||||
BGFX_RENDERER_TYPE_WEBGPU, /** (11) WebGPU */
|
||||
|
||||
BGFX_RENDERER_TYPE_COUNT
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
)
|
||||
#define BGFX_PLATFORM_SUPPORTS_PSSL (0 \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_PS5 \
|
||||
)
|
||||
#define BGFX_PLATFORM_SUPPORTS_ESSL (0 \
|
||||
|| BX_PLATFORM_ANDROID \
|
||||
|
@ -450,6 +450,7 @@ enum.Fatal { underscore, comment = "" }
|
||||
--- Renderer backend type enum.
|
||||
enum.RendererType { comment = "Renderer types:" }
|
||||
.Noop --- No rendering.
|
||||
.Agc --- AGC
|
||||
.Direct3D9 --- Direct3D 9.0
|
||||
.Direct3D11 --- Direct3D 11.0
|
||||
.Direct3D12 --- Direct3D 12.0
|
||||
|
@ -171,6 +171,11 @@ function bgfxProjectBase(_kind, _defines)
|
||||
path.join(BGFX_DIR, "src/**.bin.h"),
|
||||
}
|
||||
|
||||
overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-agc"), {
|
||||
path.join(BGFX_DIR, "src/renderer_agc.cpp"),
|
||||
path.join(BGFX_DIR, "src/renderer_agc.h"),
|
||||
})
|
||||
|
||||
overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"), {
|
||||
path.join(BGFX_DIR, "src/renderer_gnm.cpp"),
|
||||
path.join(BGFX_DIR, "src/renderer_gnm.h"),
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "glcontext_wgl.cpp"
|
||||
#include "glcontext_html5.cpp"
|
||||
#include "nvapi.cpp"
|
||||
#include "renderer_agc.cpp"
|
||||
#include "renderer_d3d11.cpp"
|
||||
#include "renderer_d3d12.cpp"
|
||||
#include "renderer_d3d9.cpp"
|
||||
|
@ -2584,6 +2584,7 @@ namespace bgfx
|
||||
}
|
||||
|
||||
BGFX_RENDERER_CONTEXT(noop);
|
||||
BGFX_RENDERER_CONTEXT(agc);
|
||||
BGFX_RENDERER_CONTEXT(d3d9);
|
||||
BGFX_RENDERER_CONTEXT(d3d11);
|
||||
BGFX_RENDERER_CONTEXT(d3d12);
|
||||
@ -2607,6 +2608,7 @@ namespace bgfx
|
||||
static RendererCreator s_rendererCreator[] =
|
||||
{
|
||||
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, true }, // Noop
|
||||
{ agc::rendererCreate, agc::rendererDestroy, BGFX_RENDERER_AGC_NAME, !!BGFX_CONFIG_RENDERER_AGC }, // GNM
|
||||
{ d3d9::rendererCreate, d3d9::rendererDestroy, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9
|
||||
{ d3d11::rendererCreate, d3d11::rendererDestroy, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11
|
||||
{ d3d12::rendererCreate, d3d12::rendererDestroy, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12
|
||||
|
@ -245,6 +245,8 @@ namespace stl = std;
|
||||
#define BGFX_SUBMIT_INTERNAL_OCCLUSION_VISIBLE UINT8_C(0x80)
|
||||
#define BGFX_SUBMIT_INTERNAL_RESERVED_MASK UINT8_C(0xff)
|
||||
|
||||
#define BGFX_RENDERER_NOOP_NAME "Noop"
|
||||
#define BGFX_RENDERER_AGC_NAME "AGC"
|
||||
#define BGFX_RENDERER_DIRECT3D9_NAME "Direct3D 9"
|
||||
#define BGFX_RENDERER_DIRECT3D11_NAME "Direct3D 11"
|
||||
#define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12"
|
||||
@ -253,7 +255,6 @@ namespace stl = std;
|
||||
#define BGFX_RENDERER_NVN_NAME "NVN"
|
||||
#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
|
||||
#define BGFX_RENDERER_WEBGPU_NAME "WebGPU"
|
||||
#define BGFX_RENDERER_NOOP_NAME "Noop"
|
||||
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL
|
||||
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33
|
||||
|
13
src/config.h
13
src/config.h
@ -19,7 +19,8 @@
|
||||
# define BGFX_CONFIG_DEBUG 0
|
||||
#endif // BGFX_CONFIG_DEBUG
|
||||
|
||||
#if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \
|
||||
#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) \
|
||||
@ -30,6 +31,12 @@
|
||||
&& !defined(BGFX_CONFIG_RENDERER_VULKAN) \
|
||||
&& !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_WINDOWS \
|
||||
@ -116,6 +123,10 @@
|
||||
# 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
|
||||
|
20
src/renderer_agc.cpp
Normal file
20
src/renderer_agc.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2011-2021 Branimir Karadzic. All rights reserved.
|
||||
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
|
||||
*/
|
||||
|
||||
#include "bgfx_p.h"
|
||||
|
||||
namespace bgfx { namespace agc
|
||||
{
|
||||
RendererContextI* rendererCreate(const Init& _init)
|
||||
{
|
||||
BX_UNUSED(_init);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void rendererDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
} /* namespace agc */ } // namespace bgfx
|
@ -8,12 +8,12 @@
|
||||
namespace bgfx
|
||||
{
|
||||
|
||||
#define BGFX_DECLARE_EMBEDDED_SHADER(_name) \
|
||||
extern const uint8_t* BX_CONCATENATE(_name, _pssl); \
|
||||
extern const uint32_t BX_CONCATENATE(_name, _pssl_size); \
|
||||
static const uint8_t BX_CONCATENATE(_name, _int_pssl)[] = { 0 }; \
|
||||
const uint8_t* BX_CONCATENATE(_name, _pssl) = &BX_CONCATENATE(_name, _int_pssl)[0]; \
|
||||
const uint32_t BX_CONCATENATE(_name, _pssl_size) = 1
|
||||
#define BGFX_DECLARE_EMBEDDED_SHADER(_name) \
|
||||
extern const uint8_t* BX_CONCATENATE(_name, _pssl); \
|
||||
extern const uint32_t BX_CONCATENATE(_name, _pssl_size); \
|
||||
static const uint8_t BX_CONCATENATE(_name, _int_pssl)[] = { 0 }; \
|
||||
const uint8_t* BX_CONCATENATE(_name, _pssl) = &BX_CONCATENATE(_name, _int_pssl)[0]; \
|
||||
const uint32_t BX_CONCATENATE(_name, _pssl_size) = 1
|
||||
|
||||
BGFX_DECLARE_EMBEDDED_SHADER(vs_debugfont);
|
||||
BGFX_DECLARE_EMBEDDED_SHADER(fs_debugfont);
|
||||
@ -42,4 +42,5 @@ namespace bgfx { namespace gnm
|
||||
void rendererDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
} /* namespace gnm */ } // namespace bgfx
|
||||
|
@ -8,10 +8,10 @@
|
||||
namespace bgfx
|
||||
{
|
||||
|
||||
#define BGFX_DECLARE_EMBEDDED_SHADER(_name) \
|
||||
extern const uint8_t* BX_CONCATENATE(_name, _nvn); \
|
||||
extern const uint32_t BX_CONCATENATE(_name, _nvn_size); \
|
||||
static const uint8_t BX_CONCATENATE(_name, _int_nvn)[] = { 0 }; \
|
||||
#define BGFX_DECLARE_EMBEDDED_SHADER(_name) \
|
||||
extern const uint8_t* BX_CONCATENATE(_name, _nvn); \
|
||||
extern const uint32_t BX_CONCATENATE(_name, _nvn_size); \
|
||||
static const uint8_t BX_CONCATENATE(_name, _int_nvn)[] = { 0 }; \
|
||||
const uint8_t* BX_CONCATENATE(_name, _nvn) = &BX_CONCATENATE(_name, _int_nvn)[0]; \
|
||||
const uint32_t BX_CONCATENATE(_name, _nvn_size) = 1
|
||||
|
||||
@ -42,4 +42,5 @@ namespace bgfx { namespace nvn
|
||||
void rendererDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
} /* namespace nvn */ } // namespace bgfx
|
||||
|
@ -44,6 +44,7 @@ namespace bgfx
|
||||
static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] =
|
||||
{
|
||||
&s_attribTypeSizeD3D9, // Noop
|
||||
&s_attribTypeSizeD3D1x, // Agc
|
||||
&s_attribTypeSizeD3D9, // Direct3D9
|
||||
&s_attribTypeSizeD3D1x, // Direct3D11
|
||||
&s_attribTypeSizeD3D1x, // Direct3D12
|
||||
|
Loading…
x
Reference in New Issue
Block a user