Просмотр исходного кода

Build support for NX platform (#1257)

* NX platform supports GLES and Vulkan

* These defines are already set on NX
Codecat 8 лет назад
Родитель
Сommit
c707e06d79
3 измененных файлов с 12 добавлено и 4 удалено
  1. 2 1
      scripts/bgfx.lua
  2. 2 0
      src/config.h
  3. 8 3
      src/renderer_gl.h

+ 2 - 1
scripts/bgfx.lua

@@ -143,10 +143,11 @@ function bgfxProject(_name, _kind, _defines)
 				"-weak_framework MetalKit",
 				"-weak_framework MetalKit",
 			}
 			}
 
 
-		configuration { "not nacl", "not linux-steamlink" }
+		configuration { "not nacl", "not linux-steamlink", "not NX32", "not NX64" }
 			includedirs {
 			includedirs {
 				--nacl has GLES2 headers modified...
 				--nacl has GLES2 headers modified...
 				--steamlink has EGL headers modified...
 				--steamlink has EGL headers modified...
+				--NX has EGL headers modified...
 				path.join(BGFX_DIR, "3rdparty/khronos"),
 				path.join(BGFX_DIR, "3rdparty/khronos"),
 			}
 			}
 
 

+ 2 - 0
src/config.h

@@ -66,6 +66,7 @@
 					|| BX_PLATFORM_QNX \
 					|| BX_PLATFORM_QNX \
 					|| BX_PLATFORM_RPI \
 					|| BX_PLATFORM_RPI \
 					|| BX_PLATFORM_STEAMLINK \
 					|| BX_PLATFORM_STEAMLINK \
+					|| BX_PLATFORM_NX \
 					? 1 : 0)
 					? 1 : 0)
 #	endif // BGFX_CONFIG_RENDERER_OPENGLES
 #	endif // BGFX_CONFIG_RENDERER_OPENGLES
 
 
@@ -74,6 +75,7 @@
 					|| BX_PLATFORM_ANDROID \
 					|| BX_PLATFORM_ANDROID \
 					|| BX_PLATFORM_LINUX \
 					|| BX_PLATFORM_LINUX \
 					|| BX_PLATFORM_WINDOWS \
 					|| BX_PLATFORM_WINDOWS \
+					|| BX_PLATFORM_NX \
 					? 1 : 0)
 					? 1 : 0)
 #	endif // BGFX_CONFIG_RENDERER_VULKAN
 #	endif // BGFX_CONFIG_RENDERER_VULKAN
 
 

+ 8 - 3
src/renderer_gl.h

@@ -15,6 +15,7 @@
 			|| BX_PLATFORM_RPI \
 			|| BX_PLATFORM_RPI \
 			|| BX_PLATFORM_STEAMLINK \
 			|| BX_PLATFORM_STEAMLINK \
 			|| BX_PLATFORM_WINDOWS \
 			|| BX_PLATFORM_WINDOWS \
+			|| BX_PLATFORM_NX \
 			) )
 			) )
 
 
 #define BGFX_USE_WGL (BGFX_CONFIG_RENDERER_OPENGL && BX_PLATFORM_WINDOWS)
 #define BGFX_USE_WGL (BGFX_CONFIG_RENDERER_OPENGL && BX_PLATFORM_WINDOWS)
@@ -82,11 +83,15 @@ typedef uint64_t GLuint64;
 #		define GL_HALF_FLOAT GL_HALF_FLOAT_OES
 #		define GL_HALF_FLOAT GL_HALF_FLOAT_OES
 #		define GL_RGBA8 GL_RGBA8_OES
 #		define GL_RGBA8 GL_RGBA8_OES
 #		define GL_UNSIGNED_INT_2_10_10_10_REV GL_UNSIGNED_INT_2_10_10_10_REV_EXT
 #		define GL_UNSIGNED_INT_2_10_10_10_REV GL_UNSIGNED_INT_2_10_10_10_REV_EXT
-#		define GL_TEXTURE_3D GL_TEXTURE_3D_OES
+#		ifndef BX_PLATFORM_NX
+#			define GL_TEXTURE_3D GL_TEXTURE_3D_OES
+#		endif
 #		define GL_SAMPLER_3D GL_SAMPLER_3D_OES
 #		define GL_SAMPLER_3D GL_SAMPLER_3D_OES
 #		define GL_TEXTURE_WRAP_R GL_TEXTURE_WRAP_R_OES
 #		define GL_TEXTURE_WRAP_R GL_TEXTURE_WRAP_R_OES
-#		define GL_MIN GL_MIN_EXT
-#		define GL_MAX GL_MAX_EXT
+#		ifndef BX_PLATFORM_NX
+#			define GL_MIN GL_MIN_EXT
+#			define GL_MAX GL_MAX_EXT
+#		endif
 #		define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
 #		define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
 #		define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
 #		define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
 #		define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES
 #		define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES