Browse Source

Added GNM renderer stub.

Branimir Karadžić 9 years ago
parent
commit
55dc1e2168
8 changed files with 21 additions and 1 deletions
  1. 1 0
      include/bgfx/bgfx.h
  2. 1 1
      include/bgfx/bgfxdefines.h
  3. 1 0
      include/bgfx/c99/bgfx.h
  4. 1 0
      src/amalgamated.cpp
  5. 5 0
      src/bgfx.cpp
  6. 1 0
      src/bgfx_p.h
  7. 10 0
      src/config.h
  8. 1 0
      src/vertexdecl.cpp

+ 1 - 0
include/bgfx/bgfx.h

@@ -60,6 +60,7 @@ namespace bgfx
 			OpenGLES,     //!< OpenGL ES 2.0+
 			OpenGL,       //!< OpenGL 2.1+
 			Vulkan,       //!< Vulkan
+			GNM,          //!< GNM
 
 			Count
 		};

+ 1 - 1
include/bgfx/bgfxdefines.h

@@ -6,7 +6,7 @@
 #ifndef BGFX_DEFINES_H_HEADER_GUARD
 #define BGFX_DEFINES_H_HEADER_GUARD
 
-#define BGFX_API_VERSION UINT32_C(21)
+#define BGFX_API_VERSION UINT32_C(22)
 
 ///
 #define BGFX_STATE_RGB_WRITE               UINT64_C(0x0000000000000001) //!< Enable RGB write.

+ 1 - 0
include/bgfx/c99/bgfx.h

@@ -51,6 +51,7 @@ typedef enum bgfx_renderer_type
     BGFX_RENDERER_TYPE_OPENGLES,
     BGFX_RENDERER_TYPE_OPENGL,
     BGFX_RENDERER_TYPE_VULKAN,
+    BGFX_RENDERER_TYPE_GNM,
 
     BGFX_RENDERER_TYPE_COUNT
 

+ 1 - 0
src/amalgamated.cpp

@@ -19,6 +19,7 @@
 #include "renderer_null.cpp"
 #include "renderer_gl.cpp"
 #include "renderer_vk.cpp"
+#include "renderer_gnm.cpp"
 #include "shader_dxbc.cpp"
 #include "shader_dx9bc.cpp"
 #include "shader_spirv.cpp"

+ 5 - 0
src/bgfx.cpp

@@ -1779,6 +1779,11 @@ namespace bgfx
 		{ gl::rendererCreate,    gl::rendererDestroy,    BGFX_RENDERER_OPENGL_NAME,     !!BGFX_CONFIG_RENDERER_OPENGLES   }, // OpenGLES
 		{ gl::rendererCreate,    gl::rendererDestroy,    BGFX_RENDERER_OPENGL_NAME,     !!BGFX_CONFIG_RENDERER_OPENGL     }, // OpenGL
 		{ vk::rendererCreate,    vk::rendererDestroy,    BGFX_RENDERER_VULKAN_NAME,     !!BGFX_CONFIG_RENDERER_VULKAN     }, // Vulkan
+#if BX_PLATFORM_PS4
+		{ gnm::rendererCreate,   gnm::rendererDestroy,   BGFX_RENDERER_GNM_NAME,        !!BGFX_CONFIG_RENDERER_GNM        }, // GNM
+#else
+		{ noop::rendererCreate,  noop::rendererDestroy,  BGFX_RENDERER_NULL_NAME,       !!BGFX_CONFIG_RENDERER_NULL       }, // Noop
+#endif // BX_PLATFORM_PS4
 	};
 	BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
 

+ 1 - 0
src/bgfx_p.h

@@ -220,6 +220,7 @@ namespace stl
 #define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12"
 #define BGFX_RENDERER_METAL_NAME      "Metal"
 #define BGFX_RENDERER_VULKAN_NAME     "Vulkan"
+#define BGFX_RENDERER_GNM_NAME        "GNM"
 #define BGFX_RENDERER_NULL_NAME       "NULL"
 
 #if BGFX_CONFIG_RENDERER_OPENGL

+ 10 - 0
src/config.h

@@ -19,6 +19,7 @@
 	&& !defined(BGFX_CONFIG_RENDERER_OPENGL) \
 	&& !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
 	&& !defined(BGFX_CONFIG_RENDERER_VULKAN) \
+	&& !defined(BGFX_CONFIG_RENDERER_GNM) \
 	&& !defined(BGFX_CONFIG_RENDERER_NULL)
 
 #	ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
@@ -75,6 +76,10 @@
 #		define BGFX_CONFIG_RENDERER_VULKAN 0
 #	endif // BGFX_CONFIG_RENDERER_VULKAN
 
+#	ifndef BGFX_CONFIG_RENDERER_GNM
+#		define BGFX_CONFIG_RENDERER_GNM 0
+#	endif // BGFX_CONFIG_RENDERER_GNM
+
 #	ifndef BGFX_CONFIG_RENDERER_NULL
 #		define BGFX_CONFIG_RENDERER_NULL (!(0 \
 					|| BGFX_CONFIG_RENDERER_DIRECT3D9 \
@@ -84,6 +89,7 @@
 					|| BGFX_CONFIG_RENDERER_OPENGL \
 					|| BGFX_CONFIG_RENDERER_OPENGLES \
 					|| BGFX_CONFIG_RENDERER_VULKAN \
+					|| BGFX_CONFIG_RENDERER_GNM \
 					? 1 : 0) )
 #	endif // BGFX_CONFIG_RENDERER_NULL
 #else
@@ -115,6 +121,10 @@
 #		define BGFX_CONFIG_RENDERER_VULKAN 0
 #	endif // BGFX_CONFIG_RENDERER_VULKAN
 
+#	ifndef BGFX_CONFIG_RENDERER_GNM
+#		define BGFX_CONFIG_RENDERER_GNM 0
+#	endif // BGFX_CONFIG_RENDERER_GNM
+
 #	ifndef BGFX_CONFIG_RENDERER_NULL
 #		define BGFX_CONFIG_RENDERER_NULL 0
 #	endif // BGFX_CONFIG_RENDERER_NULL

+ 1 - 0
src/vertexdecl.cpp

@@ -53,6 +53,7 @@ namespace bgfx
 		&s_attribTypeSizeGl,   // OpenGLES
 		&s_attribTypeSizeGl,   // OpenGL
 		&s_attribTypeSizeGl,   // Vulkan
+		&s_attribTypeSizeGl,   // GNM
 		&s_attribTypeSizeDx9,  // Count
 	};
 	BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1);