summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-02-28 07:52:28 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-02-28 07:52:28 +0100
commitabb3442fe62fe2ee81b35b7f98ca371fae468bff (patch)
treea9ca70ec681fda082e47c294203d25581bbc1643
parent2e294961b4e1a26640633a371264dd3438cc7ddb (diff)
update libs to latest (nw)
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp2
-rw-r--r--3rdparty/bgfx/README.md4
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp7
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h79
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc6
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp6
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp2
-rw-r--r--3rdparty/bgfx/include/bgfx.c99.h5
-rw-r--r--3rdparty/bgfx/include/bgfx.h14
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua18
-rw-r--r--3rdparty/bgfx/scripts/example-common.lua18
-rw-r--r--3rdparty/bgfx/scripts/genie.lua38
-rw-r--r--3rdparty/bgfx/scripts/geometryc.lua24
-rw-r--r--3rdparty/bgfx/scripts/makedisttex.lua10
-rw-r--r--3rdparty/bgfx/scripts/shaderc.lua78
-rw-r--r--3rdparty/bgfx/scripts/texturec.lua12
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp79
-rw-r--r--3rdparty/bgfx/src/bgfx_compute.sh43
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h150
-rw-r--r--3rdparty/bgfx/src/bgfx_shader.sh7
-rw-r--r--3rdparty/bgfx/src/config.h2
-rw-r--r--3rdparty/bgfx/src/glimports.h2
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp9
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp23
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h22
-rw-r--r--3rdparty/bx/scripts/genie.lua16
-rw-r--r--3rdparty/bx/scripts/toolchain.lua258
-rw-r--r--3rdparty/genie/README.md11
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua4
-rw-r--r--3rdparty/genie/src/base/api.lua7
-rw-r--r--3rdparty/genie/src/base/bake.lua6
-rw-r--r--3rdparty/genie/src/host/scripts.c58
-rw-r--r--3rdparty/mongoose/docs/API.md14
-rw-r--r--3rdparty/mongoose/docs/LuaSqlite.md51
-rw-r--r--3rdparty/mongoose/mongoose.c63
37 files changed, 652 insertions, 502 deletions
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index 7c86ebeb055..349868a9603 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -1809,7 +1809,7 @@ void ImGui::NewFrame()
g.CurrentWindowStack.resize(0);
// Create implicit window - we will only render it if the user has added something to it.
- ImGui::Begin("Debug", NULL, ImVec2(400,400));
+ ImGui::Begin("Debug", NULL, ImVec2(400,400), -1.0f, ImGuiWindowFlags_NoSavedSettings);
}
// NB: behaviour of ImGui after Shutdown() is not tested/guaranteed at the moment. This function is merely here to free heap allocations.
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index e49f6a7bc5f..1a43695d180 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -69,9 +69,9 @@ very early development and primary focusing on Mac as primary target. This is
how it currently looks.
![mac_screenshot](https://raw.githubusercontent.com/emoon/ProDBG/master/data/screens/mac_screenshot.png)
-
http://www.dogbytegames.com/ Dogbyte Games is an indie mobile developer studio
-focusing on racing games.
+focusing on racing games.
+![ios](http://www.dogbytegames.com/bgfx/offroadlegends2_bgfx_ipad2.jpg)
Examples
--------
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
index 202f03d7561..1c094cf4576 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
@@ -123,6 +123,11 @@ void VectorDisplay::resize(uint16_t _width, uint16_t _height)
void VectorDisplay::teardown()
{
+ for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
+ {
+ bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
+ }
+
teardownResDependent();
bgfx::destroyProgram(m_drawToScreenShader);
@@ -728,7 +733,7 @@ bool VectorDisplay::setDecaySteps(int _steps)
{
for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
{
- destroyDynamicVertexBuffer(m_vertexBuffers[i]);
+ bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
}
m_vertexBuffers.clear();
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
index e98e50da499..af5646500a1 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
@@ -1,9 +1,9 @@
-static const uint8_t fs_imgui_latlong_glsl[646] =
+static const uint8_t fs_imgui_latlong_glsl[649] =
{
0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
- 0x00, 0x01, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...N...varying h
+ 0x00, 0x01, 0x00, 0x51, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...Q...varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
@@ -21,32 +21,32 @@ static const uint8_t fs_imgui_latlong_glsl[646] =
0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_3 = (v_
0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);. result
- 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // _1.x = (sin(tmpv
- 0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, // ar_3) * cos(tmpv
- 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // ar_2));. result
- 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _1.y = cos(tmpva
- 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, // r_3);. result_1
- 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // .z = (-(sin(tmpv
- 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, // ar_3)) * sin(tmp
- 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // var_2));. lowp
- 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec4 tmpvar_4;.
- 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_4.xyz =
- 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, // textureCubeLod
- 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, // (s_texColor, r
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, // esult_1, u_image
- 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, // LodEnabled.x).xy
- 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;. tmpvar_4.w
- 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, // = (0.2 + (0.8 *
- 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
- 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // d.y));. gl_Frag
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // Color = tmpvar_4
- 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}...
+ 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, // _1.x = (-(sin(tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, // pvar_3)) * sin(t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, // mpvar_2));. res
+ 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, // ult_1.y = cos(tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // pvar_3);. resul
+ 0x74, 0x5f, 0x31, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, // t_1.z = (-(sin(t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, // mpvar_3)) * cos(
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // tmpvar_2));. lo
+ 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // wp vec4 tmpvar_4
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, // ;. tmpvar_4.xyz
+ 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // = textureCubeLo
+ 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // d (s_texColor
+ 0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, // , result_1, u_im
+ 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, // ageLodEnabled.x)
+ 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // .xyz;. tmpvar_4
+ 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8
+ 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // * u_imageLodEna
+ 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));. gl_F
+ 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
+ 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_4;.}...
};
-static const uint8_t fs_imgui_latlong_dx9[553] =
+static const uint8_t fs_imgui_latlong_dx9[537] =
{
0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x04, 0x02, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
+ 0x01, 0x00, 0xf4, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
@@ -71,8 +71,7 @@ static const uint8_t fs_imgui_latlong_dx9[553] =
0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0x80, // ..............U.
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0x81, // ..........U...U.
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, 0x80, 0x02, 0x00, 0x55, 0x81, // ..............U.
0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
@@ -84,8 +83,8 @@ static const uint8_t fs_imgui_latlong_dx11[600] =
{
0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x00, 0x30, 0x0a, // geLodEnabled..0.
- 0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x89, 0x11, 0x25, 0xa6, 0xf5, 0x66, 0x12, 0x3f, // ..0.DXBC..%..f.?
- 0xc0, 0x1f, 0x67, 0x9b, 0x6e, 0x4e, 0xac, 0x03, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // ..g.nN......0...
+ 0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0xbb, 0x3e, 0xd7, 0x3a, 0x63, 0xc9, 0x70, 0x0b, // ..0.DXBC.>.:c.p.
+ 0xa5, 0x2c, 0x7d, 0xb2, 0x3c, 0x0c, 0x75, 0x44, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // .,}.<.uD....0...
0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
@@ -101,19 +100,19 @@ static const uint8_t fs_imgui_latlong_dx11[600] =
0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X0...p..
0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@..
- 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@..I@........
- 0x4d, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
- 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, // ....A.......M...
- 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x16, 0x05, 0x10, 0x00, // 2...............
+ 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
+ 0x00, 0x00, 0x00, 0x00, 0x16, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@..
+ 0xdb, 0x0f, 0x49, 0x40, 0xdb, 0x0f, 0xc9, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..I@...@........
+ 0x4d, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
+ 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // ........M.......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A...
0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, 0x00, // ....M.......b...
- 0x02, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
- 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
- 0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........8.......
- 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
- 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
- 0x86, 0x03, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F~......
+ 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
+ 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
+ 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // :.......8.......
+ 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....:.......*...
+ 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
+ 0x46, 0x03, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F~......
0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
0xa3, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
index 694e2dae67b..a370f12f176 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
@@ -18,12 +18,12 @@ vec3 vecFromLatLong(vec2 _uv)
float pi = 3.14159265;
float twoPi = 2.0*pi;
float phi = _uv.x * twoPi;
- float theta = _uv.y *pi;
+ float theta = _uv.y * pi;
vec3 result;
- result.x = sin(theta)*cos(phi);
+ result.x = -sin(theta)*sin(phi);
result.y = cos(theta);
- result.z = -sin(theta)*sin(phi);
+ result.z = -sin(theta)*cos(phi);
return result;
}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 9e8039d3958..7fa19965b07 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -387,7 +387,7 @@ struct Imgui
, m_textureHeight(512)
, m_halfTexel(0.0f)
, m_nvg(NULL)
- , m_view(31)
+ , m_view(255)
, m_viewWidth(0)
, m_viewHeight(0)
, m_currentFontIdx(0)
@@ -2023,7 +2023,7 @@ struct Imgui
xx = -borderSize;
yy = -1;
width = 2*borderSize+1;
- height = m_viewHeight;
+ height = m_viewHeight+1;
triX = 0;
triY = (m_viewHeight-triSize)/2;
orientation = _checked ? TriangleOrientation::Left : TriangleOrientation::Right;
@@ -2033,7 +2033,7 @@ struct Imgui
xx = m_viewWidth - borderSize;
yy = -1;
width = 2*borderSize+1;
- height = m_viewHeight;
+ height = m_viewHeight+1;
triX = m_viewWidth - triSize - 2;
triY = (m_viewHeight-width)/2;
orientation = _checked ? TriangleOrientation::Right : TriangleOrientation::Left;
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index 01f3c90e27b..ba99291a7f7 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -136,7 +136,7 @@ ImguiFontHandle imguiGetCurrentFont();
ImguiFontHandle imguiCreate(const void* _data = NULL, uint32_t _size = 0, float _fontSize = 15.0f);
void imguiDestroy();
-void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 31);
+void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 255);
void imguiEndFrame();
void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb);
diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
index 9df3b28c62b..e77b58a59e7 100644
--- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
@@ -81,7 +81,7 @@ struct OcornutImguiContext
void create(const void* _data, uint32_t _size, float _fontSize)
{
- m_viewId = 31;
+ m_viewId = 255;
ImGuiIO& io = ImGui::GetIO();
io.DisplaySize = ImVec2(1280.0f, 720.0f);
diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h
index f5a6fa7b053..7e038e4b7c5 100644
--- a/3rdparty/bgfx/include/bgfx.c99.h
+++ b/3rdparty/bgfx/include/bgfx.c99.h
@@ -287,6 +287,7 @@ typedef struct bgfx_caps
uint64_t supported;
uint16_t maxTextureSize; /* < Maximum texture size. */
+ uint16_t maxViews; /* < Maximum views. */
uint16_t maxDrawCalls; /* < Maximum draw calls. */
uint8_t maxFBAttachments; /* < Maximum frame buffer attachments. */
@@ -1358,12 +1359,12 @@ BGFX_C_API uint32_t bgfx_submit(uint8_t _id, int32_t _depth);
/**
*
*/
-BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_texture_format_t _format, bgfx_access_t _access);
+BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
*
*/
-BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_texture_format_t _format, bgfx_access_t _access);
+BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
* Dispatch compute.
diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h
index 3ac048888a6..84ad172de03 100644
--- a/3rdparty/bgfx/include/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx.h
@@ -310,6 +310,7 @@ namespace bgfx
uint64_t supported;
uint16_t maxTextureSize; ///< Maximum texture size.
+ uint16_t maxViews; ///< Maximum views.
uint16_t maxDrawCalls; ///< Maximum draw calls.
uint8_t maxFBAttachments; ///< Maximum frame buffer attachments.
@@ -1098,6 +1099,15 @@ namespace bgfx
/// view will use these matrices.
void setViewTransform(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags = BGFX_VIEW_STEREO, const void* _projR = NULL);
+ /// Post submit view reordering.
+ ///
+ /// @param _id First view id.
+ /// @param _num Number of views to remap.
+ /// @param _remap View remap id table. Passing `NULL` will reset view ids
+ /// to default state.
+ ///
+ void setViewRemap(uint8_t _id = 0, uint8_t _num = UINT8_MAX, const void* _remap = NULL);
+
/// Sets debug marker.
void setMarker(const char* _marker);
@@ -1273,10 +1283,10 @@ namespace bgfx
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access);
///
- void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access);
+ void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
///
- void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access);
+ void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
/// Dispatch compute.
void dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX = 1, uint16_t _numY = 1, uint16_t _numZ = 1, uint8_t _flags = BGFX_SUBMIT_EYE_FIRST);
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index c42d57f0194..82fcad846b3 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -29,8 +29,8 @@ function bgfxProject(_name, _kind, _defines)
end
includedirs {
- BGFX_DIR .. "3rdparty",
- BGFX_DIR .. "../bx/include",
+ path.join(BGFX_DIR, "3rdparty"),
+ path.join(BGFX_DIR, "../bx/include"),
}
defines {
@@ -69,7 +69,7 @@ function bgfxProject(_name, _kind, _defines)
configuration { "xcode4 or osx or ios*" }
files {
- BGFX_DIR .. "src/**.mm",
+ path.join(BGFX_DIR, "src/**.mm"),
}
configuration { "osx" }
@@ -80,7 +80,7 @@ function bgfxProject(_name, _kind, _defines)
configuration { "not nacl" }
includedirs {
--nacl has GLES2 headers modified...
- BGFX_DIR .. "3rdparty/khronos",
+ path.join(BGFX_DIR, "3rdparty/khronos"),
}
configuration { "x64", "vs* or mingw*" }
@@ -91,17 +91,17 @@ function bgfxProject(_name, _kind, _defines)
configuration {}
includedirs {
- BGFX_DIR .. "include",
+ path.join(BGFX_DIR, "include"),
}
files {
- BGFX_DIR .. "include/**.h",
- BGFX_DIR .. "src/**.cpp",
- BGFX_DIR .. "src/**.h",
+ path.join(BGFX_DIR, "include/**.h"),
+ path.join(BGFX_DIR, "src/**.cpp"),
+ path.join(BGFX_DIR, "src/**.h"),
}
excludes {
- BGFX_DIR .. "src/**.bin.h",
+ path.join(BGFX_DIR, "src/**.bin.h"),
}
configuration {}
diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua
index 2626d18298c..e0983378104 100644
--- a/3rdparty/bgfx/scripts/example-common.lua
+++ b/3rdparty/bgfx/scripts/example-common.lua
@@ -8,18 +8,18 @@ project ("example-common")
kind "StaticLib"
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "include",
- BGFX_DIR .. "3rdparty",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "include"),
+ path.join(BGFX_DIR, "3rdparty"),
}
files {
- BGFX_DIR .. "3rdparty/ib-compress/**.cpp",
- BGFX_DIR .. "3rdparty/ib-compress/**.h",
- BGFX_DIR .. "3rdparty/ocornut-imgui/**.cpp",
- BGFX_DIR .. "3rdparty/ocornut-imgui/**.h",
- BGFX_DIR .. "examples/common/**.cpp",
- BGFX_DIR .. "examples/common/**.h",
+ path.join(BGFX_DIR, "3rdparty/ib-compress/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/ib-compress/**.h"),
+ path.join(BGFX_DIR, "3rdparty/ocornut-imgui/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/ocornut-imgui/**.h"),
+ path.join(BGFX_DIR, "examples/common/**.cpp"),
+ path.join(BGFX_DIR, "examples/common/**.h"),
}
if _OPTIONS["with-sdl"] then
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 0f9cf81a2c9..9056714240e 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -45,16 +45,16 @@ solution "bgfx"
language "C++"
startproject "example-00-helloworld"
-BGFX_DIR = (path.getabsolute("..") .. "/")
-local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
-local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
-BX_DIR = (BGFX_DIR .. "../bx/")
+BGFX_DIR = path.getabsolute("..")
+local BGFX_BUILD_DIR = path.join(BGFX_DIR, ".build")
+local BGFX_THIRD_PARTY_DIR = path.join(BGFX_DIR, "3rdparty")
+BX_DIR = path.getabsolute(path.join(BGFX_DIR, "../bx"))
defines {
"BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
}
-dofile (BX_DIR .. "scripts/toolchain.lua")
+dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
if not toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) then
return -- no action specified
end
@@ -80,19 +80,19 @@ function exampleProject(_name)
-- don't output debugdir for winphone builds
if "winphone81" ~= _OPTIONS["vs"] then
- debugdir (BGFX_DIR .. "examples/runtime/")
+ debugdir (path.join(BGFX_DIR, "examples/runtime"))
end
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "include",
- BGFX_DIR .. "3rdparty",
- BGFX_DIR .. "examples/common",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "include"),
+ path.join(BGFX_DIR, "3rdparty"),
+ path.join(BGFX_DIR, "examples/common"),
}
files {
- BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
- BGFX_DIR .. "examples/" .. _name .. "/**.h",
+ path.join(BGFX_DIR, "examples", _name, "**.cpp"),
+ path.join(BGFX_DIR, "examples", _name, "**.h"),
}
links {
@@ -120,10 +120,10 @@ function exampleProject(_name)
}
configuration { "x32" }
- libdirs { "$(OVR_DIR)/LibOVR/Lib/Win32/" .. _ACTION }
+ libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) }
configuration { "x64" }
- libdirs { "$(OVR_DIR)/LibOVR/Lib/x64/" .. _ACTION }
+ libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) }
configuration { "x32", "Debug" }
links { "libovrd" }
@@ -177,8 +177,8 @@ function exampleProject(_name)
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
}
-- WinRT targets need their own output directories are build files stomp over each other
- targetdir (BGFX_BUILD_DIR .. "arm_" .. _ACTION .. "/bin/" .. _name)
- objdir (BGFX_BUILD_DIR .. "arm_" .. _ACTION .. "/obj/" .. _name)
+ targetdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "bin", _name))
+ objdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "obj", _name))
configuration { "mingw-clang" }
kind "ConsoleApp"
@@ -236,7 +236,7 @@ function exampleProject(_name)
configuration { "osx" }
files {
- BGFX_DIR .. "examples/common/**.mm",
+ path.join(BGFX_DIR, "examples/common/**.mm"),
}
links {
"Cocoa.framework",
@@ -246,7 +246,7 @@ function exampleProject(_name)
configuration { "ios*" }
kind "ConsoleApp"
files {
- BGFX_DIR .. "examples/common/**.mm",
+ path.join(BGFX_DIR, "examples/common/**.mm"),
}
linkoptions {
"-framework CoreFoundation",
@@ -259,7 +259,7 @@ function exampleProject(_name)
configuration { "xcode4", "ios" }
kind "WindowedApp"
files {
- BGFX_DIR .. "examples/runtime/iOS-Info.plist"
+ path.join(BGFX_DIR, "examples/runtime/iOS-Info.plist"),
}
configuration { "qnx*" }
diff --git a/3rdparty/bgfx/scripts/geometryc.lua b/3rdparty/bgfx/scripts/geometryc.lua
index 25bf44f4348..f83c95ba845 100644
--- a/3rdparty/bgfx/scripts/geometryc.lua
+++ b/3rdparty/bgfx/scripts/geometryc.lua
@@ -8,21 +8,21 @@ project "geometryc"
kind "ConsoleApp"
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "include",
- BGFX_DIR .. "3rdparty",
- BGFX_DIR .. "examples/common",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "include"),
+ path.join(BGFX_DIR, "3rdparty"),
+ path.join(BGFX_DIR, "examples/common"),
}
files {
- BGFX_DIR .. "3rdparty/forsyth-too/**.cpp",
- BGFX_DIR .. "3rdparty/forsyth-too/**.h",
- BGFX_DIR .. "3rdparty/ib-compress/**.cpp",
- BGFX_DIR .. "3rdparty/ib-compress/**.h",
- BGFX_DIR .. "src/vertexdecl.**",
- BGFX_DIR .. "tools/geometryc/**.cpp",
- BGFX_DIR .. "tools/geometryc/**.h",
- BGFX_DIR .. "examples/common/bounds.**",
+ path.join(BGFX_DIR, "3rdparty/forsyth-too/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/forsyth-too/**.h"),
+ path.join(BGFX_DIR, "3rdparty/ib-compress/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/ib-compress/**.h"),
+ path.join(BGFX_DIR, "src/vertexdecl.**"),
+ path.join(BGFX_DIR, "tools/geometryc/**.cpp"),
+ path.join(BGFX_DIR, "tools/geometryc/**.h"),
+ path.join(BGFX_DIR, "examples/common/bounds.**"),
}
configuration { "osx" }
diff --git a/3rdparty/bgfx/scripts/makedisttex.lua b/3rdparty/bgfx/scripts/makedisttex.lua
index 3e6d48f244a..b208acdb32d 100644
--- a/3rdparty/bgfx/scripts/makedisttex.lua
+++ b/3rdparty/bgfx/scripts/makedisttex.lua
@@ -8,12 +8,12 @@ project "makedisttex"
kind "ConsoleApp"
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "3rdparty",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "3rdparty"),
}
files {
- BGFX_DIR .. "3rdparty/edtaa3/**.cpp",
- BGFX_DIR .. "3rdparty/edtaa3/**.h",
- BGFX_DIR .. "tools/makedisttex.cpp",
+ path.join(BGFX_DIR, "3rdparty/edtaa3/**.cpp"),
+ path.join(BGFX_DIR, "3rdparty/edtaa3/**.h"),
+ path.join(BGFX_DIR, "tools/makedisttex.cpp"),
}
diff --git a/3rdparty/bgfx/scripts/shaderc.lua b/3rdparty/bgfx/scripts/shaderc.lua
index cfd0f4328fd..387dd5d2878 100644
--- a/3rdparty/bgfx/scripts/shaderc.lua
+++ b/3rdparty/bgfx/scripts/shaderc.lua
@@ -7,16 +7,16 @@ project "shaderc"
uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
kind "ConsoleApp"
- local GLSL_OPTIMIZER = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
- local FCPP_DIR = (BGFX_DIR .. "3rdparty/fcpp/")
+ local GLSL_OPTIMIZER = path.join(BGFX_DIR, "3rdparty/glsl-optimizer")
+ local FCPP_DIR = path.join(BGFX_DIR, "3rdparty/fcpp")
includedirs {
- GLSL_OPTIMIZER .. "src",
+ path.join(GLSL_OPTIMIZER, "src"),
}
configuration { "vs*" }
includedirs {
- GLSL_OPTIMIZER .. "src/glsl/msvc",
+ path.join(GLSL_OPTIMIZER, "src/glsl/msvc"),
}
defines { -- glsl-optimizer
@@ -43,7 +43,7 @@ project "shaderc"
configuration { "windows", "vs*" }
includedirs {
- GLSL_OPTIMIZER .. "include/c99",
+ path.join(GLSL_OPTIMIZER, "include/c99"),
}
configuration { "windows" }
@@ -67,49 +67,49 @@ project "shaderc"
}
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "include",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "include"),
FCPP_DIR,
- GLSL_OPTIMIZER .. "include",
- GLSL_OPTIMIZER .. "src/mesa",
- GLSL_OPTIMIZER .. "src/mapi",
- GLSL_OPTIMIZER .. "src/glsl",
+ path.join(GLSL_OPTIMIZER, "include"),
+ path.join(GLSL_OPTIMIZER, "src/mesa"),
+ path.join(GLSL_OPTIMIZER, "src/mapi"),
+ path.join(GLSL_OPTIMIZER, "src/glsl"),
}
files {
- BGFX_DIR .. "tools/shaderc/**.cpp",
- BGFX_DIR .. "tools/shaderc/**.h",
- BGFX_DIR .. "src/vertexdecl.**",
-
- FCPP_DIR .. "**.h",
- FCPP_DIR .. "cpp1.c",
- FCPP_DIR .. "cpp2.c",
- FCPP_DIR .. "cpp3.c",
- FCPP_DIR .. "cpp4.c",
- FCPP_DIR .. "cpp5.c",
- FCPP_DIR .. "cpp6.c",
- FCPP_DIR .. "cpp6.c",
-
- GLSL_OPTIMIZER .. "src/mesa/**.c",
- GLSL_OPTIMIZER .. "src/glsl/**.cpp",
- GLSL_OPTIMIZER .. "src/mesa/**.h",
- GLSL_OPTIMIZER .. "src/glsl/**.c",
- GLSL_OPTIMIZER .. "src/glsl/**.cpp",
- GLSL_OPTIMIZER .. "src/glsl/**.h",
- GLSL_OPTIMIZER .. "src/util/**.c",
- GLSL_OPTIMIZER .. "src/util/**.h",
+ path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
+ path.join(BGFX_DIR, "tools/shaderc/**.h"),
+ path.join(BGFX_DIR, "src/vertexdecl.**"),
+
+ path.join(FCPP_DIR, "**.h"),
+ path.join(FCPP_DIR, "cpp1.c"),
+ path.join(FCPP_DIR, "cpp2.c"),
+ path.join(FCPP_DIR, "cpp3.c"),
+ path.join(FCPP_DIR, "cpp4.c"),
+ path.join(FCPP_DIR, "cpp5.c"),
+ path.join(FCPP_DIR, "cpp6.c"),
+ path.join(FCPP_DIR, "cpp6.c"),
+
+ path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
+ path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
+ path.join(GLSL_OPTIMIZER, "src/util/**.c"),
+ path.join(GLSL_OPTIMIZER, "src/util/**.h"),
}
excludes {
- GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
- GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
- GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
- GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
- GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
- GLSL_OPTIMIZER .. "src/glsl/main.cpp",
- GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
+ path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
+ path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
}
strip()
diff --git a/3rdparty/bgfx/scripts/texturec.lua b/3rdparty/bgfx/scripts/texturec.lua
index 76cb9ec07ae..729e545dd91 100644
--- a/3rdparty/bgfx/scripts/texturec.lua
+++ b/3rdparty/bgfx/scripts/texturec.lua
@@ -8,15 +8,15 @@ project "texturec"
kind "ConsoleApp"
includedirs {
- BX_DIR .. "include",
- BGFX_DIR .. "include",
- BGFX_DIR .. "src",
+ path.join(BX_DIR, "include"),
+ path.join(BGFX_DIR, "include"),
+ path.join(BGFX_DIR, "src"),
}
files {
- BGFX_DIR .. "src/image.*",
- BGFX_DIR .. "tools/texturec/**.cpp",
- BGFX_DIR .. "tools/texturec/**.h",
+ path.join(BGFX_DIR, "src/image.*"),
+ path.join(BGFX_DIR, "tools/texturec/**.cpp"),
+ path.join(BGFX_DIR, "tools/texturec/**.h"),
}
links {
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index c550500aa56..7d9b5714ce0 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -19,6 +19,14 @@ namespace bgfx
# define BGFX_CHECK_RENDER_THREAD()
#endif // BGFX_CONFIG_MULTITHREADED && !BX_PLATFORM_OSX && !BX_PLATFORM_IOS
+#define BGFX_CHECK_HANDLE(_handle, _max) \
+ BX_CHECK(isValid(_handle) \
+ && _handle.idx < _max \
+ , "Invalid handle. %d (< %d " #_max ")" \
+ , _handle.idx \
+ , _max \
+ );
+
#if BX_PLATFORM_ANDROID
::ANativeWindow* g_bgfxAndroidWindow = NULL;
@@ -797,6 +805,10 @@ namespace bgfx
void Frame::sort()
{
+ for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
+ {
+ m_sortKeys[ii] = SortKey::remapView(m_sortKeys[ii], m_viewRemap);
+ }
bx::radixSort64(m_sortKeys, s_ctx->m_tempKeys, m_sortValues, s_ctx->m_tempValues, m_num);
}
@@ -951,6 +963,11 @@ namespace bgfx
BX_TRACE("Multithreaded renderer is disabled.");
#endif // BGFX_CONFIG_MULTITHREADED
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_viewRemap); ++ii)
+ {
+ m_viewRemap[ii] = ii;
+ }
+
memset(m_fb, 0xff, sizeof(m_fb) );
memset(m_clear, 0, sizeof(m_clear) );
memset(m_rect, 0, sizeof(m_rect) );
@@ -1156,6 +1173,8 @@ namespace bgfx
freeDynamicBuffers();
m_submit->m_resolution = m_resolution;
m_submit->m_debug = m_debug;
+
+ memcpy(m_submit->m_viewRemap, m_viewRemap, sizeof(m_viewRemap) );
memcpy(m_submit->m_fb, m_fb, sizeof(m_fb) );
memcpy(m_submit->m_clear, m_clear, sizeof(m_clear) );
memcpy(m_submit->m_rect, m_rect, sizeof(m_rect) );
@@ -1961,6 +1980,7 @@ again:
g_caps.supported = 0
| (BGFX_CONFIG_MULTITHREADED ? BGFX_CAPS_RENDERER_MULTITHREADED : 0)
;
+ g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS;
g_caps.maxDrawCalls = BGFX_CONFIG_MAX_DRAW_CALLS;
g_caps.maxFBAttachments = 1;
@@ -2617,62 +2637,76 @@ again:
s_ctx->setClearColor(_index, _rgba);
}
+ bool checkView(uint8_t _id)
+ {
+ // workaround GCC 4.9 type-limit check.
+ const uint32_t id = _id;
+ return id < BGFX_CONFIG_MAX_VIEWS;
+ }
+
void setViewName(uint8_t _id, const char* _name)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewName(_id, _name);
}
void setViewRect(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewRect(_id, _x, _y, _width, _height);
}
void setViewScissor(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewScissor(_id, _x, _y, _width, _height);
}
void setViewClear(uint8_t _id, uint16_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewClear(_id, _flags, _rgba, _depth, _stencil);
}
void setViewClear(uint8_t _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0, uint8_t _1, uint8_t _2, uint8_t _3, uint8_t _4, uint8_t _5, uint8_t _6, uint8_t _7)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewClear(_id, _flags, _depth, _stencil, _0, _1, _2, _3, _4, _5, _6, _7);
}
void setViewSeq(uint8_t _id, bool _enabled)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewSeq(_id, _enabled);
}
void setViewFrameBuffer(uint8_t _id, FrameBufferHandle _handle)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewFrameBuffer(_id, _handle);
}
void setViewTransform(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR)
{
BGFX_CHECK_MAIN_THREAD();
- BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
s_ctx->setViewTransform(_id, _view, _projL, _flags, _projR);
}
+ void setViewRemap(uint8_t _id, uint8_t _num, const void* _remap)
+ {
+ BGFX_CHECK_MAIN_THREAD();
+ BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
+ s_ctx->setViewRemap(_id, _num, _remap);
+ }
+
void setMarker(const char* _marker)
{
BGFX_CHECK_MAIN_THREAD();
@@ -2724,18 +2758,21 @@ again:
void setUniform(UniformHandle _handle, const void* _value, uint16_t _num)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_UNIFORMS);
s_ctx->setUniform(_handle, _value, _num);
}
void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS);
s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices);
}
void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS);
s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices);
}
@@ -2760,12 +2797,14 @@ again:
void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
s_ctx->setVertexBuffer(_handle, _startVertex, _numVertices);
}
void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _numVertices)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
s_ctx->setVertexBuffer(_handle, _numVertices);
}
@@ -2784,24 +2823,28 @@ again:
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint32_t _num)
{
BGFX_CHECK_MAIN_THREAD();
+ BX_CHECK(NULL != _idb, "_idb can't be NULL");
s_ctx->setInstanceDataBuffer(_idb, _num);
}
void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
}
void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
}
void setProgram(ProgramHandle _handle)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_PROGRAMS);
s_ctx->setProgram(_handle);
}
@@ -2826,37 +2869,41 @@ again:
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS);
s_ctx->setBuffer(_stage, _handle, _access);
}
void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
s_ctx->setBuffer(_stage, _handle, _access);
}
void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS);
s_ctx->setBuffer(_stage, _handle, _access);
}
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
{
BGFX_CHECK_MAIN_THREAD();
+ BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
s_ctx->setBuffer(_stage, _handle, _access);
}
- void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access)
+ void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
{
BGFX_CHECK_MAIN_THREAD();
- s_ctx->setImage(_stage, _sampler, _handle, _mip, _format, _access);
+ s_ctx->setImage(_stage, _sampler, _handle, _mip, _access, _format);
}
- void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access)
+ void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format)
{
BGFX_CHECK_MAIN_THREAD();
- s_ctx->setImage(_stage, _sampler, _handle, _attachment, _format, _access);
+ s_ctx->setImage(_stage, _sampler, _handle, _attachment, _access, _format);
}
void dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
@@ -3466,18 +3513,18 @@ BGFX_C_API uint32_t bgfx_submit(uint8_t _id, int32_t _depth)
return bgfx::submit(_id, _depth);
}
-BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_texture_format_t _format, bgfx_access_t _access)
+BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
{
union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
- bgfx::setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::TextureFormat::Enum(_format), bgfx::Access::Enum(_access) );
+ bgfx::setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
}
-BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_texture_format_t _format, bgfx_access_t _access)
+BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format)
{
union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } handle = { _handle };
- bgfx::setImage(_stage, sampler.cpp, handle.cpp, _attachment, bgfx::TextureFormat::Enum(_format), bgfx::Access::Enum(_access) );
+ bgfx::setImage(_stage, sampler.cpp, handle.cpp, _attachment, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
}
BGFX_C_API void bgfx_dispatch(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
diff --git a/3rdparty/bgfx/src/bgfx_compute.sh b/3rdparty/bgfx/src/bgfx_compute.sh
index 5ad2959b50d..4bb11dcdcd3 100644
--- a/3rdparty/bgfx/src/bgfx_compute.sh
+++ b/3rdparty/bgfx/src/bgfx_compute.sh
@@ -16,14 +16,31 @@ float uintBitsToFloat(uint _x) { return asfloat(_x); }
vec2 uintBitsToFloat(uint2 _x) { return asfloat(_x); }
vec3 uintBitsToFloat(uint3 _x) { return asfloat(_x); }
vec4 uintBitsToFloat(uint4 _x) { return asfloat(_x); }
-uint floatBitsToUint(float _x) { return asuint(_x); }
-uvec2 floatBitsToUint(vec2 _x) { return asuint(_x); }
-uvec3 floatBitsToUint(vec3 _x) { return asuint(_x); }
-uvec4 floatBitsToUint(vec4 _x) { return asuint(_x); }
-int floatBitsToInt(float _x) { return asint(_x); }
-ivec2 floatBitsToInt(vec2 _x) { return asint(_x); }
-ivec3 floatBitsToInt(vec3 _x) { return asint(_x); }
-ivec4 floatBitsToInt(vec4 _x) { return asint(_x); }
+
+uint floatBitsToUint(float _x) { return asuint(_x); }
+uvec2 floatBitsToUint(vec2 _x) { return asuint(_x); }
+uvec3 floatBitsToUint(vec3 _x) { return asuint(_x); }
+uvec4 floatBitsToUint(vec4 _x) { return asuint(_x); }
+
+int floatBitsToInt(float _x) { return asint(_x); }
+ivec2 floatBitsToInt(vec2 _x) { return asint(_x); }
+ivec3 floatBitsToInt(vec3 _x) { return asint(_x); }
+ivec4 floatBitsToInt(vec4 _x) { return asint(_x); }
+
+uint bitfieldReverse(uint _x) { return reversebits(_x); }
+uint2 bitfieldReverse(uint2 _x) { return reversebits(_x); }
+uint3 bitfieldReverse(uint3 _x) { return reversebits(_x); }
+uint4 bitfieldReverse(uint4 _x) { return reversebits(_x); }
+
+uint packHalf2x16(vec2 _x)
+{
+ return (f32tof16(_x.x)<<16) | f32tof16(_x.y);
+}
+
+vec2 unpackHalf2x16(uint _x)
+{
+ return vec2(f16tof32(_x >> 16), f16tof32(_x) );
+}
#define SHARED groupshared
@@ -42,14 +59,16 @@ vec4 imageLoad(Texture2D _image, ivec2 _uv)
return _image.Load(uint3(_uv.xy, 0) );
}
-uint imageLoad(Texture2D<uint> _image, ivec2 _uv)
+uint4 imageLoad(Texture2D<uint> _image, ivec2 _uv)
{
- return _image.Load(uint3(_uv.xy, 0) );
+ uint rr = _image.Load(uint3(_uv.xy, 0) );
+ return uint4(rr, rr, rr, rr);
}
-uint imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
+uint4 imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
{
- return _image[_uv.xy];
+ uint rr = _image[_uv.xy];
+ return uint4(rr, rr, rr, rr);
}
ivec2 imageSize(Texture2D _image)
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index feced94a50e..eaa5c1c53e7 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -679,8 +679,10 @@ namespace bgfx
};
#define SORT_KEY_RENDER_DRAW (UINT64_C(1)<<0x2b)
+#define SORT_KEY_VIEW_SHIFT UINT8_C(0x37)
+#define SORT_KEY_VIEW_MASK ( (uint64_t(BGFX_CONFIG_MAX_VIEWS-1) )<<SORT_KEY_VIEW_SHIFT)
- BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= 32);
+ BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= 256);
BX_STATIC_ASSERT( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // must be power of 2
struct SortKey
@@ -689,7 +691,7 @@ namespace bgfx
{
// | 3 2 1 0|
// |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210|
- // | vvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd|
+ // | vvvvvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd|
// | ^ ^^ ^ ^ ^|
// | | || | | ||
// | view-+ seq-+| +-trans +-program depth-+|
@@ -699,7 +701,7 @@ namespace bgfx
const uint64_t program = uint64_t(m_program)<<0x20;
const uint64_t trans = uint64_t(m_trans )<<0x29;
const uint64_t seq = uint64_t(m_seq )<<0x2c;
- const uint64_t view = uint64_t(m_view )<<0x37;
+ const uint64_t view = uint64_t(m_view )<<SORT_KEY_VIEW_SHIFT;
const uint64_t key = depth|program|trans|SORT_KEY_RENDER_DRAW|seq|view;
return key;
}
@@ -708,7 +710,7 @@ namespace bgfx
{
// | 3 2 1 0|
// |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210|
- // | vvvvvsssssssssssdppppppppp |
+ // | vvvvvvvvsssssssssssdppppppppp |
// | ^ ^^ ^ |
// | | || | |
// | view-+ seq-+| +-program |
@@ -716,7 +718,7 @@ namespace bgfx
const uint64_t program = uint64_t(m_program)<<0x22;
const uint64_t seq = uint64_t(m_seq )<<0x2c;
- const uint64_t view = uint64_t(m_view )<<0x37;
+ const uint64_t view = uint64_t(m_view )<<SORT_KEY_VIEW_SHIFT;
const uint64_t key = program|seq|view;
return key;
}
@@ -725,7 +727,7 @@ namespace bgfx
bool decode(uint64_t _key)
{
m_seq = (_key>>0x2c)& 0x7ff;
- m_view = (_key>>0x37)&(BGFX_CONFIG_MAX_VIEWS-1);
+ m_view = uint8_t( (_key&SORT_KEY_VIEW_MASK)>>SORT_KEY_VIEW_SHIFT);
if (_key & SORT_KEY_RENDER_DRAW)
{
m_depth = _key & 0xffffffff;
@@ -738,6 +740,21 @@ namespace bgfx
return true; // compute
}
+ bool decode(uint64_t _key, uint8_t _viewRemap[BGFX_CONFIG_MAX_VIEWS])
+ {
+ bool compute = decode(_key);
+ m_view = _viewRemap[m_view];
+ return compute;
+ }
+
+ static uint64_t remapView(uint64_t _key, uint8_t _viewRemap[BGFX_CONFIG_MAX_VIEWS])
+ {
+ const uint8_t oldView = uint8_t( (_key & SORT_KEY_VIEW_MASK) >> SORT_KEY_VIEW_SHIFT);
+ const uint64_t view = uint64_t(_viewRemap[oldView]) << SORT_KEY_VIEW_SHIFT;
+ const uint64_t key = (_key & ~SORT_KEY_VIEW_MASK) | view;
+ return key;
+ }
+
void reset()
{
m_depth = 0;
@@ -1353,7 +1370,6 @@ namespace bgfx
void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
{
- BX_CHECK(_handle.idx < BGFX_CONFIG_MAX_VERTEX_BUFFERS, "Invalid vertex buffer handle. %d (< %d)", _handle.idx, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
m_draw.m_startVertex = _startVertex;
m_draw.m_numVertices = _numVertices;
m_draw.m_vertexBuffer = _handle;
@@ -1394,7 +1410,6 @@ namespace bgfx
void setProgram(ProgramHandle _handle)
{
- BX_CHECK(isValid(_handle), "Can't set program with invalid handle.");
m_key.m_program = _handle.idx;
}
@@ -1432,7 +1447,7 @@ namespace bgfx
bind.m_un.m_compute.m_mip = 0;
}
- void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access)
+ void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
{
Binding& bind = m_compute.m_bind[_stage];
bind.m_idx = _handle.idx;
@@ -1564,6 +1579,7 @@ namespace bgfx
SortKey m_key;
+ uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
float m_clearColor[BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE][4];
@@ -1720,6 +1736,20 @@ namespace bgfx
m_free.push_back(Free(_ptr, _size) );
}
+ uint64_t remove()
+ {
+ BX_CHECK(0 == m_used.size(), "");
+
+ if (0 < m_free.size() )
+ {
+ Free free = m_free.front();
+ m_free.pop_front();
+ return free.m_ptr;
+ }
+
+ return 0;
+ }
+
uint64_t alloc(uint32_t _size)
{
for (FreeList::iterator it = m_free.begin(), itEnd = m_free.end(); it != itEnd; ++it)
@@ -1758,7 +1788,7 @@ namespace bgfx
}
}
- void compact()
+ bool compact()
{
m_free.sort();
@@ -1775,6 +1805,8 @@ namespace bgfx
++next;
}
}
+
+ return 0 == m_used.size();
}
private:
@@ -2147,7 +2179,14 @@ namespace bgfx
else
{
m_dynIndexBufferAllocator.free(uint64_t(dib.m_handle.idx)<<32 | dib.m_offset);
- m_dynIndexBufferAllocator.compact();
+ if (m_dynIndexBufferAllocator.compact() )
+ {
+ for (uint64_t ptr = m_dynIndexBufferAllocator.remove(); 0 != ptr; ptr = m_dynIndexBufferAllocator.remove() )
+ {
+ IndexBufferHandle handle = { uint16_t(ptr>>32) };
+ destroyIndexBuffer(handle);
+ }
+ }
}
m_dynamicIndexBufferHandle.free(_handle.idx);
@@ -2292,7 +2331,14 @@ namespace bgfx
else
{
m_dynVertexBufferAllocator.free(uint64_t(dvb.m_handle.idx)<<32 | dvb.m_offset);
- m_dynVertexBufferAllocator.compact();
+ if (m_dynVertexBufferAllocator.compact() )
+ {
+ for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove() )
+ {
+ VertexBufferHandle handle = { uint16_t(ptr>>32) };
+ destroyVertexBuffer(handle);
+ }
+ }
}
m_dynamicVertexBufferHandle.free(_handle.idx);
@@ -2672,31 +2718,34 @@ namespace bgfx
BGFX_API_FUNC(TextureHandle createTexture(const Memory* _mem, uint32_t _flags, uint8_t _skip, TextureInfo* _info) )
{
- if (NULL != _info)
+ TextureInfo ti;
+ if (NULL == _info)
{
- ImageContainer imageContainer;
- if (imageParse(imageContainer, _mem->data, _mem->size) )
- {
- calcTextureSize(*_info
- , (uint16_t)imageContainer.m_width
- , (uint16_t)imageContainer.m_height
- , (uint16_t)imageContainer.m_depth
- , imageContainer.m_cubeMap
- , imageContainer.m_numMips
- , TextureFormat::Enum(imageContainer.m_format)
- );
- }
- else
- {
- _info->format = TextureFormat::Unknown;
- _info->storageSize = 0;
- _info->width = 0;
- _info->height = 0;
- _info->depth = 0;
- _info->numMips = 0;
- _info->bitsPerPixel = 0;
- _info->cubeMap = false;
- }
+ _info = &ti;
+ }
+
+ ImageContainer imageContainer;
+ if (imageParse(imageContainer, _mem->data, _mem->size) )
+ {
+ calcTextureSize(*_info
+ , (uint16_t)imageContainer.m_width
+ , (uint16_t)imageContainer.m_height
+ , (uint16_t)imageContainer.m_depth
+ , imageContainer.m_cubeMap
+ , imageContainer.m_numMips
+ , TextureFormat::Enum(imageContainer.m_format)
+ );
+ }
+ else
+ {
+ _info->format = TextureFormat::Unknown;
+ _info->storageSize = 0;
+ _info->width = 0;
+ _info->height = 0;
+ _info->depth = 0;
+ _info->numMips = 0;
+ _info->bitsPerPixel = 0;
+ _info->cubeMap = false;
}
TextureHandle handle = { m_textureHandle.alloc() };
@@ -2705,6 +2754,7 @@ namespace bgfx
{
TextureRef& ref = m_textureRef[handle.idx];
ref.m_refCount = 1;
+ ref.m_format = uint8_t(_info->format);
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateTexture);
cmdbuf.write(handle);
@@ -3038,6 +3088,23 @@ namespace bgfx
}
}
+ BGFX_API_FUNC(void setViewRemap(uint8_t _id, uint8_t _num, const void* _remap) )
+ {
+ const uint32_t num = bx::uint32_min( (BGFX_CONFIG_MAX_VIEWS - _id) + _num, BGFX_CONFIG_MAX_VIEWS) - _id;
+ if (NULL == _remap)
+ {
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ uint8_t id = uint8_t(ii+_id);
+ m_viewRemap[id] = id;
+ }
+ }
+ else
+ {
+ memcpy(&m_viewRemap[_id], _remap, num);
+ }
+ }
+
BGFX_API_FUNC(void setMarker(const char* _marker) )
{
m_submit->setMarker(_marker);
@@ -3190,12 +3257,13 @@ namespace bgfx
m_submit->setBuffer(_stage, dvb.m_handle, _access);
}
- BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access) )
+ BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format) )
{
- m_submit->setImage(_stage, _sampler, _handle, _mip, _format, _access);
+ _format = TextureFormat::Count == _format ? TextureFormat::Enum(m_textureRef[_handle.idx].m_format) : _format;
+ m_submit->setImage(_stage, _sampler, _handle, _mip, _access, _format);
}
- BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access) )
+ BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format) )
{
BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment);
TextureHandle textureHandle = BGFX_INVALID_HANDLE;
@@ -3207,7 +3275,7 @@ namespace bgfx
BX_CHECK(isValid(textureHandle), "Frame buffer texture %d is invalid.", _attachment);
}
- setImage(_stage, _sampler, textureHandle, 0, _format, _access);
+ setImage(_stage, _sampler, textureHandle, 0, _access, _format);
}
BGFX_API_FUNC(uint32_t dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags) )
@@ -3337,6 +3405,7 @@ namespace bgfx
struct TextureRef
{
int16_t m_refCount;
+ uint8_t m_format;
};
struct FrameBufferRef
@@ -3358,6 +3427,7 @@ namespace bgfx
FrameBufferRef m_frameBufferRef[BGFX_CONFIG_MAX_FRAME_BUFFERS];
VertexDeclRef m_declRef;
+ uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh
index 7d1aadbd0e7..e0e14cf544b 100644
--- a/3rdparty/bgfx/src/bgfx_shader.sh
+++ b/3rdparty/bgfx/src/bgfx_shader.sh
@@ -189,6 +189,10 @@ vec2 vec2_splat(float _x) { return vec2(_x, _x); }
vec3 vec3_splat(float _x) { return vec3(_x, _x, _x); }
vec4 vec4_splat(float _x) { return vec4(_x, _x, _x, _x); }
+uvec2 uvec2_splat(uint _x) { return uvec2(_x, _x); }
+uvec3 uvec3_splat(uint _x) { return uvec3(_x, _x, _x); }
+uvec4 uvec4_splat(uint _x) { return uvec4(_x, _x, _x, _x); }
+
vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_mtx, _vec); }
vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_vec, _mtx); }
vec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_mtx, _vec); }
@@ -239,6 +243,9 @@ vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); }
# define vec2_splat(_x) vec2(_x)
# define vec3_splat(_x) vec3(_x)
# define vec4_splat(_x) vec4(_x)
+# define uvec2_splat(_x) uvec2(_x)
+# define uvec3_splat(_x) uvec3(_x)
+# define uvec4_splat(_x) uvec4(_x)
vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }
vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_mtx, _vec); }
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h
index 1a069b4e116..396e6506372 100644
--- a/3rdparty/bgfx/src/config.h
+++ b/3rdparty/bgfx/src/config.h
@@ -168,7 +168,7 @@
#ifndef BGFX_CONFIG_MAX_VIEWS
// Do not change. Must be power of 2.
-# define BGFX_CONFIG_MAX_VIEWS 32
+# define BGFX_CONFIG_MAX_VIEWS 256
#endif // BGFX_CONFIG_MAX_VIEWS
#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 5
diff --git a/3rdparty/bgfx/src/glimports.h b/3rdparty/bgfx/src/glimports.h
index 93f8586cc03..6a67f8d8e16 100644
--- a/3rdparty/bgfx/src/glimports.h
+++ b/3rdparty/bgfx/src/glimports.h
@@ -481,7 +481,7 @@ GL_IMPORT_NV___(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObj
GL_IMPORT (true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer, glDiscardFramebufferEXT);
-#else
+#elif !BGFX_USE_GL_DYNAMIC_LIB
GL_IMPORT______(true, PFNGLTEXIMAGE3DPROC, glTexImage3D);
GL_IMPORT______(true, PFNGLTEXSUBIMAGE3DPROC, glTexSubImage3D);
GL_IMPORT______(true, PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D);
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index 1cd7735e4e7..e67eacb9a77 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -665,6 +665,11 @@ namespace bgfx
#endif // BX_PLATFORM_WINRT
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
+ DX_CHECK(m_factory->MakeWindowAssociation(g_bgfxHwnd, 0
+ | DXGI_MWA_NO_WINDOW_CHANGES
+ | DXGI_MWA_NO_ALT_ENTER
+ ) );
+
m_numWindows = 1;
if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
@@ -726,7 +731,7 @@ namespace bgfx
}
// Init reserved part of view name.
- for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
+ for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
{
char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
bx::snprintf(name, sizeof(name), "%3d ", ii);
@@ -3051,7 +3056,7 @@ namespace bgfx
int32_t numItems = _render->m_num;
for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
{
- const bool isCompute = key.decode(_render->m_sortKeys[item]);
+ const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
const bool viewChanged = 0
|| key.m_view != view
|| item == numItems
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index a904328440a..634704065bd 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -570,7 +570,7 @@ namespace bgfx
}
// Init reserved part of view name.
- for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
+ for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
{
char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
bx::snprintf(name, sizeof(name), "%3d ", ii);
@@ -2864,7 +2864,7 @@ namespace bgfx
{
for (uint32_t item = 0, numItems = _render->m_num; item < numItems; ++item)
{
- const bool isCompute = key.decode(_render->m_sortKeys[item]);
+ const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
if (isCompute)
{
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index eb25d6a7013..f5caa585dcd 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -232,7 +232,7 @@ namespace bgfx
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
- { GL_STENCIL_INDEX8, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, false }, // D0S8
+ { GL_STENCIL_INDEX8, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -430,6 +430,7 @@ namespace bgfx
OES_texture_npot,
OES_texture_half_float,
OES_texture_half_float_linear,
+ OES_texture_stencil8,
OES_vertex_array_object,
OES_vertex_half_float,
OES_vertex_type_10_10_10_2,
@@ -590,6 +591,7 @@ namespace bgfx
{ "OES_texture_npot", false, true },
{ "OES_texture_half_float", false, true },
{ "OES_texture_half_float_linear", false, true },
+ { "OES_texture_stencil8", false, true },
{ "OES_vertex_array_object", false, !BX_PLATFORM_IOS },
{ "OES_vertex_half_float", false, true },
{ "OES_vertex_type_10_10_10_2", false, true },
@@ -1165,7 +1167,8 @@ namespace bgfx
}
}
- if (!isTextureFormatValid(TextureFormat::R8) )
+ if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
+ || !isTextureFormatValid(TextureFormat::R8) )
{
// GL core has to use GL_R8 Issue#208, GLES2 has to use GL_LUMINANCE issue#226
s_textureFormat[TextureFormat::R8].m_internalFmt = GL_LUMINANCE;
@@ -1385,7 +1388,7 @@ namespace bgfx
}
// Init reserved part of view name.
- for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
+ for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
{
bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1, "%3d ", ii);
}
@@ -2554,6 +2557,10 @@ namespace bgfx
GLSL_TYPE(GL_IMAGE_2D);
GLSL_TYPE(GL_IMAGE_3D);
GLSL_TYPE(GL_IMAGE_CUBE);
+ GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D);
+ GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_2D);
+ GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_3D);
+ GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_CUBE);
}
#undef GLSL_TYPE
@@ -2636,6 +2643,10 @@ namespace bgfx
case GL_IMAGE_2D:
case GL_IMAGE_3D:
case GL_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_1D:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
return UniformType::Uniform1iv;
};
@@ -2833,6 +2844,10 @@ namespace bgfx
case GL_IMAGE_2D:
case GL_IMAGE_3D:
case GL_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_1D:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
BX_TRACE("Sampler #%d at location %d.", m_numSamplers, loc);
m_sampler[m_numSamplers] = loc;
m_numSamplers++;
@@ -4279,7 +4294,7 @@ namespace bgfx
int32_t numItems = _render->m_num;
for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
{
- const bool isCompute = key.decode(_render->m_sortKeys[item]);
+ const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
const bool viewChanged = 0
|| key.m_view != view
|| item == numItems
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 1218392bfbc..626b85343a2 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -167,6 +167,10 @@ typedef uint64_t GLuint64;
# define GL_RGBA32F 0x8814
#endif // GL_RGBA32F
+#ifndef GL_STENCIL_INDEX
+# define GL_STENCIL_INDEX 0x1901
+#endif // GL_STENCIL_INDEX
+
#ifndef GL_RED
# define GL_RED 0x1903
#endif // GL_RED
@@ -472,6 +476,22 @@ typedef uint64_t GLuint64;
# define GL_IMAGE_CUBE 0x9050
#endif // GL_IMAGE_CUBE
+#ifndef GL_UNSIGNED_INT_IMAGE_1D
+# define GL_UNSIGNED_INT_IMAGE_1D 0x9062
+#endif // GL_UNSIGNED_INT_IMAGE_1D
+
+#ifndef GL_UNSIGNED_INT_IMAGE_2D
+# define GL_UNSIGNED_INT_IMAGE_2D 0x9063
+#endif // GL_UNSIGNED_INT_IMAGE_2D
+
+#ifndef GL_UNSIGNED_INT_IMAGE_3D
+# define GL_UNSIGNED_INT_IMAGE_3D 0x9064
+#endif // GL_UNSIGNED_INT_IMAGE_3D
+
+#ifndef GL_UNSIGNED_INT_IMAGE_CUBE
+# define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
+#endif // GL_UNSIGNED_INT_IMAGE_CUBE
+
#ifndef GL_PROGRAM_INPUT
# define GL_PROGRAM_INPUT 0x92E3
#endif // GL_PROGRAM_INPUT
@@ -892,7 +912,7 @@ namespace bgfx
GLint m_attributes[Attrib::Count]; // sparse
GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
- GLint m_sampler[BGFX_CONFIG_MAX_TEXTURES];
+ GLint m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
uint8_t m_numSamplers;
ConstantBuffer* m_constantBuffer;
diff --git a/3rdparty/bx/scripts/genie.lua b/3rdparty/bx/scripts/genie.lua
index 75e5d663c97..3f9ea26cb20 100644
--- a/3rdparty/bx/scripts/genie.lua
+++ b/3rdparty/bx/scripts/genie.lua
@@ -17,9 +17,9 @@ solution "bx"
language "C++"
-BX_DIR = (path.getabsolute("..") .. "/")
-local BX_BUILD_DIR = (BX_DIR .. ".build/")
-local BX_THIRD_PARTY_DIR = (BX_DIR .. "3rdparty/")
+BX_DIR = path.getabsolute("..")
+local BX_BUILD_DIR = path.join(BX_DIR, ".build")
+local BX_THIRD_PARTY_DIR = path.join(BX_DIR, "3rdparty")
defines {
"BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
@@ -39,15 +39,15 @@ project "bx.test"
uuid "8a653da8-23d6-11e3-acb4-887628d43830"
kind "ConsoleApp"
- debugdir (BX_DIR .. "tests")
+ debugdir (path.join(BX_DIR, "tests"))
removeflags {
"NoExceptions",
}
includedirs {
- BX_DIR .. "include",
- BX_THIRD_PARTY_DIR .. "UnitTest++/src/",
+ path.join(BX_DIR, "include"),
+ path.join(BX_THIRD_PARTY_DIR, "UnitTest++/src"),
}
links {
@@ -55,8 +55,8 @@ project "bx.test"
}
files {
- BX_DIR .. "tests/**.cpp",
- BX_DIR .. "tests/**.H",
+ path.join(BX_DIR, "tests/**.cpp"),
+ path.join(BX_DIR, "tests/**.H"),
}
configuration { "vs*" }
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 04a594feb6a..3d761911276 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -3,7 +3,7 @@
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
-local bxDir = (path.getabsolute("..") .. "/")
+local bxDir = path.getabsolute("..")
local naclToolchain = ""
function toolchain(_buildDir, _libDir)
@@ -71,7 +71,7 @@ function toolchain(_buildDir, _libDir)
-- Avoid error when invoking genie --help.
if (_ACTION == nil) then return false end
- location (_buildDir .. "projects/" .. _ACTION)
+ location (path.join(_buildDir, "projects", _ACTION))
if _ACTION == "clean" then
os.rmdir(BUILD_DIR)
@@ -107,7 +107,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-android-arm")
+ location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
end
if "android-mips" == _OPTIONS["gcc"] then
@@ -119,7 +119,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-gcc"
premake.gcc.cxx = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-g++"
premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-android-mips")
+ location (path.join(_buildDir, "projects", _ACTION .. "-android-mips"))
end
if "android-x86" == _OPTIONS["gcc"] then
@@ -131,7 +131,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = "$(ANDROID_NDK_X86)/bin/i686-linux-android-gcc"
premake.gcc.cxx = "$(ANDROID_NDK_X86)/bin/i686-linux-android-g++"
premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-android-x86")
+ location (path.join(_buildDir, "projects", _ACTION .. "-android-x86"))
end
if "asmjs" == _OPTIONS["gcc"] then
@@ -144,43 +144,43 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cxx = "$(EMSCRIPTEN)/em++"
premake.gcc.ar = "$(EMSCRIPTEN)/emar"
premake.gcc.llvm = true
- location (_buildDir .. "projects/" .. _ACTION .. "-asmjs")
+ location (path.join(_buildDir, "projects", _ACTION .. "-asmjs"))
end
if "freebsd" == _OPTIONS["gcc"] then
- location (_buildDir .. "projects/" .. _ACTION .. "-freebsd")
+ location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
end
if "ios-arm" == _OPTIONS["gcc"] then
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
premake.gcc.ar = "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-ios-arm")
+ location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
end
if "ios-simulator" == _OPTIONS["gcc"] then
premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
premake.gcc.ar = "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-ios-simulator")
+ location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
end
if "linux-gcc" == _OPTIONS["gcc"] then
- location (_buildDir .. "projects/" .. _ACTION .. "-linux")
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
end
if "linux-clang" == _OPTIONS["gcc"] then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
premake.gcc.ar = "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-linux-clang")
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
end
if "mingw-gcc" == _OPTIONS["gcc"] then
premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
premake.gcc.ar = "$(MINGW)/bin/ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-mingw-gcc")
+ location (path.join(_buildDir, "projects", _ACTION .. "-mingw-gcc"))
end
if "mingw-clang" == _OPTIONS["gcc"] then
@@ -189,7 +189,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "$(MINGW)/bin/ar"
-- premake.gcc.ar = "$(CLANG)/bin/llvm-ar"
-- premake.gcc.llvm = true
- location (_buildDir .. "projects/" .. _ACTION .. "-mingw-clang")
+ location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang"))
end
if "nacl" == _OPTIONS["gcc"] then
@@ -208,7 +208,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = naclToolchain .. "gcc"
premake.gcc.cxx = naclToolchain .. "g++"
premake.gcc.ar = naclToolchain .. "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-nacl")
+ location (path.join(_buildDir, "projects", _ACTION .. "-nacl"))
end
if "nacl-arm" == _OPTIONS["gcc"] then
@@ -227,7 +227,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = naclToolchain .. "gcc"
premake.gcc.cxx = naclToolchain .. "g++"
premake.gcc.ar = naclToolchain .. "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-nacl-arm")
+ location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm"))
end
if "osx" == _OPTIONS["gcc"] then
@@ -237,7 +237,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cxx = osxToolchain .. "clang++"
premake.gcc.ar = osxToolchain .. "ar"
end
- location (_buildDir .. "projects/" .. _ACTION .. "-osx")
+ location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
end
if "pnacl" == _OPTIONS["gcc"] then
@@ -256,7 +256,7 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = naclToolchain .. "clang"
premake.gcc.cxx = naclToolchain .. "clang++"
premake.gcc.ar = naclToolchain .. "ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-pnacl")
+ location (path.join(_buildDir, "projects", _ACTION .. "-pnacl"))
end
if "qnx-arm" == _OPTIONS["gcc"] then
@@ -268,38 +268,38 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc"
premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++"
premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar"
- location (_buildDir .. "projects/" .. _ACTION .. "-qnx-arm")
+ location (path.join(_buildDir, "projects", _ACTION .. "-qnx-arm"))
end
if "rpi" == _OPTIONS["gcc"] then
- location (_buildDir .. "projects/" .. _ACTION .. "-rpi")
+ location (path.join(_buildDir, "projects", _ACTION .. "-rpi"))
end
elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
premake.vstudio.toolset = ("LLVM-" .. _ACTION)
- location (_buildDir .. "projects/" .. _ACTION .. "-clang")
+ location (path.join(_buildDir, "projects", _ACTION .. "-clang"))
end
if "winphone8" == _OPTIONS["vs"] then
premake.vstudio.toolset = "v110_wp80"
- location (_buildDir .. "projects/" .. _ACTION .. "-winphone8")
+ location (path.join(_buildDir, "projects", _ACTION .. "-winphone8"))
end
if "winphone81" == _OPTIONS["vs"] then
premake.vstudio.toolset = "v120_wp81"
platforms { "ARM" }
- location (_buildDir .. "projects/" .. _ACTION .. "-winphone81")
+ location (path.join(_buildDir, "projects", _ACTION .. "-winphone81"))
end
elseif _ACTION == "xcode4" then
if "osx" == _OPTIONS["xcode"] then
premake.xcode.toolset = "macosx"
- location (_buildDir .. "projects/" .. _ACTION .. "-osx")
+ location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
end
if "ios" == _OPTIONS["xcode"] then
premake.xcode.toolset = "iphoneos"
- location (_buildDir .. "projects/" .. _ACTION .. "-ios")
+ location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
end
end
@@ -334,7 +334,7 @@ function toolchain(_buildDir, _libDir)
}
configuration { "vs*" }
- includedirs { bxDir .. "include/compat/msvc" }
+ includedirs { path.join(bxDir, "include/compat/msvc") }
defines {
"WIN32",
"_WIN32",
@@ -355,28 +355,28 @@ function toolchain(_buildDir, _libDir)
}
configuration { "vs2008" }
- includedirs { bxDir .. "include/compat/msvc/pre1600" }
+ includedirs { path.join(bxDir .. "include/compat/msvc/pre1600") }
configuration { "x32", "vs*" }
- targetdir (_buildDir .. "win32_" .. _ACTION .. "/bin")
- objdir (_buildDir .. "win32_" .. _ACTION .. "/obj")
+ targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
+ objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
libdirs {
- _libDir .. "lib/win32_" .. _ACTION,
+ path.join(_libDir, "lib/win32_" .. _ACTION),
"$(DXSDK_DIR)/lib/x86",
}
configuration { "x64", "vs*" }
defines { "_WIN64" }
- targetdir (_buildDir .. "win64_" .. _ACTION .. "/bin")
- objdir (_buildDir .. "win64_" .. _ACTION .. "/obj")
+ targetdir (path.join(_buildDir, "win64_" .. _ACTION, "bin"))
+ objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
libdirs {
- _libDir .. "lib/win64_" .. _ACTION,
+ path.join(_libDir, "lib/win64_" .. _ACTION),
"$(DXSDK_DIR)/lib/x64",
}
configuration { "ARM", "vs*" }
- targetdir (_buildDir .. "arm_" .. _ACTION .. "/bin")
- objdir (_buildDir .. "arm_" .. _ACTION .. "/obj")
+ targetdir (path.join(_buildDir, "arm_" .. _ACTION, "bin"))
+ objdir (path.join(_buildDir, "arm_" .. _ACTION, "obj"))
configuration { "vs*-clang" }
buildoptions {
@@ -384,12 +384,12 @@ function toolchain(_buildDir, _libDir)
}
configuration { "x32", "vs*-clang" }
- targetdir (_buildDir .. "win32_" .. _ACTION .. "-clang/bin")
- objdir (_buildDir .. "win32_" .. _ACTION .. "-clang/obj")
+ targetdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/bin"))
+ objdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/obj"))
configuration { "x64", "vs*-clang" }
- targetdir (_buildDir .. "win64_" .. _ACTION .. "-clang/bin")
- objdir (_buildDir .. "win64_" .. _ACTION .. "-clang/obj")
+ targetdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/bin"))
+ objdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/obj"))
configuration { "winphone8*" }
removeflags {
@@ -399,7 +399,7 @@ function toolchain(_buildDir, _libDir)
configuration { "mingw-*" }
defines { "WIN32" }
- includedirs { bxDir .. "include/compat/mingw" }
+ includedirs { path.join(bxDir, "include/compat/mingw") }
buildoptions {
"-std=c++11",
"-Wunused-value",
@@ -416,19 +416,19 @@ function toolchain(_buildDir, _libDir)
}
configuration { "x32", "mingw-gcc" }
- targetdir (_buildDir .. "win32_mingw-gcc" .. "/bin")
- objdir (_buildDir .. "win32_mingw-gcc" .. "/obj")
+ targetdir (path.join(_buildDir, "win32_mingw-gcc/bin"))
+ objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
libdirs {
- _libDir .. "lib/win32_mingw-gcc",
+ path.join(_libDir, "lib/win32_mingw-gcc"),
"$(DXSDK_DIR)/lib/x86",
}
buildoptions { "-m32" }
configuration { "x64", "mingw-gcc" }
- targetdir (_buildDir .. "win64_mingw-gcc" .. "/bin")
- objdir (_buildDir .. "win64_mingw-gcc" .. "/obj")
+ targetdir (path.join(_buildDir, "win64_mingw-gcc/bin"))
+ objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
libdirs {
- _libDir .. "lib/win64_mingw-gcc",
+ path.join(_libDir, "lib/win64_mingw-gcc"),
"$(DXSDK_DIR)/lib/x64",
"$(GLES_X64_DIR)",
}
@@ -446,19 +446,19 @@ function toolchain(_buildDir, _libDir)
}
configuration { "x32", "mingw-clang" }
- targetdir (_buildDir .. "win32_mingw-clang" .. "/bin")
- objdir (_buildDir .. "win32_mingw-clang" .. "/obj")
+ targetdir (path.join(_buildDir, "win32_mingw-clang/bin"))
+ objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
libdirs {
- _libDir .. "lib/win32_mingw-clang",
+ path.join(_libDir, "lib/win32_mingw-clang"),
"$(DXSDK_DIR)/lib/x86",
}
buildoptions { "-m32" }
configuration { "x64", "mingw-clang" }
- targetdir (_buildDir .. "win64_mingw-clang" .. "/bin")
- objdir (_buildDir .. "win64_mingw-clang" .. "/obj")
+ targetdir (path.join(_buildDir, "win64_mingw-clang/bin"))
+ objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
libdirs {
- _libDir .. "lib/win64_mingw-clang",
+ path.join(_libDir, "lib/win64_mingw-clang"),
"$(DXSDK_DIR)/lib/x64",
"$(GLES_X64_DIR)",
}
@@ -487,33 +487,33 @@ function toolchain(_buildDir, _libDir)
}
configuration { "linux-gcc", "x32" }
- targetdir (_buildDir .. "linux32_gcc" .. "/bin")
- objdir (_buildDir .. "linux32_gcc" .. "/obj")
- libdirs { _libDir .. "lib/linux32_gcc" }
+ targetdir (path.join(_buildDir, "linux32_gcc/bin"))
+ objdir (path.join(_buildDir, "linux32_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux32_gcc") }
buildoptions {
"-m32",
}
configuration { "linux-gcc", "x64" }
- targetdir (_buildDir .. "linux64_gcc" .. "/bin")
- objdir (_buildDir .. "linux64_gcc" .. "/obj")
- libdirs { _libDir .. "lib/linux64_gcc" }
+ targetdir (path.join(_buildDir, "linux64_gcc/bin"))
+ objdir (path.join(_buildDir, "linux64_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux64_gcc") }
buildoptions {
"-m64",
}
configuration { "linux-clang", "x32" }
- targetdir (_buildDir .. "linux32_clang" .. "/bin")
- objdir (_buildDir .. "linux32_clang" .. "/obj")
- libdirs { _libDir .. "lib/linux32_clang" }
+ targetdir (path.join(_buildDir, "linux32_clang/bin"))
+ objdir (path.join(_buildDir, "linux32_clang/obj"))
+ libdirs { path.join(_libDir, "lib/linux32_clang") }
buildoptions {
"-m32",
}
configuration { "linux-clang", "x64" }
- targetdir (_buildDir .. "linux64_clang" .. "/bin")
- objdir (_buildDir .. "linux64_clang" .. "/obj")
- libdirs { _libDir .. "lib/linux64_clang" }
+ targetdir (path.join(_buildDir, "linux64_clang/bin"))
+ objdir (path.join(_buildDir, "linux64_clang/obj"))
+ libdirs { path.join(_libDir, "lib/linux64_clang") }
buildoptions {
"-m64",
}
@@ -559,17 +559,17 @@ function toolchain(_buildDir, _libDir)
}
configuration { "android-arm" }
- targetdir (_buildDir .. "android-arm" .. "/bin")
- objdir (_buildDir .. "android-arm" .. "/obj")
+ targetdir (path.join(_buildDir, "android-arm/bin"))
+ objdir (path.join(_buildDir, "android-arm/obj"))
libdirs {
- _libDir .. "lib/android-arm",
+ path.join(_libDir, "lib/android-arm"),
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
}
includedirs {
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
}
buildoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
"-mthumb",
"-march=armv7-a",
"-mfloat-abi=softfp",
@@ -578,46 +578,46 @@ function toolchain(_buildDir, _libDir)
"-Wundef",
}
linkoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtbegin_so.o",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtend_so.o",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
"-march=armv7-a",
"-Wl,--fix-cortex-a8",
}
configuration { "android-mips" }
- targetdir (_buildDir .. "android-mips" .. "/bin")
- objdir (_buildDir .. "android-mips" .. "/obj")
+ targetdir (path.join(_buildDir, "android-mips/bin"))
+ objdir (path.join(_buildDir, "android-mips/obj"))
libdirs {
- _libDir .. "lib/android-mips",
+ path.join(_libDir, "lib/android-mips"),
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips",
}
includedirs {
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include",
}
buildoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
"-Wunused-value",
"-Wundef",
}
linkoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtbegin_so.o",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtend_so.o",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtbegin_so.o"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtend_so.o"),
}
configuration { "android-x86" }
- targetdir (_buildDir .. "android-x86" .. "/bin")
- objdir (_buildDir .. "android-x86" .. "/obj")
+ targetdir (path.join(_buildDir, "android-x86/bin"))
+ objdir (path.join(_buildDir, "android-x86/obj"))
libdirs {
- _libDir .. "lib/android-x86",
+ path.join(_libDir, "lib/android-x86"),
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86",
}
includedirs {
"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include",
}
buildoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
"-march=i686",
"-mtune=atom",
"-mstackrealign",
@@ -627,15 +627,15 @@ function toolchain(_buildDir, _libDir)
"-Wundef",
}
linkoptions {
- "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtbegin_so.o",
- "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtend_so.o",
+ "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
+ path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "/arch-x86/usr/lib/crtend_so.o"),
}
configuration { "asmjs" }
- targetdir (_buildDir .. "asmjs" .. "/bin")
- objdir (_buildDir .. "asmjs" .. "/obj")
- libdirs { _libDir .. "lib/asmjs" }
+ targetdir (path.join(_buildDir, "asmjs/bin"))
+ objdir (path.join(_buildDir, "asmjs/obj"))
+ libdirs { path.join(_libDir, "lib/asmjs") }
buildoptions {
"-isystem$(EMSCRIPTEN)/system/include",
"-isystem$(EMSCRIPTEN)/system/include/libc",
@@ -644,11 +644,11 @@ function toolchain(_buildDir, _libDir)
}
configuration { "freebsd" }
- targetdir (_buildDir .. "freebsd" .. "/bin")
- objdir (_buildDir .. "freebsd" .. "/obj")
- libdirs { _libDir .. "lib/freebsd" }
+ targetdir (path.join(_buildDir, "freebsd/bin"))
+ objdir (path.join(_buildDir, "freebsd/obj"))
+ libdirs { path.join(_libDir, "lib/freebsd") }
includedirs {
- bxDir .. "include/compat/freebsd",
+ path.join(bxDir, "include/compat/freebsd"),
}
configuration { "nacl or nacl-arm or pnacl" }
@@ -664,7 +664,7 @@ function toolchain(_buildDir, _libDir)
}
includedirs {
"$(NACL_SDK_ROOT)/include",
- bxDir .. "include/compat/nacl",
+ path.join(bxDir, "include/compat/nacl"),
}
configuration { "nacl" }
@@ -678,9 +678,9 @@ function toolchain(_buildDir, _libDir)
}
configuration { "x32", "nacl" }
- targetdir (_buildDir .. "nacl-x86" .. "/bin")
- objdir (_buildDir .. "nacl-x86" .. "/obj")
- libdirs { _libDir .. "lib/nacl-x86" }
+ targetdir (path.join(_buildDir, "nacl-x86/bin"))
+ objdir (path.join(_buildDir, "nacl-x86/obj"))
+ libdirs { path.join(_libDir, "lib/nacl-x86") }
linkoptions { "-melf32_nacl" }
configuration { "x32", "nacl", "Debug" }
@@ -690,9 +690,9 @@ function toolchain(_buildDir, _libDir)
libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release" }
configuration { "x64", "nacl" }
- targetdir (_buildDir .. "nacl-x64" .. "/bin")
- objdir (_buildDir .. "nacl-x64" .. "/obj")
- libdirs { _libDir .. "lib/nacl-x64" }
+ targetdir (path.join(_buildDir, "nacl-x64/bin"))
+ objdir (path.join(_buildDir, "nacl-x64/obj"))
+ libdirs { path.join(_libDir, "lib/nacl-x64") }
linkoptions { "-melf64_nacl" }
configuration { "x64", "nacl", "Debug" }
@@ -705,9 +705,9 @@ function toolchain(_buildDir, _libDir)
buildoptions {
"-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
}
- targetdir (_buildDir .. "nacl-arm" .. "/bin")
- objdir (_buildDir .. "nacl-arm" .. "/obj")
- libdirs { _libDir .. "lib/nacl-arm" }
+ targetdir (path.join(_buildDir, "nacl-arm/bin"))
+ objdir (path.join(_buildDir, "nacl-arm/obj"))
+ libdirs { path.join(_libDir, "lib/nacl-arm") }
configuration { "nacl-arm", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Debug" }
@@ -716,9 +716,9 @@ function toolchain(_buildDir, _libDir)
libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Release" }
configuration { "pnacl" }
- targetdir (_buildDir .. "pnacl" .. "/bin")
- objdir (_buildDir .. "pnacl" .. "/obj")
- libdirs { _libDir .. "lib/pnacl" }
+ targetdir (path.join(_buildDir, "pnacl/bin"))
+ objdir (path.join(_buildDir, "pnacl/obj"))
+ libdirs { path.join(_libDir, "lib/pnacl") }
configuration { "pnacl", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" }
@@ -727,27 +727,27 @@ function toolchain(_buildDir, _libDir)
libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" }
configuration { "Xbox360" }
- targetdir (_buildDir .. "xbox360" .. "/bin")
- objdir (_buildDir .. "xbox360" .. "/obj")
- includedirs { bxDir .. "include/compat/msvc" }
- libdirs { _libDir .. "lib/xbox360" }
+ targetdir (path.join(_buildDir, "xbox360/bin"))
+ objdir (path.join(_buildDir, "xbox360/obj"))
+ includedirs { path.join(bxDir, "include/compat/msvc") }
+ libdirs { path.join(_libDir, "lib/xbox360") }
defines {
"NOMINMAX",
"_XBOX",
}
configuration { "osx", "x32" }
- targetdir (_buildDir .. "osx32_clang" .. "/bin")
- objdir (_buildDir .. "osx32_clang" .. "/obj")
- libdirs { _libDir .. "lib/osx32_clang" }
+ targetdir (path.join(_buildDir, "osx32_clang/bin"))
+ objdir (path.join(_buildDir, "osx32_clang/obj"))
+ libdirs { path.join(_libDir, "lib/osx32_clang") }
buildoptions {
"-m32",
}
configuration { "osx", "x64" }
- targetdir (_buildDir .. "osx64_clang" .. "/bin")
- objdir (_buildDir .. "osx64_clang" .. "/obj")
- libdirs { _libDir .. "lib/osx64_clang" }
+ targetdir (path.join(_buildDir, "osx64_clang/bin"))
+ objdir (path.join(_buildDir, "osx64_clang/obj"))
+ libdirs { path.join(_libDir, "lib/osx64_clang") }
buildoptions {
"-m64",
}
@@ -759,7 +759,7 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
- includedirs { bxDir .. "include/compat/osx" }
+ includedirs { path.join(bxDir, "include/compat/osx") }
configuration { "ios*" }
linkoptions {
@@ -770,12 +770,12 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
- includedirs { bxDir .. "include/compat/ios" }
+ includedirs { path.join(bxDir, "include/compat/ios") }
configuration { "ios-arm" }
- targetdir (_buildDir .. "ios-arm" .. "/bin")
- objdir (_buildDir .. "ios-arm" .. "/obj")
- libdirs { _libDir .. "lib/ios-arm" }
+ targetdir (path.join(_buildDir, "ios-arm/bin"))
+ objdir (path.join(_buildDir, "ios-arm/obj"))
+ libdirs { path.join(_libDir, "lib/ios-arm") }
linkoptions {
"-miphoneos-version-min=7.0",
"-arch armv7",
@@ -791,9 +791,9 @@ function toolchain(_buildDir, _libDir)
}
configuration { "ios-simulator" }
- targetdir (_buildDir .. "ios-simulator" .. "/bin")
- objdir (_buildDir .. "ios-simulator" .. "/obj")
- libdirs { _libDir .. "lib/ios-simulator" }
+ targetdir (path.join(_buildDir, "ios-simulator/bin"))
+ objdir (path.join(_buildDir, "ios-simulator/obj"))
+ libdirs { path.join(_libDir, "lib/ios-simulator") }
linkoptions {
"-mios-simulator-version-min=7.0",
"-arch i386",
@@ -809,10 +809,10 @@ function toolchain(_buildDir, _libDir)
}
configuration { "qnx-arm" }
- targetdir (_buildDir .. "qnx-arm" .. "/bin")
- objdir (_buildDir .. "qnx-arm" .. "/obj")
- libdirs { _libDir .. "lib/qnx-arm" }
--- includedirs { bxDir .. "include/compat/qnx" }
+ targetdir (path.join(_buildDir, "qnx-arm/bin"))
+ objdir (path.join(_buildDir, "qnx-arm/obj"))
+ libdirs { path.join(_libDir, "lib/qnx-arm") }
+-- includedirs { path.join(bxDir, "include/compat/qnx") }
buildoptions {
"-std=c++0x",
"-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
@@ -821,10 +821,10 @@ function toolchain(_buildDir, _libDir)
}
configuration { "rpi" }
- targetdir (_buildDir .. "rpi" .. "/bin")
- objdir (_buildDir .. "rpi" .. "/obj")
+ targetdir (path.join(_buildDir, "rpi/bin"))
+ objdir (path.join(_buildDir, "rpi/obj"))
libdirs {
- _libDir .. "lib/rpi",
+ path.join(_libDir, "lib/rpi"),
"/opt/vc/lib",
}
defines {
diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md
index 1269aeb30c3..509e23c02a5 100644
--- a/3rdparty/genie/README.md
+++ b/3rdparty/genie/README.md
@@ -61,15 +61,18 @@ intention to keep it compatible with it.
- Added ability to configure Visual Studio toolset from GENie script.
- Added `UnsignedChar` flag to force char to be unsigned.
- Removed vs2002, vs2003, vs2005, Solaris, and Haiku support.
- - Allow source files in the same project to have the same name.
+ - Allow source files in the same project to have the same name. Added
+ `SingleOutputDir` flag to use single output directory (original behaviour).
- Added WinRT support.
- Added `removeflags`, `removelinks`.
- Added vs2015 support.
- Added `targetsubdir`.
- Added support for solution folders `group`.
- - Added `options` section (and `ForceCpp` to enforce C++ compile even if extension is for C files)
- - Added `msgcompile`, `msgresource`, `msglinking` and `msgarchiving` as overrides for make messages
- - Added `messageskip` list to disable some of compiler messages
+ - Added `options` section (and `ForceCpp` to enforce C++ compile even if
+ extension is for C files)
+ - Added `msgcompile`, `msgresource`, `msglinking` and `msgarchiving` as
+ overrides for make messages.
+ - Added `messageskip` list to disable some of compiler messages.
## Why fork?
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua
index dbc22063739..9ae28a8e714 100644
--- a/3rdparty/genie/src/actions/make/make_cpp.lua
+++ b/3rdparty/genie/src/actions/make/make_cpp.lua
@@ -324,8 +324,8 @@
_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " "))
- _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))
- _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))
+ _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
+ _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',
make.list(table.join(cc.getdefines(cfg.resdefines),
diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua
index af2f9f95151..c46567a0631 100644
--- a/3rdparty/genie/src/base/api.lua
+++ b/3rdparty/genie/src/base/api.lua
@@ -42,6 +42,12 @@
scope = "config",
},
+ buildoptions_c =
+ {
+ kind = "list",
+ scope = "config",
+ },
+
buildoptions_cpp =
{
kind = "list",
@@ -130,6 +136,7 @@
NoNativeWChar = 1,
NoPCH = 1,
NoRTTI = 1,
+ SingleOutputDir = 1,
Optimize = 1,
OptimizeSize = 1,
OptimizeSpeed = 1,
diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua
index b8843422ff6..7a12e6b8528 100644
--- a/3rdparty/genie/src/base/bake.lua
+++ b/3rdparty/genie/src/base/bake.lua
@@ -380,7 +380,11 @@
dir = cfg_dirs[cfg][v]
if hit_counts[dir] == 1 then break end
end
- cfg.objectsdir = path.getrelative(cfg.location, dir)
+ if (cfg.flags.SingleOutputDir) then
+ cfg.objectsdir = cfg.objdir or cfg.project.objdir or "obj"
+ else
+ cfg.objectsdir = path.getrelative(cfg.location, dir)
+ end
end
end
end
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index a5ce08fcf75..837d46e8d07 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -69,33 +69,33 @@ const char* builtin_scripts[] = {
"m)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\n for _, pattern in ipairs(removes) do\n if pattern == tbl[i] then\n table.remove(tbl, i)\n break\n end\n end\n end\nend\nlocal function mergeobject(dest, src)\nif not src then \nreturn \nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend"
"\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then \nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then \ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nf"
"or _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, "
- "2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n \n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n \n return nil\n end\n \n local function getprojrec(dstArray, foundList, cfg, cfgname, searc"
- "hField, bLinkage)\n if(not cfg) then return end\n \n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n \n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n \n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname"
- "],\n cfgname, searchField, bLinkage);\n end\n end\n end\n \n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.pr"
- "oject.name:lower()] = true;\n \n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n \n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n \"links\", true);\n end\n \n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n \n return dstArray;\n end\n \n \n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n \n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstC"
- "fg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n \n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n "
- " dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n \n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n \n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n \n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageO"
- "nly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n \n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor "
- "_, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nels"
- "e\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
+ "2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\nif (cfg.flags.SingleOutputDir) then\ncfg.objectsdir = cfg.objdir or cfg.project.objdir or \"obj\"\nelse\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n \n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].k"
+ "ind;\n end\n \n return nil\n end\n \n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n \n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n \n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n \n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind("
+ "usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n \n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local func"
+ "tion getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n \n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n \n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n \"links\", true);\n end\n \n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n \n return dstArray;\n end\n \n \n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n \n return false;\n e"
+ "nd\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n \n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n"
+ " dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n \n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n \n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n \n for name, field"
+ " in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n \n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\n"
+ "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nloca"
+ "l platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
/* base/api.lua */
- "premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = functi"
- "on(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,"
- "\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind "
- " = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\ns"
- "cope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\","
- "\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:s"
- "ub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nel"
- "seif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: exp"
- "ected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) "
- "then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.s"
- "etarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n info.kind == \"dirlist\" or \n info.kind == \"filelist\" or\n info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords"
- " = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function cre"
- "ateproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \""
- "solution\") then\nerror(\"no active solution\", 2)\nend\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usage projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln = premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end"
- "\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npre"
- "make.option.add(opt)\nend\n",
+ "premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = "
+ "\"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\ni"
+ "f v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nsco"
+ "pe = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\n"
+ "kind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\n"
+ "kind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\")"
+ " then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not conta"
+ "iner) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.i"
+ "nsert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err"
+ " = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn "
+ "premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n info.kind == \"dirlist\" or \n info.kind == \"filelist\" or\n info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\n"
+ "table.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgr"
+ "oup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.Curr"
+ "entContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usage projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln "
+ "= premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\n"
+ "end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
/* base/cmdline.lua */
"newoption \n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{"
@@ -185,10 +185,10 @@ const char* builtin_scripts[] = {
"$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $("
"SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, fi"
"le in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platfor"
- "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedir"
- "s(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\n"
- "local testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OB"
- "JDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
+ "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resd"
+ "efines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = p"
+ "ath.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\n"
+ "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
"local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
diff --git a/3rdparty/mongoose/docs/API.md b/3rdparty/mongoose/docs/API.md
index 5fb61a2e018..9549c4f9d63 100644
--- a/3rdparty/mongoose/docs/API.md
+++ b/3rdparty/mongoose/docs/API.md
@@ -1,6 +1,6 @@
# Mongoose API Reference
- struct mg_server *mg_create_server(void *server_param);
+ struct mg_server *mg_create_server(void *server_param, mg_handler_t handler);
Creates web server instance. Returns opaque instance pointer, or NULL if
there is not enough memory. `server_param`: Could be any pointer, or NULL.
@@ -173,7 +173,7 @@ a response body. Mongoose provides functions for all three parts:
Mongoose will call a handler repeatedly after each socket write.
<!-- -->
-
+
void mg_send_file(struct mg_connection *, const char *path);
Tells Mongoose to serve given file. Mongoose handles file according to
@@ -187,7 +187,7 @@ event handler must return `MG_MORE`.
const char *data, size_t data_len);
Similar to `mg_write()`, but wraps the data into a websocket frame with a
-given websocket `opcode`.
+given websocket `opcode`.
const char *mg_get_header(const struct mg_connection *, const char *name);
@@ -219,15 +219,15 @@ the length of the fetched value, or 0 if variable not found.
const char *user,
const char *password);
-Add, edit or delete the entry in the passwords file.
+Add, edit or delete the entry in the passwords file.
This function allows an application to manipulate .htpasswd files on the
fly by adding, deleting and changing user records. This is one of the
-several ways of implementing authentication on the server side.
+several ways of implementing authentication on the server side.
If password is not NULL, entry is added (or modified if already exists).
-If password is NULL, entry is deleted.
+If password is NULL, entry is deleted.
Return: 1 on success, 0 on error.
-
+
int mg_parse_multipart(const char *buf, int buf_len,
char *var_name, int var_name_len,
char *file_name, int file_name_len,
diff --git a/3rdparty/mongoose/docs/LuaSqlite.md b/3rdparty/mongoose/docs/LuaSqlite.md
deleted file mode 100644
index 18e160a3d47..00000000000
--- a/3rdparty/mongoose/docs/LuaSqlite.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Mongoose Lua Server Pages
-
-Pre-built Windows and Mac mongoose binaries support Lua Server Pages
-functionality.
-That means it is possible to write PHP-like scripts with mongoose
-using Lua programming language instead of PHP. Lua is known
-for it's speed and small size. Mongoose uses Lua version 5.2.3, the
-documentation for it can be found at
-[Lua 5.2 reference manual](http://www.lua.org/manual/5.2/).
-
-To create a Lua Page, make a file that is called `ANY_NAME.lp`. For example,
-`my_page.lp`. It is important to have a file
-name that ends up with `.lp`, cause this is the way mongoose recognises
-Lua Page file. The contents of the file, just like
-with PHP, is HTML with embedded Lua code. Lua code must be enclosed within
-`&lt;? ?&gt;` blocks, and can appear anywhere on the page.
-
-Mongoose does not send HTTP headers for Lua pages. Therefore,
-every Lua Page must begin with HTTP status line and headers, like this:
-
- <? mg.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n') ?>
- <html><body>
- <span>Today is:</span> <? mg.write(os.date("%A")) ?>
- </body></html>
-
-Note that this example uses function `mg.write()`, which prints data to the
-web page. Using function `mg.write()` is the way to generate web content from
-inside Lua code. In addition to `mg.write()`, all standard library functions
-are accessible from the Lua code (please check reference manual for details).
-Information about the request is available via the `mg.request_info` object.
-I contains request method, all headers, etcetera. Please refer to
-`struct mg_request_info` definition in
-[mongoose.h](https://github.com/cesanta/mongoose/blob/master/mongoose.h)
-to see what is available via the `mg.request_info` object.
-Check out [prime_numbers.lp](https://github.com/cesanta/mongoose/blob/master/examples/lua/prime_numbers.lp) for some example.
-
-Mongoose exports the following to the Lua Server Page:
-
- mg.write(str) -- writes string to the client
- mg.onerror(msg) -- error handler, can be overridden
- mg.request_info -- a table with request information
-
-Using Lua scripting it is easy to emulate SSI functionality. For example,
-to include the content of another file, one can write:
-
- <? mg.write(io.open('MY_FILE.TXT'):read('*all')) ?>
-
-To serve a Lua Page, mongoose creates Lua context. That context is used for
-all Lua blocks within the page. That means, all Lua blocks on the same page
-share the same context. If one block defines a variable, for example, that
-variable is visible in all following blocks.
diff --git a/3rdparty/mongoose/mongoose.c b/3rdparty/mongoose/mongoose.c
index 9014b90bf79..aa74d0b2d97 100644
--- a/3rdparty/mongoose/mongoose.c
+++ b/3rdparty/mongoose/mongoose.c
@@ -124,12 +124,7 @@ typedef struct _stati64 ns_stat_t;
#include <sys/socket.h>
#include <sys/select.h>
#define closesocket(x) close(x)
-#ifndef __OS2__
#define __cdecl
-#else
-#include <sys/time.h>
-typedef int socklen_t;
-#endif
#define INVALID_SOCKET (-1)
#define to64(x) strtoll(x, NULL, 10)
typedef int sock_t;
@@ -606,6 +601,30 @@ int ns_socketpair(sock_t sp[2]) {
// TODO(lsm): use non-blocking resolver
static int ns_resolve2(const char *host, struct in_addr *ina) {
+#ifdef NS_ENABLE_GETADDRINFO
+ int rv = 0;
+ struct addrinfo hints, *servinfo, *p;
+ struct sockaddr_in *h = NULL;
+ char *ip = NS_MALLOC(17);
+ memset(ip, '\0', 17);
+
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+
+ if((rv = getaddrinfo(host, NULL , NULL, &servinfo)) != 0) {
+ DBG(("getaddrinfo(%s) failed: %s", host, strerror(errno)));
+ return 0;
+ }
+
+ for(p = servinfo; p != NULL; p = p->ai_next) {
+ memcpy(&h, &p->ai_addr, sizeof(struct sockaddr_in *));
+ memcpy(ina, &h->sin_addr, sizeof(ina));
+ }
+
+ freeaddrinfo(servinfo);
+ return 1;
+#else
struct hostent *he;
if ((he = gethostbyname(host)) == NULL) {
DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
@@ -614,6 +633,7 @@ static int ns_resolve2(const char *host, struct in_addr *ina) {
return 1;
}
return 0;
+#endif
}
// Resolve FDQN "host", store IP address in the "ip".
@@ -1559,37 +1579,6 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#define MAP_FAILED NULL
#define MAP_PRIVATE 0
#define PROT_READ 0
-#elif defined(__OS2__)
-static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
- int offset) {
- void *p;
-
- int pos = lseek( fd, 0, SEEK_CUR ); /* Get a current position */
-
- if (pos == -1)
- return NULL;
-
- /* Seek to offset offset */
- if (lseek( fd, offset, SEEK_SET) == -1)
- return NULL;
-
- p = malloc(len);
-
- /* Read in a file */
- if (!p || read(fd, p, len) == -1) {
- free(p);
- p = NULL;
- }
-
- /* Restore the position */
- lseek(fd, pos, SEEK_SET);
-
- return p;
-}
-#define munmap(x, y) free(x)
-#define MAP_FAILED NULL
-#define MAP_PRIVATE 0
-#define PROT_READ 0
#else
#include <sys/mman.h>
#endif
@@ -3009,9 +2998,9 @@ size_t mg_websocket_write(struct mg_connection *conn, int opcode,
copy_len = 4 + data_len;
} else {
// 64-bit length field
- copy[1] = 127;
const uint32_t hi = htonl((uint32_t) ((uint64_t) data_len >> 32));
const uint32_t lo = htonl(data_len & 0xffffffff);
+ copy[1] = 127;
memcpy(copy+2,&hi,sizeof(hi));
memcpy(copy+6,&lo,sizeof(lo));
memcpy(copy + 10, data, data_len);