mirror of https://github.com/bkaradzic/bgfx
Cleanup.
This commit is contained in:
parent
1c3e28fd9d
commit
0b3aec69a9
|
@ -3,6 +3,28 @@
|
|||
-- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
|
||||
--
|
||||
|
||||
function overridefiles(_srcPath, _dstPath, _files)
|
||||
|
||||
local remove = {}
|
||||
local add = {}
|
||||
for _, file in ipairs(_files) do
|
||||
file = path.getrelative(_srcPath, file)
|
||||
local filePath = path.join(BGFX_DIR, "../bgfx-ext", file)
|
||||
if not os.isfile(filePath) then print(filePath .. " not found") return end
|
||||
|
||||
table.insert(remove, path.join(_srcPath, file))
|
||||
table.insert(add, filePath)
|
||||
end
|
||||
|
||||
removefiles {
|
||||
remove,
|
||||
}
|
||||
|
||||
files {
|
||||
add,
|
||||
}
|
||||
end
|
||||
|
||||
function bgfxProject(_name, _kind, _defines)
|
||||
|
||||
project ("bgfx" .. _name)
|
||||
|
@ -129,6 +151,16 @@ function bgfxProject(_name, _kind, _defines)
|
|||
path.join(BGFX_DIR, "src/**.bin.h"),
|
||||
}
|
||||
|
||||
overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-ext"), {
|
||||
path.join(BGFX_DIR, "src/renderer_vk.cpp"),
|
||||
path.join(BGFX_DIR, "src/renderer_vk.h"),
|
||||
})
|
||||
|
||||
overridefiles(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-ext"), {
|
||||
path.join(BGFX_DIR, "src/renderer_gnm.cpp"),
|
||||
path.join(BGFX_DIR, "src/renderer_gnm.h"),
|
||||
})
|
||||
|
||||
if _OPTIONS["with-amalgamated"] then
|
||||
excludes {
|
||||
path.join(BGFX_DIR, "src/bgfx.cpp"),
|
||||
|
|
21
src/bgfx.cpp
21
src/bgfx.cpp
|
@ -1059,6 +1059,17 @@ namespace bgfx
|
|||
|
||||
static void dumpCaps()
|
||||
{
|
||||
BX_TRACE("");
|
||||
|
||||
RendererType::Enum renderers[RendererType::Count];
|
||||
uint8_t num = getSupportedRenderers(renderers);
|
||||
|
||||
BX_TRACE("Supported renderer backends (%d):", num);
|
||||
for (uint32_t ii = 0; ii < num; ++ii)
|
||||
{
|
||||
BX_TRACE("\t - %s", getRendererName(renderers[ii]) );
|
||||
}
|
||||
|
||||
BX_TRACE("");
|
||||
BX_TRACE("Sort key masks:");
|
||||
BX_TRACE("\t View %016" PRIx64, SORT_KEY_VIEW_MASK);
|
||||
|
@ -1710,6 +1721,11 @@ namespace bgfx
|
|||
{ 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
|
||||
#if BX_PLATFORM_PS4
|
||||
{ gnm::rendererCreate, gnm::rendererDestroy, BGFX_RENDERER_GNM_NAME, !!BGFX_CONFIG_RENDERER_GNM }, // GNM
|
||||
#else
|
||||
{ noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NOOP_NAME, !!BGFX_CONFIG_RENDERER_NOOP }, // Noop
|
||||
#endif // BX_PLATFORM_PS4
|
||||
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
|
||||
{ mtl::rendererCreate, mtl::rendererDestroy, BGFX_RENDERER_METAL_NAME, !!BGFX_CONFIG_RENDERER_METAL }, // Metal
|
||||
#else
|
||||
|
@ -1718,11 +1734,6 @@ 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_NOOP_NAME, !!BGFX_CONFIG_RENDERER_NOOP }, // Noop
|
||||
#endif // BX_PLATFORM_PS4
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
|
||||
|
||||
|
|
|
@ -73,7 +73,11 @@
|
|||
# endif // BGFX_CONFIG_RENDERER_OPENGLES
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_VULKAN
|
||||
# define BGFX_CONFIG_RENDERER_VULKAN 0
|
||||
# define BGFX_CONFIG_RENDERER_VULKAN (0 \
|
||||
|| BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_LINUX \
|
||||
|| BX_PLATFORM_WINDOWS \
|
||||
? 1 : 0)
|
||||
# endif // BGFX_CONFIG_RENDERER_VULKAN
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_GNM
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "bgfx_p.h"
|
||||
|
||||
#if BGFX_CONFIG_RENDERER_GNM
|
||||
# include "../../bgfx-ext/src/renderer_gnm1.cpp"
|
||||
#else
|
||||
|
||||
namespace bgfx { namespace gnm
|
||||
{
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "bgfx_p.h"
|
||||
|
||||
#if BGFX_CONFIG_RENDERER_VULKAN
|
||||
# include "../../bgfx-ext/src/renderer_vk1.cpp"
|
||||
#else
|
||||
|
||||
namespace bgfx { namespace vk
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue