Bladeren bron

3rdparty: update bx, bimg and bgfx

Daniele Bartolini 6 jaren geleden
bovenliggende
commit
a9ff17f1f4
100 gewijzigde bestanden met toevoegingen van 643 en 9805 verwijderingen
  1. 2 1
      3rdparty/bgfx/.appveyor.yml
  2. 254 157
      3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
  3. 75 62
      3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
  4. 57 41
      3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
  5. 54 15
      3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
  6. 99 50
      3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
  7. 23 16
      3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
  8. 1 1
      3rdparty/bgfx/3rdparty/dear-imgui/widgets/dock.inl
  9. 0 94
      3rdparty/bgfx/3rdparty/glslang/.appveyor.yml
  10. 0 13
      3rdparty/bgfx/3rdparty/glslang/.clang-format
  11. 0 17
      3rdparty/bgfx/3rdparty/glslang/.gitattributes
  12. 0 10
      3rdparty/bgfx/3rdparty/glslang/.gitignore
  13. 0 128
      3rdparty/bgfx/3rdparty/glslang/.travis.yml
  14. 0 100
      3rdparty/bgfx/3rdparty/glslang/Android.mk
  15. 0 245
      3rdparty/bgfx/3rdparty/glslang/BUILD.bazel
  16. 0 247
      3rdparty/bgfx/3rdparty/glslang/BUILD.gn
  17. 0 214
      3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt
  18. 0 1
      3rdparty/bgfx/3rdparty/glslang/CODE_OF_CONDUCT.md
  19. 0 105
      3rdparty/bgfx/3rdparty/glslang/ChooseMSVCCRT.cmake
  20. 0 44
      3rdparty/bgfx/3rdparty/glslang/External/CMakeLists.txt
  21. 1 1
      3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt
  22. 0 137
      3rdparty/bgfx/3rdparty/glslang/README-spirv-remap.txt
  23. 0 390
      3rdparty/bgfx/3rdparty/glslang/README.md
  24. 6 3
      3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt
  25. 47 0
      3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  26. 2 0
      3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp
  27. 22 15
      3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt
  28. 0 28
      3rdparty/bgfx/3rdparty/glslang/Test/100.conf
  29. 0 227
      3rdparty/bgfx/3rdparty/glslang/Test/100.frag
  30. 0 76
      3rdparty/bgfx/3rdparty/glslang/Test/100Limits.vert
  31. 0 41
      3rdparty/bgfx/3rdparty/glslang/Test/100samplerExternal.frag
  32. 0 76
      3rdparty/bgfx/3rdparty/glslang/Test/100scope.vert
  33. 0 87
      3rdparty/bgfx/3rdparty/glslang/Test/110scope.vert
  34. 0 248
      3rdparty/bgfx/3rdparty/glslang/Test/120.frag
  35. 0 203
      3rdparty/bgfx/3rdparty/glslang/Test/120.vert
  36. 0 178
      3rdparty/bgfx/3rdparty/glslang/Test/130.frag
  37. 0 78
      3rdparty/bgfx/3rdparty/glslang/Test/130.vert
  38. 0 53
      3rdparty/bgfx/3rdparty/glslang/Test/140.frag
  39. 0 79
      3rdparty/bgfx/3rdparty/glslang/Test/140.vert
  40. 0 51
      3rdparty/bgfx/3rdparty/glslang/Test/150.frag
  41. 0 139
      3rdparty/bgfx/3rdparty/glslang/Test/150.geom
  42. 0 34
      3rdparty/bgfx/3rdparty/glslang/Test/150.tesc
  43. 0 35
      3rdparty/bgfx/3rdparty/glslang/Test/150.tese
  44. 0 29
      3rdparty/bgfx/3rdparty/glslang/Test/150.vert
  45. 0 161
      3rdparty/bgfx/3rdparty/glslang/Test/300.frag
  46. 0 204
      3rdparty/bgfx/3rdparty/glslang/Test/300.vert
  47. 0 76
      3rdparty/bgfx/3rdparty/glslang/Test/300BuiltIns.frag
  48. 0 58
      3rdparty/bgfx/3rdparty/glslang/Test/300block.frag
  49. 0 19
      3rdparty/bgfx/3rdparty/glslang/Test/300layout.frag
  50. 0 57
      3rdparty/bgfx/3rdparty/glslang/Test/300layout.vert
  51. 0 8
      3rdparty/bgfx/3rdparty/glslang/Test/300link.frag
  52. 0 11
      3rdparty/bgfx/3rdparty/glslang/Test/300link2.frag
  53. 0 7
      3rdparty/bgfx/3rdparty/glslang/Test/300link3.frag
  54. 0 135
      3rdparty/bgfx/3rdparty/glslang/Test/300operations.frag
  55. 0 41
      3rdparty/bgfx/3rdparty/glslang/Test/300samplerExternal.frag
  56. 0 38
      3rdparty/bgfx/3rdparty/glslang/Test/300samplerExternalYUV.frag
  57. 0 74
      3rdparty/bgfx/3rdparty/glslang/Test/300scope.vert
  58. 0 256
      3rdparty/bgfx/3rdparty/glslang/Test/310.comp
  59. 0 451
      3rdparty/bgfx/3rdparty/glslang/Test/310.frag
  60. 0 152
      3rdparty/bgfx/3rdparty/glslang/Test/310.geom
  61. 0 43
      3rdparty/bgfx/3rdparty/glslang/Test/310.inheritMemory.frag
  62. 0 184
      3rdparty/bgfx/3rdparty/glslang/Test/310.tesc
  63. 0 128
      3rdparty/bgfx/3rdparty/glslang/Test/310.tese
  64. 0 403
      3rdparty/bgfx/3rdparty/glslang/Test/310.vert
  65. 0 121
      3rdparty/bgfx/3rdparty/glslang/Test/310AofA.vert
  66. 0 8
      3rdparty/bgfx/3rdparty/glslang/Test/310implicitSizeArrayError.vert
  67. 0 18
      3rdparty/bgfx/3rdparty/glslang/Test/310runtimeArray.vert
  68. 0 17
      3rdparty/bgfx/3rdparty/glslang/Test/320.comp
  69. 0 225
      3rdparty/bgfx/3rdparty/glslang/Test/320.frag
  70. 0 134
      3rdparty/bgfx/3rdparty/glslang/Test/320.geom
  71. 0 161
      3rdparty/bgfx/3rdparty/glslang/Test/320.tesc
  72. 0 114
      3rdparty/bgfx/3rdparty/glslang/Test/320.tese
  73. 0 255
      3rdparty/bgfx/3rdparty/glslang/Test/320.vert
  74. 0 165
      3rdparty/bgfx/3rdparty/glslang/Test/330.frag
  75. 0 12
      3rdparty/bgfx/3rdparty/glslang/Test/330comp.frag
  76. 0 201
      3rdparty/bgfx/3rdparty/glslang/Test/400.frag
  77. 0 330
      3rdparty/bgfx/3rdparty/glslang/Test/400.geom
  78. 0 125
      3rdparty/bgfx/3rdparty/glslang/Test/400.tesc
  79. 0 125
      3rdparty/bgfx/3rdparty/glslang/Test/400.tese
  80. 0 106
      3rdparty/bgfx/3rdparty/glslang/Test/400.vert
  81. 0 39
      3rdparty/bgfx/3rdparty/glslang/Test/410.geom
  82. 0 11
      3rdparty/bgfx/3rdparty/glslang/Test/410.tesc
  83. 0 9
      3rdparty/bgfx/3rdparty/glslang/Test/410.vert
  84. 0 30
      3rdparty/bgfx/3rdparty/glslang/Test/420.comp
  85. 0 14
      3rdparty/bgfx/3rdparty/glslang/Test/420.frag
  86. 0 55
      3rdparty/bgfx/3rdparty/glslang/Test/420.geom
  87. 0 43
      3rdparty/bgfx/3rdparty/glslang/Test/420.tesc
  88. 0 90
      3rdparty/bgfx/3rdparty/glslang/Test/420.tese
  89. 0 161
      3rdparty/bgfx/3rdparty/glslang/Test/420.vert
  90. 0 21
      3rdparty/bgfx/3rdparty/glslang/Test/420_size_gl_in.geom
  91. 0 90
      3rdparty/bgfx/3rdparty/glslang/Test/430.comp
  92. 0 223
      3rdparty/bgfx/3rdparty/glslang/Test/430.vert
  93. 0 108
      3rdparty/bgfx/3rdparty/glslang/Test/430AofA.frag
  94. 0 74
      3rdparty/bgfx/3rdparty/glslang/Test/430scope.vert
  95. 0 2
      3rdparty/bgfx/3rdparty/glslang/Test/435.vert
  96. 0 153
      3rdparty/bgfx/3rdparty/glslang/Test/440.frag
  97. 0 197
      3rdparty/bgfx/3rdparty/glslang/Test/440.vert
  98. 0 6
      3rdparty/bgfx/3rdparty/glslang/Test/450.comp
  99. 0 68
      3rdparty/bgfx/3rdparty/glslang/Test/450.frag
  100. 0 19
      3rdparty/bgfx/3rdparty/glslang/Test/450.geom

+ 2 - 1
3rdparty/bgfx/.appveyor.yml

@@ -1,11 +1,12 @@
 shallow_clone: true
 
 os:
-  - Visual Studio 2017
+  - Visual Studio 2019
 
 environment:
   matrix:
   - TOOLSET: vs2017
+  - TOOLSET: vs2019
 
 configuration:
   - Debug

+ 254 - 157
3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (main code and documentation)
 
 // Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
@@ -29,12 +29,12 @@ DOCUMENTATION
 - MISSION STATEMENT
 - END-USER GUIDE
 - PROGRAMMER GUIDE
-  - Read first.
-  - How to update to a newer version of Dear ImGui.
-  - Getting started with integrating Dear ImGui in your code/engine.
-  - This is how a simple application may look like (2 variations).
-  - This is how a simple rendering function may look like.
-  - Using gamepad/keyboard navigation controls.
+  - READ FIRST
+  - HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI
+  - GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
+  - HOW A SIMPLE APPLICATION MAY LOOK LIKE (2 variations)
+  - HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
+  - USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
 - API BREAKING CHANGES (read me when you update!)
 - FREQUENTLY ASKED QUESTIONS (FAQ)
   - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer)
@@ -45,7 +45,8 @@ CODE
 // [SECTION] FORWARD DECLARATIONS
 // [SECTION] CONTEXT AND MEMORY ALLOCATORS
 // [SECTION] MAIN USER FACING STRUCTURES (ImGuiStyle, ImGuiIO)
-// [SECTION] MISC HELPERS/UTILITIES (Maths, String, Format, Hash, File functions)
+// [SECTION] MISC HELPERS/UTILITIES (Geometry, String, Format, Hash, File functions)
+// [SECTION] MISC HELPERS/UTILITIES (File functions)
 // [SECTION] MISC HELPERS/UTILITIES (ImText* functions)
 // [SECTION] MISC HELPERS/UTILITIES (Color functions)
 // [SECTION] ImGuiStorage
@@ -118,8 +119,8 @@ CODE
  PROGRAMMER GUIDE
  ================
 
- READ FIRST:
-
+ READ FIRST
+ ----------
  - Remember to read the FAQ (https://www.dearimgui.org/faq)
  - Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic, there are no construction
    or destruction steps, less superfluous data retention on your side, less state duplication, less state synchronization, less bugs.
@@ -140,8 +141,8 @@ CODE
    However, imgui_internal.h can optionally export math operators for ImVec2/ImVec4, which we use in this codebase.
  - C++: pay attention that ImVector<> manipulates plain-old-data and does not honor construction/destruction (avoid using it in your code!).
 
- HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI:
-
+ HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI
+ ----------------------------------------------
  - Overwrite all the sources files except for imconfig.h (if you have made modification to your copy of imconfig.h)
  - Or maintain your own branch where you have imconfig.h modified.
  - Read the "API BREAKING CHANGES" section (below). This is where we list occasional API breaking changes.
@@ -150,8 +151,8 @@ CODE
    likely be a comment about it. Please report any issue to the GitHub page!
  - Try to keep your copy of dear imgui reasonably up to date.
 
- GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE:
-
+ GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
+ ---------------------------------------------------------------
  - Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
  - Add the Dear ImGui source files to your projects or using your preferred build system.
    It is recommended you build and statically link the .cpp files as part of your project and not as shared library (DLL).
@@ -163,7 +164,8 @@ CODE
  - Refer to the bindings and demo applications in the examples/ folder for instruction on how to setup your code.
  - If you are running over a standard OS with a common graphics API, you should be able to use unmodified imgui_impl_*** files from the examples/ folder.
 
- HOW A SIMPLE APPLICATION MAY LOOK LIKE:
+ HOW A SIMPLE APPLICATION MAY LOOK LIKE
+ --------------------------------------
  EXHIBIT 1: USING THE EXAMPLE BINDINGS (imgui_impl_XXX.cpp files from the examples/ folder).
 
      // Application init: create a dear imgui context, setup some options, load fonts
@@ -199,8 +201,7 @@ CODE
      ImGui_ImplWin32_Shutdown();
      ImGui::DestroyContext();
 
- HOW A SIMPLE APPLICATION MAY LOOK LIKE:
- EXHIBIT 2: IMPLEMENTING CUSTOM BINDING / CUSTOM ENGINE.
+ EXHIBIT 2: IMPLEMENTING CUSTOM BINDING / CUSTOM ENGINE
 
      // Application init: create a dear imgui context, setup some options, load fonts
      ImGui::CreateContext();
@@ -254,8 +255,8 @@ CODE
      // Shutdown
      ImGui::DestroyContext();
 
- HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE:
-
+ HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
+ ---------------------------------------------
     void void MyImGuiRenderFunction(ImDrawData* draw_data)
     {
        // TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled
@@ -292,7 +293,7 @@ CODE
                  MyEngineScissor((int)(pcmd->ClipRect.x - pos.x), (int)(pcmd->ClipRect.y - pos.y), (int)(pcmd->ClipRect.z - pos.x), (int)(pcmd->ClipRect.w - pos.y));
 
                  // Render 'pcmd->ElemCount/3' indexed triangles.
-                 // By default the indices ImDrawIdx are 16-bits, you can change them to 32-bits in imconfig.h if your engine doesn't support 16-bits indices.
+                 // By default the indices ImDrawIdx are 16-bit, you can change them to 32-bit in imconfig.h if your engine doesn't support 16-bit indices.
                  MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer, vtx_buffer);
              }
              idx_buffer += pcmd->ElemCount;
@@ -307,11 +308,20 @@ CODE
  - Refer to the FAQ for more information. Amusingly, it is called a FAQ because people frequently run into the same issues!
 
  USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
-
+ ------------------------------------------
  - The gamepad/keyboard navigation is fairly functional and keeps being improved.
- - Gamepad support is particularly useful to use dear imgui on a console system (e.g. PS4, Switch, XB1) without a mouse!
+ - Gamepad support is particularly useful to use Dear ImGui on a console system (e.g. PS4, Switch, XB1) without a mouse!
  - You can ask questions and report issues at https://github.com/ocornut/imgui/issues/787
  - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable.
+ - Keyboard:
+    - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
+      NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
+    - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag
+      will be set. For more advanced uses, you may want to read from:
+       - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set.
+       - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used).
+       - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions.
+      Please reach out if you think the game vs navigation input sharing could be improved.
  - Gamepad:
     - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
     - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame().
@@ -323,15 +333,6 @@ CODE
     - You can download PNG/PSD files depicting the gamepad controls for common controllers at: http://goo.gl/9LgVZW.
     - If you need to share inputs between your game and the imgui parts, the easiest approach is to go all-or-nothing, with a buttons combo
       to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved.
- - Keyboard:
-    - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
-      NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
-    - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag
-      will be set. For more advanced uses, you may want to read from:
-       - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set.
-       - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used).
-       - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions.
-      Please reach out if you think the game vs navigation input sharing could be improved.
  - Mouse:
     - PS4 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback.
     - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard.
@@ -352,7 +353,28 @@ CODE
  When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
  You can read releases logs https://github.com/ocornut/imgui/releases for more details.
 
- - 2019/10/22 (1.74) - removed redirecting functions/enums that were marked obsolete in 1.52 (October 2017): Begin() (5 arguments signature), IsRootWindowOrAnyChildHovered(), AlignFirstTextHeightToWidgets(), SetNextWindowPosCenter(), ImFont::Glyph. See docs/Changelog.txt or grep this log for details and new names, or see how they were implemented until 1.73.
+ - 2019/12/13 (1.75) - [imgui_internal.h] changed ImRect() default constructor initializes all fields to 0.0f instead of (FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX). If you used ImRect::Add() to create bounding boxes by adding multiple points into it, you may need to fix your initial value.
+ - 2019/12/08 (1.75) - removed redirecting functions/enums that were marked obsolete in 1.53 (December 2017):
+                       - ShowTestWindow()                    -> use ShowDemoWindow()
+                       - IsRootWindowFocused()               -> use IsWindowFocused(ImGuiFocusedFlags_RootWindow)
+                       - IsRootWindowOrAnyChildFocused()     -> use IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows)
+                       - SetNextWindowContentWidth(w)        -> use SetNextWindowContentSize(ImVec2(w, 0.0f)
+                       - GetItemsLineHeightWithSpacing()     -> use GetFrameHeightWithSpacing()
+                       - ImGuiCol_ChildWindowBg              -> use ImGuiCol_ChildBg
+                       - ImGuiStyleVar_ChildWindowRounding   -> use ImGuiStyleVar_ChildRounding
+                       - ImGuiTreeNodeFlags_AllowOverlapMode -> use ImGuiTreeNodeFlags_AllowItemOverlap
+                       - IMGUI_DISABLE_TEST_WINDOWS          -> use IMGUI_DISABLE_DEMO_WINDOWS
+ - 2019/12/08 (1.75) - obsoleted calling ImDrawList::PrimReserve() with a negative count (which was the vaguely documented and rarely if ever used). Instead we added an explicit PrimUnreserve() API.
+ - 2019/12/06 (1.75) - removed implicit default parameter to IsMouseDragging(int button = 0) to be consistent with other mouse functions (none of the other functions have it).
+ - 2019/11/21 (1.74) - ImFontAtlas::AddCustomRectRegular() now requires an ID larger than 0x110000 (instead of 0x10000) to conform with supporting Unicode planes 1-16 in a future update. ID below 0x110000 will now assert.
+ - 2019/11/19 (1.74) - renamed IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS to IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS for consistency.
+ - 2019/11/19 (1.74) - renamed IMGUI_DISABLE_MATH_FUNCTIONS to IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS for consistency.
+ - 2019/10/22 (1.74) - removed redirecting functions/enums that were marked obsolete in 1.52 (October 2017):
+                       - Begin() [old 5 args version]        -> use Begin() [3 args], use SetNextWindowSize() SetNextWindowBgAlpha() if needed
+                       - IsRootWindowOrAnyChildHovered()     -> use IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows)
+                       - AlignFirstTextHeightToWidgets()     -> use AlignTextToFramePadding()
+                       - SetNextWindowPosCenter()            -> use SetNextWindowPos() with a pivot of (0.5f, 0.5f)
+                       - ImFont::Glyph                       -> use ImFontGlyph
  - 2019/10/14 (1.74) - inputs: Fixed a miscalculation in the keyboard/mouse "typematic" repeat delay/rate calculation, used by keys and e.g. repeating mouse buttons as well as the GetKeyPressedAmount() function.
                        if you were using a non-default value for io.KeyRepeatRate (previous default was 0.250), you can add +io.KeyRepeatDelay to it to compensate for the fix.
                        The function was triggering on: 0.0 and (delay+rate*N) where (N>=1). Fixed formula responds to (N>=0). Effectively it made io.KeyRepeatRate behave like it was set to (io.KeyRepeatRate + io.KeyRepeatDelay).
@@ -470,14 +492,9 @@ CODE
  - 2016/09/25 (1.50) - style.WindowTitleAlign is now a ImVec2 (ImGuiAlign enum was removed). set to (0.5f,0.5f) for horizontal+vertical centering, (0.0f,0.0f) for upper-left, etc.
  - 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal.
  - 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore.
-                       If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you.
-                       If your TitleBg/TitleBgActive alpha was <1.0f you need to tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
-                       This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color.
-                           ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col)
-                           {
-                               float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a;
-                               return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a);
-                           }
+                       If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you, otherwise if <1.0f you need tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
+                       This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color: 
+                       ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); }
                        If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color.
  - 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext().
  - 2016/05/02 (1.49) - renamed SetNextTreeNodeOpened() to SetNextTreeNodeOpen(), no redirection.
@@ -536,14 +553,13 @@ CODE
  - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
  - 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions.
  - 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader.
-              (1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels.
-                       font init:  { const void* png_data; unsigned int png_size; ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size); <..Upload texture to GPU..>; }
-                       became:     { unsigned char* pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); <..Upload texture to GPU>; io.Fonts->TexId = YourTextureIdentifier; }
-                       you now have more flexibility to load multiple TTF fonts and manage the texture buffer for internal needs.
-                       it is now recommended that you sample the font texture with bilinear interpolation.
-              (1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render images). make sure to set io.Fonts->TexID.
-              (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix)
-              (1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets
+ - 2015/01/11 (1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels.
+                       - old:  const void* png_data; unsigned int png_size; ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size); [..Upload texture to GPU..];
+                       - new:  unsigned char* pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); [..Upload texture to GPU..]; io.Fonts->TexId = YourTexIdentifier;
+                       you now have more flexibility to load multiple TTF fonts and manage the texture buffer for internal needs. It is now recommended that you sample the font texture with bilinear interpolation.
+ - 2015/01/11 (1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render images). make sure to set io.Fonts->TexID.
+ - 2015/01/11 (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix)
+ - 2015/01/11 (1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets
  - 2014/12/10 (1.18) - removed SetNewWindowDefaultPos() in favor of new generic API SetNextWindowPos(pos, ImGuiSetCondition_FirstUseEver)
  - 2014/11/28 (1.17) - moved IO.Font*** options to inside the IO.Font-> structure (FontYOffset, FontTexUvForWhite, FontBaseScale, FontFallbackGlyph)
  - 2014/11/26 (1.17) - reworked syntax of IMGUI_ONCE_UPON_A_FRAME helper macro to increase compiler compatibility
@@ -572,13 +588,16 @@ CODE
     - See demo code in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function.
     - The demo covers most features of Dear ImGui, so you can read the code and see its output.
     - See documentation and comments at the top of imgui.cpp + effectively imgui.h.
-    - Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the examples/
-      folder to explain how to integrate Dear ImGui with your own engine/application.
+    - Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the
+      examples/ folder to explain how to integrate Dear ImGui with your own engine/application.
+    - The Wiki (https://github.com/ocornut/imgui/wiki) has many resources and links.
+    - The Glossary (https://github.com/ocornut/imgui/wiki/Glossary) page also may be useful.
     - Your programming IDE is your friend, find the type or function declaration to find comments
       associated to it.
 
  Q: Which version should I get?
  Q: Why the names "Dear ImGui" vs "ImGui"?
+ >> This library is called "Dear ImGui", please don't call it "ImGui" :)
  >> See https://www.dearimgui.org/faq
 
  Q&A: Concerns
@@ -608,6 +627,7 @@ CODE
      have 'io.WantCaptureKeyboard=false'. Depending on your application logic it may or not be inconvenient. You might want to track which key-downs
      were targeted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.)
 
+ Q. How can I enable keyboard controls?
  Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)
  Q: I integrated Dear ImGui in my engine and the text or lines are blurry..
  Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
@@ -747,7 +767,7 @@ CODE
  Q: How can I easily use icons in my application?
  Q: How can I load multiple fonts?
  Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
- >> See https://www.dearimgui.org/faq and misc/fonts/README.txt
+ >> See https://www.dearimgui.org/faq and docs/FONTS.txt
 
  Q&A: Community
  ==============
@@ -1003,6 +1023,7 @@ ImGuiIO::ImGuiIO()
 {
     // Most fields are initialized with zero
     memset(this, 0, sizeof(*this));
+    IM_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT); // Our pre-C++11 IM_STATIC_ASSERT() macros triggers warning on modern compilers so we don't use it here.
 
     // Settings
     ConfigFlags = ImGuiConfigFlags_None;
@@ -1065,7 +1086,7 @@ ImGuiIO::ImGuiIO()
 // - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
 void ImGuiIO::AddInputCharacter(unsigned int c)
 {
-    if (c > 0 && c < 0x10000)
+    if (c > 0 && c <= IM_UNICODE_CODEPOINT_MAX)
         InputQueueCharacters.push_back((ImWchar)c);
 }
 
@@ -1075,7 +1096,7 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
     {
         unsigned int c = 0;
         utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL);
-        if (c > 0 && c < 0x10000)
+        if (c > 0 && c <= IM_UNICODE_CODEPOINT_MAX)
             InputQueueCharacters.push_back((ImWchar)c);
     }
 }
@@ -1086,7 +1107,7 @@ void ImGuiIO::ClearInputCharacters()
 }
 
 //-----------------------------------------------------------------------------
-// [SECTION] MISC HELPERS/UTILITIES (Maths, String, Format, Hash, File functions)
+// [SECTION] MISC HELPERS/UTILITIES (Geometry, String, Format, Hash, File functions)
 //-----------------------------------------------------------------------------
 
 ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p)
@@ -1190,7 +1211,7 @@ const char* ImStrchrRange(const char* str, const char* str_end, char c)
 
 int ImStrlenW(const ImWchar* str)
 {
-    //return (int)wcslen((const wchar_t*)str);  // FIXME-OPT: Could use this when wchar_t are 16-bits
+    //return (int)wcslen((const wchar_t*)str);  // FIXME-OPT: Could use this when wchar_t are 16-bit
     int n = 0;
     while (*str++) n++;
     return n;
@@ -1258,12 +1279,16 @@ const char* ImStrSkipBlank(const char* str)
 // A) MSVC version appears to return -1 on overflow, whereas glibc appears to return total count (which may be >= buf_size).
 // Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm.
 // B) When buf==NULL vsnprintf() will return the output size.
-#ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
+#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
 
+// We support stb_sprintf which is much faster (see: https://github.com/nothings/stb/blob/master/stb_sprintf.h)
+// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS 
+// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are 
+// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
 //#define IMGUI_USE_STB_SPRINTF
 #ifdef IMGUI_USE_STB_SPRINTF
 #define STB_SPRINTF_IMPLEMENTATION
-#include "imstb_sprintf.h"
+#include "stb_sprintf.h"
 #endif
 
 #if defined(_MSC_VER) && !defined(vsnprintf)
@@ -1302,7 +1327,7 @@ int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args)
     buf[w] = 0;
     return w;
 }
-#endif // #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
+#endif // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
 
 // CRC32 needs a 1KB lookup table (not cache friendly)
 // Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily:
@@ -1374,10 +1399,16 @@ ImU32 ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
     return ~crc;
 }
 
-FILE* ImFileOpen(const char* filename, const char* mode)
+//-----------------------------------------------------------------------------
+// [SECTION] MISC HELPERS/UTILITIES (File functions)
+//-----------------------------------------------------------------------------
+
+// Default file functions
+#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
+ImFileHandle ImFileOpen(const char* filename, const char* mode)
 {
 #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
-    // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can)
+    // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. 
     const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
     const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;
     ImVector<ImWchar> buf;
@@ -1390,42 +1421,48 @@ FILE* ImFileOpen(const char* filename, const char* mode)
 #endif
 }
 
-// Load file content into memory
+// We should in theory be using fseeko()/ftello() with off_t and _fseeki64()/_ftelli64() with __int64, waiting for the PR that does that in a very portable pre-C++11 zero-warnings way.
+bool    ImFileClose(ImFileHandle f)     { return fclose(f) == 0; }
+ImU64   ImFileGetSize(ImFileHandle f)   { long off = 0, sz = 0; return ((off = ftell(f)) != -1 && !fseek(f, 0, SEEK_END) && (sz = ftell(f)) != -1 && !fseek(f, off, SEEK_SET)) ? (ImU64)sz : (ImU64)-1; }
+ImU64   ImFileRead(void* data, ImU64 sz, ImU64 count, ImFileHandle f)           { return fread(data, (size_t)sz, (size_t)count, f); }
+ImU64   ImFileWrite(const void* data, ImU64 sz, ImU64 count, ImFileHandle f)    { return fwrite(data, (size_t)sz, (size_t)count, f); }
+#endif // #ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
+
+// Helper: Load file content into memory
 // Memory allocated with IM_ALLOC(), must be freed by user using IM_FREE() == ImGui::MemFree()
-void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, size_t* out_file_size, int padding_bytes)
+void*   ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_file_size, int padding_bytes)
 {
-    IM_ASSERT(filename && file_open_mode);
+    IM_ASSERT(filename && mode);
     if (out_file_size)
         *out_file_size = 0;
 
-    FILE* f;
-    if ((f = ImFileOpen(filename, file_open_mode)) == NULL)
+    ImFileHandle f;
+    if ((f = ImFileOpen(filename, mode)) == NULL)
         return NULL;
 
-    long file_size_signed;
-    if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET))
+    size_t file_size = (size_t)ImFileGetSize(f);
+    if (file_size == (size_t)-1)
     {
-        fclose(f);
+        ImFileClose(f);
         return NULL;
     }
 
-    size_t file_size = (size_t)file_size_signed;
     void* file_data = IM_ALLOC(file_size + padding_bytes);
     if (file_data == NULL)
     {
-        fclose(f);
+        ImFileClose(f);
         return NULL;
     }
-    if (fread(file_data, 1, file_size, f) != file_size)
+    if (ImFileRead(file_data, 1, file_size, f) != file_size)
     {
-        fclose(f);
+        ImFileClose(f);
         IM_FREE(file_data);
         return NULL;
     }
     if (padding_bytes > 0)
         memset((void*)(((char*)file_data) + file_size), 0, (size_t)padding_bytes);
 
-    fclose(f);
+    ImFileClose(f);
     if (out_file_size)
         *out_file_size = file_size;
 
@@ -1436,7 +1473,7 @@ void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, size_
 // [SECTION] MISC HELPERS/UTILITIES (ImText* functions)
 //-----------------------------------------------------------------------------
 
-// Convert UTF-8 to 32-bits character, process single character input.
+// Convert UTF-8 to 32-bit character, process single character input.
 // Based on stb_from_utf8() from github.com/nothings/stb/
 // We handle UTF-8 decoding error by skipping forward.
 int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end)
@@ -1451,7 +1488,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
     }
     if ((*str & 0xe0) == 0xc0)
     {
-        *out_char = 0xFFFD; // will be invalid but not end of string
+        *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string
         if (in_text_end && in_text_end - (const char*)str < 2) return 1;
         if (*str < 0xc2) return 2;
         c = (unsigned int)((*str++ & 0x1f) << 6);
@@ -1462,7 +1499,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
     }
     if ((*str & 0xf0) == 0xe0)
     {
-        *out_char = 0xFFFD; // will be invalid but not end of string
+        *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string
         if (in_text_end && in_text_end - (const char*)str < 3) return 1;
         if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3;
         if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below
@@ -1476,7 +1513,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
     }
     if ((*str & 0xf8) == 0xf0)
     {
-        *out_char = 0xFFFD; // will be invalid but not end of string
+        *out_char = IM_UNICODE_CODEPOINT_INVALID; // will be invalid but not end of string
         if (in_text_end && in_text_end - (const char*)str < 4) return 1;
         if (*str > 0xf4) return 4;
         if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 4;
@@ -1507,7 +1544,7 @@ int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const cha
         in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
         if (c == 0)
             break;
-        if (c < 0x10000)    // FIXME: Losing characters that don't fit in 2 bytes
+        if (c <= IM_UNICODE_CODEPOINT_MAX)    // FIXME: Losing characters that don't fit in 2 bytes
             *buf_out++ = (ImWchar)c;
     }
     *buf_out = 0;
@@ -1525,7 +1562,7 @@ int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
         in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
         if (c == 0)
             break;
-        if (c < 0x10000)
+        if (c <= IM_UNICODE_CODEPOINT_MAX)
             char_count++;
     }
     return char_count;
@@ -3827,9 +3864,12 @@ void ImGui::Shutdown(ImGuiContext* context)
     g.SettingsWindows.clear();
     g.SettingsHandlers.clear();
 
-    if (g.LogFile && g.LogFile != stdout)
+    if (g.LogFile)
     {
-        fclose(g.LogFile);
+#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
+        if (g.LogFile != stdout)
+#endif
+            ImFileClose(g.LogFile);
         g.LogFile = NULL;
     }
     g.LogBuffer.clear();
@@ -3895,7 +3935,7 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
     //   (A) Handle the ImDrawCmd::VtxOffset value in your renderer back-end, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
     //       Most example back-ends already support this from 1.71. Pre-1.71 back-ends won't.
     //       Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
-    //   (B) Or handle 32-bits indices in your renderer back-end, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
+    //   (B) Or handle 32-bit indices in your renderer back-end, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
     //       Most example back-ends already support this. For example, the OpenGL example code detect index size at compile-time:
     //         glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
     //       Your own engine or render API may use different parameters or function calls to specify index sizes.
@@ -4200,7 +4240,8 @@ int ImGui::GetKeyIndex(ImGuiKey imgui_key)
     return g.IO.KeyMap[imgui_key];
 }
 
-// Note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]!
+// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]!
+// Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]!
 bool ImGui::IsKeyDown(int user_key_index)
 {
     if (user_key_index < 0)
@@ -4260,23 +4301,14 @@ bool ImGui::IsKeyReleased(int user_key_index)
     return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index];
 }
 
-bool ImGui::IsMouseDown(int button)
+bool ImGui::IsMouseDown(ImGuiMouseButton button)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
     return g.IO.MouseDown[button];
 }
 
-bool ImGui::IsAnyMouseDown()
-{
-    ImGuiContext& g = *GImGui;
-    for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
-        if (g.IO.MouseDown[n])
-            return true;
-    return false;
-}
-
-bool ImGui::IsMouseClicked(int button, bool repeat)
+bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4291,18 +4323,17 @@ bool ImGui::IsMouseClicked(int button, bool repeat)
         if (amount > 0)
             return true;
     }
-
     return false;
 }
 
-bool ImGui::IsMouseReleased(int button)
+bool ImGui::IsMouseReleased(ImGuiMouseButton button)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
     return g.IO.MouseReleased[button];
 }
 
-bool ImGui::IsMouseDoubleClicked(int button)
+bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4310,7 +4341,7 @@ bool ImGui::IsMouseDoubleClicked(int button)
 }
 
 // [Internal] This doesn't test if the button is pressed
-bool ImGui::IsMouseDragPastThreshold(int button, float lock_threshold)
+bool ImGui::IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4319,7 +4350,7 @@ bool ImGui::IsMouseDragPastThreshold(int button, float lock_threshold)
     return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold;
 }
 
-bool ImGui::IsMouseDragging(int button, float lock_threshold)
+bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4330,7 +4361,8 @@ bool ImGui::IsMouseDragging(int button, float lock_threshold)
 
 ImVec2 ImGui::GetMousePos()
 {
-    return GImGui->IO.MousePos;
+    ImGuiContext& g = *GImGui;
+    return g.IO.MousePos;
 }
 
 // NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed!
@@ -4353,10 +4385,19 @@ bool ImGui::IsMousePosValid(const ImVec2* mouse_pos)
     return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID;
 }
 
+bool ImGui::IsAnyMouseDown()
+{
+    ImGuiContext& g = *GImGui;
+    for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
+        if (g.IO.MouseDown[n])
+            return true;
+    return false;
+}
+
 // Return the delta from the initial clicking position while the mouse button is clicked or was just released.
 // This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
 // NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse position valid when dragging even outside the client window.
-ImVec2 ImGui::GetMouseDragDelta(int button, float lock_threshold)
+ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4369,7 +4410,7 @@ ImVec2 ImGui::GetMouseDragDelta(int button, float lock_threshold)
     return ImVec2(0.0f, 0.0f);
 }
 
-void ImGui::ResetMouseDragDelta(int button)
+void ImGui::ResetMouseDragDelta(ImGuiMouseButton button)
 {
     ImGuiContext& g = *GImGui;
     IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
@@ -4445,7 +4486,7 @@ bool ImGui::IsItemFocused()
     return true;
 }
 
-bool ImGui::IsItemClicked(int mouse_button)
+bool ImGui::IsItemClicked(ImGuiMouseButton mouse_button)
 {
     return IsMouseClicked(mouse_button) && IsItemHovered(ImGuiHoveredFlags_None);
 }
@@ -4595,7 +4636,7 @@ void ImGui::EndChild()
     ImGuiWindow* window = g.CurrentWindow;
 
     IM_ASSERT(g.WithinEndChild == false);
-    IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow);   // Mismatched BeginChild()/EndChild() callss
+    IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow);   // Mismatched BeginChild()/EndChild() calls
 
     g.WithinEndChild = true;
     if (window->BeginCount > 1)
@@ -4842,10 +4883,10 @@ struct ImGuiResizeGripDef
 
 static const ImGuiResizeGripDef resize_grip_def[4] =
 {
-    { ImVec2(1,1), ImVec2(-1,-1), 0, 3 }, // Lower right
-    { ImVec2(0,1), ImVec2(+1,-1), 3, 6 }, // Lower left
-    { ImVec2(0,0), ImVec2(+1,+1), 6, 9 }, // Upper left
-    { ImVec2(1,0), ImVec2(-1,+1), 9,12 }, // Upper right
+    { ImVec2(1,1), ImVec2(-1,-1), 0, 3 }, // Lower-right
+    { ImVec2(0,1), ImVec2(+1,-1), 3, 6 }, // Lower-left
+    { ImVec2(0,0), ImVec2(+1,+1), 6, 9 }, // Upper-left (Unused)
+    { ImVec2(1,0), ImVec2(-1,+1), 9,12 }, // Upper-right (Unused)
 };
 
 static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness)
@@ -4860,6 +4901,17 @@ static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_
     return ImRect();
 }
 
+// 0..3: corners (Lower-right, Lower-left, Unused, Unused)
+// 4..7: borders (Top, Right, Bottom, Left)
+ImGuiID ImGui::GetWindowResizeID(ImGuiWindow* window, int n)
+{
+    IM_ASSERT(n >= 0 && n <= 7);
+    ImGuiID id = window->ID;
+    id = ImHashStr("#RESIZE", 0, id);
+    id = ImHashData(&n, sizeof(int), id);
+    return id;
+}
+
 // Handle resize for: Resize Grips, Borders, Gamepad
 // Return true when using auto-fit (double click on resize grip)
 static bool ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4])
@@ -4897,7 +4949,7 @@ static bool ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
         if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x);
         if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
         bool hovered, held;
-        ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
+        ButtonBehavior(resize_rect, window->GetID(resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
         //GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
         if (hovered || held)
             g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;
@@ -4923,7 +4975,7 @@ static bool ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
     {
         bool hovered, held;
         ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS);
-        ButtonBehavior(border_rect, window->GetID((void*)(intptr_t)(border_n + 4)), &hovered, &held, ImGuiButtonFlags_FlattenChildren);
+        ButtonBehavior(border_rect, window->GetID(border_n + 4), &hovered, &held, ImGuiButtonFlags_FlattenChildren);
         //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
         if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
         {
@@ -5525,7 +5577,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
         // Handle manual resize: Resize Grips, Borders, Gamepad
         int border_held = -1;
         ImU32 resize_grip_col[4] = {};
-        const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // 4
+        const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it.
         const float resize_grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
         if (!window->Collapsed)
             if (UpdateManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0]))
@@ -5824,14 +5876,14 @@ void ImGui::End()
     // Error checking: verify that user hasn't called End() too many times!
     if (g.CurrentWindowStack.Size <= 1 && g.WithinFrameScopeWithImplicitWindow)
     {
-        IMGUI_USER_ERROR(g.CurrentWindowStack.Size > 1, "Calling End() too many times!");
+        IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size > 1, "Calling End() too many times!");
         return;
     }
     IM_ASSERT(g.CurrentWindowStack.Size > 0);
 
     // Error checking: verify that user doesn't directly call End() on a child window.
     if (window->Flags & ImGuiWindowFlags_ChildWindow)
-        IMGUI_USER_ERROR(g.WithinEndChild, "Must call EndChild() and not End()!");
+        IM_ASSERT_USER_ERROR(g.WithinEndChild, "Must call EndChild() and not End()!");
 
     // Close anything that is open
     if (window->DC.CurrentColumns)
@@ -7005,13 +7057,13 @@ static void ImGui::ErrorCheckEndFrame()
     {
         if (g.CurrentWindowStack.Size > 1)
         {
-            IMGUI_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?");
+            IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?");
             while (g.CurrentWindowStack.Size > 1)
                 End();
         }
         else
         {
-            IMGUI_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?");
+            IM_ASSERT_USER_ERROR(g.CurrentWindowStack.Size == 1, "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?");
         }
     }
 
@@ -7533,7 +7585,7 @@ void ImGui::EndPopup()
     g.WithinEndChild = false;
 }
 
-bool ImGui::OpenPopupOnItemClick(const char* str_id, int mouse_button)
+bool ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiMouseButton mouse_button)
 {
     ImGuiWindow* window = GImGui->CurrentWindow;
     if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
@@ -7549,7 +7601,7 @@ bool ImGui::OpenPopupOnItemClick(const char* str_id, int mouse_button)
 // This is a helper to handle the simplest case of associating one named popup to one given widget.
 // You may want to handle this on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters).
 // You can pass a NULL str_id to use the identifier of the last item.
-bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
+bool ImGui::BeginPopupContextItem(const char* str_id, ImGuiMouseButton mouse_button)
 {
     ImGuiWindow* window = GImGui->CurrentWindow;
     if (window->SkipItems)
@@ -7561,7 +7613,7 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
     return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
 }
 
-bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool also_over_items)
+bool ImGui::BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mouse_button, bool also_over_items)
 {
     if (!str_id)
         str_id = "window_context";
@@ -7572,7 +7624,7 @@ bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool a
     return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
 }
 
-bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
+bool ImGui::BeginPopupContextVoid(const char* str_id, ImGuiMouseButton mouse_button)
 {
     if (!str_id)
         str_id = "void_context";
@@ -8766,7 +8818,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
     bool source_drag_active = false;
     ImGuiID source_id = 0;
     ImGuiID source_parent_id = 0;
-    int mouse_button = 0;
+    ImGuiMouseButton mouse_button = ImGuiMouseButton_Left;
     if (!(flags & ImGuiDragDropFlags_SourceExtern))
     {
         source_id = window->DC.LastItemId;
@@ -9049,9 +9101,15 @@ void ImGui::LogText(const char* fmt, ...)
     va_list args;
     va_start(args, fmt);
     if (g.LogFile)
-        vfprintf(g.LogFile, fmt, args);
+    {
+        g.LogBuffer.Buf.resize(0);
+        g.LogBuffer.appendfv(fmt, args);
+        ImFileWrite(g.LogBuffer.c_str(), sizeof(char), (ImU64)g.LogBuffer.size(), g.LogFile);
+    }
     else
+    {
         g.LogBuffer.appendfv(fmt, args);
+    }
     va_end(args);
 }
 
@@ -9128,8 +9186,11 @@ void ImGui::LogToTTY(int auto_open_depth)
     ImGuiContext& g = *GImGui;
     if (g.LogEnabled)
         return;
+    IM_UNUSED(auto_open_depth);
+#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
     LogBegin(ImGuiLogType_TTY, auto_open_depth);
     g.LogFile = stdout;
+#endif
 }
 
 // Start logging/capturing text output to given file
@@ -9146,8 +9207,8 @@ void ImGui::LogToFile(int auto_open_depth, const char* filename)
         filename = g.IO.LogFilename;
     if (!filename || !filename[0])
         return;
-    FILE* f = ImFileOpen(filename, "ab");
-    if (f == NULL)
+    ImFileHandle f = ImFileOpen(filename, "ab");
+    if (!f)
     {
         IM_ASSERT(0);
         return;
@@ -9184,10 +9245,12 @@ void ImGui::LogFinish()
     switch (g.LogType)
     {
     case ImGuiLogType_TTY:
+#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
         fflush(g.LogFile);
+#endif
         break;
     case ImGuiLogType_File:
-        fclose(g.LogFile);
+        ImFileClose(g.LogFile);
         break;
     case ImGuiLogType_Buffer:
         break;
@@ -9213,7 +9276,11 @@ void ImGui::LogButtons()
     ImGuiContext& g = *GImGui;
 
     PushID("LogButtons");
+#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
     const bool log_to_tty = Button("Log To TTY"); SameLine();
+#else
+    const bool log_to_tty = false;
+#endif
     const bool log_to_file = Button("Log To File"); SameLine();
     const bool log_to_clipboard = Button("Log To Clipboard"); SameLine();
     PushAllowKeyboardFocus(false);
@@ -9345,18 +9412,12 @@ void ImGui::LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size)
             line_end[-1] = 0;
             const char* name_end = line_end - 1;
             const char* type_start = line + 1;
-            char* type_end = (char*)(intptr_t)ImStrchrRange(type_start, name_end, ']');
+            char* type_end = (char*)(void*)ImStrchrRange(type_start, name_end, ']');
             const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL;
             if (!type_end || !name_start)
-            {
-                name_start = type_start; // Import legacy entries that have no type
-                type_start = "Window";
-            }
-            else
-            {
-                *type_end = 0; // Overwrite first ']'
-                name_start++;  // Skip second '['
-            }
+                continue;
+            *type_end = 0; // Overwrite first ']'
+            name_start++;  // Skip second '['
             entry_handler = FindSettingsHandler(type_start);
             entry_data = entry_handler ? entry_handler->ReadOpenFn(&g, entry_handler, name_start) : NULL;
         }
@@ -9379,11 +9440,11 @@ void ImGui::SaveIniSettingsToDisk(const char* ini_filename)
 
     size_t ini_data_size = 0;
     const char* ini_data = SaveIniSettingsToMemory(&ini_data_size);
-    FILE* f = ImFileOpen(ini_filename, "wt");
+    ImFileHandle f = ImFileOpen(ini_filename, "wt");
     if (!f)
         return;
-    fwrite(ini_data, sizeof(char), ini_data_size, f);
-    fclose(f);
+    ImFileWrite(ini_data, sizeof(char), ini_data_size, f);
+    ImFileClose(f);
 }
 
 // Call registered handlers (e.g. SettingsHandlerWindow_WriteAll() + custom handlers) to write their stuff into a text buffer
@@ -9485,6 +9546,10 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
 #else
 #include <windows.h>
 #endif
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) // UWP doesn't have Win32 functions
+#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
+#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
+#endif
 #elif defined(__APPLE__)
 #include <TargetConditionals.h>
 #endif
@@ -9675,7 +9740,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
     static bool show_windows_rects = false;
     static int  show_windows_rect_type = WRT_WorkRect;
     static bool show_windows_begin_order = false;
-    static bool show_drawcmd_clip_rects = true;
+    static bool show_drawcmd_details = true;
 
     // Basic info
     ImGuiContext& g = *GImGui;
@@ -9726,9 +9791,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
                 return;
 
             if (window && !window->WasActive)
-                ImGui::Text("(Note: owning Window is inactive: DrawList is not being rendered!)");
+                ImGui::TextDisabled("Warning: owning Window is inactive. This DrawList is not being rendered!");
 
-            int elem_offset = 0;
+            unsigned int elem_offset = 0;
             for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem_offset += pcmd->ElemCount, pcmd++)
             {
                 if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0)
@@ -9738,45 +9803,77 @@ void ImGui::ShowMetricsWindow(bool* p_open)
                     ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData);
                     continue;
                 }
+
                 ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL;
                 char buf[300];
-                ImFormatString(buf, IM_ARRAYSIZE(buf), "Draw %4d triangles, tex 0x%p, clip_rect (%4.0f,%4.0f)-(%4.0f,%4.0f)",
-                    pcmd->ElemCount/3, (void*)(intptr_t)pcmd->TextureId, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
+                ImFormatString(buf, IM_ARRAYSIZE(buf), "DrawCmd: %4d triangles, Tex 0x%p, ClipRect (%4.0f,%4.0f)-(%4.0f,%4.0f)",
+                    pcmd->ElemCount/3, (void*)(intptr_t)pcmd->TextureId,
+                    pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
                 bool pcmd_node_open = ImGui::TreeNode((void*)(pcmd - draw_list->CmdBuffer.begin()), "%s", buf);
-                if (show_drawcmd_clip_rects && fg_draw_list && ImGui::IsItemHovered())
+                if (show_drawcmd_details && fg_draw_list && ImGui::IsItemHovered())
                 {
                     ImRect clip_rect = pcmd->ClipRect;
-                    ImRect vtxs_rect;
-                    for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
+                    ImRect vtxs_rect(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
+                    for (unsigned int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
                         vtxs_rect.Add(draw_list->VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos);
-                    clip_rect.Floor(); fg_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,0,255,255));
-                    vtxs_rect.Floor(); fg_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,255,0,255));
+                    fg_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255,0,255,255));
+                    fg_draw_list->AddRect(ImFloor(vtxs_rect.Min), ImFloor(vtxs_rect.Max), IM_COL32(255,255,0,255));
                 }
                 if (!pcmd_node_open)
                     continue;
 
+                // Calculate approximate coverage area (touched pixel count)
+                // This will be in pixels squared as long there's no post-scaling happening to the renderer output.
+                float total_area = 0.0f;
+                for (unsigned int base_idx = elem_offset; base_idx < (elem_offset + pcmd->ElemCount); base_idx += 3)
+                {
+                    ImVec2 triangle[3];
+                    for (int n = 0; n < 3; n++)
+                        triangle[n] = draw_list->VtxBuffer[idx_buffer ? idx_buffer[base_idx + n] : (base_idx + n)].pos;
+                    total_area += ImTriangleArea(triangle[0], triangle[1], triangle[2]);
+                }
+
+                // Display vertex information summary. Hover to get all triangles drawn in wire-frame
+                ImFormatString(buf, IM_ARRAYSIZE(buf), "Mesh: ElemCount: %d, VtxOffset: +%d, IdxOffset: +%d, Area: ~%0.f px", pcmd->ElemCount, pcmd->VtxOffset, pcmd->IdxOffset, total_area);
+                ImGui::Selectable(buf);
+                if (fg_draw_list && ImGui::IsItemHovered() && show_drawcmd_details)
+                {
+                    // Draw wire-frame version of everything
+                    ImDrawListFlags backup_flags = fg_draw_list->Flags;
+                    fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles.
+                    ImRect clip_rect = pcmd->ClipRect;
+                    fg_draw_list->AddRect(ImFloor(clip_rect.Min), ImFloor(clip_rect.Max), IM_COL32(255, 0, 255, 255));
+                    for (unsigned int base_idx = elem_offset; base_idx < (elem_offset + pcmd->ElemCount); base_idx += 3)
+                    {
+                        ImVec2 triangle[3];
+                        for (int n = 0; n < 3; n++)
+                            triangle[n] = draw_list->VtxBuffer[idx_buffer ? idx_buffer[base_idx + n] : (base_idx + n)].pos;
+                        fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), true, 1.0f);
+                    }
+                    fg_draw_list->Flags = backup_flags;
+                }
+
                 // Display individual triangles/vertices. Hover on to get the corresponding triangle highlighted.
-                ImGui::Text("ElemCount: %d, ElemCount/3: %d, VtxOffset: +%d, IdxOffset: +%d", pcmd->ElemCount, pcmd->ElemCount/3, pcmd->VtxOffset, pcmd->IdxOffset);
                 ImGuiListClipper clipper(pcmd->ElemCount/3); // Manually coarse clip our print out of individual vertices to save CPU, only items that may be visible.
                 while (clipper.Step())
                     for (int prim = clipper.DisplayStart, idx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++)
                     {
                         char *buf_p = buf, *buf_end = buf + IM_ARRAYSIZE(buf);
-                        ImVec2 triangles_pos[3];
+                        ImVec2 triangle[3];
                         for (int n = 0; n < 3; n++, idx_i++)
                         {
-                            int vtx_i = idx_buffer ? idx_buffer[idx_i] : idx_i;
-                            ImDrawVert& v = draw_list->VtxBuffer[vtx_i];
-                            triangles_pos[n] = v.pos;
+                            ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[idx_i] : idx_i];
+                            triangle[n] = v.pos;
                             buf_p += ImFormatString(buf_p, buf_end - buf_p, "%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n",
-                                (n == 0) ? "elem" : "    ", idx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col);
+                                (n == 0) ? "Vert:" : "     ", idx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col);
                         }
+
                         ImGui::Selectable(buf, false);
                         if (fg_draw_list && ImGui::IsItemHovered())
                         {
                             ImDrawListFlags backup_flags = fg_draw_list->Flags;
-                            fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines at is more readable for very large and thin triangles.
-                            fg_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f);
+                            fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles.
+                            fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255,255,0,255), true, 1.0f);
                             fg_draw_list->Flags = backup_flags;
                         }
                     }
@@ -9860,7 +9957,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
                     ImGui::PushID(tab);
                     if (ImGui::SmallButton("<")) { TabBarQueueChangeTabOrder(tab_bar, tab, -1); } ImGui::SameLine(0, 2);
                     if (ImGui::SmallButton(">")) { TabBarQueueChangeTabOrder(tab_bar, tab, +1); } ImGui::SameLine();
-                    ImGui::Text("%02d%c Tab 0x%08X", tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID);
+                    ImGui::Text("%02d%c Tab 0x%08X '%s'", tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, (tab->NameOffset != -1) ? tab_bar->GetTabName(tab) : "");
                     ImGui::PopID();
                 }
                 ImGui::TreePop();
@@ -9963,7 +10060,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
             }
             ImGui::Unindent();
         }
-        ImGui::Checkbox("Show clipping rectangle when hovering ImDrawCmd node", &show_drawcmd_clip_rects);
+        ImGui::Checkbox("Show details when hovering ImDrawCmd node", &show_drawcmd_details);
         ImGui::TreePop();
     }
 

+ 75 - 62
3rdparty/bgfx/3rdparty/dear-imgui/imgui.h

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (headers)
 
 // See imgui.cpp file for documentation.
@@ -47,8 +47,8 @@ Index of this file:
 
 // Version
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
-#define IMGUI_VERSION               "1.74 WIP"
-#define IMGUI_VERSION_NUM           17301
+#define IMGUI_VERSION               "1.75 WIP"
+#define IMGUI_VERSION_NUM           17401
 #define IMGUI_CHECKVERSION()        ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
 
 // Define attributes of all API symbols declarations (e.g. for DLL under Windows)
@@ -80,6 +80,8 @@ Index of this file:
 #else
 #define IM_OFFSETOF(_TYPE,_MEMBER)  ((size_t)&(((_TYPE*)0)->_MEMBER))           // Offset of _MEMBER within _TYPE. Old style macro.
 #endif
+#define IM_UNICODE_CODEPOINT_MAX     0xFFFF                                     // Last Unicode code point supported by this build.
+#define IM_UNICODE_CODEPOINT_INVALID 0xFFFD                                     // Standard invalid Unicode code point.
 
 // Warnings
 #if defined(__clang__)
@@ -136,6 +138,7 @@ typedef int ImGuiDataType;          // -> enum ImGuiDataType_        // Enum: A
 typedef int ImGuiDir;               // -> enum ImGuiDir_             // Enum: A cardinal direction
 typedef int ImGuiKey;               // -> enum ImGuiKey_             // Enum: A key identifier (ImGui-side enum)
 typedef int ImGuiNavInput;          // -> enum ImGuiNavInput_        // Enum: An input identifier for navigation
+typedef int ImGuiMouseButton;       // -> enum ImGuiMouseButton_     // Enum: A mouse button identifier (0=left, 1=right, 2=middle)
 typedef int ImGuiMouseCursor;       // -> enum ImGuiMouseCursor_     // Enum: A mouse cursor identifier
 typedef int ImGuiStyleVar;          // -> enum ImGuiStyleVar_        // Enum: A variable identifier for styling
 typedef int ImDrawCornerFlags;      // -> enum ImDrawCornerFlags_    // Flags: for ImDrawList::AddRect(), AddRectFilled() etc.
@@ -431,6 +434,7 @@ namespace ImGui
     // - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
     // - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
     // - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
+    // - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
     // - Use v_min > v_max to lock edits.
     IMGUI_API bool          DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f);     // If v_min >= v_max we have no bound
     IMGUI_API bool          DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f);
@@ -563,16 +567,17 @@ namespace ImGui
     // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
     // - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls.
     //   User can manipulate the visibility state by calling OpenPopup().
+    // - We default to use the right mouse (ImGuiMouseButton_Right=1) for the Popup Context functions.
     // (*) You can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup.
     // Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time.
     IMGUI_API void          OpenPopup(const char* str_id);                                      // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
     IMGUI_API bool          BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0);                                             // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returns true!
-    IMGUI_API bool          BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1);                                 // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
-    IMGUI_API bool          BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true);  // helper to open and begin popup when clicked on current window.
-    IMGUI_API bool          BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1);                                 // helper to open and begin popup when clicked in void (where there are no imgui windows).
+    IMGUI_API bool          BeginPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1);                    // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
+    IMGUI_API bool          BeginPopupContextWindow(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1, bool also_over_items = true);  // helper to open and begin popup when clicked on current window.
+    IMGUI_API bool          BeginPopupContextVoid(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1);                    // helper to open and begin popup when clicked in void (where there are no imgui windows).
     IMGUI_API bool          BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);                     // modal dialog (regular window with title bar, block interactions behind the modal window, can't close the modal window by clicking outside)
     IMGUI_API void          EndPopup();                                                                                             // only call EndPopup() if BeginPopupXXX() returns true!
-    IMGUI_API bool          OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1);                                  // helper to open popup when clicked on last item (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors). return true when just opened.
+    IMGUI_API bool          OpenPopupOnItemClick(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1);                     // helper to open popup when clicked on last item (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors). return true when just opened.
     IMGUI_API bool          IsPopupOpen(const char* str_id);                                    // return true if the popup is open at the current begin-ed level of the popup stack.
     IMGUI_API void          CloseCurrentPopup();                                                // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
 
@@ -630,7 +635,7 @@ namespace ImGui
     IMGUI_API bool          IsItemHovered(ImGuiHoveredFlags flags = 0);                         // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
     IMGUI_API bool          IsItemActive();                                                     // is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)
     IMGUI_API bool          IsItemFocused();                                                    // is the last item focused for keyboard/gamepad navigation?
-    IMGUI_API bool          IsItemClicked(int mouse_button = 0);                                // is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()
+    IMGUI_API bool          IsItemClicked(ImGuiMouseButton mouse_button = 0);                   // is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()
     IMGUI_API bool          IsItemVisible();                                                    // is the last item visible? (items may be out of sight because of clipping/scrolling)
     IMGUI_API bool          IsItemEdited();                                                     // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
     IMGUI_API bool          IsItemActivated();                                                  // was the last item just made active (item was previously inactive).
@@ -667,27 +672,34 @@ namespace ImGui
     IMGUI_API void          ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
     IMGUI_API void          ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
 
-    // Inputs Utilities
+    // Inputs Utilities: Keyboard
+    // - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[].
+    // - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index.
     IMGUI_API int           GetKeyIndex(ImGuiKey imgui_key);                                    // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
-    IMGUI_API bool          IsKeyDown(int user_key_index);                                      // is key being held. == io.KeysDown[user_key_index]. note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]!
-    IMGUI_API bool          IsKeyPressed(int user_key_index, bool repeat = true);               // was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
-    IMGUI_API bool          IsKeyReleased(int user_key_index);                                  // was key released (went from Down to !Down)..
+    IMGUI_API bool          IsKeyDown(int user_key_index);                                      // is key being held. == io.KeysDown[user_key_index]. 
+    IMGUI_API bool          IsKeyPressed(int user_key_index, bool repeat = true);               // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
+    IMGUI_API bool          IsKeyReleased(int user_key_index);                                  // was key released (went from Down to !Down)?
     IMGUI_API int           GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
-    IMGUI_API bool          IsMouseDown(int button);                                            // is mouse button held (0=left, 1=right, 2=middle)
-    IMGUI_API bool          IsAnyMouseDown();                                                   // is any mouse button held
-    IMGUI_API bool          IsMouseClicked(int button, bool repeat = false);                    // did mouse button clicked (went from !Down to Down) (0=left, 1=right, 2=middle)
-    IMGUI_API bool          IsMouseDoubleClicked(int button);                                   // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
-    IMGUI_API bool          IsMouseReleased(int button);                                        // did mouse button released (went from Down to !Down)
-    IMGUI_API bool          IsMouseDragging(int button = 0, float lock_threshold = -1.0f);      // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
-    IMGUI_API bool          IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);  // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
-    IMGUI_API bool          IsMousePosValid(const ImVec2* mouse_pos = NULL);                    // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse
+    IMGUI_API void          CaptureKeyboardFromApp(bool want_capture_keyboard_value = true);    // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
+
+    // Inputs Utilities: Mouse
+    // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
+    // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle.
+    // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold')
+    IMGUI_API bool          IsMouseDown(ImGuiMouseButton button);                               // is mouse button held?
+    IMGUI_API bool          IsMouseClicked(ImGuiMouseButton button, bool repeat = false);       // did mouse button clicked? (went from !Down to Down)
+    IMGUI_API bool          IsMouseReleased(ImGuiMouseButton button);                           // did mouse button released? (went from Down to !Down)
+    IMGUI_API bool          IsMouseDoubleClicked(ImGuiMouseButton button);                      // did mouse button double-clicked? a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
+    IMGUI_API bool          IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
+    IMGUI_API bool          IsMousePosValid(const ImVec2* mouse_pos = NULL);                    // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
+    IMGUI_API bool          IsAnyMouseDown();                                                   // is any mouse button held?
     IMGUI_API ImVec2        GetMousePos();                                                      // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
-    IMGUI_API ImVec2        GetMousePosOnOpeningCurrentPopup();                                 // retrieve backup of mouse position at the time of opening popup we have BeginPopup() into
-    IMGUI_API ImVec2        GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f);    // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lock_threshold < -1.0f uses io.MouseDraggingThreshold.
-    IMGUI_API void          ResetMouseDragDelta(int button = 0);                                //
+    IMGUI_API ImVec2        GetMousePosOnOpeningCurrentPopup();                                 // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)
+    IMGUI_API bool          IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f);         // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
+    IMGUI_API ImVec2        GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f);   // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
+    IMGUI_API void          ResetMouseDragDelta(ImGuiMouseButton button = 0);                   //
     IMGUI_API ImGuiMouseCursor GetMouseCursor();                                                // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
-    IMGUI_API void          SetMouseCursor(ImGuiMouseCursor type);                              // set desired cursor type
-    IMGUI_API void          CaptureKeyboardFromApp(bool want_capture_keyboard_value = true);    // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
+    IMGUI_API void          SetMouseCursor(ImGuiMouseCursor cursor_type);                       // set desired cursor type
     IMGUI_API void          CaptureMouseFromApp(bool want_capture_mouse_value = true);          // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.
 
     // Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard)
@@ -752,8 +764,8 @@ enum ImGuiWindowFlags_
     ImGuiWindowFlags_ChildMenu              = 1 << 28   // Don't use! For internal use by BeginMenu()
 
     // [Obsolete]
-    //ImGuiWindowFlags_ShowBorders          = 1 << 7,   // --> Set style.FrameBorderSize=1.0f / style.WindowBorderSize=1.0f to enable borders around windows and items
-    //ImGuiWindowFlags_ResizeFromAnySide    = 1 << 17,  // --> Set io.ConfigWindowsResizeFromEdges and make sure mouse cursors are supported by back-end (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
+    //ImGuiWindowFlags_ShowBorders          = 1 << 7,   // --> Set style.FrameBorderSize=1.0f or style.WindowBorderSize=1.0f to enable borders around items or windows.
+    //ImGuiWindowFlags_ResizeFromAnySide    = 1 << 17,  // --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by back-end (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
 };
 
 // Flags for ImGui::InputText()
@@ -804,11 +816,6 @@ enum ImGuiTreeNodeFlags_
     ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13,  // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
     //ImGuiTreeNodeFlags_NoScrollOnOpen     = 1 << 14,  // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
     ImGuiTreeNodeFlags_CollapsingHeader     = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
-
-    // Obsolete names (will be removed)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-    , ImGuiTreeNodeFlags_AllowOverlapMode = ImGuiTreeNodeFlags_AllowItemOverlap // [renamed in 1.53]
-#endif
 };
 
 // Flags for ImGui::Selectable()
@@ -1025,7 +1032,7 @@ enum ImGuiBackendFlags_
     ImGuiBackendFlags_HasGamepad            = 1 << 0,   // Back-end Platform supports gamepad and currently has one connected.
     ImGuiBackendFlags_HasMouseCursors       = 1 << 1,   // Back-end Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
     ImGuiBackendFlags_HasSetMousePos        = 1 << 2,   // Back-end Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
-    ImGuiBackendFlags_RendererHasVtxOffset  = 1 << 3    // Back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bits indices.
+    ImGuiBackendFlags_RendererHasVtxOffset  = 1 << 3    // Back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
 };
 
 // Enumeration for PushStyleColor() / PopStyleColor()
@@ -1084,9 +1091,7 @@ enum ImGuiCol_
     // Obsolete names (will be removed)
 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
     , ImGuiCol_ModalWindowDarkening = ImGuiCol_ModalWindowDimBg                      // [renamed in 1.63]
-    , ImGuiCol_ChildWindowBg = ImGuiCol_ChildBg                                      // [renamed in 1.53]
-    //ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered, // [unused since 1.60+] the close button now uses regular button colors.
-    //ImGuiCol_ComboBg,                                                              // [unused since 1.53+] ComboBg has been merged with PopupBg, so a redirect isn't accurate.
+    //, ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered// [unused since 1.60+] the close button now uses regular button colors.
 #endif
 };
 
@@ -1123,8 +1128,7 @@ enum ImGuiStyleVar_
 
     // Obsolete names (will be removed)
 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-    , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT                        // [renamed in 1.60]
-    , ImGuiStyleVar_ChildWindowRounding = ImGuiStyleVar_ChildRounding   // [renamed in 1.53]
+    , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT                    // [renamed in 1.60]
 #endif
 };
 
@@ -1173,6 +1177,16 @@ enum ImGuiColorEditFlags_
 #endif
 };
 
+// Identify a mouse button. 
+// Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.
+enum ImGuiMouseButton_
+{
+    ImGuiMouseButton_Left = 0,
+    ImGuiMouseButton_Right = 1,
+    ImGuiMouseButton_Middle = 2,
+    ImGuiMouseButton_COUNT = 5
+};
+
 // Enumeration for GetMouseCursor()
 // User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
 enum ImGuiMouseCursor_
@@ -1186,6 +1200,7 @@ enum ImGuiMouseCursor_
     ImGuiMouseCursor_ResizeNESW,        // When hovering over the bottom-left corner of a window
     ImGuiMouseCursor_ResizeNWSE,        // When hovering over the bottom-right corner of a window
     ImGuiMouseCursor_Hand,              // (Unused by Dear ImGui functions. Use for e.g. hyperlinks)
+    ImGuiMouseCursor_NotAllowed,        // When hovering something with disallowed interaction. Usually a crossed circle.
     ImGuiMouseCursor_COUNT
 
     // Obsolete names (will be removed)
@@ -1271,6 +1286,7 @@ struct ImVector
     inline int          _grow_capacity(int sz) const        { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; }
     inline void         resize(int new_size)                { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
     inline void         resize(int new_size, const T& v)    { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; }
+    inline void         shrink(int new_size)                { IM_ASSERT(new_size <= Size); Size = new_size; } // Resize a vector to a smaller size, guaranteed not to cause a reallocation
     inline void         reserve(int new_capacity)           { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
 
     // NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
@@ -1387,9 +1403,9 @@ struct ImGuiIO
     // Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff.
     const char* BackendPlatformName;            // = NULL
     const char* BackendRendererName;            // = NULL
-    void*       BackendPlatformUserData;        // = NULL
-    void*       BackendRendererUserData;        // = NULL
-    void*       BackendLanguageUserData;        // = NULL
+    void*       BackendPlatformUserData;        // = NULL           // User data for platform back-end
+    void*       BackendRendererUserData;        // = NULL           // User data for renderer back-end
+    void*       BackendLanguageUserData;        // = NULL           // User data for non C++ programming language back-end
 
     // Optional: Access OS clipboard
     // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
@@ -1451,7 +1467,7 @@ struct ImGuiIO
     ImVec2      MouseDelta;                     // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
 
     //------------------------------------------------------------------
-    // [Internal] ImGui will maintain those fields. Forward compatibility not guaranteed!
+    // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
     //------------------------------------------------------------------
 
     ImVec2      MousePosPrev;                   // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
@@ -1575,12 +1591,6 @@ namespace ImGui
     static inline bool  IsAnyWindowFocused()                  { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
     static inline bool  IsAnyWindowHovered()                  { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
     static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { IM_UNUSED(on_edge); IM_UNUSED(outward); IM_ASSERT(0); return pos; }
-    // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
-    static inline void  ShowTestWindow()                      { return ShowDemoWindow(); }
-    static inline bool  IsRootWindowFocused()                 { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); }
-    static inline bool  IsRootWindowOrAnyChildFocused()       { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); }
-    static inline void  SetNextWindowContentWidth(float w)    { SetNextWindowContentSize(ImVec2(w, 0.0f)); }
-    static inline float GetItemsLineHeightWithSpacing()       { return GetFrameHeightWithSpacing(); }
 }
 typedef ImGuiInputTextCallback      ImGuiTextEditCallback;    // OBSOLETED in 1.63 (from Aug 2018): made the names consistent
 typedef ImGuiInputTextCallbackData  ImGuiTextEditCallbackData;
@@ -1727,7 +1737,7 @@ struct ImGuiListClipper
     IMGUI_API void End();                                               // Automatically called on the last call of Step() that returns false.
 };
 
-// Helpers macros to generate 32-bits encoded colors
+// Helpers macros to generate 32-bit encoded colors
 #ifdef IMGUI_USE_BGRA_PACKED_COLOR
 #define IM_COL32_R_SHIFT    16
 #define IM_COL32_G_SHIFT    8
@@ -1791,13 +1801,13 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c
 
 // Typically, 1 command = 1 GPU draw call (unless command is a callback)
 // Pre 1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset'
-// is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bits indices.
+// is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
 struct ImDrawCmd
 {
     unsigned int    ElemCount;              // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
     ImVec4          ClipRect;               // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
     ImTextureID     TextureId;              // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
-    unsigned int    VtxOffset;              // Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be >0 to support meshes larger than 64K vertices with 16-bits indices.
+    unsigned int    VtxOffset;              // Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be >0 to support meshes larger than 64K vertices with 16-bit indices.
     unsigned int    IdxOffset;              // Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
     ImDrawCallback  UserCallback;           // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
     void*           UserCallbackData;       // The draw callback code can access this.
@@ -1806,8 +1816,8 @@ struct ImDrawCmd
 };
 
 // Vertex index
-// (to allow large meshes with 16-bits indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
-// (to use 32-bits indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
+// (to allow large meshes with 16-bit indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
+// (to use 32-bit indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
 #ifndef ImDrawIdx
 typedef unsigned short ImDrawIdx;
 #endif
@@ -1916,7 +1926,7 @@ struct ImDrawList
     // Primitives
     // - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
     IMGUI_API void  AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
-    IMGUI_API void  AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1.0f);   // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4-bits corresponding to which corner to round
+    IMGUI_API void  AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1.0f);   // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4 bits corresponding to which corner to round
     IMGUI_API void  AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);                     // a: upper-left, b: lower-right (== upper-left + size)
     IMGUI_API void  AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
     IMGUI_API void  AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f);
@@ -1925,6 +1935,8 @@ struct ImDrawList
     IMGUI_API void  AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
     IMGUI_API void  AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f);
     IMGUI_API void  AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 12);
+    IMGUI_API void  AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f);
+    IMGUI_API void  AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments);
     IMGUI_API void  AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
     IMGUI_API void  AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
     IMGUI_API void  AddPolyline(const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness);
@@ -1967,6 +1979,7 @@ struct ImDrawList
     IMGUI_API void  Clear();
     IMGUI_API void  ClearFreeMemory();
     IMGUI_API void  PrimReserve(int idx_count, int vtx_count);
+    IMGUI_API void  PrimUnreserve(int idx_count, int vtx_count);
     IMGUI_API void  PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col);      // Axis aligned rectangle (composed of two triangles)
     IMGUI_API void  PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
     IMGUI_API void  PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
@@ -2045,7 +2058,7 @@ struct ImFontGlyphRangesBuilder
     ImVector<ImU32> UsedChars;            // Store 1-bit per Unicode code point (0=unused, 1=used)
 
     ImFontGlyphRangesBuilder()          { Clear(); }
-    inline void     Clear()             { int size_in_bytes = 0x10000 / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
+    inline void     Clear()             { int size_in_bytes = (IM_UNICODE_CODEPOINT_MAX+1) / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
     inline bool     GetBit(int n) const { int off = (n >> 5); ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; }  // Get bit n in the array
     inline void     SetBit(int n)       { int off = (n >> 5); ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; }               // Set bit n in the array
     inline void     AddChar(ImWchar c)  { SetBit(c); }                          // Add character
@@ -2057,12 +2070,12 @@ struct ImFontGlyphRangesBuilder
 // See ImFontAtlas::AddCustomRectXXX functions.
 struct ImFontAtlasCustomRect
 {
-    unsigned int    ID;             // Input    // User ID. Use <0x10000 to map into a font glyph, >=0x10000 for other/internal/custom texture data.
+    unsigned int    ID;             // Input    // User ID. Use < 0x110000 to map into a font glyph, >= 0x110000 for other/internal/custom texture data.
     unsigned short  Width, Height;  // Input    // Desired rectangle dimension
     unsigned short  X, Y;           // Output   // Packed position in Atlas
-    float           GlyphAdvanceX;  // Input    // For custom font glyphs only (ID<0x10000): glyph xadvance
-    ImVec2          GlyphOffset;    // Input    // For custom font glyphs only (ID<0x10000): glyph display offset
-    ImFont*         Font;           // Input    // For custom font glyphs only (ID<0x10000): target font
+    float           GlyphAdvanceX;  // Input    // For custom font glyphs only (ID < 0x110000): glyph xadvance
+    ImVec2          GlyphOffset;    // Input    // For custom font glyphs only (ID < 0x110000): glyph display offset
+    ImFont*         Font;           // Input    // For custom font glyphs only (ID < 0x110000): target font
     ImFontAtlasCustomRect()         { ID = 0xFFFFFFFF; Width = Height = 0; X = Y = 0xFFFF; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0,0); Font = NULL; }
     bool IsPacked() const           { return X != 0xFFFF; }
 };
@@ -2141,9 +2154,9 @@ struct ImFontAtlas
     // After calling Build(), you can query the rectangle position and render your pixels.
     // You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
     // so you can render e.g. custom colorful icons and use them as regular glyphs.
-    // Read misc/fonts/README.txt for more details about using colorful icons.
-    IMGUI_API int               AddCustomRectRegular(unsigned int id, int width, int height);                                                                   // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
-    IMGUI_API int               AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0));   // Id needs to be < 0x10000 to register a rectangle to map into a specific font.
+    // Read docs/FONTS.txt for more details about using colorful icons.
+    IMGUI_API int               AddCustomRectRegular(unsigned int id, int width, int height);                                                                   // Id needs to be >= 0x110000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
+    IMGUI_API int               AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0));   // Id needs to be < 0x110000 to register a rectangle to map into a specific font.
     const ImFontAtlasCustomRect*GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
 
     // [Internal]

+ 57 - 41
3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (demo code)
 
 // Message to the person tempted to delete this file when integrating Dear ImGui into their code base:
@@ -115,10 +115,6 @@ Index of this file:
 // [SECTION] Forward Declarations, Helpers
 //-----------------------------------------------------------------------------
 
-#if !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && defined(IMGUI_DISABLE_TEST_WINDOWS) && !defined(IMGUI_DISABLE_DEMO_WINDOWS)   // Obsolete name since 1.53, TEST->DEMO
-#define IMGUI_DISABLE_DEMO_WINDOWS
-#endif
-
 #if !defined(IMGUI_DISABLE_DEMO_WINDOWS)
 
 // Forward Declarations
@@ -137,7 +133,7 @@ static void ShowExampleAppCustomRendering(bool* p_open);
 static void ShowExampleMenuFile();
 
 // Helper to display a little (?) mark which shows a tooltip when hovered.
-// In your own code you may want to display an actual icon if you are using a merged icon fonts (see misc/fonts/README.txt)
+// In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.txt)
 static void HelpMarker(const char* desc)
 {
     ImGui::TextDisabled("(?)");
@@ -157,25 +153,28 @@ void ImGui::ShowUserGuide()
     ImGuiIO& io = ImGui::GetIO();
     ImGui::BulletText("Double-click on title bar to collapse window.");
     ImGui::BulletText("Click and drag on lower corner to resize window\n(double-click to auto fit window to its contents).");
-    if (io.ConfigWindowsMoveFromTitleBarOnly)
-        ImGui::BulletText("Click and drag on title bar to move window.");
-    else
-        ImGui::BulletText("Click and drag on any empty space to move window.");
-    ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
     ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
+    ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
     if (io.FontAllowUserScaling)
         ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
-    ImGui::BulletText("Mouse Wheel to scroll.");
-    ImGui::BulletText("While editing text:\n");
+    ImGui::BulletText("While inputing text:\n");
     ImGui::Indent();
-    ImGui::BulletText("Hold SHIFT or use mouse to select text.");
     ImGui::BulletText("CTRL+Left/Right to word jump.");
     ImGui::BulletText("CTRL+A or double-click to select all.");
-    ImGui::BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard.");
+    ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste.");
     ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
     ImGui::BulletText("ESCAPE to revert.");
     ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
     ImGui::Unindent();
+    ImGui::BulletText("With keyboard navigation enabled:");
+    ImGui::Indent();
+    ImGui::BulletText("Arrow keys to navigate.");
+    ImGui::BulletText("Space to activate a widget.");
+    ImGui::BulletText("Return to input text into a widget.");
+    ImGui::BulletText("Escape to deactivate a widget, close popup, exit child window.");
+    ImGui::BulletText("Alt to jump to the menu layer of a window.");
+    ImGui::BulletText("CTRL+Tab to select a window.");
+    ImGui::Unindent();
 }
 
 //-----------------------------------------------------------------------------
@@ -316,12 +315,20 @@ void ImGui::ShowDemoWindow(bool* p_open)
 
     if (ImGui::CollapsingHeader("Help"))
     {
+        ImGui::Text("ABOUT THIS DEMO:");
+        ImGui::BulletText("Sections below are demonstrating many aspects of the library.");
+        ImGui::BulletText("The \"Examples\" menu above leads to more demo contents.");
+        ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
+                          "and Metrics (general purpose Dear ImGui debugging tool).");
+        ImGui::Separator();
+
         ImGui::Text("PROGRAMMER GUIDE:");
-        ImGui::BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
-        ImGui::BulletText("Please see the comments in imgui.cpp.");
-        ImGui::BulletText("Please see the examples/ application.");
-        ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
-        ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
+        ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
+        ImGui::BulletText("See comments in imgui.cpp.");
+        ImGui::BulletText("See example applications in the examples/ folder.");
+        ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/");
+        ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
+        ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
         ImGui::Separator();
 
         ImGui::Text("USER GUIDE:");
@@ -365,7 +372,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
 
         if (ImGui::TreeNode("Backend Flags"))
         {
-            HelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.");
+            HelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.\nHere we expose then as read-only fields to avoid breaking interactions with your back-end.");
             ImGuiBackendFlags backend_flags = io.BackendFlags; // Make a local copy to avoid modifying actual back-end flags.
             ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad);
             ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors);
@@ -377,6 +384,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
 
         if (ImGui::TreeNode("Style"))
         {
+            HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function.");
             ImGui::ShowStyleEditor();
             ImGui::TreePop();
             ImGui::Separator();
@@ -758,14 +766,14 @@ static void ShowDemoWindowWidgets()
         if (ImGui::TreeNode("UTF-8 Text"))
         {
             // UTF-8 test with Japanese characters
-            // (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read misc/fonts/README.txt for details.)
+            // (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read docs/FONTS.txt for details.)
             // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8
             // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature')
             // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE.
             //   Instead we are encoding a few strings with hexadecimal constants. Don't do this in your application!
             //   Please use u8"text in any language" in your application!
             // Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
-            ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read misc/fonts/README.txt for details.");
+            ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read docs/FONTS.txt for details.");
             ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string.
             ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
             static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
@@ -2015,7 +2023,7 @@ static void ShowDemoWindowLayout()
             if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags))
             {
                 for (int n = 0; n < IM_ARRAYSIZE(opened); n++)
-                    if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n]))
+                    if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None))
                     {
                         ImGui::Text("This is the %s tab!", names[n]);
                         if (n & 1)
@@ -2193,10 +2201,10 @@ static void ShowDemoWindowLayout()
         ImGui::SameLine(140); enable_track |= ImGui::DragInt("##item", &track_item, 0.25f, 0, 99, "Item = %d");
 
         bool scroll_to_off = ImGui::Button("Scroll Offset");
-        ImGui::SameLine(140); scroll_to_off |= ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, 9999, "+%.0f px");
+        ImGui::SameLine(140); scroll_to_off |= ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, FLT_MAX, "+%.0f px");
 
         bool scroll_to_pos = ImGui::Button("Scroll To Pos");
-        ImGui::SameLine(140); scroll_to_pos |= ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, 9999, "X/Y = %.0f px");
+        ImGui::SameLine(140); scroll_to_pos |= ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, FLT_MAX, "X/Y = %.0f px");
         ImGui::PopItemWidth();
 
         if (scroll_to_off || scroll_to_pos)
@@ -2433,7 +2441,7 @@ static void ShowDemoWindowLayout()
         ImVec2 pos = ImGui::GetCursorScreenPos();
         ImVec4 clip_rect(pos.x, pos.y, pos.x + size.x, pos.y + size.y);
         ImGui::InvisibleButton("##dummy", size);
-        if (ImGui::IsItemActive() && ImGui::IsMouseDragging()) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; }
+        if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0)) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; }
         ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x + size.x, pos.y + size.y), IM_COL32(90, 90, 120, 255));
         ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect);
         ImGui::TreePop();
@@ -3039,7 +3047,7 @@ static void ShowDemoWindowMisc()
 
         if (ImGui::TreeNode("Mouse cursors"))
         {
-            const char* mouse_cursors_names[] = { "Arrow", "TextInput", "Move", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand" };
+            const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" };
             IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT);
 
             ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]);
@@ -3106,11 +3114,17 @@ void ImGui::ShowAboutWindow(bool* p_open)
 #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS
         ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS");
 #endif
-#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
-        ImGui::Text("define: IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS");
+#ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
+        ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS");
+#endif
+#ifdef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
+        ImGui::Text("define: IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS");
+#endif
+#ifdef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
+        ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS");
 #endif
-#ifdef IMGUI_DISABLE_MATH_FUNCTIONS
-        ImGui::Text("define: IMGUI_DISABLE_MATH_FUNCTIONS");
+#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
+        ImGui::Text("define: IMGUI_DISABLE_FILE_FUNCTIONS");
 #endif
 #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS
         ImGui::Text("define: IMGUI_DISABLE_DEFAULT_ALLOCATORS");
@@ -3237,7 +3251,7 @@ void ImGui::ShowFontSelector(const char* label)
     HelpMarker(
         "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n"
         "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
-        "- Read FAQ and documentation in misc/fonts/ for more details.\n"
+        "- Read FAQ and docs/FONTS.txt for more details.\n"
         "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
 }
 
@@ -3365,7 +3379,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
                 if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0)
                 {
                     // Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons.
-                    // Read the FAQ and misc/fonts/README.txt about using icon fonts. It's really easy and super convenient!
+                    // Read the FAQ and docs/FONTS.txt about using icon fonts. It's really easy and super convenient!
                     ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i];
                     ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i];
                 }
@@ -3383,7 +3397,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
         {
             ImGuiIO& io = ImGui::GetIO();
             ImFontAtlas* atlas = io.Fonts;
-            HelpMarker("Read FAQ and misc/fonts/README.txt for details on font loading.");
+            HelpMarker("Read FAQ and docs/FONTS.txt for details on font loading.");
             ImGui::PushItemWidth(120);
             for (int i = 0; i < atlas->Fonts.Size; i++)
             {
@@ -3403,17 +3417,17 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
                     ImGui::Text("Fallback character: '%c' (U+%04X)", font->FallbackChar, font->FallbackChar);
                     ImGui::Text("Ellipsis character: '%c' (U+%04X)", font->EllipsisChar, font->EllipsisChar);
                     const float surface_sqrt = sqrtf((float)font->MetricsTotalSurface);
-                    ImGui::Text("Texture surface: %d pixels (approx) ~ %dx%d", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt);
+                    ImGui::Text("Texture Area: about %d px ~%dx%d px", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt);
                     for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
                         if (const ImFontConfig* cfg = &font->ConfigData[config_i])
                             ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
                     if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
                     {
                         // Display all glyphs of the fonts in separate pages of 256 characters
-                        for (int base = 0; base < 0x10000; base += 256)
+                        for (unsigned int base = 0; base <= IM_UNICODE_CODEPOINT_MAX; base += 256)
                         {
                             int count = 0;
-                            for (int n = 0; n < 256; n++)
+                            for (unsigned int n = 0; n < 256; n++)
                                 count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0;
                             if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph"))
                             {
@@ -3421,7 +3435,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
                                 float cell_spacing = style.ItemSpacing.y;
                                 ImVec2 base_pos = ImGui::GetCursorScreenPos();
                                 ImDrawList* draw_list = ImGui::GetWindowDrawList();
-                                for (int n = 0; n < 256; n++)
+                                for (unsigned int n = 0; n < 256; n++)
                                 {
                                     ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing));
                                     ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size);
@@ -4426,9 +4440,11 @@ static void ShowExampleAppCustomRendering(bool* p_open)
         {
             static float sz = 36.0f;
             static float thickness = 3.0f;
+            static int ngon_sides = 6;
             static ImVec4 colf = ImVec4(1.0f, 1.0f, 0.4f, 1.0f);
             ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f");
             ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f");
+            ImGui::SliderInt("n-gon sides", &ngon_sides, 3, 12);
             ImGui::ColorEdit4("Color", &colf.x);
             const ImVec2 p = ImGui::GetCursorScreenPos();
             const ImU32 col = ImColor(colf);
@@ -4441,7 +4457,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
             {
                 // First line uses a thickness of 1.0f, second line uses the configurable thickness
                 float th = (n == 0) ? 1.0f : thickness;
-                draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 6, th);                x += sz + spacing;  // Hexagon
+                draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th);         x += sz + spacing;  // n-gon
                 draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 20, th);               x += sz + spacing;  // Circle
                 draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f,  corners_none, th);     x += sz + spacing;  // Square
                 draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_all, th);      x += sz + spacing;  // Square with all rounded corners
@@ -4455,7 +4471,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
                 x = p.x + 4;
                 y += sz + spacing;
             }
-            draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 6);              x += sz + spacing;  // Hexagon
+            draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz*0.5f, col, ngon_sides);   x += sz + spacing;  // n-gon
             draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 32);             x += sz + spacing;  // Circle
             draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col);                        x += sz + spacing;  // Square
             draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f);                 x += sz + spacing;  // Square with all rounded corners

+ 54 - 15
3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (drawing and font code)
 
 /*
@@ -516,10 +516,13 @@ void ImDrawList::PopTextureID()
     UpdateTextureID();
 }
 
-// NB: this can be called with negative count for removing primitives (as long as the result does not underflow)
+// Reserve space for a number of vertices and indices.
+// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or 
+// submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
 void ImDrawList::PrimReserve(int idx_count, int vtx_count)
 {
     // Large mesh support (when enabled)
+    IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0);
     if (sizeof(ImDrawIdx) == 2 && (_VtxCurrentIdx + vtx_count >= (1 << 16)) && (Flags & ImDrawListFlags_AllowVtxOffset))
     {
         _VtxCurrentOffset = VtxBuffer.Size;
@@ -527,7 +530,7 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count)
         AddDrawCmd();
     }
 
-    ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size-1];
+    ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size - 1];
     draw_cmd.ElemCount += idx_count;
 
     int vtx_buffer_old_size = VtxBuffer.Size;
@@ -539,6 +542,17 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count)
     _IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size;
 }
 
+// Release the a number of reserved vertices/indices from the end of the last reservation made with PrimReserve().
+void ImDrawList::PrimUnreserve(int idx_count, int vtx_count)
+{
+    IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0);
+
+    ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size - 1];
+    draw_cmd.ElemCount -= idx_count;
+    VtxBuffer.shrink(VtxBuffer.Size - vtx_count);
+    IdxBuffer.shrink(IdxBuffer.Size - idx_count);
+}
+
 // Fully unrolled with inline call to keep our debug builds decently fast.
 void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col)
 {
@@ -1090,6 +1104,30 @@ void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col,
     PathFillConvex(col);
 }
 
+// Guaranteed to honor 'num_segments'
+void ImDrawList::AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness)
+{
+    if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2)
+        return;
+
+    // Because we are filling a closed shape we remove 1 from the count of segments/points
+    const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
+    PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
+    PathStroke(col, true, thickness);
+}
+
+// Guaranteed to honor 'num_segments'
+void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)
+{
+    if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2)
+        return;
+
+    // Because we are filling a closed shape we remove 1 from the count of segments/points
+    const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
+    PathArcTo(center, radius, 0.0f, a_max, num_segments - 1);
+    PathFillConvex(col);
+}
+
 void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
 {
     if ((col & IM_COL32_A_MASK) == 0)
@@ -1673,7 +1711,7 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels,
     void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0);
     if (!data)
     {
-        IM_ASSERT(0); // Could not load file.
+        IM_ASSERT_USER_ERROR(0, "Could not load font file!");
         return NULL;
     }
     ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
@@ -1725,7 +1763,8 @@ ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed
 
 int ImFontAtlas::AddCustomRectRegular(unsigned int id, int width, int height)
 {
-    IM_ASSERT(id >= 0x10000);
+    // Breaking change on 2019/11/21 (1.74): ImFontAtlas::AddCustomRectRegular() now requires an ID >= 0x110000 (instead of >= 0x10000)
+    IM_ASSERT(id >= 0x110000);
     IM_ASSERT(width > 0 && width <= 0xFFFF);
     IM_ASSERT(height > 0 && height <= 0xFFFF);
     ImFontAtlasCustomRect r;
@@ -1905,7 +1944,7 @@ bool    ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
             dst_tmp.GlyphsSet.Resize(dst_tmp.GlyphsHighest + 1);
 
         for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
-            for (int codepoint = src_range[0]; codepoint <= src_range[1]; codepoint++)
+            for (unsigned int codepoint = src_range[0]; codepoint <= src_range[1]; codepoint++)
             {
                 if (dst_tmp.GlyphsSet.GetBit(codepoint))    // Don't overwrite existing glyphs. We could make this an option for MergeMode (e.g. MergeOverwrite==true)
                     continue;
@@ -2189,7 +2228,7 @@ void ImFontAtlasBuildFinish(ImFontAtlas* atlas)
     for (int i = 0; i < atlas->CustomRects.Size; i++)
     {
         const ImFontAtlasCustomRect& r = atlas->CustomRects[i];
-        if (r.Font == NULL || r.ID > 0x10000)
+        if (r.Font == NULL || r.ID >= 0x110000)
             continue;
 
         IM_ASSERT(r.Font->ContainerAtlas == atlas);
@@ -2453,7 +2492,7 @@ void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end)
         text += c_len;
         if (c_len == 0)
             break;
-        if (c < 0x10000)
+        if (c <= IM_UNICODE_CODEPOINT_MAX)
             AddChar((ImWchar)c);
     }
 }
@@ -2467,12 +2506,12 @@ void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges)
 
 void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges)
 {
-    int max_codepoint = 0x10000;
-    for (int n = 0; n < max_codepoint; n++)
+    const int max_codepoint = IM_UNICODE_CODEPOINT_MAX;
+    for (int n = 0; n <= max_codepoint; n++)
         if (GetBit(n))
         {
             out_ranges->push_back((ImWchar)n);
-            while (n < max_codepoint - 1 && GetBit(n + 1))
+            while (n < max_codepoint && GetBit(n + 1))
                 n++;
             out_ranges->push_back((ImWchar)n);
         }
@@ -2601,7 +2640,7 @@ void ImFont::AddGlyph(ImWchar codepoint, float x0, float y0, float x1, float y1,
 void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst)
 {
     IM_ASSERT(IndexLookup.Size > 0);    // Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function.
-    int index_size = IndexLookup.Size;
+    unsigned int index_size = (unsigned int)IndexLookup.Size;
 
     if (dst < index_size && IndexLookup.Data[dst] == (ImWchar)-1 && !overwrite_dst) // 'dst' already exists
         return;
@@ -3020,9 +3059,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
         x += char_width;
     }
 
-    // Give back unused vertices
-    draw_list->VtxBuffer.resize((int)(vtx_write - draw_list->VtxBuffer.Data));
-    draw_list->IdxBuffer.resize((int)(idx_write - draw_list->IdxBuffer.Data));
+    // Give back unused vertices (clipped ones, blanks) ~ this is essentially a PrimUnreserve() action.
+    draw_list->VtxBuffer.Size = (int)(vtx_write - draw_list->VtxBuffer.Data); // Same as calling shrink()
+    draw_list->IdxBuffer.Size = (int)(idx_write - draw_list->IdxBuffer.Data);
     draw_list->CmdBuffer[draw_list->CmdBuffer.Size-1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size);
     draw_list->_VtxWritePtr = vtx_write;
     draw_list->_IdxWritePtr = idx_write;

+ 99 - 50
3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (internal structures/api)
 
 // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
@@ -31,7 +31,7 @@ Index of this file:
 #error Must include imgui.h before imgui_internal.h
 #endif
 
-#include <stdio.h>      // FILE*
+#include <stdio.h>      // FILE*, sscanf
 #include <stdlib.h>     // NULL, malloc, free, qsort, atoi, atof
 #include <math.h>       // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf
 #include <limits.h>     // INT_MIN, INT_MAX
@@ -60,6 +60,14 @@ Index of this file:
 #pragma GCC diagnostic ignored "-Wclass-memaccess"          // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
 #endif
 
+// Legacy defines
+#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS                // Renamed in 1.74
+#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
+#endif
+#ifdef IMGUI_DISABLE_MATH_FUNCTIONS                         // Renamed in 1.74
+#error Use IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
+#endif
+
 //-----------------------------------------------------------------------------
 // Forward declarations
 //-----------------------------------------------------------------------------
@@ -132,48 +140,48 @@ extern IMGUI_API ImGuiContext* GImGui;  // Current implicit context pointer
 #endif
 
 //-----------------------------------------------------------------------------
-// Generic helpers
-//-----------------------------------------------------------------------------
-// - Macros
-// - Helpers: Misc
-// - Helpers: Bit manipulation
-// - Helpers: Geometry
-// - Helpers: String, Formatting
-// - Helpers: UTF-8 <> wchar conversions
-// - Helpers: ImVec2/ImVec4 operators
-// - Helpers: Maths
-// - Helper: ImBoolVector
-// - Helper: ImPool<>
-// - Helper: ImChunkStream<>
+// Macros
 //-----------------------------------------------------------------------------
 
-// Macros
-#define IM_PI           3.14159265358979323846f
-#ifdef _WIN32
-#define IM_NEWLINE      "\r\n"   // Play it nice with Windows users (2018/05 news: Microsoft announced that Notepad will finally display Unix-style carriage returns!)
-#else
-#define IM_NEWLINE      "\n"
+// Debug Logging
+#ifndef IMGUI_DEBUG_LOG
+#define IMGUI_DEBUG_LOG(_FMT,...)       printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__)
 #endif
-#define IM_TABSIZE      (4)
+
+// Static Asserts
 #if (__cplusplus >= 201100)
 #define IM_STATIC_ASSERT(_COND)         static_assert(_COND, "")
 #else
 #define IM_STATIC_ASSERT(_COND)         typedef char static_assertion_##__line__[(_COND)?1:-1]
 #endif
-#define IM_F32_TO_INT8_UNBOUND(_VAL)    ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f)))   // Unsaturated, for display purpose
-#define IM_F32_TO_INT8_SAT(_VAL)        ((int)(ImSaturate(_VAL) * 255.0f + 0.5f))               // Saturated, always output 0..255
-#define IM_FLOOR(_VAL)                  ((float)(int)(_VAL))                                    // ImFloor() is not inlined in MSVC debug builds
-#define IM_ROUND(_VAL)                  ((float)(int)((_VAL) + 0.5f))                           //
+
+// "Paranoid" Debug Asserts are meant to only be enabled during specific debugging/work, otherwise would slow down the code too much.
+// We currently don't have many of those so the effect is currently negligible, but onward intent to add more aggressive ones in the code.
+//#define IMGUI_DEBUG_PARANOID
+#ifdef IMGUI_DEBUG_PARANOID
+#define IM_ASSERT_PARANOID(_EXPR)       IM_ASSERT(_EXPR)
+#else
+#define IM_ASSERT_PARANOID(_EXPR)   
+#endif
 
 // Error handling
-#ifndef IMGUI_USER_ERROR
-#define IMGUI_USER_ERROR(_EXPR, _MSG)   IM_ASSERT((_EXPR) && (_MSG))    // Recoverable User Error
+// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults.
+#ifndef IM_ASSERT_USER_ERROR
+#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG)   // Recoverable User Error
 #endif
 
-// Debug Logging
-#ifndef IMGUI_DEBUG_LOG
-#define IMGUI_DEBUG_LOG(_FMT,...)       printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__)
+// Misc Macros
+#define IM_PI                           3.14159265358979323846f
+#ifdef _WIN32
+#define IM_NEWLINE                      "\r\n"   // Play it nice with Windows users (Update: since 2018-05, Notepad finally appears to support Unix-style carriage returns!)
+#else
+#define IM_NEWLINE                      "\n"
 #endif
+#define IM_TABSIZE                      (4)
+#define IM_F32_TO_INT8_UNBOUND(_VAL)    ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f)))   // Unsaturated, for display purpose
+#define IM_F32_TO_INT8_SAT(_VAL)        ((int)(ImSaturate(_VAL) * 255.0f + 0.5f))               // Saturated, always output 0..255
+#define IM_FLOOR(_VAL)                  ((float)(int)(_VAL))                                    // ImFloor() is not inlined in MSVC debug builds
+#define IM_ROUND(_VAL)                  ((float)(int)((_VAL) + 0.5f))                           //
 
 // Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
 #ifdef _MSC_VER
@@ -182,9 +190,22 @@ extern IMGUI_API ImGuiContext* GImGui;  // Current implicit context pointer
 #define IMGUI_CDECL
 #endif
 
+//-----------------------------------------------------------------------------
+// Generic helpers
+//-----------------------------------------------------------------------------
+// - Helpers: Misc
+// - Helpers: Bit manipulation
+// - Helpers: String, Formatting
+// - Helpers: UTF-8 <> wchar conversions
+// - Helpers: ImVec2/ImVec4 operators
+// - Helpers: Maths
+// - Helpers: Geometry
+// - Helper: ImBoolVector
+// - Helper: ImPool<>
+// - Helper: ImChunkStream<>
+//-----------------------------------------------------------------------------
+
 // Helpers: Misc
-IMGUI_API void*         ImFileLoadToMemory(const char* filename, const char* file_open_mode, size_t* out_file_size = NULL, int padding_bytes = 0);
-IMGUI_API FILE*         ImFileOpen(const char* filename, const char* file_open_mode);
 #define ImQsort         qsort
 IMGUI_API ImU32         ImHashData(const void* data, size_t data_size, ImU32 seed = 0);
 IMGUI_API ImU32         ImHashStr(const char* data, size_t data_size = 0, ImU32 seed = 0);
@@ -196,13 +217,6 @@ static inline ImU32     ImHash(const void* data, int size, ImU32 seed = 0) { ret
 static inline bool      ImIsPowerOfTwo(int v)           { return v != 0 && (v & (v - 1)) == 0; }
 static inline int       ImUpperPowerOfTwo(int v)        { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
 
-// Helpers: Geometry
-IMGUI_API ImVec2        ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);
-IMGUI_API bool          ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
-IMGUI_API ImVec2        ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
-IMGUI_API void          ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);
-IMGUI_API ImGuiDir      ImGetDirQuadrantFromDelta(float dx, float dy);
-
 // Helpers: String, Formatting
 IMGUI_API int           ImStricmp(const char* str1, const char* str2);
 IMGUI_API int           ImStrnicmp(const char* str1, const char* str2, size_t count);
@@ -252,9 +266,35 @@ static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs)
 static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs)            { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); }
 #endif
 
+// Helpers: File System
+#if defined(__EMSCRIPTEN__) && !defined(IMGUI_DISABLE_FILE_FUNCTIONS)
+#define IMGUI_DISABLE_FILE_FUNCTIONS
+#endif
+#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
+#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
+typedef void* ImFileHandle;
+static inline ImFileHandle  ImFileOpen(const char*, const char*)                    { return NULL; }
+static inline bool          ImFileClose(ImFileHandle)                               { return false; }
+static inline ImU64         ImFileGetSize(ImFileHandle)                             { return (ImU64)-1; }
+static inline ImU64         ImFileRead(void*, ImU64, ImU64, ImFileHandle)           { return 0; }
+static inline ImU64         ImFileWrite(const void*, ImU64, ImU64, ImFileHandle)    { return 0; }
+#endif
+
+#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
+typedef FILE* ImFileHandle;
+IMGUI_API ImFileHandle      ImFileOpen(const char* filename, const char* mode);
+IMGUI_API bool              ImFileClose(ImFileHandle file);
+IMGUI_API ImU64             ImFileGetSize(ImFileHandle file);
+IMGUI_API ImU64             ImFileRead(void* data, ImU64 size, ImU64 count, ImFileHandle file);
+IMGUI_API ImU64             ImFileWrite(const void* data, ImU64 size, ImU64 count, ImFileHandle file);
+#else
+#define IMGUI_DISABLE_TTY_FUNCTIONS // Can't use stdout, fflush if we are not using default file functions
+#endif
+IMGUI_API void*             ImFileLoadToMemory(const char* filename, const char* mode, size_t* out_file_size = NULL, int padding_bytes = 0);
+
 // Helpers: Maths
 // - Wrapper for standard libs functions. (Note that imgui_demo.cpp does _not_ use them to keep the code easy to copy)
-#ifndef IMGUI_DISABLE_MATH_FUNCTIONS
+#ifndef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
 static inline float  ImFabs(float x)                                            { return fabsf(x); }
 static inline float  ImSqrt(float x)                                            { return sqrtf(x); }
 static inline float  ImPow(float x, float y)                                    { return powf(x, y); }
@@ -297,6 +337,14 @@ static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a)
 static inline float  ImLinearSweep(float current, float target, float speed)    { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; }
 static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs)                { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
 
+// Helpers: Geometry
+IMGUI_API ImVec2     ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);
+IMGUI_API bool       ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
+IMGUI_API ImVec2     ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
+IMGUI_API void       ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);
+inline float         ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c) { return ImFabs((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) * 0.5f; }
+IMGUI_API ImGuiDir   ImGetDirQuadrantFromDelta(float dx, float dy);
+
 // Helper: ImBoolVector
 // Store 1-bit per value. Note that Resize() currently clears the whole vector.
 struct IMGUI_API ImBoolVector
@@ -596,7 +644,7 @@ struct IMGUI_API ImRect
     ImVec2      Min;    // Upper-left
     ImVec2      Max;    // Lower-right
 
-    ImRect()                                        : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX)  {}
+    ImRect()                                        : Min(0.0f, 0.0f), Max(0.0f, 0.0f)              {}
     ImRect(const ImVec2& min, const ImVec2& max)    : Min(min), Max(max)                            {}
     ImRect(const ImVec4& v)                         : Min(v.x, v.y), Max(v.z, v.w)                  {}
     ImRect(float x1, float y1, float x2, float y2)  : Min(x1, y1), Max(x2, y2)                      {}
@@ -800,7 +848,7 @@ struct IMGUI_API ImDrawListSharedData
     ImVec2          TexUvWhitePixel;            // UV of white pixel in the atlas
     ImFont*         Font;                       // Current/default font (optional, for simplified AddText overload)
     float           FontSize;                   // Current/default font size (optional, for simplified AddText overload)
-    float           CurveTessellationTol;
+    float           CurveTessellationTol;       // Tessellation tolerance when using PathBezierCurveTo()
     ImVec4          ClipRectFullscreen;         // Value for PushClipRectFullscreen()
     ImDrawListFlags InitialFlags;               // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
 
@@ -1053,7 +1101,7 @@ struct ImGuiContext
     ImGuiID                 DragDropAcceptIdPrev;               // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
     int                     DragDropAcceptFrameCount;           // Last time a target expressed a desire to accept the source
     ImVector<unsigned char> DragDropPayloadBufHeap;             // We don't expose the ImVector<> directly
-    unsigned char           DragDropPayloadBufLocal[8];         // Local buffer for small payloads
+    unsigned char           DragDropPayloadBufLocal[16];        // Local buffer for small payloads
 
     // Tab bars
     ImGuiTabBar*                    CurrentTabBar;
@@ -1095,7 +1143,7 @@ struct ImGuiContext
     // Capture/Logging
     bool                    LogEnabled;
     ImGuiLogType            LogType;
-    FILE*                   LogFile;                            // If != NULL log to stdout/ file
+    ImFileHandle            LogFile;                            // If != NULL log to stdout/ file
     ImGuiTextBuffer         LogBuffer;                          // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
     float                   LogLinePosY;
     bool                    LogLineFirstItem;
@@ -1465,7 +1513,7 @@ enum ImGuiTabBarFlagsPrivate_
 // Extend ImGuiTabItemFlags_
 enum ImGuiTabItemFlagsPrivate_
 {
-    ImGuiTabItemFlags_NoCloseButton             = 1 << 20   // Store whether p_open is set or not, which we need to recompute ContentWidth during layout.
+    ImGuiTabItemFlags_NoCloseButton             = 1 << 20   // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout)
 };
 
 // Storage for one active tab item (sizeof() 26~32 bytes)
@@ -1480,7 +1528,7 @@ struct ImGuiTabItem
     float               Width;                  // Width currently displayed
     float               ContentWidth;           // Width of actual contents, stored during BeginTabItem() call
 
-    ImGuiTabItem()      { ID = Flags = 0; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = ContentWidth = 0.0f; }
+    ImGuiTabItem()      { ID = 0; Flags = 0; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = ContentWidth = 0.0f; }
 };
 
 // Storage for a tab bar (sizeof() 92~96 bytes)
@@ -1553,7 +1601,7 @@ namespace ImGui
 
     IMGUI_API void          SetCurrentFont(ImFont* font);
     inline ImFont*          GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }
-    inline ImDrawList*      GetForegroundDrawList(ImGuiWindow*) { ImGuiContext& g = *GImGui; return &g.ForegroundDrawList; } // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches.
+    inline ImDrawList*      GetForegroundDrawList(ImGuiWindow* window) { IM_UNUSED(window); ImGuiContext& g = *GImGui; return &g.ForegroundDrawList; } // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches.
 
     // Init
     IMGUI_API void          Initialize(ImGuiContext* context);
@@ -1643,7 +1691,7 @@ namespace ImGui
     inline bool             IsActiveIdUsingNavDir(ImGuiDir dir)                         { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
     inline bool             IsActiveIdUsingNavInput(ImGuiNavInput input)                { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavInputMask & (1 << input)) != 0; }
     inline bool             IsActiveIdUsingKey(ImGuiKey key)                            { ImGuiContext& g = *GImGui; IM_ASSERT(key < 64); return (g.ActiveIdUsingKeyInputMask & ((ImU64)1 << key)) != 0; }
-    IMGUI_API bool          IsMouseDragPastThreshold(int button, float lock_threshold = -1.0f);
+    IMGUI_API bool          IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);
     inline bool             IsKeyPressedMap(ImGuiKey key, bool repeat = true)           { ImGuiContext& g = *GImGui; const int key_index = g.IO.KeyMap[key]; return (key_index >= 0) ? IsKeyPressed(key_index, repeat) : false; }
     inline bool             IsNavInputDown(ImGuiNavInput n)                             { ImGuiContext& g = *GImGui; return g.IO.NavInputs[n] > 0.0f; }
     inline bool             IsNavInputTest(ImGuiNavInput n, ImGuiInputReadMode rm)      { return (GetNavInputAmount(n, rm) > 0.0f); }
@@ -1712,7 +1760,8 @@ namespace ImGui
     IMGUI_API bool          ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags);
     IMGUI_API void          Scrollbar(ImGuiAxis axis);
     IMGUI_API bool          ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* p_scroll_v, float avail_v, float contents_v, ImDrawCornerFlags rounding_corners);
-    IMGUI_API ImGuiID       GetScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
+    IMGUI_API ImGuiID       GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
+    IMGUI_API ImGuiID       GetWindowResizeID(ImGuiWindow* window, int n); // 0..3: corners, 4..7: borders
     IMGUI_API void          SeparatorEx(ImGuiSeparatorFlags flags);
 
     // Widgets low-level behaviors

+ 23 - 16
3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp

@@ -1,4 +1,4 @@
-// dear imgui, v1.74 WIP
+// dear imgui, v1.75 WIP
 // (widgets code)
 
 /*
@@ -768,13 +768,13 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
     RenderArrow(window->DrawList, bb.Min + g.Style.FramePadding, text_col, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);
 
     // Switch to moving the window after mouse is moved beyond the initial drag threshold
-    if (IsItemActive() && IsMouseDragging())
+    if (IsItemActive() && IsMouseDragging(0))
         StartMouseMovingWindow(window);
 
     return pressed;
 }
 
-ImGuiID ImGui::GetScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
+ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
 {
     return window->GetIDNoKeepAlive(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY");
 }
@@ -881,7 +881,7 @@ void ImGui::Scrollbar(ImGuiAxis axis)
     ImGuiContext& g = *GImGui;
     ImGuiWindow* window = g.CurrentWindow;
 
-    const ImGuiID id = GetScrollbarID(window, axis);
+    const ImGuiID id = GetWindowScrollbarID(window, axis);
     KeepAliveID(id);
 
     // Calculate scrollbar bounding box
@@ -2489,7 +2489,7 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
     return value_changed;
 }
 
-// For 32-bits and larger types, slider bounds are limited to half the natural type range.
+// For 32-bit and larger types, slider bounds are limited to half the natural type range.
 // So e.g. an integer Slider between INT_MAX-10 and INT_MAX will fail, but an integer Slider between INT_MAX/2-10 and INT_MAX/2 will be ok.
 // It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders.
 bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
@@ -3172,7 +3172,7 @@ namespace ImStb
 static int     STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj)                             { return obj->CurLenW; }
 static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING* obj, int idx)                      { return obj->TextW[idx]; }
 static float   STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx)  { ImWchar c = obj->TextW[line_start_idx + char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; ImGuiContext& g = *GImGui; return g.Font->GetCharAdvance(c) * (g.FontSize / g.Font->FontSize); }
-static int     STB_TEXTEDIT_KEYTOTEXT(int key)                                                    { return key >= 0x10000 ? 0 : key; }
+static int     STB_TEXTEDIT_KEYTOTEXT(int key)                                                    { return key >= 0x200000 ? 0 : key; }
 static ImWchar STB_TEXTEDIT_NEWLINE = '\n';
 static void    STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx)
 {
@@ -3355,6 +3355,10 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
     if (c >= 0xE000 && c <= 0xF8FF)
         return false;
 
+    // Filter Unicode ranges we are not handling in this build.
+    if (c > IM_UNICODE_CODEPOINT_MAX)
+        return false;
+
     // Generic named filters
     if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific))
     {
@@ -3479,8 +3483,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
 
     const bool user_clicked = hovered && io.MouseClicked[0];
     const bool user_nav_input_start = (g.ActiveId != id) && ((g.NavInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_NavKeyboard));
-    const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetScrollbarID(draw_window, ImGuiAxis_Y);
-    const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetScrollbarID(draw_window, ImGuiAxis_Y);
+    const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
+    const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
 
     bool clear_active_id = false;
     bool select_all = (g.ActiveId != id) && ((flags & ImGuiInputTextFlags_AutoSelectAll) != 0 || user_nav_input_start) && (!is_multiline);
@@ -3778,7 +3782,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
                     s += ImTextCharFromUtf8(&c, s, NULL);
                     if (c == 0)
                         break;
-                    if (c >= 0x10000 || !InputTextFilterCharacter(&c, flags, callback, callback_user_data))
+                    if (!InputTextFilterCharacter(&c, flags, callback, callback_user_data))
                         continue;
                     clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c;
                 }
@@ -4002,7 +4006,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
             // In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter.
             searches_remaining += is_multiline ? 1 : 0;
             int line_count = 0;
-            //for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++)  // FIXME-OPT: Could use this when wchar_t are 16-bits
+            //for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++)  // FIXME-OPT: Could use this when wchar_t are 16-bit
             for (const ImWchar* s = text_begin; *s != 0; s++)
                 if (*s == '\n')
                 {
@@ -4079,7 +4083,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
                     break;
                 if (rect_pos.y < clip_rect.y)
                 {
-                    //p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p);  // FIXME-OPT: Could use this when wchar_t are 16-bits
+                    //p = (const ImWchar*)wmemchr((const wchar_t*)p, '\n', text_selected_end - p);  // FIXME-OPT: Could use this when wchar_t are 16-bit
                     //p = p ? p + 1 : text_selected_end;
                     while (p < text_selected_end)
                         if (*p++ == '\n')
@@ -6487,7 +6491,7 @@ void    ImGui::EndTabBar()
     ImGuiTabBar* tab_bar = g.CurrentTabBar;
     if (tab_bar == NULL)
     {
-        IMGUI_USER_ERROR(tab_bar != NULL, "Mismatched BeginTabBar()/EndTabBar()!");
+        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Mismatched BeginTabBar()/EndTabBar()!");
         return;
     }
     if (tab_bar->WantLayout)
@@ -6884,7 +6888,7 @@ bool    ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f
     ImGuiTabBar* tab_bar = g.CurrentTabBar;
     if (tab_bar == NULL)
     {
-        IMGUI_USER_ERROR(tab_bar, "BeginTabItem() Needs to be called between BeginTabBar() and EndTabBar()!");
+        IM_ASSERT_USER_ERROR(tab_bar, "BeginTabItem() Needs to be called between BeginTabBar() and EndTabBar()!");
         return false;
     }
     bool ret = TabItemEx(tab_bar, label, p_open, flags);
@@ -6938,6 +6942,12 @@ bool    ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
         return false;
     }
 
+    // Store into ImGuiTabItemFlags_NoCloseButton, also honor ImGuiTabItemFlags_NoCloseButton passed by user (although not documented)
+    if (flags & ImGuiTabItemFlags_NoCloseButton)
+        p_open = NULL;
+    else if (p_open == NULL)
+        flags |= ImGuiTabItemFlags_NoCloseButton;
+
     // Calculate tab contents size
     ImVec2 size = TabItemCalcSize(label, p_open != NULL);
 
@@ -6955,9 +6965,6 @@ bool    ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
     tab_bar->LastTabItemIdx = (short)tab_bar->Tabs.index_from_ptr(tab);
     tab->ContentWidth = size.x;
 
-    if (p_open == NULL)
-        flags |= ImGuiTabItemFlags_NoCloseButton;
-
     const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount);
     const bool tab_bar_focused = (tab_bar->Flags & ImGuiTabBarFlags_IsFocused) != 0;
     const bool tab_appearing = (tab->LastFrameVisible + 1 < g.FrameCount);

+ 1 - 1
3rdparty/bgfx/3rdparty/dear-imgui/widgets/dock.inl

@@ -706,7 +706,7 @@ namespace ImGui
 						dock_tab->setActive();
 					}
 
-					if (IsItemActive() && IsMouseDragging())
+					if (IsItemActive() && IsMouseDragging(0))
 					{
 						m_drag_offset = GetMousePos() - dock_tab->pos;
 						doUndock(*dock_tab);

+ 0 - 94
3rdparty/bgfx/3rdparty/glslang/.appveyor.yml

@@ -1,94 +0,0 @@
-# Windows Build Configuration for AppVeyor
-# http://www.appveyor.com/docs/appveyor-yml
-
-# build version format
-version: "{build}"
-
-os: Visual Studio 2013
-
-platform:
-  - x64
-
-configuration:
-  - Debug
-  - Release
-
-branches:
-  only:
-    - master
-
-# Travis advances the master-tot tag to current top of the tree after
-# each push into the master branch, because it relies on that tag to
-# upload build artifacts to the master-tot release. This will cause
-# double testing for each push on Appveyor: one for the push, one for
-# the tag advance. Disable testing tags.
-skip_tags: true
-
-clone_depth: 5
-
-matrix:
-  fast_finish: true # Show final status immediately if a test fails.
-
-# scripts that run after cloning repository
-install:
-  - C:/Python27/python.exe update_glslang_sources.py
-  - set PATH=C:\ninja;C:\Python36;%PATH%
-  - git clone https://github.com/google/googletest.git External/googletest
-  - cd External/googletest
-  - git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
-  - cd ../..
-
-build:
-  parallel: true  # enable MSBuild parallel builds
-  verbosity: minimal
-
-build_script:
-  - mkdir build && cd build
-  - cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
-  - cmake --build . --config %CONFIGURATION% --target install
-
-test_script:
-  - ctest -C %CONFIGURATION% --output-on-failure
-  - cd ../Test && bash runtests
-  - cd ../build
-
-after_test:
-  # For debug build, the generated dll has a postfix "d" in its name.
-  - ps: >-
-      If ($env:configuration -Match "Debug") {
-        $env:SUFFIX="d"
-      } Else {
-        $env:SUFFIX=""
-      }
-  - cd install
-  # Zip all glslang artifacts for uploading and deploying
-  - 7z a glslang-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip
-    bin\glslangValidator.exe
-    bin\spirv-remap.exe
-    include\glslang\*
-    lib\glslang%SUFFIX%.lib
-    lib\HLSL%SUFFIX%.lib
-    lib\OGLCompiler%SUFFIX%.lib
-    lib\OSDependent%SUFFIX%.lib
-    lib\SPIRV%SUFFIX%.lib
-    lib\SPVRemapper%SUFFIX%.lib
-    lib\SPIRV-Tools%SUFFIX%.lib
-    lib\SPIRV-Tools-opt%SUFFIX%.lib
-
-artifacts:
-  - path: build\install\*.zip
-    name: artifacts-zip
-
-deploy:
-  - provider: GitHub
-    auth_token:
-      secure: YglcSYdl0TylEa59H4K6lylBEDr586NAt2EMgZquSo+iuPrwgZQuJLPCoihSm9y6
-    release: master-tot
-    description: "Continuous build of the latest master branch by Appveyor and Travis CI"
-    artifact: artifacts-zip
-    draft: false
-    prerelease: false
-    force_update: true
-    on:
-      branch: master
-      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013

+ 0 - 13
3rdparty/bgfx/3rdparty/glslang/.clang-format

@@ -1,13 +0,0 @@
-Language: Cpp
-IndentWidth: 4
-PointerAlignment: Left
-BreakBeforeBraces: Custom
-BraceWrapping: { AfterFunction: true, AfterControlStatement: false }
-IndentCaseLabels: false
-ReflowComments: false
-ColumnLimit: 120
-AccessModifierOffset: -4
-AlignTrailingComments: true
-AllowShortBlocksOnASingleLine: false
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false

+ 0 - 17
3rdparty/bgfx/3rdparty/glslang/.gitattributes

@@ -1,17 +0,0 @@
-# test files have a mix of lf/crlf, and that's a good thing, for testing, don't mess with it
-# bash scripts need lines ending with lf, and that's correct for Windows too, e.g., under Cygwin
-# (scripts often don't have a suffix)
-* -text
-*.sh text eof=lf
-
-# txt files should be native and normalized
-*.txt text
-
-# source code can be native and normalized, but simpler if lf everywhere; will try that way
-*.h text eol=lf
-*.c text eol=lf
-*.cpp text eol=lf
-*.y text eol=lf
-*.out text eol=lf
-*.conf text eol=lf
-*.err text eol=lf

+ 0 - 10
3rdparty/bgfx/3rdparty/glslang/.gitignore

@@ -1,10 +0,0 @@
-*.o
-*.a
-*.so
-*.exe
-tags
-TAGS
-build/
-Test/localResults/
-External/googletest
-External/spirv-tools

+ 0 - 128
3rdparty/bgfx/3rdparty/glslang/.travis.yml

@@ -1,128 +0,0 @@
-# Linux and Mac Build Configuration for Travis
-
-language: cpp
-
-os:
-  - linux
-  - osx
-
-# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
-sudo: false
-dist: trusty
-
-env:
-  global:
-    - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI=
-  matrix:
-    - GLSLANG_BUILD_TYPE=Release
-    - GLSLANG_BUILD_TYPE=Debug
-
-compiler:
-  - clang
-  - gcc
-
-matrix:
-  fast_finish: true # Show final status immediately if a test fails.
-  exclude:
-    # Skip GCC builds on Mac OS X.
-    - os: osx
-      compiler: gcc
-  include:
-    # Additional build using Android NDK.
-    - env: BUILD_NDK=ON
-
-cache:
-  apt: true
-
-branches:
-  only:
-    - master
-
-addons:
-  apt:
-    packages:
-      - clang-3.6
-
-install:
-  # Make sure that clang-3.6 is selected on Linux.
-  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
-      export CC=clang-3.6 CXX=clang++-3.6;
-    fi
-  # Download a recent Android NDK and use its android.toolchain.cmake file.
-  - if [[ "$BUILD_NDK" == "ON" ]]; then
-      export ANDROID_NDK=$HOME/android-ndk;
-      git init $ANDROID_NDK;
-      pushd $ANDROID_NDK;
-        git remote add dneto0 https://github.com/dneto0/android-ndk.git;
-        git fetch --depth=1 dneto0 r17b-strip;
-        git checkout FETCH_HEAD;
-      popd;
-      export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake;
-    fi
-
-before_script:
-  - git clone --depth=1 https://github.com/google/googletest.git External/googletest
-  - ./update_glslang_sources.py
-
-script:
-  - mkdir build && cd build
-  # For Android, do release building using NDK without testing.
-  # Use android-14, the oldest native API level supporeted by NDK r17b.
-  # We can use newer API levels if we want.
-  # For Linux and macOS, do debug/release building with testing.
-  - if [[ "$BUILD_NDK" == "ON" ]]; then
-      cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
-            -DANDROID_NATIVE_API_LEVEL=android-14
-            -DCMAKE_BUILD_TYPE=Release
-            -DANDROID_ABI="armeabi-v7a with NEON"
-            -DBUILD_TESTING=OFF ..;
-      make -j4;
-    else
-      cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE}
-            -DCMAKE_INSTALL_PREFIX=`pwd`/install ..;
-      make -j4 install;
-      ctest --output-on-failure &&
-      cd ../Test && ./runtests;
-    fi
-
-after_success:
-  # For debug build, the generated dll has a postfix "d" in its name.
-  - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then
-      export SUFFIX="d";
-    else
-      export SUFFIX="";
-    fi
-  # Create tarball for deployment
-  - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then
-      cd ../build/install;
-      export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip;
-      zip ${TARBALL}
-        bin/glslangValidator
-        include/glslang/*
-        lib/libglslang${SUFFIX}.a
-        lib/libHLSL${SUFFIX}.a
-        lib/libOGLCompiler${SUFFIX}.a
-        lib/libOSDependent${SUFFIX}.a
-        lib/libSPIRV${SUFFIX}.a
-        lib/libSPVRemapper${SUFFIX}.a
-        lib/libSPIRV-Tools${SUFFIX}.a
-        lib/libSPIRV-Tools-opt${SUFFIX}.a;
-    fi
-
-before_deploy:
-  # Tag the current top of the tree as "master-tot".
-  # Travis CI replies on the tag name to properly push to GitHub Releases.
-  - git config --global user.name "Travis CI"
-  - git config --global user.email "[email protected]"
-  - git tag -f master-tot
-  - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags
-
-deploy:
-  provider: releases
-  api_key: ${glslangtoken}
-  on:
-    branch: master
-    condition: ${CC} == clang* && ${BUILD_NDK} != ON
-  file: ${TARBALL}
-  skip_cleanup: true
-  overwrite: true

+ 0 - 100
3rdparty/bgfx/3rdparty/glslang/Android.mk

@@ -1,100 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
-# AMD and NV extensions are turned on by default in upstream Glslang.
-GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE:=OSDependent
-LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
-LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
-LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE:=OGLCompiler
-LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
-LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
-LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
-LOCAL_STATIC_LIBRARIES:=OSDependent
-include $(BUILD_STATIC_LIBRARY)
-
-# Build Glslang's HLSL parser library.
-include $(CLEAR_VARS)
-LOCAL_MODULE:=HLSL
-LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
-LOCAL_SRC_FILES:= \
-		hlsl/hlslAttributes.cpp \
-		hlsl/hlslGrammar.cpp \
-		hlsl/hlslOpMap.cpp \
-		hlsl/hlslParseables.cpp \
-		hlsl/hlslParseHelper.cpp \
-		hlsl/hlslScanContext.cpp \
-		hlsl/hlslTokenStream.cpp
-LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
-	$(LOCAL_PATH)/hlsl
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))
-
-LOCAL_MODULE:=glslang
-LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
-LOCAL_SRC_FILES:= \
-		glslang/GenericCodeGen/CodeGen.cpp \
-		glslang/GenericCodeGen/Link.cpp \
-		glslang/MachineIndependent/attribute.cpp \
-		glslang/MachineIndependent/Constant.cpp \
-		glslang/MachineIndependent/glslang_tab.cpp \
-		glslang/MachineIndependent/InfoSink.cpp \
-		glslang/MachineIndependent/Initialize.cpp \
-		glslang/MachineIndependent/Intermediate.cpp \
-		glslang/MachineIndependent/intermOut.cpp \
-		glslang/MachineIndependent/IntermTraverse.cpp \
-		glslang/MachineIndependent/iomapper.cpp \
-		glslang/MachineIndependent/limits.cpp \
-		glslang/MachineIndependent/linkValidate.cpp \
-		glslang/MachineIndependent/parseConst.cpp \
-		glslang/MachineIndependent/ParseContextBase.cpp \
-		glslang/MachineIndependent/ParseHelper.cpp \
-		glslang/MachineIndependent/PoolAlloc.cpp \
-		glslang/MachineIndependent/propagateNoContraction.cpp \
-		glslang/MachineIndependent/reflection.cpp \
-		glslang/MachineIndependent/RemoveTree.cpp \
-		glslang/MachineIndependent/Scan.cpp \
-		glslang/MachineIndependent/ShaderLang.cpp \
-		glslang/MachineIndependent/SymbolTable.cpp \
-		glslang/MachineIndependent/Versions.cpp \
-		glslang/MachineIndependent/preprocessor/PpAtom.cpp \
-		glslang/MachineIndependent/preprocessor/PpContext.cpp \
-		glslang/MachineIndependent/preprocessor/Pp.cpp \
-		glslang/MachineIndependent/preprocessor/PpScanner.cpp \
-		glslang/MachineIndependent/preprocessor/PpTokens.cpp
-LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
-	$(LOCAL_PATH)/glslang/MachineIndependent \
-	$(GLSLANG_OUT_PATH)
-LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE:=SPIRV
-LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
-LOCAL_SRC_FILES:= \
-	SPIRV/GlslangToSpv.cpp \
-	SPIRV/InReadableOrder.cpp \
-	SPIRV/Logger.cpp \
-	SPIRV/SPVRemapper.cpp \
-	SPIRV/SpvBuilder.cpp \
-	SPIRV/SpvPostProcess.cpp \
-	SPIRV/SpvTools.cpp \
-	SPIRV/disassemble.cpp \
-	SPIRV/doc.cpp
-LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/SPIRV
-LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/SPIRV
-LOCAL_STATIC_LIBRARIES:=glslang
-include $(BUILD_STATIC_LIBRARY)

+ 0 - 245
3rdparty/bgfx/3rdparty/glslang/BUILD.bazel

@@ -1,245 +0,0 @@
-package(
-    default_visibility = ["//visibility:public"],
-)
-
-# Description:
-#
-# Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator.
-
-licenses(["notice"])
-
-exports_files(["LICENSE"])
-
-COMMON_COPTS = select({
-    "@bazel_tools//src/conditions:windows": [""],
-    "//conditions:default": [
-        "-Wall",
-        "-Wuninitialized",
-        "-Wunused",
-        "-Wunused-local-typedefs",
-        "-Wunused-parameter",
-        "-Wunused-value",
-        "-Wunused-variable",
-        "-Wno-reorder",
-        "-std=c++11",
-        "-fvisibility=hidden",
-        "-fvisibility-inlines-hidden",
-        "-fno-exceptions",
-        "-fno-rtti",
-    ],
-})
-
-cc_library(
-    name = "glslang",
-    srcs = glob(
-        [
-            "glslang/GenericCodeGen/*.cpp",
-            "glslang/MachineIndependent/*.cpp",
-            "glslang/MachineIndependent/preprocessor/*.cpp",
-            "hlsl/*.cpp",
-        ],
-        exclude = [
-            "glslang/MachineIndependent/pch.cpp",
-            "glslang/MachineIndependent/pch.h",
-            "hlsl/pch.cpp",
-            "hlsl/pch.h",
-        ],
-    ) + [
-        "OGLCompilersDLL/InitializeDll.cpp",
-    ] + select({
-        "@bazel_tools//src/conditions:windows":
-            ["glslang/OSDependent/Windows/ossource.cpp"],
-        "//conditions:default":
-            ["glslang/OSDependent/Unix/ossource.cpp"],
-    }),
-    hdrs = glob([
-        "glslang/Include/*.h",
-        "glslang/MachineIndependent/*.h",
-        "glslang/MachineIndependent/preprocessor/*.h",
-        "hlsl/*.h",
-    ]) + [
-        "OGLCompilersDLL/InitializeDll.h",
-        "StandAlone/DirStackFileIncluder.h",
-        "glslang/OSDependent/osinclude.h",
-        "glslang/Public/ShaderLang.h",
-    ],
-    copts = COMMON_COPTS,
-    defines = [
-        "AMD_EXTENSIONS",
-        "ENABLE_HLSL=0",
-        "ENABLE_OPT=0",
-        "NV_EXTENSIONS",
-    ],
-    linkopts = select({
-        "@bazel_tools//src/conditions:windows": [""],
-        "//conditions:default": ["-lm", "-lpthread"],
-    }),
-    linkstatic = 1,
-)
-
-genrule(
-    name = "export_spirv_headers",
-    srcs = [
-        "SPIRV/GLSL.ext.AMD.h",
-        "SPIRV/GLSL.ext.EXT.h",
-        "SPIRV/GLSL.ext.KHR.h",
-        "SPIRV/GLSL.ext.NV.h",
-        "SPIRV/GLSL.std.450.h",
-        "SPIRV/spirv.hpp",
-    ],
-    outs = [
-        "include/SPIRV/GLSL.ext.AMD.h",
-        "include/SPIRV/GLSL.ext.EXT.h",
-        "include/SPIRV/GLSL.ext.KHR.h",
-        "include/SPIRV/GLSL.ext.NV.h",
-        "include/SPIRV/GLSL.std.450.h",
-        "include/SPIRV/spirv.hpp",
-    ],
-    cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
-)
-
-cc_library(
-    name = "SPIRV_headers",
-    hdrs = [":export_spirv_headers"],
-    copts = COMMON_COPTS,
-    includes = [
-        "include",
-        "include/SPIRV",
-    ],
-    linkstatic = 1,
-)
-
-cc_library(
-    name = "SPIRV",
-    srcs = glob(
-        ["SPIRV/*.cpp"],
-        exclude = [
-            "SPIRV/SpvTools.cpp",
-        ],
-    ),
-    hdrs = [
-        "SPIRV/GlslangToSpv.h",
-        "SPIRV/Logger.h",
-        "SPIRV/SPVRemapper.h",
-        "SPIRV/SpvBuilder.h",
-        "SPIRV/SpvTools.h",
-        "SPIRV/bitutils.h",
-        "SPIRV/disassemble.h",
-        "SPIRV/doc.h",
-        "SPIRV/hex_float.h",
-        "SPIRV/spvIR.h",
-    ],
-    copts = COMMON_COPTS,
-    includes = ["SPIRV"],
-    linkopts = select({
-        "@bazel_tools//src/conditions:windows": [""],
-        "//conditions:default": ["-lm"],
-    }),
-    linkstatic = 1,
-    deps = [
-        ":SPIRV_headers",
-        ":glslang",
-    ],
-)
-
-cc_library(
-    name = "glslang-default-resource-limits",
-    srcs = ["StandAlone/ResourceLimits.cpp"],
-    hdrs = ["StandAlone/ResourceLimits.h"],
-    copts = COMMON_COPTS,
-    linkstatic = 1,
-    deps = [":glslang"],
-)
-
-cc_binary(
-    name = "glslangValidator",
-    srcs = [
-        "StandAlone/StandAlone.cpp",
-        "StandAlone/Worklist.h",
-    ],
-    copts = COMMON_COPTS,
-    deps = [
-        ":SPIRV",
-        ":glslang",
-        ":glslang-default-resource-limits",
-    ],
-)
-
-cc_binary(
-    name = "spirv-remap",
-    srcs = ["StandAlone/spirv-remap.cpp"],
-    copts = COMMON_COPTS,
-    deps = [
-        ":SPIRV",
-        ":glslang",
-        ":glslang-default-resource-limits",
-    ],
-)
-
-filegroup(
-    name = "test_files",
-    srcs = glob(
-        ["Test/**"],
-        exclude = [
-            "Test/bump",
-            "Test/glslangValidator",
-            "Test/runtests",
-        ],
-    ),
-)
-
-cc_library(
-    name = "glslang_test_lib",
-    testonly = 1,
-    srcs = [
-        "gtests/HexFloat.cpp",
-        "gtests/Initializer.h",
-        "gtests/Settings.cpp",
-        "gtests/Settings.h",
-        "gtests/TestFixture.cpp",
-        "gtests/TestFixture.h",
-        "gtests/main.cpp",
-    ],
-    copts = COMMON_COPTS,
-    data = [":test_files"],
-    defines = select({
-        # Unfortunately we can't use $(location) in cc_library at the moment.
-        # See https://github.com/bazelbuild/bazel/issues/1023
-        # So we'll specify the path manually.
-        "@bazel_tools//src/conditions:windows":
-            ["GLSLANG_TEST_DIRECTORY='\"../../../../../Test\"'"],
-        "//conditions:default":
-            ["GLSLANG_TEST_DIRECTORY='\"Test\"'"],
-    }),
-    linkstatic = 1,
-    deps = [
-        ":SPIRV",
-        ":glslang",
-        ":glslang-default-resource-limits",
-        "@com_google_googletest//:gtest",
-    ],
-)
-
-GLSLANG_TESTS = glob(
-    ["gtests/*.FromFile.cpp"],
-    # Since we are not building the SPIRV-Tools dependency, the following tests
-    # cannot be performed.
-    exclude = [
-        "gtests/Hlsl.FromFile.cpp",
-        "gtests/Spv.FromFile.cpp",
-    ],
-)
-
-[cc_test(
-    name = test_file.replace("gtests/", "").replace(".FromFile.cpp", "") + "_test",
-    srcs = [test_file],
-    copts = COMMON_COPTS,
-    data = [
-        ":test_files",
-    ],
-    deps = [
-        ":SPIRV",
-        ":glslang",
-        ":glslang_test_lib",
-    ],
-) for test_file in GLSLANG_TESTS]

+ 0 - 247
3rdparty/bgfx/3rdparty/glslang/BUILD.gn

@@ -1,247 +0,0 @@
-# Copyright (C) 2018 Google, Inc.
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-#    Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-#
-#    Redistributions in binary form must reproduce the above
-#    copyright notice, this list of conditions and the following
-#    disclaimer in the documentation and/or other materials provided
-#    with the distribution.
-#
-#    Neither the name of Google Inc. nor the names of its
-#    contributors may be used to endorse or promote products derived
-#    from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-import("//build_overrides/glslang.gni")
-
-# Both Chromium and Fuchsia use by default a set of warning errors
-# that is far too strict to compile this project. These are also
-# typically appended after |cflags|, overriding target-specific
-# definitions. To work around this, determine which configs to
-# add and remove in order to succesfully build the project.
-if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
-  _configs_to_remove = [ "//build/config:default_warnings" ]
-  _configs_to_add = []
-} else {
-  _configs_to_remove = [ "//build/config/compiler:chromium_code" ]
-  _configs_to_add = [ "//build/config/compiler:no_chromium_code" ]
-}
-
-spirv_tools_dir = glslang_spirv_tools_dir
-
-config("glslang_public") {
-  include_dirs = [ "." ]
-
-  defines = [ "ENABLE_HLSL=1" ]
-}
-
-source_set("glslang_sources") {
-  public_configs = [ ":glslang_public" ]
-
-  sources = [
-    "OGLCompilersDLL/InitializeDll.cpp",
-    "OGLCompilersDLL/InitializeDll.h",
-    "SPIRV/GLSL.ext.AMD.h",
-    "SPIRV/GLSL.ext.EXT.h",
-    "SPIRV/GLSL.ext.KHR.h",
-    "SPIRV/GLSL.ext.NV.h",
-    "SPIRV/GLSL.std.450.h",
-    "SPIRV/GlslangToSpv.cpp",
-    "SPIRV/GlslangToSpv.h",
-    "SPIRV/InReadableOrder.cpp",
-    "SPIRV/Logger.cpp",
-    "SPIRV/Logger.h",
-    "SPIRV/SPVRemapper.cpp",
-    "SPIRV/SPVRemapper.h",
-    "SPIRV/SpvBuilder.cpp",
-    "SPIRV/SpvBuilder.h",
-    "SPIRV/SpvPostProcess.cpp",
-    "SPIRV/SpvTools.cpp",
-    "SPIRV/SpvTools.h",
-    "SPIRV/bitutils.h",
-    "SPIRV/disassemble.cpp",
-    "SPIRV/disassemble.h",
-    "SPIRV/doc.cpp",
-    "SPIRV/doc.h",
-    "SPIRV/hex_float.h",
-    "SPIRV/spirv.hpp",
-    "SPIRV/spvIR.h",
-    "glslang/GenericCodeGen/CodeGen.cpp",
-    "glslang/GenericCodeGen/Link.cpp",
-    "glslang/Include/BaseTypes.h",
-    "glslang/Include/Common.h",
-    "glslang/Include/ConstantUnion.h",
-    "glslang/Include/InfoSink.h",
-    "glslang/Include/InitializeGlobals.h",
-    "glslang/Include/PoolAlloc.h",
-    "glslang/Include/ResourceLimits.h",
-    "glslang/Include/ShHandle.h",
-    "glslang/Include/Types.h",
-    "glslang/Include/arrays.h",
-    "glslang/Include/intermediate.h",
-    "glslang/Include/revision.h",
-    "glslang/MachineIndependent/Constant.cpp",
-    "glslang/MachineIndependent/InfoSink.cpp",
-    "glslang/MachineIndependent/Initialize.cpp",
-    "glslang/MachineIndependent/Initialize.h",
-    "glslang/MachineIndependent/IntermTraverse.cpp",
-    "glslang/MachineIndependent/Intermediate.cpp",
-    "glslang/MachineIndependent/LiveTraverser.h",
-    "glslang/MachineIndependent/ParseContextBase.cpp",
-    "glslang/MachineIndependent/ParseHelper.cpp",
-    "glslang/MachineIndependent/ParseHelper.h",
-    "glslang/MachineIndependent/PoolAlloc.cpp",
-    "glslang/MachineIndependent/RemoveTree.cpp",
-    "glslang/MachineIndependent/RemoveTree.h",
-    "glslang/MachineIndependent/Scan.cpp",
-    "glslang/MachineIndependent/Scan.h",
-    "glslang/MachineIndependent/ScanContext.h",
-    "glslang/MachineIndependent/ShaderLang.cpp",
-    "glslang/MachineIndependent/SymbolTable.cpp",
-    "glslang/MachineIndependent/SymbolTable.h",
-    "glslang/MachineIndependent/Versions.cpp",
-    "glslang/MachineIndependent/Versions.h",
-    "glslang/MachineIndependent/attribute.cpp",
-    "glslang/MachineIndependent/attribute.h",
-    "glslang/MachineIndependent/gl_types.h",
-    "glslang/MachineIndependent/glslang_tab.cpp",
-    "glslang/MachineIndependent/glslang_tab.cpp.h",
-    "glslang/MachineIndependent/intermOut.cpp",
-    "glslang/MachineIndependent/iomapper.cpp",
-    "glslang/MachineIndependent/iomapper.h",
-    "glslang/MachineIndependent/limits.cpp",
-    "glslang/MachineIndependent/linkValidate.cpp",
-    "glslang/MachineIndependent/localintermediate.h",
-    "glslang/MachineIndependent/parseConst.cpp",
-    "glslang/MachineIndependent/parseVersions.h",
-    "glslang/MachineIndependent/preprocessor/Pp.cpp",
-    "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
-    "glslang/MachineIndependent/preprocessor/PpContext.cpp",
-    "glslang/MachineIndependent/preprocessor/PpContext.h",
-    "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
-    "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
-    "glslang/MachineIndependent/preprocessor/PpTokens.h",
-    "glslang/MachineIndependent/propagateNoContraction.cpp",
-    "glslang/MachineIndependent/propagateNoContraction.h",
-    "glslang/MachineIndependent/reflection.cpp",
-    "glslang/MachineIndependent/reflection.h",
-    "glslang/OSDependent/osinclude.h",
-    "glslang/Public/ShaderLang.h",
-    "hlsl/hlslAttributes.cpp",
-    "hlsl/hlslAttributes.h",
-    "hlsl/hlslGrammar.cpp",
-    "hlsl/hlslGrammar.h",
-    "hlsl/hlslOpMap.cpp",
-    "hlsl/hlslOpMap.h",
-    "hlsl/hlslParseHelper.cpp",
-    "hlsl/hlslParseHelper.h",
-    "hlsl/hlslParseables.cpp",
-    "hlsl/hlslParseables.h",
-    "hlsl/hlslScanContext.cpp",
-    "hlsl/hlslScanContext.h",
-    "hlsl/hlslTokenStream.cpp",
-    "hlsl/hlslTokenStream.h",
-    "hlsl/hlslTokens.h",
-  ]
-
-  defines = [ "ENABLE_OPT=1" ]
-
-  if (is_win) {
-    sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
-    defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
-  } else {
-    sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
-    defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
-  }
-
-  if (is_clang) {
-    cflags = [
-      "-Wno-extra-semi",
-      "-Wno-ignored-qualifiers",
-      "-Wno-implicit-fallthrough",
-      "-Wno-inconsistent-missing-override",
-      "-Wno-sign-compare",
-      "-Wno-unused-variable",
-      "-Wno-missing-field-initializers",
-      "-Wno-newline-eof",
-    ]
-  }
-  if (is_win && !is_clang) {
-    cflags = [
-      "/wd4018",  # signed/unsigned mismatch
-      "/wd4189",  # local variable is initialized but not referenced
-    ]
-  }
-
-  deps = [
-    "${spirv_tools_dir}:spvtools_opt",
-    "${spirv_tools_dir}:spvtools_val",
-  ]
-
-  configs -= _configs_to_remove
-  configs += _configs_to_add
-}
-
-source_set("glslang_default_resource_limits_sources") {
-  sources = [
-    "StandAlone/ResourceLimits.cpp",
-    "StandAlone/ResourceLimits.h",
-  ]
-  deps = [
-    ":glslang_sources",
-  ]
-  public_configs = [ ":glslang_public" ]
-
-  configs -= _configs_to_remove
-  configs += _configs_to_add
-}
-
-executable("glslang_validator") {
-  sources = [
-    "StandAlone/DirStackFileIncluder.h",
-    "StandAlone/StandAlone.cpp",
-  ]
-  if (!is_win) {
-    cflags = [ "-Woverflow" ]
-  }
-  defines = [ "ENABLE_OPT=1" ]
-  deps = [
-    ":glslang_default_resource_limits_sources",
-    ":glslang_sources",
-  ]
-
-  configs -= _configs_to_remove
-  configs += _configs_to_add
-}
-
-executable("spirv-remap") {
-  sources = [
-    "StandAlone/spirv-remap.cpp",
-  ]
-  defines = [ "ENABLE_OPT=1" ]
-  deps = [
-    ":glslang_sources",
-  ]
-
-  configs -= _configs_to_remove
-  configs += _configs_to_add
-}

+ 0 - 214
3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt

@@ -1,214 +0,0 @@
-# increase to 3.1 once all major distributions
-# include a version of CMake >= 3.1
-cmake_minimum_required(VERSION 2.8.12)
-if (POLICY CMP0048)
-  cmake_policy(SET CMP0048 NEW)
-endif()
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-# Enable compile commands database
-set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-
-# Adhere to GNU filesystem layout conventions
-include(GNUInstallDirs)
-
-# Needed for CMAKE_DEPENDENT_OPTION macro
-include(CMakeDependentOption)
-
-option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
-option(BUILD_EXTERNAL "Build external dependencies in /External" ON)
-
-set(LIB_TYPE STATIC)
-
-if(BUILD_SHARED_LIBS)
-    set(LIB_TYPE SHARED)
-endif()
-
-option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL})
-if(NOT ${SKIP_GLSLANG_INSTALL})
-  set(ENABLE_GLSLANG_INSTALL ON)
-endif()
-option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
-
-option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
-
-option(ENABLE_GLSLANG_WEB "Reduces glslang to minimum needed for web use" OFF)
-option(ENABLE_GLSLANG_WEB_DEVEL "For ENABLE_GLSLANG_WEB builds, enables compilation error messages" OFF)
-option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using Emscripten, enables SINGLE_FILE build" OFF)
-option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using Emscripten, builds to run on Node instead of Web" OFF)
-
-CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF)
-
-option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
-option(ENABLE_PCH "Enables Precompiled header" ON)
-option(ENABLE_CTEST "Enables testing" ON)
-
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
-    set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
-endif()
-
-option(USE_CCACHE "Use ccache" OFF)
-if(USE_CCACHE)
-    find_program(CCACHE_FOUND ccache)
-    if(CCACHE_FOUND)
-        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
-    endif(CCACHE_FOUND)
-endif()
-
-# Precompiled header macro. Parameters are source file list and filename for pch cpp file.
-macro(glslang_pch SRCS PCHCPP)
-  if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio" AND ENABLE_PCH)
-    set(PCH_NAME "$(IntDir)\\pch.pch")
-    # make source files use/depend on PCH_NAME
-    set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}")
-    # make PCHCPP file compile and generate PCH_NAME
-    set_source_files_properties(${PCHCPP} PROPERTIES COMPILE_FLAGS "/Ycpch.h /Fp${PCH_NAME} /Zm300" OBJECT_OUTPUTS "${PCH_NAME}")
-    list(APPEND ${SRCS} "${PCHCPP}")
-  endif()
-endmacro(glslang_pch)
-
-project(glslang)
-
-if(ENABLE_CTEST)
-    include(CTest)
-endif()
-
-if(ENABLE_HLSL)
-    add_definitions(-DENABLE_HLSL)
-endif(ENABLE_HLSL)
-
-if(ENABLE_GLSLANG_WEB)
-    add_definitions(-DGLSLANG_WEB)
-    if(ENABLE_GLSLANG_WEB_DEVEL)
-        add_definitions(-DGLSLANG_WEB_DEVEL)
-    endif(ENABLE_GLSLANG_WEB_DEVEL)
-endif(ENABLE_GLSLANG_WEB)
-
-if(WIN32)
-    set(CMAKE_DEBUG_POSTFIX "d")
-    if(MSVC)
-        include(ChooseMSVCCRT.cmake)
-    endif(MSVC)
-    add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
-elseif(UNIX)
-    add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
-else(WIN32)
-    message("unknown platform")
-endif(WIN32)
-
-if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
-    add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
-                        -Wunused-parameter -Wunused-value  -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions)
-    add_compile_options(-Wno-reorder)  # disable this from -Wall, since it happens all over.
-    add_compile_options(-fno-rtti)
-elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
-    add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
-                        -Wunused-parameter -Wunused-value  -Wunused-variable)
-    add_compile_options(-Wno-reorder)  # disable this from -Wall, since it happens all over.
-    add_compile_options(-fno-rtti)
-elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
-    add_compile_options(/GR-) # Disable RTTI
-endif()
-
-if(EMSCRIPTEN)
-    add_compile_options(-Os -fno-exceptions)
-    add_compile_options("SHELL: -s WASM=1")
-    add_compile_options("SHELL: -s WASM_OBJECT_FILES=0")
-    add_link_options(-Os)
-    add_link_options("SHELL: -s FILESYSTEM=0")
-    add_link_options("SHELL: --llvm-lto 1")
-    add_link_options("SHELL: --closure 1")
-    add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
-
-    if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
-        add_link_options("SHELL: -s SINGLE_FILE=1")
-    endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
-else()
-    if(ENABLE_GLSLANG_WEB)
-        if(MSVC)
-            add_compile_options(/Os /GR-)
-        else()
-            add_compile_options(-Os -fno-exceptions)
-            add_link_options(-Os)
-        endif()
-    endif(ENABLE_GLSLANG_WEB)
-endif(EMSCRIPTEN)
-
-# Request C++11
-if(${CMAKE_VERSION} VERSION_LESS 3.1)
-    # CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD
-    # remove this block once CMake >=3.1 has fixated in the ecosystem
-    add_compile_options(-std=c++11)
-else()
-    set(CMAKE_CXX_STANDARD 11)
-    set(CMAKE_CXX_STANDARD_REQUIRED ON)
-    set(CMAKE_CXX_EXTENSIONS OFF)
-endif()
-
-function(glslang_set_link_args TARGET)
-    # For MinGW compiles, statically link against the GCC and C++ runtimes.
-    # This avoids the need to ship those runtimes as DLLs.
-    if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
-        set_target_properties(${TARGET} PROPERTIES
-                              LINK_FLAGS "-static -static-libgcc -static-libstdc++")
-    endif()
-endfunction(glslang_set_link_args)
-
-# CMake needs to find the right version of python, right from the beginning,
-# otherwise, it will find the wrong version and fail later
-if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
-    find_package(PythonInterp 3 REQUIRED)
-
-	# We depend on these for later projects, so they should come first.
-	add_subdirectory(External)
-endif()
-
-if(NOT TARGET SPIRV-Tools-opt)
-    set(ENABLE_OPT OFF)
-endif()
-
-if(ENABLE_OPT)
-    message(STATUS "optimizer enabled")
-    add_definitions(-DENABLE_OPT=1)
-else()
-    if(ENABLE_HLSL)
-        message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL")
-    endif()
-    add_definitions(-DENABLE_OPT=0)
-endif()
-
-add_subdirectory(glslang)
-add_subdirectory(OGLCompilersDLL)
-if(ENABLE_GLSLANG_BINARIES)
-    add_subdirectory(StandAlone)
-endif()
-add_subdirectory(SPIRV)
-if(ENABLE_HLSL)
-    add_subdirectory(hlsl)
-endif(ENABLE_HLSL)
-if(ENABLE_CTEST)
-    add_subdirectory(gtests)
-endif()
-
-if(BUILD_TESTING)
-    # glslang-testsuite runs a bash script on Windows.
-    # Make sure to use '-o igncr' flag to ignore carriage returns (\r).
-    set(IGNORE_CR_FLAG "")
-    if(WIN32)
-        set(IGNORE_CR_FLAG -o igncr)
-    endif()
-
-    if (CMAKE_CONFIGURATION_TYPES)
-        set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
-        set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator)
-        set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap)
-    else(CMAKE_CONFIGURATION_TYPES)
-        set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
-        set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
-        set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
-    endif(CMAKE_CONFIGURATION_TYPES)
-
-    add_test(NAME glslang-testsuite
-        COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)
-endif(BUILD_TESTING)

+ 0 - 1
3rdparty/bgfx/3rdparty/glslang/CODE_OF_CONDUCT.md

@@ -1 +0,0 @@
-A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil.

+ 0 - 105
3rdparty/bgfx/3rdparty/glslang/ChooseMSVCCRT.cmake

@@ -1,105 +0,0 @@
-# The macro choose_msvc_crt() takes a list of possible
-# C runtimes to choose from, in the form of compiler flags,
-# to present to the user. (MTd for /MTd, etc)
-#
-# The macro is invoked at the end of the file.
-#
-# CMake already sets CRT flags in the CMAKE_CXX_FLAGS_* and
-# CMAKE_C_FLAGS_* variables by default. To let the user
-# override that for each build type:
-# 1. Detect which CRT is already selected, and reflect this in
-# LLVM_USE_CRT_* so the user can have a better idea of what
-# changes they're making.
-# 2. Replace the flags in both variables with the new flag via a regex.
-# 3. set() the variables back into the cache so the changes
-# are user-visible.
-
-### Helper macros: ###
-macro(make_crt_regex regex crts)
-  set(${regex} "")
-  foreach(crt ${${crts}})
-    # Trying to match the beginning or end of the string with stuff
-    # like [ ^]+ didn't work, so use a bunch of parentheses instead.
-    set(${regex} "${${regex}}|(^| +)/${crt}($| +)")
-  endforeach(crt)
-  string(REGEX REPLACE "^\\|" "" ${regex} "${${regex}}")
-endmacro(make_crt_regex)
-
-macro(get_current_crt crt_current regex flagsvar)
-  # Find the selected-by-CMake CRT for each build type, if any.
-  # Strip off the leading slash and any whitespace.
-  string(REGEX MATCH "${${regex}}" ${crt_current} "${${flagsvar}}")
-  string(REPLACE "/" " " ${crt_current} "${${crt_current}}")
-  string(STRIP "${${crt_current}}" ${crt_current})
-endmacro(get_current_crt)
-
-# Replaces or adds a flag to a variable.
-# Expects 'flag' to be padded with spaces.
-macro(set_flag_in_var flagsvar regex flag)
-  string(REGEX MATCH "${${regex}}" current_flag "${${flagsvar}}")
-  if("${current_flag}" STREQUAL "")
-    set(${flagsvar} "${${flagsvar}}${${flag}}")
-  else()
-    string(REGEX REPLACE "${${regex}}" "${${flag}}" ${flagsvar} "${${flagsvar}}")
-  endif()
-  string(STRIP "${${flagsvar}}" ${flagsvar})
-  # Make sure this change gets reflected in the cache/gui.
-  # CMake requires the docstring parameter whenever set() touches the cache,
-  # so get the existing docstring and re-use that.
-  get_property(flagsvar_docs CACHE ${flagsvar} PROPERTY HELPSTRING)
-  set(${flagsvar} "${${flagsvar}}" CACHE STRING "${flagsvar_docs}" FORCE)
-endmacro(set_flag_in_var)
-
-
-macro(choose_msvc_crt MSVC_CRT)
-  if(LLVM_USE_CRT)
-    message(FATAL_ERROR
-      "LLVM_USE_CRT is deprecated. Use the CMAKE_BUILD_TYPE-specific
-variables (LLVM_USE_CRT_DEBUG, etc) instead.")
-  endif()
-
-  make_crt_regex(MSVC_CRT_REGEX ${MSVC_CRT})
-
-  foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
-    string(TOUPPER "${build_type}" build)
-    if (NOT LLVM_USE_CRT_${build})
-      get_current_crt(LLVM_USE_CRT_${build}
-        MSVC_CRT_REGEX
-        CMAKE_CXX_FLAGS_${build})
-      set(LLVM_USE_CRT_${build}
-        "${LLVM_USE_CRT_${build}}"
-        CACHE STRING "Specify VC++ CRT to use for ${build_type} configurations."
-        FORCE)
-      set_property(CACHE LLVM_USE_CRT_${build}
-        PROPERTY STRINGS ;${${MSVC_CRT}})
-    endif(NOT LLVM_USE_CRT_${build})
-  endforeach(build_type)
-
-  foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
-    string(TOUPPER "${build_type}" build)
-    if ("${LLVM_USE_CRT_${build}}" STREQUAL "")
-      set(flag_string " ")
-    else()
-      set(flag_string " /${LLVM_USE_CRT_${build}} ")
-      list(FIND ${MSVC_CRT} ${LLVM_USE_CRT_${build}} idx)
-      if (idx LESS 0)
-        message(FATAL_ERROR
-          "Invalid value for LLVM_USE_CRT_${build}: ${LLVM_USE_CRT_${build}}. Valid options are one of: ${${MSVC_CRT}}")
-      endif (idx LESS 0)
-      message(STATUS "Using ${build_type} VC++ CRT: ${LLVM_USE_CRT_${build}}")
-    endif()
-    foreach(lang C CXX)
-      set_flag_in_var(CMAKE_${lang}_FLAGS_${build} MSVC_CRT_REGEX flag_string)
-    endforeach(lang)
-  endforeach(build_type)
-endmacro(choose_msvc_crt MSVC_CRT)
-
-
-# List of valid CRTs for MSVC
-set(MSVC_CRT
-  MD
-  MDd
-  MT
-  MTd)
-
-choose_msvc_crt(MSVC_CRT)

+ 0 - 44
3rdparty/bgfx/3rdparty/glslang/External/CMakeLists.txt

@@ -1,44 +0,0 @@
-# Suppress all warnings from external projects.
-set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)
-
-if(BUILD_TESTING)
-    if(TARGET gmock)
-        message(STATUS "Google Mock already configured - use it")
-    elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
-        # We need to make sure Google Test does not mess up with the
-        # global CRT settings on Windows.
-        if(WIN32)
-            set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-        endif(WIN32)
-        # EXCLUDE_FROM_ALL keeps the install target from installing GTEST files.
-        add_subdirectory(googletest EXCLUDE_FROM_ALL)
-        set(GTEST_TARGETS
-            gtest
-            gtest_main
-            gmock
-            gmock_main)
-        foreach(target ${GTEST_TARGETS})
-            set_property(TARGET ${target} PROPERTY FOLDER gtest)
-        endforeach()
-        mark_as_advanced(gmock_build_tests
-            BUILD_GMOCK
-            BUILD_GTEST
-            BUILD_SHARED_LIBS
-            gtest_build_samples
-            gtest_build_tests
-            gtest_disable_pthreads
-            gtest_force_shared_crt
-            gtest_hide_internal_symbols)
-    else()
-        message(STATUS
-            "Google Mock was not found - tests based on that will not build")
-    endif()
-endif()
-
-if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
-    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
-        set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
-        add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
-    endif()
-endif()
-

+ 1 - 1
3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt

@@ -11,5 +11,5 @@ endif(WIN32)
 if(ENABLE_GLSLANG_INSTALL)
     install(TARGETS OGLCompiler EXPORT OGLCompilerTargets
             ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-	install(EXPORT OGLCompilerTargets DESTINATION lib/cmake)
+	install(EXPORT OGLCompilerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
 endif(ENABLE_GLSLANG_INSTALL)

+ 0 - 137
3rdparty/bgfx/3rdparty/glslang/README-spirv-remap.txt

@@ -1,137 +0,0 @@
-
-VERSION
---------------------------------------------------------------------------------
-spirv-remap 0.97
-
-INTRO:
---------------------------------------------------------------------------------
-spirv-remap is a utility to improve compression of SPIR-V binary files via
-entropy reduction, plus optional stripping of debug information and
-load/store optimization.  It transforms SPIR-V to SPIR-V, remapping IDs.  The
-resulting modules have an increased ID range (IDs are not as tightly packed
-around zero), but will compress better when multiple modules are compressed
-together, since compressor's dictionary can find better cross module
-commonality.
-
-Remapping is accomplished via canonicalization.  Thus, modules can be
-compressed one at a time with no loss of quality relative to operating on
-many modules at once.  The command line tool operates on multiple modules
-only in the trivial repetition sense, for ease of use.  The remapper API
-only accepts a single module at a time.
-
-There are two modes of use: command line, and a C++11 API.  Both are
-described below.
-
-spirv-remap is currently in an alpha state.  Although there are no known
-remapping defects, it has only been exercised on one real world game shader
-workload.
-
-
-FEEDBACK
---------------------------------------------------------------------------------
-Report defects, enhancements requests, code improvements, etc to:
-   [email protected]
-
-
-COMMAND LINE USAGE:
---------------------------------------------------------------------------------
-Examples are given with a verbosity of one (-v), but more verbosity can be
-had via -vv, -vvv, etc, or an integer parameter to --verbose, such as
-"--verbose 4".  With no verbosity, the command is silent and returns 0 on
-success, and a positive integer error on failure.
-
-Pre-built binaries for several OSs are available.  Examples presented are
-for Linux.  Command line arguments can be provided in any order.
-
-1. Basic ID remapping
-
-Perform ID remapping on all shaders in "*.spv", writing new files with
-the same basenames to /tmp/out_dir.
-
-  spirv-remap -v --map all --input *.spv --output /tmp/out_dir
-
-2. Perform all possible size reductions
-
-  spirv-remap-linux-64 -v --do-everything --input *.spv --output /tmp/out_dir
-
-Note that --do-everything is a synonym for:
-
-  --map all --dce all --opt all --strip all
-
-API USAGE:
---------------------------------------------------------------------------------
-
-The public interface to the remapper is defined in SPIRV/SPVRemapper.h as follows:
-
-namespace spv {
-
-class spirvbin_t
-{
-public:
-   enum Options { ... };
-   spirvbin_t(int verbose = 0);  // construct
-
-   // remap an existing binary in memory
-   void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = DO_EVERYTHING);
-
-   // Type for error/log handler functions
-   typedef std::function<void(const std::string&)> errorfn_t;
-   typedef std::function<void(const std::string&)> logfn_t;
-
-   // Register error/log handling functions (can be c/c++ fn, lambda fn, or functor)
-   static void registerErrorHandler(errorfn_t handler) { errorHandler = handler; }
-   static void registerLogHandler(logfn_t handler)     { logHandler   = handler; }
-};
-
-} // namespace spv
-
-The class definition is in SPVRemapper.cpp.
-
-remap() accepts an std::vector of SPIR-V words, modifies them per the
-request given in 'opts', and leaves the 'spv' container with the result.
-It is safe to instantiate one spirvbin_t per thread and process a different
-SPIR-V in each.
-
-The "opts" parameter to remap() accepts a bit mask of desired remapping
-options.  See REMAPPING AND OPTIMIZATION OPTIONS.
-
-On error, the function supplied to registerErrorHandler() will be invoked.
-This can be a standard C/C++ function, a lambda function, or a functor.
-The default handler simply calls exit(5); The error handler is a static
-member, so need only be set up once, not once per spirvbin_t instance.
-
-Log messages are supplied to registerLogHandler().  By default, log
-messages are eaten silently.  The log handler is also a static member.
-
-BUILD DEPENDENCIES:
---------------------------------------------------------------------------------
- 1. C++11 compatible compiler
- 2. cmake
- 3. glslang
-
-
-BUILDING
---------------------------------------------------------------------------------
-The standalone remapper is built along side glslangValidator through its
-normal build process.
-
-
-REMAPPING AND OPTIMIZATION OPTIONS
---------------------------------------------------------------------------------
-API:
-   These are bits defined under spv::spirvbin_t::, and can be
-   bitwise or-ed together as desired.
-
-   MAP_TYPES      = canonicalize type IDs
-   MAP_NAMES      = canonicalize named data
-   MAP_FUNCS      = canonicalize function bodies
-   DCE_FUNCS      = remove dead functions
-   DCE_VARS       = remove dead variables
-   DCE_TYPES      = remove dead types
-   OPT_LOADSTORE  = optimize unneeded load/stores
-   MAP_ALL        = (MAP_TYPES | MAP_NAMES | MAP_FUNCS)
-   DCE_ALL        = (DCE_FUNCS | DCE_VARS | DCE_TYPES)
-   OPT_ALL        = (OPT_LOADSTORE)
-   ALL_BUT_STRIP  = (MAP_ALL | DCE_ALL | OPT_ALL)
-   DO_EVERYTHING  = (STRIP | ALL_BUT_STRIP)
-

+ 0 - 390
3rdparty/bgfx/3rdparty/glslang/README.md

@@ -1,390 +0,0 @@
-Also see the Khronos landing page for glslang as a reference front end:
-
-https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
-
-The above page includes where to get binaries, and is kept up to date
-regarding the feature level of glslang.
-
-glslang
-=======
-
-[![Build Status](https://travis-ci.org/KhronosGroup/glslang.svg?branch=master)](https://travis-ci.org/KhronosGroup/glslang)
-[![Build status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master)
-
-An OpenGL and OpenGL ES shader front end and validator.
-
-There are several components:
-
-1. A GLSL/ESSL front-end for reference validation and translation of GLSL/ESSL into an AST.
-
-2. An HLSL front-end for translation of a broad generic HLL into the AST. See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status.
-
-3. A SPIR-V back end for translating the AST to SPIR-V.
-
-4. A standalone wrapper, `glslangValidator`, that can be used as a command-line tool for the above.
-
-How to add a feature protected by a version/extension/stage/profile:  See the
-comment in `glslang/MachineIndependent/Versions.cpp`.
-
-Tasks waiting to be done are documented as GitHub issues.
-
-Deprecations
-------------
-
-1. GLSLang, when installed through CMake, will install a `SPIRV` folder into
-`${CMAKE_INSTALL_INCLUDEDIR}`. This `SPIRV` folder is being moved to
-`glslang/SPIRV`. During the transition the `SPIRV` folder will be installed into
-both locations. The old install of `SPIRV/` will be removed as a CMake install
-target no sooner then May 1, 2020. See issue #1964.
-
-Execution of Standalone Wrapper
--------------------------------
-
-To use the standalone binary form, execute `glslangValidator`, and it will print
-a usage statement.  Basic operation is to give it a file containing a shader,
-and it will print out warnings/errors and optionally an AST.
-
-The applied stage-specific rules are based on the file extension:
-* `.vert` for a vertex shader
-* `.tesc` for a tessellation control shader
-* `.tese` for a tessellation evaluation shader
-* `.geom` for a geometry shader
-* `.frag` for a fragment shader
-* `.comp` for a compute shader
-
-There is also a non-shader extension
-* `.conf` for a configuration file of limits, see usage statement for example
-
-Building
---------
-
-Instead of building manually, you can also download the binaries for your
-platform directly from the [master-tot release][master-tot-release] on GitHub.
-Those binaries are automatically uploaded by the buildbots after successful
-testing and they always reflect the current top of the tree of the master
-branch.
-
-### Dependencies
-
-* A C++11 compiler.
-  (For MSVS: 2015 is recommended, 2013 is fully supported/tested, and 2010 support is attempted, but not tested.)
-* [CMake][cmake]: for generating compilation targets.
-* make: _Linux_, ninja is an alternative, if configured.
-* [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.)
-* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y).
-* [googletest][googletest]: _optional_, but should use if making any changes to glslang.
-
-### Build steps
-
-The following steps assume a Bash shell. On Windows, that could be the Git Bash
-shell or some other shell of your choosing.
-
-#### 1) Check-Out this project 
-
-```bash
-cd <parent of where you want glslang to be>
-git clone https://github.com/KhronosGroup/glslang.git
-```
-
-#### 2) Check-Out External Projects
-
-```bash
-cd <the directory glslang was cloned to, "External" will be a subdirectory>
-git clone https://github.com/google/googletest.git External/googletest
-```
-
-If you want to use googletest with Visual Studio 2013, you also need to check out an older version:
-
-```bash
-# to use googletest with Visual Studio 2013
-cd External/googletest
-git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
-cd ../..
-```
-
-If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
-or wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, install
-spirv-tools with this:
-
-```bash
-./update_glslang_sources.py
-```
-
-#### 3) Configure
-
-Assume the source directory is `$SOURCE_DIR` and the build directory is
-`$BUILD_DIR`. First ensure the build directory exists, then navigate to it:
-
-```bash
-mkdir -p $BUILD_DIR
-cd $BUILD_DIR
-```
-
-For building on Linux:
-
-```bash
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE_DIR
-# "Release" (for CMAKE_BUILD_TYPE) could also be "Debug" or "RelWithDebInfo"
-```
-
-For building on Windows:
-
-```bash
-cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install"
-# The CMAKE_INSTALL_PREFIX part is for testing (explained later).
-```
-
-The CMake GUI also works for Windows (version 3.4.1 tested).
-
-Also, consider using `git config --global core.fileMode false` (or with `--local`) on Windows
-to prevent the addition of execution permission on files.
-
-#### 4) Build and Install
-
-```bash
-# for Linux:
-make -j4 install
-
-# for Windows:
-cmake --build . --config Release --target install
-# "Release" (for --config) could also be "Debug", "MinSizeRel", or "RelWithDebInfo"
-```
-
-If using MSVC, after running CMake to configure, use the
-Configuration Manager to check the `INSTALL` project.
-
-### If you need to change the GLSL grammar
-
-The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with
-bison if it changes, the output files are committed to the repo to avoid every
-developer needing to have bison configured to compile the project when grammar
-changes are quite infrequent. For windows you can get binaries from
-[GnuWin32][bison-gnu-win32].
-
-The command to rebuild is:
-
-```bash
-m4 -P MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
-bison --defines=MachineIndependent/glslang_tab.cpp.h
-      -t MachineIndependent/glslang.y
-      -o MachineIndependent/glslang_tab.cpp
-```
-
-The above commands are also available in the bash script in `updateGrammar`,
-when executed from the glslang subdirectory of the glslang repository.
-With no arguments it builds the full grammar, and with a "web" argument,
-the web grammar subset (see more about the web subset in the next section).
-
-### Building to WASM for the Web and Node
-
-Use the steps in [Build Steps](#build-steps), with the following notes/exceptions:
-* For building the web subset of core glslang:
-  + execute `updateGrammar web` from the glslang subdirectory
-    (or if using your own scripts, `m4` needs a `-DGLSLANG_WEB` argument)
-  + set `-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF`
-  + turn on `-DENABLE_GLSLANG_WEB=ON`
-  + optionally, for GLSL compilation error messages, turn on `-DENABLE_GLSLANG_WEB_DEVEL=ON`
-* `emsdk` needs to be present in your executable search path, *PATH* for
-  Bash-like enivironments
-  + [Instructions located
-    here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
-* Wrap cmake call: `emcmake cmake`
-* To get a fully minimized build, make sure to use `brotli` to compress the .js
-  and .wasm files
-
-Example:
-
-```sh
-emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_WEB=ON \
-    -DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF ..
-```
-
-Testing
--------
-
-Right now, there are two test harnesses existing in glslang: one is [Google
-Test](gtests/), one is the [`runtests` script](Test/runtests). The former
-runs unit tests and single-shader single-threaded integration tests, while
-the latter runs multiple-shader linking tests and multi-threaded tests.
-
-### Running tests
-
-The [`runtests` script](Test/runtests) requires compiled binaries to be
-installed into `$BUILD_DIR/install`. Please make sure you have supplied the
-correct configuration to CMake (using `-DCMAKE_INSTALL_PREFIX`) when building;
-otherwise, you may want to modify the path in the `runtests` script.
-
-Running Google Test-backed tests:
-
-```bash
-cd $BUILD_DIR
-
-# for Linux:
-ctest
-
-# for Windows:
-ctest -C {Debug|Release|RelWithDebInfo|MinSizeRel}
-
-# or, run the test binary directly
-# (which gives more fine-grained control like filtering):
-<dir-to-glslangtests-in-build-dir>/glslangtests
-```
-
-Running `runtests` script-backed tests:
-
-```bash
-cd $SOURCE_DIR/Test && ./runtests
-```
-
-### Contributing tests
-
-Test results should always be included with a pull request that modifies
-functionality.
-
-If you are writing unit tests, please use the Google Test framework and
-place the tests under the `gtests/` directory.
-
-Integration tests are placed in the `Test/` directory. It contains test input
-and a subdirectory `baseResults/` that contains the expected results of the
-tests.  Both the tests and `baseResults/` are under source-code control.
-
-Google Test runs those integration tests by reading the test input, compiling
-them, and then compare against the expected results in `baseResults/`. The
-integration tests to run via Google Test is registered in various
-`gtests/*.FromFile.cpp` source files. `glslangtests` provides a command-line
-option `--update-mode`, which, if supplied, will overwrite the golden files
-under the `baseResults/` directory with real output from that invocation.
-For more information, please check `gtests/` directory's
-[README](gtests/README.md).
-
-For the `runtests` script, it will generate current results in the
-`localResults/` directory and `diff` them against the `baseResults/`.
-When you want to update the tracked test results, they need to be
-copied from `localResults/` to `baseResults/`.  This can be done by
-the `bump` shell script.
-
-You can add your own private list of tests, not tracked publicly, by using
-`localtestlist` to list non-tracked tests.  This is automatically read
-by `runtests` and included in the `diff` and `bump` process.
-
-Programmatic Interfaces
------------------------
-
-Another piece of software can programmatically translate shaders to an AST
-using one of two different interfaces:
-* A new C++ class-oriented interface, or
-* The original C functional interface
-
-The `main()` in `StandAlone/StandAlone.cpp` shows examples using both styles.
-
-### C++ Class Interface (new, preferred)
-
-This interface is in roughly the last 1/3 of `ShaderLang.h`.  It is in the
-glslang namespace and contains the following, here with suggested calls
-for generating SPIR-V:
-
-```cxx
-const char* GetEsslVersionString();
-const char* GetGlslVersionString();
-bool InitializeProcess();
-void FinalizeProcess();
-
-class TShader
-    setStrings(...);
-    setEnvInput(EShSourceHlsl or EShSourceGlsl, stage,  EShClientVulkan or EShClientOpenGL, 100);
-    setEnvClient(EShClientVulkan or EShClientOpenGL, EShTargetVulkan_1_0 or EShTargetVulkan_1_1 or EShTargetOpenGL_450);
-    setEnvTarget(EShTargetSpv, EShTargetSpv_1_0 or EShTargetSpv_1_3);
-    bool parse(...);
-    const char* getInfoLog();
-
-class TProgram
-    void addShader(...);
-    bool link(...);
-    const char* getInfoLog();
-    Reflection queries
-```
-
-For just validating (not generating code), subsitute these calls:
-
-```cxx
-    setEnvInput(EShSourceHlsl or EShSourceGlsl, stage,  EShClientNone, 0);
-    setEnvClient(EShClientNone, 0);
-    setEnvTarget(EShTargetNone, 0);
-```
-
-See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more
-details. There is a block comment giving more detail above the calls for
-`setEnvInput, setEnvClient, and setEnvTarget`.
-
-### C Functional Interface (original)
-
-This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to
-as the `Sh*()` interface, as all the entry points start `Sh`.
-
-The `Sh*()` interface takes a "compiler" call-back object, which it calls after
-building call back that is passed the AST and can then execute a backend on it.
-
-The following is a simplified resulting run-time call stack:
-
-```c
-ShCompile(shader, compiler) -> compiler(AST) -> <back end>
-```
-
-In practice, `ShCompile()` takes shader strings, default version, and
-warning/error and other options for controlling compilation.
-
-Basic Internal Operation
-------------------------
-
-* Initial lexical analysis is done by the preprocessor in
-  `MachineIndependent/Preprocessor`, and then refined by a GLSL scanner
-  in `MachineIndependent/Scan.cpp`.  There is currently no use of flex.
-
-* Code is parsed using bison on `MachineIndependent/glslang.y` with the
-  aid of a symbol table and an AST.  The symbol table is not passed on to
-  the back-end; the intermediate representation stands on its own.
-  The tree is built by the grammar productions, many of which are
-  offloaded into `ParseHelper.cpp`, and by `Intermediate.cpp`.
-
-* The intermediate representation is very high-level, and represented
-  as an in-memory tree.   This serves to lose no information from the
-  original program, and to have efficient transfer of the result from
-  parsing to the back-end.  In the AST, constants are propogated and
-  folded, and a very small amount of dead code is eliminated.
-
-  To aid linking and reflection, the last top-level branch in the AST
-  lists all global symbols.
-
-* The primary algorithm of the back-end compiler is to traverse the
-  tree (high-level intermediate representation), and create an internal
-  object code representation.  There is an example of how to do this
-  in `MachineIndependent/intermOut.cpp`.
-
-* Reduction of the tree to a linear byte-code style low-level intermediate
-  representation is likely a good way to generate fully optimized code.
-
-* There is currently some dead old-style linker-type code still lying around.
-
-* Memory pool: parsing uses types derived from C++ `std` types, using a
-  custom allocator that puts them in a memory pool.  This makes allocation
-  of individual container/contents just few cycles and deallocation free.
-  This pool is popped after the AST is made and processed.
-
-  The use is simple: if you are going to call `new`, there are three cases:
-
-  - the object comes from the pool (its base class has the macro
-    `POOL_ALLOCATOR_NEW_DELETE` in it) and you do not have to call `delete`
-
-  - it is a `TString`, in which case call `NewPoolTString()`, which gets
-    it from the pool, and there is no corresponding `delete`
-
-  - the object does not come from the pool, and you have to do normal
-    C++ memory management of what you `new`
-
-
-[cmake]: https://cmake.org/
-[python]: https://www.python.org/
-[bison]: https://www.gnu.org/software/bison/
-[googletest]: https://github.com/google/googletest
-[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm
-[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot

+ 6 - 3
3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt

@@ -36,7 +36,7 @@ set(SPVREMAP_HEADERS
 add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
 set_property(TARGET SPIRV PROPERTY FOLDER glslang)
 set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
-target_include_directories(SPIRV PUBLIC 
+target_include_directories(SPIRV PUBLIC
 	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
 	$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
 
@@ -91,8 +91,11 @@ if(ENABLE_GLSLANG_INSTALL)
                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif()
 
-    install(EXPORT SPVRemapperTargets DESTINATION lib/cmake)
-    install(EXPORT SPIRVTargets DESTINATION lib/cmake)
+    if (ENABLE_SPVREMAPPER)
+        install(EXPORT SPVRemapperTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+    endif()
+
+    install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
 
     install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
     install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)

+ 47 - 0
3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -2608,6 +2608,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
         atomic = true;
         break;
 
+    case glslang::EOpAbsDifference:
+    case glslang::EOpAddSaturate:
+    case glslang::EOpSubSaturate:
+    case glslang::EOpAverage:
+    case glslang::EOpAverageRounded:
+    case glslang::EOpMul32x16:
+        builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
+        builder.addExtension("SPV_INTEL_shader_integer_functions2");
+        binOp = node->getOp();
+        break;
+
     case glslang::EOpIgnoreIntersectionNV:
     case glslang::EOpTerminateRayNV:
     case glslang::EOpTraceNV:
@@ -5231,6 +5242,30 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD
         binOp = spv::OpLogicalNotEqual;
         break;
 
+    case glslang::EOpAbsDifference:
+        binOp = isUnsigned ? spv::OpAbsUSubINTEL : spv::OpAbsISubINTEL;
+        break;
+
+    case glslang::EOpAddSaturate:
+        binOp = isUnsigned ? spv::OpUAddSatINTEL : spv::OpIAddSatINTEL;
+        break;
+
+    case glslang::EOpSubSaturate:
+        binOp = isUnsigned ? spv::OpUSubSatINTEL : spv::OpISubSatINTEL;
+        break;
+
+    case glslang::EOpAverage:
+        binOp = isUnsigned ? spv::OpUAverageINTEL : spv::OpIAverageINTEL;
+        break;
+
+    case glslang::EOpAverageRounded:
+        binOp = isUnsigned ? spv::OpUAverageRoundedINTEL : spv::OpIAverageRoundedINTEL;
+        break;
+
+    case glslang::EOpMul32x16:
+        binOp = isUnsigned ? spv::OpUMul32x16INTEL : spv::OpIMul32x16INTEL;
+        break;
+
     case glslang::EOpLessThan:
     case glslang::EOpGreaterThan:
     case glslang::EOpLessThanEqual:
@@ -5745,6 +5780,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
             libCall = spv::GLSLstd450FindSMsb;
         break;
 
+    case glslang::EOpCountLeadingZeros:
+        builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
+        builder.addExtension("SPV_INTEL_shader_integer_functions2");
+        unaryOp = spv::OpUCountLeadingZerosINTEL;
+        break;
+
+    case glslang::EOpCountTrailingZeros:
+        builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
+        builder.addExtension("SPV_INTEL_shader_integer_functions2");
+        unaryOp = spv::OpUCountTrailingZerosINTEL;
+        break;
+
     case glslang::EOpBallot:
     case glslang::EOpReadFirstInvocation:
     case glslang::EOpAnyInvocation:

+ 2 - 0
3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp

@@ -931,6 +931,8 @@ const char* CapabilityString(int info)
     case CapabilityDemoteToHelperInvocationEXT:             return "DemoteToHelperInvocationEXT";
     case CapabilityShaderClockKHR:                          return "ShaderClockKHR";
 
+    case CapabilityIntegerFunctions2INTEL:              return "CapabilityIntegerFunctions2INTEL";
+
     default: return "Bad";
     }
 }

+ 22 - 15
3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt

@@ -9,21 +9,20 @@ target_include_directories(glslang-default-resource-limits
 
 
 set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
-set(REMAPPER_SOURCES spirv-remap.cpp)
 
 add_executable(glslangValidator ${SOURCES})
-add_executable(spirv-remap ${REMAPPER_SOURCES})
 set_property(TARGET glslangValidator PROPERTY FOLDER tools)
-set_property(TARGET spirv-remap PROPERTY FOLDER tools)
 glslang_set_link_args(glslangValidator)
-glslang_set_link_args(spirv-remap)
 
 set(LIBRARIES
     glslang
     SPIRV
-    SPVRemapper
     glslang-default-resource-limits)
 
+if(ENABLE_SPVREMAPPER)
+    set(LIBRARIES ${LIBRARIES} SPVRemapper)
+endif()
+
 if(WIN32)
     set(LIBRARIES ${LIBRARIES} psapi)
 elseif(UNIX)
@@ -33,10 +32,17 @@ elseif(UNIX)
 endif(WIN32)
 
 target_link_libraries(glslangValidator ${LIBRARIES})
-target_link_libraries(spirv-remap ${LIBRARIES})
-target_include_directories(glslangValidator PUBLIC 
-	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
-	$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
+target_include_directories(glslangValidator PUBLIC
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
+    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
+
+if(ENABLE_SPVREMAPPER)
+    set(REMAPPER_SOURCES spirv-remap.cpp)
+    add_executable(spirv-remap ${REMAPPER_SOURCES})
+    set_property(TARGET spirv-remap PROPERTY FOLDER tools)
+    glslang_set_link_args(spirv-remap)
+    target_link_libraries(spirv-remap ${LIBRARIES})
+endif()
 
 if(WIN32)
     source_group("Source" FILES ${SOURCES})
@@ -45,16 +51,17 @@ endif(WIN32)
 if(ENABLE_GLSLANG_INSTALL)
     install(TARGETS glslangValidator EXPORT glslangValidatorTargets
             RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+    install(EXPORT glslangValidatorTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
 
-    install(TARGETS spirv-remap EXPORT spirv-remapTargets
+    if(ENABLE_SPVREMAPPER)
+        install(TARGETS spirv-remap EXPORT spirv-remapTargets
             RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-	
-	install(EXPORT glslangValidatorTargets DESTINATION lib/cmake)
-	install(EXPORT spirv-remapTargets DESTINATION lib/cmake)
-            
+        install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+    endif()
+
     if(BUILD_SHARED_LIBS)
         install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-		install(EXPORT glslang-default-resource-limitsTargets DESTINATION lib/cmake)
+        install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
     endif()
 endif(ENABLE_GLSLANG_INSTALL)

+ 0 - 28
3rdparty/bgfx/3rdparty/glslang/Test/100.conf

@@ -1,28 +0,0 @@
-MaxLights 32
-MaxClipPlanes 6
-MaxTextureUnits 32
-MaxTextureCoords 32
-MaxVertexAttribs 8
-MaxVertexUniformComponents 4096
-MaxVaryingFloats 64
-MaxVertexTextureImageUnits 0
-MaxCombinedTextureImageUnits 8
-MaxTextureImageUnits 8
-MaxFragmentUniformComponents 4096
-MaxDrawBuffers 1
-MaxVertexUniformVectors 16
-MaxVaryingVectors 8
-MaxFragmentUniformVectors 16
-MaxVertexOutputVectors 16
-MaxFragmentInputVectors 15
-MinProgramTexelOffset -8
-MaxProgramTexelOffset 7
-nonInductiveForLoops 0
-whileLoops 0
-doWhileLoops 0
-generalUniformIndexing 0
-generalAttributeMatrixVectorIndexing 0
-generalVaryingIndexing 0
-generalSamplerIndexing 0
-generalVariableIndexing 0
-generalConstantMatrixVectorIndexing 0

+ 0 - 227
3rdparty/bgfx/3rdparty/glslang/Test/100.frag

@@ -1,227 +0,0 @@
-// okay
-#version 100
-int a[3] = { 2, 3, 4, };  // ERROR (lots)
-#version 100
-int uint;
-
-attribute vec4 v[3];     // ERROR
-
-float f = 2;             // ERROR
-
-uniform block {          // ERROR
-    int x;
-};
-
-void foo(float);
-
-void main()
-{
-    foo(3);              // ERROR
-    int s = 1 << 4;      // ERROR
-    s = 16 >> 2;         // ERROR
-    if (a == a);         // ERROR
-    int b, c;
-    b = c & 4;           // ERROR
-    b = c % 4;           // ERROR
-    b = c | 4;           // ERROR
-    b >>= 2;             // ERROR
-    b <<= 2;             // ERROR
-    b %= 3;              // ERROR
-
-    struct S {
-        float f;
-        float a[10];
-    } s1, s2;
-
-    s1 = s2;             // ERROR
-    if (s1 == s2);       // ERROR
-    if (s1 != s2);       // ERROR
-
-    switch(b) {          // ERROR
-    }
-}
-
-invariant gl_FragColor;
-float fa[];              // ERROR
-float f13;
-invariant f13;           // ERROR
-struct S { int a; };
-invariant S;             // ERROR, not an input or output
-invariant float fi;      // ERROR
-varying vec4 av;
-invariant av;            // okay in v100
-
-void foo10()
-{
-    invariant f;         // ERROR
-    invariant float f2;  // ERROR
-    float f3;
-    invariant f3;        // ERROR
-}
-
-uniform vec2 uv2;
-invariant uv2;              // ERROR
-invariant uniform vec3 uv3; // ERROR
-
-sampler2D glob2D;           // ERROR
-void f11(sampler2D p2d)
-{
-    sampler2D v2D;          // ERROR
-}
-varying sampler2D vary2D;   // ERROR
-
-struct sp {
-    highp float f;
-    in float g;             // ERROR
-    uniform float h;        // ERROR
-    invariant float i;      // ERROR
-};
-
-uniform sampler3D s3D;      // ERROR
-
-#extension GL_OES_texture_3D : enable
-
-precision highp sampler3D;
-uniform sampler3D s3D2;
-
-void foo234()
-{
-    texture3D(s3D2, vec3(0.2), 0.2);
-    texture3DProj(s3D2, v[1], 0.4);
-    dFdx(v[0]);    // ERROR
-    dFdy(3.2);     // ERROR
-    fwidth(f13);   // ERROR
-}
-
-#extension GL_OES_standard_derivatives : enable
-
-void foo236()
-{
-    dFdx(v[0]);
-    dFdy(3.2);
-    fwidth(f13);
-    gl_FragDepth = f13;    // ERROR
-    gl_FragDepthEXT = f13; // ERROR
-}
-
-#extension GL_EXT_frag_depth : enable
-
-void foo239()
-{
-    gl_FragDepth = f13;    // ERROR
-    gl_FragDepthEXT = f13;
-}
-
-#extension GL_OES_EGL_image_external : enable
-
-uniform samplerExternalOES sExt;
-
-void foo245()
-{
-    texture2D(sExt, vec2(0.2));
-    texture2DProj(sExt, vec3(f13));
-    texture2DProj(sExt, v[2]);
-}
-
-precision mediump samplerExternalOES;
-uniform samplerExternalOES mediumExt;
-uniform highp samplerExternalOES highExt;
-
-void foo246()
-{
-    texture2D(mediumExt, vec2(0.2));
-    texture2DProj(highExt, v[2]);
-    texture3D(sExt, vec3(f13));   // ERROR
-    texture2DProjLod(sExt, vec3(f13), f13);  // ERROR
-    int a;
-    ~a;    // ERROR
-    a | a; // ERROR
-    a & a; // ERROR
-}
-
-#extension GL_OES_EGL_image_external : disable
-uniform sampler2D s2Dg;
-
-int foo203940(int a, float b, float a)  // ERROR, a redefined
-{
-    texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2);  // ERROR, extension not enabled
-    return a;
-}
-
-float f123 = 4.0f;   // ERROR
-float f124 = 5e10F;  // ERROR
-
-#extension GL_EXT_shader_texture_lod : enable
-
-uniform samplerCube sCube;
-
-void foo323433()
-{
-    texture2DLodEXT(s2Dg, uv2, f13);
-    texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2);
-    texture2DGradEXT(s2Dg, uv2, uv2, uv2);
-    textureCubeGradEXT(sCube, vec3(f13), vec3(f13), vec3(f13));
-}
-
-int fgfg(float f, mediump int i);
-int fgfg(float f, highp int i) { return 2; }   // ERROR, precision qualifier difference
-
-int fffg(float f);
-int fffg(float f);  // ERROR, can't have multiple prototypes 
-
-int gggf(float f);
-int gggf(float f) { return 2; }
-
-int agggf(float f) { return 2; }
-int agggf(float f);
-int agggf(float f);  // ERROR, second prototype
-
-varying struct SSS { float f; } s; // ERROR
-
-int vf(void);
-int vf2();
-int vf3(void v);      // ERROR
-int vf4(int, void);   // ERROR
-int vf5(int, void v); // ERROR
-
-void badswizzle()
-{
-    vec3 a[5];
-    a.y;        // ERROR, no array swizzle
-    a.zy;       // ERROR, no array swizzle
-    a.nothing;  // ERROR
-    a.length(); // ERROR, not this version
-    a.method(); // ERROR
-}
-
-float fooinit();
-
-float fooinittest()
-{
-    return fooinit();
-}
-
-// Test extra-function initializers
-const float fi1 = 3.0;
-const float fi2 = 4.0;
-const float fi3 = 5.0;
-
-float fooinit()
-{
-    return fi1 + fi2 + fi3;  // should make a constant of 12.0
-}
-
-int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer
-
-#ifdef GL_EXT_shader_non_constant_global_initializers
-#extension GL_EXT_shader_non_constant_global_initializers : enable
-#endif
-
-int init2 = gl_FrontFacing ? 1 : 2;
-
-#pragma STDGL invariant(all)
-
-#line 3000
-#error line of this error should be 3000
-
-uniform samplerExternalOES badExt;  // syntax ERROR

+ 0 - 76
3rdparty/bgfx/3rdparty/glslang/Test/100Limits.vert

@@ -1,76 +0,0 @@
-#version 100
-
-int ga, gb;
-float f;
-
-uniform sampler2D fsa[3];
-uniform float fua[10];
-attribute mat3 am3;
-attribute vec2 av2;
-varying vec4 va[4];
-
-const mat2 m2 = mat2(1.0);
-const vec3 v3 = vec3(2.0);
-
-void foo(inout float a) {}
-
-int bar()
-{
-    return 1;
-}
-
-void main()
-{
-    while (ga < gb) { }
-
-    do { } while (false);
-
-    for (           ;              ;         );           // ERROR
-    for (           ;        ga==gb;         );           // ERROR
-    for (           ;              ;      f++);           // ERROR
-    for (     ga = 0;              ;         );           // ERROR
-    for ( bool a = false;          ;         );           // ERROR
-    for (float a = 0.0; a == sin(f);         );           // ERROR
-    for (  int a = 0;       a  < 10;   a *= 2);           // ERROR
-    for (  int a = 0;       a <= 20;      a++)  --a;      // ERROR
-    for (  int a = 0;       a <= 20;      a++)  { if (ga==0) a = 4; } // ERROR
-    for (float a = 0.0;   a <= 20.0; a += 2.0);
-    for (float a = 0.0;   a != 20.0; a -= 2.0)  { if (ga==0) ga = 4; }
-    for (float a = 0.0;   a == 20.0;      a--) for (float a = 0.0;   a == 20.0;      a--);  // two different 'a's, everything okay
-    for (float a = 0.0;   a <= 20.0; a += 2.0);
-    for (float a = 0.0;   a <= 20.0; a += 2.0);
-    for (float a = 0.0;   a > 2.0 * 20.0; a += v3.y);
-    for (float a = 0.0;   a >= 20.0; a += 2.0) foo(a);    // ERROR
-
-    int ia[9];
-
-    fsa[ga];  // ERROR
-    fua[ga];
-    am3[ga];  // ERROR
-    av2[ga];  // ERROR
-    va[2+ga]; // ERROR
-    m2[ga];   // ERROR
-    v3[ga/2]; // ERROR
-    ia[ga];   // ERROR
-
-    for (int a = 3; a >= 0; a--) {
-        fsa[a];
-        fua[a+2];
-        am3[3*a];
-        av2[3*a];
-        va[a-1];
-        m2[a/2];
-        v3[a];
-        ia[a];
-        ia[bar()];  // ERROR
-    }
-
-    fsa[2];
-    fua[3];
-    am3[2];
-    av2[1];
-    va[1];
-    m2[1];
-    v3[1];
-    ia[3];
-}

+ 0 - 41
3rdparty/bgfx/3rdparty/glslang/Test/100samplerExternal.frag

@@ -1,41 +0,0 @@
-#version 100
-
-#extension GL_OES_EGL_image_external : enable
-
-uniform samplerExternalOES sExt;
-precision mediump samplerExternalOES;
-uniform samplerExternalOES mediumExt;
-uniform highp samplerExternalOES highExt;
-
-void main()
-{
-    texture2D(sExt, vec2(0.2));
-    texture2D(mediumExt, vec2(0.2));
-    texture2D(highExt, vec2(0.2));
-    texture2DProj(sExt, vec3(0.3));
-    texture2DProj(sExt, vec4(0.3));
-
-    int lod = 0;
-    highp float bias = 0.01;
-    textureSize(sExt, lod);  // ERROR
-    texture(sExt, vec2(0.2));  // ERROR
-    texture(sExt, vec2(0.2), bias);  // ERROR
-    textureProj(sExt, vec3(0.2));  // ERROR
-    textureProj(sExt, vec3(0.2), bias);  // ERROR
-    textureProj(sExt, vec4(0.2));  // ERROR
-    textureProj(sExt, vec4(0.2), bias);  // ERROR
-    texelFetch(sExt, ivec2(4), lod);  // ERROR
-
-    texture3D(sExt, vec3(0.3));  // ERROR
-    texture2DProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-    texture(sExt, vec3(0.3));  // ERROR
-    textureProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-}
-
-#extension GL_OES_EGL_image_external : disable
-
-#extension GL_OES_EGL_image_external_essl3 : enable
-uniform samplerExternalOES badExt;  // ERROR
-#extension GL_OES_EGL_image_external_essl3 : disable
-
-uniform samplerExternalOES badExt;  // ERROR

+ 0 - 76
3rdparty/bgfx/3rdparty/glslang/Test/100scope.vert

@@ -1,76 +0,0 @@
-#version 100
-
-int f(int a, int b, int c)
-{
-	int a = b;  // ERROR, redefinition
-
-    {
-		float a = float(a) + 1.0;
-    }
-
-	return a;
-}
-
-int f(int a, int b, int c);  // okay to redeclare
-
-bool b;
-float b(int a);      // ERROR: redefinition
-
-float c(int a);
-bool c;              // ERROR: redefinition
-
-float f;             // ERROR: redefinition
-float tan;           // okay, built-in is in an outer scope
-float sin(float x);  // ERROR: can't redefine built-in functions
-float cos(float x)   // ERROR: can't redefine built-in functions
-{
-	return 1.0;
-}
-bool radians(bool x) // okay, can overload built-in functions
-{
-    return true;
-}
-
-invariant gl_Position;
-
-void main()
-{
-    int g();    // ERROR: no local function declarations
-	g();
-
-    float sin;  // okay
-	sin;
-    sin(0.7);  // ERROR, use of hidden function
-    f(1,2,3);
-
-    float f;    // hides f()
-    f = 3.0;
-
-    gl_Position = vec4(f);
-
-    for (int f = 0; f < 10; ++f)
-        ++f;
-
-    int x = 1;
-    { 
-        float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2
-        int z = z; // ERROR: z not previously defined.
-    }
-    {
-        int x = x; // x is initialized to '1'
-    }
-
-    struct S 
-    { 
-        int x; 
-    };
-    {
-        S S = S(0); // 'S' is only visible as a struct and constructor 
-        S.x;        // 'S' is now visible as a variable
-    }
-
-    int degrees;
-    degrees(3.2);  // ERROR, use of hidden built-in function
-}
-
-varying struct SSS { float f; } s; // ERROR

+ 0 - 87
3rdparty/bgfx/3rdparty/glslang/Test/110scope.vert

@@ -1,87 +0,0 @@
-#version 110
-
-int f(int a, int b, int c)
-{
-	int a = b;  // ERROR, redefinition
-
-    {
-		float a = float(a) + 1.0; // okay
-    }
-
-	return a;
-}
-
-int f(int a, int b, int c);  // okay to redeclare
-
-bool b;
-float b(int a);      // okay, b and b() are different
-
-float c(int a);
-bool c;              // okay, and c() are different
-
-float f;             // okay f and f() are different
-float tan;           // okay, hides built-in function
-float sin(float x);  // okay, can redefine built-in functions
-float cos(float x)   // okay, can redefine built-in functions
-{
-	return 1.0;
-}
-bool radians(bool x) // okay, can overload built-in functions
-{
-    return true;
-}
-
-int gi = f(1,2,3);  // ERROR, can't call user-defined function from global scope
-
-void main()
-{
-    int g();    // okay
-    g();
-
-    float sin; // okay
-    sin;
-    sin(0.7);  // okay
-    f(1,2,3);
-
-    float f;
-    f = 3.0;
-
-    gl_Position = vec4(f);
-
-    for (int f = 0; f < 10; ++f)
-        ++f;
-
-    int x = 1;
-    { 
-        float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2
-        int z = z; // ERROR: z not previously defined.
-    }
-    {
-        int x = x; // x is initialized to '1'
-    }
-
-    struct S 
-    { 
-        int x; 
-    };
-    {
-        S S = S(0); // 'S' is only visible as a struct and constructor 
-        S.x;        // 'S' is now visible as a variable
-    }
-
-    int degrees;
-    degrees(3.2);
-
-    {
-        S s;
-        s.x = 3;
-        struct S {   // okay, hides S
-            bool b;
-        };
-        S t;
-        t.b = true;
-        struct S {    // ERROR, redefinition of struct S
-            float f;
-        };
-    }
-}

+ 0 - 248
3rdparty/bgfx/3rdparty/glslang/Test/120.frag

@@ -1,248 +0,0 @@
-#version 120
-
-float lowp;
-float mediump;
-float highp;
-
-float precision;
-
-in vec4 i;
-out vec4 o;
-
-uniform sampler2D s2D;
-centroid varying vec2 centTexCoord;
-
-uniform mat4x2 m;
-
-struct s {
-    float f;
-};
-
-void main()
-{
-    mat2x3 m23 = mat2x3(m);
-
-    int a;
-    bool b;
-    s sv = s(a);
-    float[2] ia = float[2](3, i.y);
-    float f1 = 1;
-    float f = a;
-    f = a;
-    ivec3 iv3;
-    vec3 v3 = iv3;
-    f = f + a;
-    f = a - f;
-    f += a;
-    f = a - f;
-    v3 *= iv3;
-    v3 = iv3 / 2.0f;
-    v3 = 3.0 * iv3;
-    v3 = 2 * v3;
-    v3 = v3 - 2;
-    if (f <  a ||
-        a <= f ||
-        f >  a ||
-        f >= a ||
-        a == f ||
-        f != a);
-    f = b ? a : f;
-    f = b ? f : a;
-    f = b ? a : a;
-    s news = sv;
-    
-    i.xy + i.xyz;      // ERROR
-    m * i.xyz;         // ERROR
-    m + i;             // ERROR
-    int aoeu = 1.0;    // ERROR
-    f = b;             // ERROR
-    f = a + b;         // ERROR
-    f = b * a;         // ERROR
-    b = a;             // ERROR
-    b = b + f;         // ERROR
-    f |= b;            // ERROR
-
-    gl_FragColor = texture2D(s2D, centTexCoord);
-
-    float flat;
-    float smooth;
-    float noperspective;
-    float uvec2;
-    float uvec3;
-    float uvec4;
-    //packed;     // ERROR, reserved word
-
-    {
-        mat4 m;
-        vec4 v;
-        bool b;
-        gl_FragColor += b ? v : m;  // ERROR, types don't match around ":"
-    }
-
-    gl_FragColor.xr;    // ERROR, swizzlers not from same field space
-    gl_FragColor.xyxyx.xy; // ERROR, cannot make a vec5, even temporarily
-    centTexCoord.z;     // ERROR, swizzler out of range
-    (a,b) = true;       // ERROR, not an l-value
-}
-
-float imageBuffer;
-float uimage2DRect;
-
-int main() {}           // ERROR
-void main(int a) {}     // ERROR
-
-const int a;            // ERROR
-
-int foo(in float a);
-int foo(out float a)    // ERROR
-{
-    return 3.2;         // ERROR
-    foo(a);             // ERROR
-}
-
-bool gen(vec3 v)
-{
-    if (abs(v[0]) < 1e-4F && abs(v[1]) < 1e-4)
-        return true;
-}
-
-void v1()
-{
-}
-
-void v2()
-{
-    return v1();  // ERROR, no expression allowed, even though void
-}
-
-void atest()
-{
-    vec4 v = gl_TexCoord[1];
-    v += gl_TexCoord[3];
-}
-
-varying vec4 gl_TexCoord[6];  // okay, assigning a size
-varying vec4 gl_TexCoord[5];  // ERROR, changing size
-
-mat2x2 m22;
-mat2x3 m23;
-mat2x4 m24;
-
-mat3x2 m32;
-mat3x3 m33;
-mat3x4 m34;
-
-mat4x2 m42;
-mat4x3 m43;
-mat4x4 m44;
-
-void foo123()
-{
-    mat2 r2 = matrixCompMult(m22, m22);
-    mat3 r3 = matrixCompMult(m33, m33);
-    mat4 r4 = matrixCompMult(m44, m44);
-
-    mat2x3 r23 = matrixCompMult(m23, m23);
-    mat2x4 r24 = matrixCompMult(m24, m24);
-    mat3x2 r32 = matrixCompMult(m32, m32);
-    mat3x4 r34 = matrixCompMult(m34, m34);
-    mat4x2 r42 = matrixCompMult(m42, m42);
-    mat4x3 r43 = matrixCompMult(m43, m43);
-
-    mat3x2 rfoo1 = matrixCompMult(m23, m32);  // ERROR
-    mat3x4 rfoo2 = matrixCompMult(m34, m44);  // ERROR    
-}
-
-void matConst()
-{
-    vec2 v2;
-    vec3 v3;
-    mat4 m4b1 = mat4(v2, v3);                      // ERROR, not enough
-    mat4 m4b2 = mat4(v2, v3, v3, v3, v3, v2, v2);  // ERROR, too much
-    mat4 m4g = mat4(v2, v3, v3, v3, v3, v3);
-    mat4 m4 = mat4(v2, v3, v3, v3, v3, v2);
-    mat3 m3 = mat3(m4);
-    mat3 m3b1 = mat3(m4, v2);                      // ERROR, extra arg
-    mat3 m3b2 = mat3(m4, m4);                      // ERROR, extra arg
-    mat3x2 m32 = mat3x2(m4);
-    mat4 m4c = mat4(m32);
-    mat3 m3s = mat3(v2.x);
-
-    mat3 m3a1[2] = mat3[2](m3s, m3s);
-    mat3 m3a2[2] = mat3[2](m3s, m3s, m3s);         // ERROR, too many args
-}
-
-uniform sampler3D s3D;
-uniform sampler1D s1D;
-uniform sampler2DShadow s2DS;
-
-void foo2323()
-{
-    vec4 v;
-    vec2 v2;
-    float f;
-    v = texture2DLod(s2D, v2, f);    // ERROR
-    v = texture3DProjLod(s3D, v, f); // ERROR
-    v = texture1DProjLod(s1D, v, f); // ERROR
-    v = shadow2DProjLod(s2DS, v, f); // ERROR
-
-    v = texture1DGradARB(s1D, f, f, f);         // ERROR
-    v = texture2DProjGradARB(s2D, v, v2, v2);   // ERROR
-    v = shadow2DProjGradARB(s2DS, v, v2, v2);   // ERROR
-}
-
-#extension GL_ARB_shader_texture_lod : require
-
-void foo2324()
-{
-    vec4 v;
-    vec2 v2;
-    float f;
-    v = texture2DLod(s2D, v2, f);
-    v = texture3DProjLod(s3D, v, f);
-    v = texture1DProjLod(s1D, v, f);
-    v = shadow2DProjLod(s2DS, v, f);
-
-    v = texture1DGradARB(s1D, f, f, f);
-    v = texture2DProjGradARB(s2D, v, v2, v2);
-    v = shadow2DProjGradARB(s2DS, v, v2, v2);
-    v = shadow2DRectProjGradARB(s2DS, v, v2, v2);  // ERROR
-}
-
-uniform sampler2DRect s2DRbad;  // ERROR
-
-void foo121111()
-{
-    vec2 v2;
-    vec4 v = texture2DRect(s2DRbad, v2);
-}
-
-#extension GL_ARB_texture_rectangle : enable
-
-uniform sampler2DRect s2DR;
-uniform sampler2DRectShadow s2DRS;
-
-void foo12111()
-{
-    vec2 v2;
-    vec3 v3;
-    vec4 v4;
-    vec4 v;
-    v = texture2DRect(s2DR, v2);
-    v = texture2DRectProj(s2DR, v3);
-    v = texture2DRectProj(s2DR, v4);
-    v = shadow2DRect(s2DRS, v3);
-    v = shadow2DRectProj(s2DRS, v4);
-
-    v = shadow2DRectProjGradARB(s2DRS, v, v2, v2);
-}
-
-void voidTernary()
-{
-	bool b;
-	b ? foo121111() : foo12111();
-	b ? foo121111() : 4;  // ERROR
-	b ? 3 : foo12111();   // ERROR
-}
-
-float halfFloat1 = 1.0h;   // syntax ERROR

+ 0 - 203
3rdparty/bgfx/3rdparty/glslang/Test/120.vert

@@ -1,203 +0,0 @@
-#version 120
-
-in vec4 i;                // ERROR
-out vec4 o;               // ERROR
-
-attribute vec2 attv2;
-attribute vec4 attv4;
-uniform sampler2D s2D;
-invariant varying vec2 centTexCoord;
-invariant gl_Position;
-centroid gl_Position;     // ERROR
-centroid centroid foo;    // ERROR
-invariant gl_Position, gl_PointSize;
-
-void main()
-{
-    centTexCoord = attv2; 
-    gl_Position = attv4;
-
-    gl_ClipVertex = attv4;
-    gl_ClipDistance[1] = 0.2;  // ERROR
-
-    vec3[12] a;
-    vec4[a.length()] b;
-    gl_Position = b[b.length()-1];
-
-    float f[];
-    int a1 = f.length();  // ERROR
-    float f[7];
-    int aa = f.length();
-    int a2 = f.length;    // ERROR
-    int a3 = f.length(a); // ERROR
-    int a4 = f.flizbit;   // ERROR
-    int a4 = f.flizbit(); // ERROR
-    float md[2][4];       // ERROR
-    float[2] md2[4];      // ERROR
-    float[2][4] md3;      // ERROR
-    float md5, md6[2][3]; // ERROR
-    float[2] md4, md7[4]; // ERROR
-    float md9[2][3] = float[2][3](1, 2, 3, 4, 5, 6);  // ERROR
-    float md10, md11[2][3] = float[2][3](1, 2, 3, 4, 5, 6);  // ERROR
-
-    gl_PointSize = 3.8;
-}
-
-uniform float initted = 3.4;   // okay
-
-const float concall = sin(0.3);
-
-int[2][3] foo(                 // ERROR
-              float[2][3] a,   // ERROR
-              float[2] b[3],   // ERROR
-              float c[2][3]);  // ERROR
-
-int overloadA(in float f);
-int overloadA(out float f);        // ERROR, different qualifiers
-float overloadA(float);            // ERROR, different return value for same signature
-float overloadA(out float f, int);
-float overloadA(int i);
-
-void overloadB(float, const in float) { }
-
-vec2 overloadC(int, int);
-vec2 overloadC(const in int, float);
-vec2 overloadC(float, int);
-vec2 overloadC(vec2, vec2);
-
-vec3 overloadD(int, float);
-vec3 overloadD(float, in int);
-
-vec3 overloadE(float[2]);
-vec3 overloadE(mat2 m);
-vec3 overloadE(vec2 v);
-
-vec3 overloadF(int);
-vec3 overloadF(float);
-
-void foo()
-{
-    float f;
-    int i;
-
-    overloadB(f, f);
-    overloadB(f, 2);
-    overloadB(1, i);
-
-    overloadC(1);    // ERROR
-    overloadC(1, i);
-    overloadC(vec2(1), vec2(2));
-    overloadC(f, 3.0);           // ERROR, no way
-    overloadC(ivec2(1), vec2(2));
-
-    overloadD(i, f);
-    overloadD(f, i);
-    overloadD(i, i);   // ERROR, ambiguous
-
-    int overloadB;     // hiding
-    overloadB(1, i);   // ERROR
-
-    sin(1);
-    texture2D(s2D, ivec2(0));
-    clamp(attv4, 0, 1);
-    clamp(ivec4(attv4), 0, 1);
-
-    int a[2];
-    overloadC(a, 3); // ERROR
-    overloadE(a);    // ERROR
-    overloadE(3.3);  // ERROR
-    overloadE(vec2(3.3));
-    overloadE(mat2(0.5));
-    overloadE(ivec4(1)); // ERROR
-    overloadE(ivec2(1));
-
-    float b[2];
-    overloadE(b);
-    
-    overloadF(1, 1); // ERROR
-    overloadF(1);
-}
-
-varying vec4 gl_TexCoord[35]; // ERROR, size too big
-
-// tests for output conversions
-void outFun(in float, out ivec2, in int, out float);
-int outFunRet(in float, out int, const in int, out ivec4);
-ivec2 outFunRet(in float, out ivec4, in int, out ivec4);
-
-void foo2()
-{
-    vec2 v2;
-    vec4 v4;
-    float f;
-    int i;
-
-    outFun(i, v2, i, f);
-    outFunRet(i, f, i, v4);
-    float ret = outFunRet(i, f, i, v4);
-    vec2 ret2 = outFunRet(i, v4, i, v4);
-    bool b = any(lessThan(v4, attv4));  // tests aggregate arg to unary built-in 
-}
-
-void noise()
-{
-    float f1 = noise1(1.0);
-    vec2 f2 = noise2(vec2(1.0));
-    vec3 f3 = noise3(vec3(1.0));
-    vec4 f4 = noise4(vec4(1.0));
-}
-
-// version 130 features
-
-uniform int c;
-
-attribute ivec2 x;
-attribute vec2 v2a;
-attribute float c1D;
-attribute vec2  c2D;
-attribute vec3  c3D;
-
-uniform vec4 v4;
-
-void foo213()
-{
-    float f = 3;
-    switch (c) {         // ERRORs...
-    case 1:              
-        f = sin(f);
-        break;
-    case 2:
-        f = f * f;
-    default:
-        f = 3.0;
-    }
-
-    int i;          
-    i << 3 | 0x8A >> 1 & 0xFF;      // ERRORs...
-
-    vec3 modfOut, modfIn;
-    vec3 v11 = modf(modfIn, modfOut); // ERRORS...
-    float t = trunc(f);
-    vec2 v12 = round(v2a);
-    vec2 v13 = roundEven(v2a);
-    bvec2 b10 = isnan(v2a);
-    bvec4 b11 = isinf(v4);
-
-    sinh(c1D) +                      // ERRORS...
-    cosh(c1D) * tanh(c2D);
-    asinh(c4D) + acosh(c4D);
-    atanh(c3D);
-
-    int id = gl_VertexID;            // ERROR
-    gl_ClipDistance[1] = 0.3;        // ERROR
-}
-
-int gl_ModelViewMatrix[] = 0;
-
-// token pasting (ERRORS...)
-
-#define mac abc##def
-int mac;
-
-#define macr(A,B) A ## B
-int macr(qrs,tuv);

+ 0 - 178
3rdparty/bgfx/3rdparty/glslang/Test/130.frag

@@ -1,178 +0,0 @@
-#version 130
-
-lowp vec3 a;
-mediump float b;
-highp int c;
-
-precision highp float;
-
-in vec4 i;
-out vec4 o;
-
-flat in float fflat;
-smooth in float fsmooth;
-noperspective in float fnop;
-
-void main()
-{
-    float clip = gl_ClipDistance[3];
-}
-
-uniform samplerCube sampC;
-
-void foo()
-{
-    vec4 s = textureGather(sampC, vec3(0.2));
-}
-
-#extension GL_ARB_texture_gather : enable
-
-void bar()
-{
-    vec4 s = textureGather(sampC, vec3(0.2));
-}
-
-flat in vec3 gl_Color;     // ERROR, type
-in vec4 gl_Color;
-flat in vec4 gl_Color;
-flat in vec4 gl_Color[2];  // ERROR, array 
-vec4 gl_Color;             // ERROR, storage
-
-#extension GL_ARB_texture_gather : warn
-
-void bar2()
-{
-    vec4 s = textureGather(sampC, vec3(0.2));
-
-    uvec3 uv3;
-    bvec3 b3;
-    b3 = lessThan(uv3, uv3);
-    b3 = equal(uv3, uv3);
-    const bvec2 bl1 = greaterThanEqual(uvec2(2, 3), uvec2(3,3));
-    const bvec2 bl2 = equal(uvec2(2, 3), uvec2(3,3));
-    const bvec2 bl3 = equal(bl1, bl2);  // yes, equal
-    int a1[int(bl3.x)];
-    int a2[int(bl3.y)];
-    a1[0];  // size 1
-    a2[0];  // size 1
-    const bvec4 bl4 = notEqual(greaterThan(uvec4(1,2,3,4), uvec4(0,2,0,6)), lessThanEqual(uvec4(7,8,9,10), uvec4(6, 8, 0, 11)));  // compare (t,f,t,f) with (f,t,f,t)
-    int a3[int(bl4.x)+int(bl4.y)+int(bl4.z)+int(bl4.w)];
-    a3[3];  // size 4
-    b3 != b3;
-    b3 < b3;                   // ERROR
-    uv3 > uv3;                 // ERROR
-    uvec2(2, 3) >= uvec2(3,3); // ERROR
-    int(bl4) <= int(bl4);      // true
-    int(bl4.x) > int(bl4.y);   // false
-}
-
-#extension GL_ARB_texture_gather : enable
-#extension GL_ARB_texture_rectangle : enable
-
-uniform sampler2D samp2D;
-uniform sampler2DShadow samp2DS;
-uniform sampler2DRect samp2DR;
-uniform sampler2DArray samp2DA;
-
-void bar23()
-{
-    vec4 s;
-    s = textureGatherOffset(sampC, vec3(0.3), ivec2(1));        // ERROR
-    s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1));      // ERROR
-    s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1));
-    s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1));
-    s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); // ERROR
-    s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2);    // ERROR
-}
-
-#extension GL_ARB_gpu_shader5 : enable
-
-void bar234()
-{
-    vec4 s;
-    s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1));
-    s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1));
-    s = textureGatherOffset(samp2DR, vec2(0.3), ivec2(1));
-    s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1));
-    s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2);
-}
-
-#extension GL_ARB_texture_cube_map_array : enable
-
-uniform  samplerCubeArray Sca;
-uniform isamplerCubeArray Isca;
-uniform usamplerCubeArray Usca;
-uniform samplerCubeArrayShadow Scas;
-
-void bar235()
-{
-    ivec3 a = textureSize(Sca, 3);
-    vec4 b = texture(Sca, i);
-    ivec4 c = texture(Isca, i, 0.7);
-    uvec4 d = texture(Usca, i);
-    
-    b = textureLod(Sca, i, 1.7);
-    a = textureSize(Scas, a.x);
-    float f = texture(Scas, i, b.y);
-    c = textureGrad(Isca, i, vec3(0.1), vec3(0.2));
-}
-
-int \
-    x;  // ERROR until 420pack is turned on
-
-#extension GL_ARB_shading_language_420pack : enable
-
-const int ai[3] = { 10, 23, 32 };
-layout(binding=0) uniform blockname { int a; } instanceName;  // ERROR
-uniform layout(binding=0) sampler2D bounds;
-
-void bar23444()
-{
-    mat4x3 m43;  \
-    float a1 = m43[3].y;
-    vec3 v3;
-    int a2 = m43.length();
-    a2 += m43[1].length();
-    a2 += v3.length();
-    const float b = 2 * a1;
-    a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset;
-    bool boolb;
-    boolb.length();     // ERROR
-    m43[3][1].length(); // ERROR
-    v3.length;          // ERROR
-    v3.length(b);       // ERROR
-}
-
-in float gl_FogFragCoord;
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in float gl_FogFragCoord;
-in int gl_FogFragCoord;    // ERROR
-
-layout(early_fragment_tests) in;         // ERROR
-layout(r32i) uniform iimage2D iimg2Dbad; // ERROR
-
-#extension GL_ARB_shader_image_load_store : enable
-
-layout(early_fragment_tests) in;
-
-layout(r32i) uniform iimage2D iimg2D;
-
-void qux2()
-{
-    int i;
-    imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);
-    ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
-}
-
-layout(early_fragment_tests) out;         // ERROR
-
-#extension GL_ARB_explicit_uniform_location : enable
-
-layout(location = 3) uniform vec4 ucolor0; // ERROR: explicit attrib location is also required for version < 330
-
-#extension GL_ARB_explicit_attrib_location : enable
-
-layout(location = 4) uniform vec4 ucolor1;
-

+ 0 - 78
3rdparty/bgfx/3rdparty/glslang/Test/130.vert

@@ -1,78 +0,0 @@
-#version 130
-
-uniform int c;
-uniform usampler2D us2D;
-
-in ivec2 x;
-in vec2 v2a;
-in float c1D;
-in vec2  c2D;
-in vec3  c3D;
-smooth vec4  c4D;  // ??
-
-uniform vec4 v4;
-
-void main()
-{
-    float f = 3;
-    switch (c) {     // full switch testing in switch.frag
-    case 1:
-        f = sin(f);
-        break;
-    case 2:
-        f = f * f;
-    default:
-        f = 3.0;
-    }
-
-    uint i;
-    i = texture(us2D, x).w;          // full uint testing in uint.frag
-    i << 3u | 0x8Au >> 1u & 0xFFu;
-
-    vec3 modfOut, modfIn;
-    vec3 v11 = modf(modfIn, modfOut);
-    float t = trunc(f);
-    vec2 v12 = round(v2a);
-    vec2 v13 = roundEven(v2a);
-    bvec2 b10 = isnan(v2a);
-    bvec4 b11 = isinf(v4);
-
-    sinh(c1D) +
-    cosh(c1D) * tanh(c2D);
-    asinh(c4D) + acosh(c4D);
-    atanh(c3D);
-
-    int id = gl_VertexID;
-    gl_ClipDistance[1] = 0.3;
-}
-
-// version 140 features
-
-//uniform isamplerBuffer sbuf;
-
-//layout(std140) uniform blockName {
-//    int anonMem;
-//};
-
-void foo88()
-{
-    int id = gl_InstanceID;    // ERROR
-    //id += anonMem;
-    id += texelFetch(id, 8);
-
-    gl_ClipVertex;         // these are all present...
-    gl_Color;
-    gl_LightSource[0];
-    gl_DepthRange.far;
-    gl_TexCoord;
-    gl_FogFragCoord;
-    gl_FrontColor;
-}
-
-// token pasting
-
-#define mac abc##def
-int mac;
-
-#define macr(A,B) A##B
-int macr(qrs,tuv);

+ 0 - 53
3rdparty/bgfx/3rdparty/glslang/Test/140.frag

@@ -1,53 +0,0 @@
-#version 140
-
-varying vec4 v;
-
-in vec4 i;
-out vec4 o;
-
-in float gl_ClipDistance[5];
-
-void main()
-{
-    float clip = gl_ClipDistance[2];
-}
-#ifdef GL_ES
-#error GL_ES is set
-#else
-#error GL_ES is not set
-#endif
-
-in struct S { float f; } s; // ERROR
-
-float patch = 3.1;
-
-layout(location=3) in vec4 vl;  // ERROR
-
-layout(location = 3) out vec4 factorBad;  // ERROR
-
-#extension GL_ARB_explicit_attrib_location : enable
-
-layout(location = 5) out vec4 factor;
-
-#extension GL_ARB_separate_shader_objects : enable
-
-layout(location=4) in vec4 vl2;
-
-float fooi();
-
-void foo()
-{
-    vec2 r1 = modf(v.xy, v.zw);  // ERROR, v.zw not l-value
-    vec2 r2 = modf(o.xy, o.zw);
-    o.z = fooi();
-}
-
-// Test extra-function initializers
-
-float i1 = gl_FrontFacing ? -2.0 : 2.0;
-float i2 = 102;
-
-float fooi()
-{
-    return i1 + i2;
-}

+ 0 - 79
3rdparty/bgfx/3rdparty/glslang/Test/140.vert

@@ -1,79 +0,0 @@
-#version 140
-
-uniform isamplerBuffer sbuf;
-
-layout(std140) uniform blockName {
-    int anonMem;
-};
-
-void main()
-{
-    int id = gl_InstanceID;
-    id += anonMem;
-    id += texelFetch(sbuf, 8).w;
-    gl_ClipVertex;      // could be ERROR, but compiling under compatibility profile
-    gl_Color;           // could be ERROR, but compiling under compatibility profile
-    gl_LightSource[0];  // could be ERROR, but compiling under compatibility profile
-    gl_DepthRange.far;
-    gl_TexCoord;        // could be ERROR, but compiling under compatibility profile
-    gl_FogFragCoord;    // could be ERROR, but compiling under compatibility profile
-    gl_FrontColor;      // could be ERROR, but compiling under compatibility profile
-}
-
-out vec4 gl_Position;  // ERROR
-
-layout(location = 9) in vec4 locBad;  // ERROR
-
-#extension GL_ARB_explicit_attrib_location : enable
-
-layout(location = 9) in vec4 loc;
-
-#extension GL_ARB_separate_shader_objects : enable
-
-out vec4 gl_Position;
-in vec4 gl_Position;   // ERROR
-out vec3 gl_Position;  // ERROR
-
-out float gl_PointSize;
-out vec4 gl_ClipVertex;
-out float gl_FogFragCoord;
-
-uniform sampler2DRect s2dr;
-uniform sampler2DRectShadow s2drs;
-in ivec2 itloc2;
-in vec2 tloc2;
-in vec3 tloc3;
-in vec4 tloc4;
-
-void foo()
-{
-    vec4 v = texelFetch(s2dr, itloc2);
-    v += texelFetch(s2dr, itloc2, 0.2);     // ERROR, no lod
-    v += texture(s2dr, tloc2);
-    v += texture(s2dr, tloc2, 0.3);         // ERROR, no bias
-    v += texture(s2drs, tloc3);
-    v += textureProj(s2dr, tloc3);
-    v += textureProj(s2dr, tloc4);
-    v += textureProjGradOffset(s2dr, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2));
-    v += textureProjGradOffset(s2drs, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2));
-}
-
-void devi()
-{
-    gl_DeviceIndex; // ERROR, no extension
-    gl_ViewIndex;   // ERROR, no extension
-}
-
-#ifdef GL_EXT_device_group
-#extension GL_EXT_device_group : enable
-#endif
-
-#ifdef GL_EXT_multiview
-#extension GL_EXT_multiview : enable
-#endif
-
-void devie()
-{
-    gl_DeviceIndex;
-    gl_ViewIndex;
-}

+ 0 - 51
3rdparty/bgfx/3rdparty/glslang/Test/150.frag

@@ -1,51 +0,0 @@
-#version 150 core
-
-in vec4 gl_FragCoord;
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR
-layout(pixel_center_integer) in vec4 gl_FragCoord;  // ERROR
-layout(origin_upper_left) in vec4 foo;  // ERROR
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;
-
-void main()
-{
-    vec4 c = gl_FragCoord;
-}
-
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, declared after use
-
-in struct S { float f; } s;
-
-float patch = 3.1;
-
-uniform sampler2DMS sms;
-uniform isampler2DMS isms;
-uniform usampler2DMS usms;
-uniform sampler2DMSArray smsa;
-uniform isampler2DMSArray ismsa;
-uniform usampler2DMSArray usmsa;
-
-flat in ivec2 p2;
-flat in ivec3 p3;
-flat in int samp;
-
-void barWxyz()
-{
-    ivec2 t11 = textureSize( sms);
-    ivec2 t12 = textureSize(isms);
-    ivec2 t13 = textureSize(usms);
-    ivec3 t21 = textureSize( smsa);
-    ivec3 t22 = textureSize(ismsa);
-    ivec3 t23 = textureSize(usmsa);
-     vec4 t31 = texelFetch( sms, p2, samp);
-    ivec4 t32 = texelFetch(isms, p2, samp);
-    uvec4 t33 = texelFetch(usms, p2, 3);
-     vec4 t41 = texelFetch( smsa, p3, samp);
-    ivec4 t42 = texelFetch(ismsa, ivec3(2), samp);
-    uvec4 t43 = texelFetch(usmsa, p3, samp);
-}
-
-int primitiveID()
-{
-   return gl_PrimitiveID;
-   gl_PerFragment; // ERROR, block name can't get reused
-}

+ 0 - 139
3rdparty/bgfx/3rdparty/glslang/Test/150.geom

@@ -1,139 +0,0 @@
-#version 150 core
-
-in fromVertex {
-    in vec3 color;
-} fromV[];
-
-out toFragment {
-    out vec3 color;
-} toF;
-
-out fromVertex {  // okay to reuse a block name for another block name
-    vec3 color;
-};
-
-out fooB {
-    vec2 color;
-} fromVertex;     // ERROR, cannot reuse block name as block instance
-
-int fromVertex;   // ERROR, cannot reuse a block name for something else
-
-out fooC {
-    vec2 color;
-} fooC;           // ERROR, cannot have same name for block and instance name
-
-void main()
-{
-    EmitVertex();
-    EndPrimitive();
-    EmitStreamVertex(1);    // ERROR
-    EndStreamPrimitive(0);  // ERROR
-
-    color = fromV[0].color;
-    gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
-    gl_Position = gl_in[0].gl_Position;
-    gl_PointSize = gl_in[3].gl_PointSize;
-    gl_PrimitiveID = gl_PrimitiveIDIn;
-    gl_Layer = 2;
-}
-
-out vec4 ov0;  // stream should be 0
-layout(stream = 4) out vec4 ov4;
-out vec4 o1v0;  // stream should be 0
-
-layout(stream = 3) uniform;        // ERROR
-layout(stream = 3) in;             // ERROR
-layout(stream = 3) uniform int ua; // ERROR
-layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR
-
-layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out;  // just means "stream = 3, triangle_strip"
-layout(stream = 3, triangle_strip) out;
-out vec4 ov3;  // stream should be 3
-
-layout(stream = 6) out ooutb { vec4 a; } ouuaa6;
-
-layout(stream = 6) out ooutb2 {
-    layout(stream = 6) vec4 a;
-} ouua6;
-
-layout(stream = 7) out ooutb3 {
-    layout(stream = 6) vec4 a;  // ERROR
-} ouua7;
-
-out vec4 ov2s3;  // stream should be 3
-
-layout(max_vertices = 200) out;
-layout(max_vertices = 300) out;   // ERROR, too big
-void foo(layout(max_vertices = 4) int a)  // ERROR
-{
-    ouuaa6.a = vec4(1.0);
-}
-
-layout(line_strip, points, triangle_strip, stream = 3, points) out;  // ERROR, changing output primitive
-layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive
-layout(triangle_strip) in; // ERROR, not an input primitive
-layout(triangle_strip) uniform; // ERROR
-layout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable
-layout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input
-layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
-out outbn2 {
-    layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0
-    layout(max_vertices = 3) int b; // ERROR, not on a block member
-    layout(triangle_strip)   int c; // ERROR, not on a block member
-} outbi;
-
-layout(lines) out;  // ERROR, not on output
-layout(lines_adjacency) in;
-layout(triangles) in;             // ERROR, can't change it
-layout(triangles_adjacency) in;   // ERROR, can't change it
-layout(invocations = 4) in;       // ERROR, not until 4.0
-
-in inbn {
-    layout(stream = 2) int a;     // ERROR, stream on input
-} inbi[];
-
-in sameName {
-    int a15;
-} insn[];
-
-out sameName {
-    float f15;
-};
-
-uniform sameName {
-    bool b15;
-};
-
-float summ = gl_MaxVertexAttribs +
-             gl_MaxVertexUniformComponents +
-             gl_MaxVaryingFloats +
-             gl_MaxVaryingComponents +
-             gl_MaxVertexOutputComponents  +
-             gl_MaxGeometryInputComponents  +
-             gl_MaxGeometryOutputComponents  +
-             gl_MaxFragmentInputComponents  +
-             gl_MaxVertexTextureImageUnits +
-             gl_MaxCombinedTextureImageUnits +
-             gl_MaxTextureImageUnits +
-             gl_MaxFragmentUniformComponents +
-             gl_MaxDrawBuffers +
-             gl_MaxClipDistances  +
-             gl_MaxGeometryTextureImageUnits +
-             gl_MaxGeometryOutputVertices +
-             gl_MaxGeometryTotalOutputComponents  +
-             gl_MaxGeometryUniformComponents  +
-             gl_MaxGeometryVaryingComponents;
-
-void fooe1()
-{
-    gl_ViewportIndex = gl_MaxViewports - 1;
-}
-
-#extension GL_ARB_viewport_array : enable
-
-void fooe2()
-{
-    gl_ViewportIndex = gl_MaxViewports - 1;
-}
-
-out int gl_ViewportIndex;

+ 0 - 34
3rdparty/bgfx/3rdparty/glslang/Test/150.tesc

@@ -1,34 +0,0 @@
-#version 150
-
-#extension GL_ARB_tessellation_shader : enable
-
-layout(vertices = 4) out;
-int outa[gl_out.length()];
-
-patch out vec4 patchOut;
-
-void main()
-{
-    barrier();
-
-    int a = gl_MaxTessControlInputComponents +
-            gl_MaxTessControlOutputComponents +
-            gl_MaxTessControlTextureImageUnits +
-            gl_MaxTessControlUniformComponents +
-            gl_MaxTessControlTotalOutputComponents;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;
-    float cd = gl_in[1].gl_ClipDistance[2];
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    int iid = gl_InvocationID;
-
-    gl_out[gl_InvocationID].gl_Position = p;
-    gl_out[gl_InvocationID].gl_PointSize = ps;
-    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;
-
-    gl_TessLevelOuter[3] = 3.2;
-    gl_TessLevelInner[1] = 1.3;
-}

+ 0 - 35
3rdparty/bgfx/3rdparty/glslang/Test/150.tese

@@ -1,35 +0,0 @@
-#version 150
-
-#extension GL_ARB_tessellation_shader : enable
-
-layout(quads, cw) in;
-layout(fractional_odd_spacing) in;    
-layout(point_mode) in;
-patch in vec4 patchIn;
-
-void main()
-{
-    barrier(); // ERROR
-
-    int a = gl_MaxTessEvaluationInputComponents +
-            gl_MaxTessEvaluationOutputComponents +
-            gl_MaxTessEvaluationTextureImageUnits +
-            gl_MaxTessEvaluationUniformComponents +
-            gl_MaxTessPatchComponents +
-            gl_MaxPatchVertices +
-            gl_MaxTessGenLevel;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;
-    float cd = gl_in[1].gl_ClipDistance[2];
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    vec3 tc = gl_TessCoord;
-    float tlo = gl_TessLevelOuter[3];
-    float tli = gl_TessLevelInner[1];
-
-    gl_Position = p;
-    gl_PointSize = ps;
-    gl_ClipDistance[2] = cd;
-}

+ 0 - 29
3rdparty/bgfx/3rdparty/glslang/Test/150.vert

@@ -1,29 +0,0 @@
-#version 150 core
-
-#ifndef GL_core_profile
-#	error standard macro GL_core_profile not defined
-#endif
-
-in vec4 iv4;
-
-uniform float ps;
-
-invariant gl_Position;
-
-void main()
-{
-    gl_Position = iv4;
-    gl_PointSize = ps;
-    gl_ClipDistance[2] = iv4.x;
-    gl_ClipVertex = iv4;
-}
-
-out float gl_ClipDistance[4];
-
-uniform foob {
-    int a[];
-};
-int a[5]; // ERROR, resizing user-block member
-
-#line 3000
-#error line of this error should be 3001

+ 0 - 161
3rdparty/bgfx/3rdparty/glslang/Test/300.frag

@@ -1,161 +0,0 @@
-#version 300 es
-void nodef1(float f); // ERROR, no default precision
-uniform sampler2D s2D;
-uniform lowp sampler3D s3D;
-uniform samplerCube sCube;
-uniform lowp samplerCubeShadow sCubeShadow;
-uniform lowp sampler2DShadow s2DShadow;
-uniform lowp sampler2DArray s2DArray;
-uniform lowp sampler2DArrayShadow s2DArrayShadow;
-
-uniform lowp isampler2D is2D;
-uniform lowp isampler3D is3D;
-uniform lowp isamplerCube isCube;
-uniform lowp isampler2DArray is2DArray;
-
-uniform lowp usampler2D us2D;
-uniform lowp usampler3D us3D;
-uniform lowp usamplerCube usCube;
-uniform lowp usampler2DArray us2DArray;
-precision lowp float;
-in float c1D;
-in vec2  c2D;
-in vec3  c3D;
-smooth vec4  c4D;
-
-flat in int   ic1D;
-flat in ivec2 ic2D;
-flat in ivec3 ic3D;
-flat in ivec4 ic4D;
-noperspective in vec4 badv; // ERROR
-in sampler2D bads;          // ERROR
-precision lowp uint;        // ERROR
-
-struct s {
-    int i;
-    sampler2D s;
-};
-
-in s badout;               // ERROR, can't contain a sampler
-                           // ERROR, can't have int in struct without flat
-struct S2 {
-    vec3 c;
-    float f;
-};
-
-in S2 s2;
-
-out vec3 sc;
-out float sf;
-
-uniform sampler2D arrayedSampler[5];
-
-void main()
-{
-    float f;
-    vec4 v;
-    v = texture(s2D, c2D);
-    v = textureProj(s3D, c4D);
-    v = textureLod(s2DArray, c3D, 1.2);
-    f = textureOffset(s2DShadow, c3D, ic2D, c1D);  // ERROR, offset argument not constant
-    v = texelFetch(s3D, ic3D, ic1D);
-    v = texelFetchOffset(arrayedSampler[2], ic2D, 4, ic2D);   // ERROR, offset argument not constant
-    f = textureLodOffset(s2DShadow, c3D, c1D, ic2D);
-    v = textureProjLodOffset(s2D, c3D, c1D, ic2D);
-    v = textureGrad(sCube, c3D, c3D, c3D);
-    f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
-    v = textureProjGrad(s3D, c4D, c3D, c3D);
-    v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
-    v = texture(arrayedSampler[ic1D], c2D);                 // ERROR
-
-    ivec4 iv;
-    iv = texture(is2D, c2D);
-    iv = textureProjOffset(is2D, c4D, ic2D);
-    iv = textureProjLod(is2D, c3D, c1D);
-    iv = textureProjGrad(is2D, c3D, c2D, c2D);
-    iv = texture(is3D, c3D, 4.2);
-    iv = textureLod(isCube, c3D, c1D);
-    iv = texelFetch(is2DArray, ic3D, ic1D);
-
-    iv.xy = textureSize(sCubeShadow, 2);
-
-    float precise;
-    double boo;       // ERROR
-    dvec2 boo2;       // ERROR
-    dvec3 boo3;       // ERROR
-    dvec4 boo4;       // ERROR
-
-    f += gl_FragCoord.y;
-    gl_FragDepth = f;
-
-    sc = s2.c;
-    sf = s2.f;
-
-    sinh(c1D) +
-    cosh(c1D) * tanh(c2D);
-    asinh(c4D) + acosh(c4D);
-    atanh(c3D);
-}
-
-uniform multi {
-    int[2] a[3];      // ERROR
-    int[2][3] b;      // ERROR
-    int c[2][3];      // ERROR
-} multiInst[2][3];    // ERROR
-
-out vec4 colors[4];
-
-void foo()
-{
-    colors[2] = c4D;
-    colors[ic1D] = c4D;  // ERROR
-}
-
-uniform s st1;
-uniform s st2;
-
-void foo13(s inSt2)
-{
-    if (st1 == st2);  // ERROR
-    if (st1 != st2);  // ERROR
-    st1.s == st2.s;   // ERROR
-    inSt2 = st1;      // ERROR
-    inSt2 == st1;     // ERROR
-}
-
-void foo23()
-{
-    textureOffset(s2DShadow, c3D, ivec2(-8, 7), c1D);
-    textureOffset(s2DShadow, c3D, ivec2(-9, 8), c1D);
-}
-
-void foo324(void)
-{
-    float p = pow(3.2, 4.6);
-    p += sin(0.4);
-    p += distance(vec2(10.0, 11.0), vec2(13.0, 15.0)); // 5
-    p += dot(vec3(2,3,5), vec3(-2,-1,4));              // 13
-    vec3 c3 = cross(vec3(3,-3,1), vec3(4,9,2));        // (-15, -2, 39)
-    c3 += faceforward(vec3(1,2,3), vec3(2,3,5), vec3(-2,-1,4));     // (-1,-2,-3)
-    c3 += faceforward(vec3(1,2,3), vec3(-2,-3,-5), vec3(-2,-1,4));  // (1,2,3)
-    vec2 c2 = reflect(vec2(1,3), vec2(0,1));           // (1,-3)
-    c2 += refract(vec2(1,3), vec2(0,1), 1.0);          // (1,-3)
-    c2 += refract(vec2(1,3), vec2(0,1), 3.0);
-    c2 += refract(vec2(1,0.1), vec2(0,1), 5.0);        // (0,0)
-    mat3x2 m32 = outerProduct(vec2(2,3), vec3(5,7,11));// rows: (10, 14, 22), (15, 21, 33)
-}
-
-uniform mediump;       // ERROR
-
-layout(early_fragment_tests) in;  // ERROR
-
-#ifndef GL_FRAGMENT_PRECISION_HIGH
-#error missing GL_FRAGMENT_PRECISION_HIGH
-#endif
-
-invariant in;                // ERROR
-invariant in vec4;           // ERROR
-invariant in vec4 fooinv;    // ERROR
-
-float imageBuffer;    // ERROR, reserved
-float uimage2DRect;   // ERROR, reserved

+ 0 - 204
3rdparty/bgfx/3rdparty/glslang/Test/300.vert

@@ -1,204 +0,0 @@
-#version 300 es
-
-uniform mat4x3 m43;
-uniform mat3x3 m33;
-uniform mat4x4 m44;
-
-in vec3 v3;
-varying vec2 v2;               // ERROR, varying reserved
-in vec4 bad[10];               // ERROR, no arrayed inputs
-highp in vec4 badorder;        // ERROR, incorrect qualifier order
-out invariant vec4 badorder2;  // ERROR, incorrect qualifier order
-in centroid vec4 badorder4;    // ERROR, incorrect qualifier order
-out flat vec4 badorder3;       // ERROR, incorrect qualifier order
-void bar(in const float a);    // ERROR, incorrect qualifier order
-void bar2(highp in float b);   // ERROR, incorrect qualifier order
-smooth flat out vec4 rep;      // ERROR, replicating interpolation qualification
-centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification
-in uniform vec4 rep3;          // ERROR, replicating storage qualification
-
-struct S {
-    vec3 c;
-    float f;
-};
-
-out S s;
-
-void main()
-{
-    int id = gl_VertexID + gl_InstanceID;
-
-    int c0 = gl_MaxVertexAttribs;
-    int c1 = gl_MaxVertexUniformVectors;
-    int c2 = gl_MaxVertexOutputVectors;
-    int c3 = gl_MaxFragmentInputVectors;
-    int c4 = gl_MaxVertexTextureImageUnits;
-    int c5 = gl_MaxCombinedTextureImageUnits;
-    int c6 = gl_MaxTextureImageUnits;
-    int c7 = gl_MaxFragmentUniformVectors;
-    int c8 = gl_MaxDrawBuffers;
-    int c9 = gl_MinProgramTexelOffset;
-    int c10 = gl_MaxProgramTexelOffset;
-
-    mat3x4 tm = transpose(m43);
-    highp float dm = determinant(m44);
-    mat3x3 im = inverse(m33);
-
-    mat3x2 op = outerProduct(v2, v3);
-
-    gl_Position = m44[2];
-    gl_PointSize = v2.y;
-
-     s.c = v3;
-     s.f = dm;
-
-#ifdef GL_ES
-#error GL_ES is set
-#else
-#error GL_ES is not set
-#endif
-}
-
-float badsize[];    // ERROR
-float[] badsize2;   // ERROR
-uniform ub {
-    int a[];        // ERROR
-} ubInst[];         // ERROR
-void foo(int a[]);  // ERROR
-float okayA[] = float[](3.0f, 4.0F);  // Okay
-
-out vec3 newV;
-void newVFun()
-{
-    newV = v3;
-}
-
-invariant newV;  // ERROR, variable already used
-in vec4 invIn;
-invariant invIn; // ERROR, in v300
-out S s2;
-invariant s2;
-invariant out S s3;
-flat out int;
-
-uniform ub2 {
-    float f;
-} a;
-
-uniform ub2 {  // ERROR redeclaration of block name (same instance name)
-    float g;
-} a;
-
-uniform ub2 {  // ERROR redeclaration of block name (different instance name)
-    float f;
-} c;
-
-uniform ub2 {  // ERROR redeclaration of block name (no instance name)
-    float f123;
-};
-
-uniform ub3 {
-    bool b23;
-};
-
-uniform ub3 {  // ERROR redeclaration of block name (no instance name in first or declared)
-    bool b234;
-};
-
-precision lowp sampler3D;
-precision lowp sampler2DShadow;
-precision lowp sampler2DArrayShadow;
-
-uniform sampler2D s2D;
-uniform sampler3D s3D;
-uniform sampler2DShadow s2DS;
-uniform sampler2DArrayShadow s2DAS;
-in vec2 c2D;
-
-void foo23()
-{
-    ivec2 x1 = textureSize(s2D, 2);
-    textureSize(s2D);        // ERROR, no lod
-    ivec3 x3 = textureSize(s2DAS, -1);
-    textureSize(s2DAS);      // ERROR, no lod
-    vec4 x4 = texture(s2D, c2D);
-    texture(s2D, c2D, 0.2);  // ERROR, bias
-    vec4 x5 = textureProjOffset(s3D, vec4(0.2), ivec3(1));
-    textureProjOffset(s3D, vec4(0.2), ivec3(1), .03);  // ERROR, bias
-    float x6 = textureProjGradOffset(s2DS, invIn, vec2(4.2), vec2(5.3), ivec2(1));
-}
-
-int fgfg(float f, mediump int i);
-int fgfg(float f, highp int i);   // ERROR, precision qualifier difference
-
-int fgfgh(float f, const in mediump int i);
-int fgfgh(float f, in mediump int i);   // ERROR, precision qualifier difference
-
-void foo2349()
-{
-    float[] x = float[] (1.0, 2.0, 3.0);
-	float[] y = x;
-    float[3] z = x;
-    float[3] w;
-    w = y;
-}
-
-int[] foo213234();        // ERROR
-int foo234234(float[]);   // ERROR
-int foo234235(vec2[] v);  // ERROR
-precision highp float[2]; // ERROR
-
-int fffg(float f);
-int fffg(float f);
-
-int gggf(float f);
-int gggf(float f) { return 2; }
-int gggf(float f);
-
-int agggf(float f) { return 2; }
-int agggf(float f);
-
-out struct Ssss { float f; } ssss;
-
-uniform Bblock {
-   int a;
-} Binst;
-int Bfoo;
-
-layout(std140) Binst;    // ERROR
-layout(std140) Bblock;   // ERROR
-layout(std140) Bfoo;     // ERROR
-
-layout(std430) uniform B430 { int a; } B430i;     // ERROR
-
-struct SNA {
-    int a[];             // ERROR
-};
-
-void fooDeeparray()
-{
-    float[] x = float[] (1.0, 2.0, 3.0),
-            y = float[] (1.0, 2.0, 3.0, 4.0);
-    float xp[3], yp[4];
-    xp = x;
-    yp = y;
-    xp = y; // ERROR, wrong size
-    yp = x; // ERROR, wrong size
-}
-
-layout(num_views = 2) in; // ERROR, no extension
-
-void mwErr()
-{
-    gl_ViewID_OVR;   // ERROR, no extension
-}
-
-#extension GL_OVR_multiview : enable
-
-layout(num_views = 2) uniform float mwUniform; // ERROR, must be global
-layout(num_views = 2) in; // OK
-
-void mwOk()
-{
-    gl_ViewID_OVR;
-}

+ 0 - 76
3rdparty/bgfx/3rdparty/glslang/Test/300BuiltIns.frag

@@ -1,76 +0,0 @@
-#version 300 es
-
-int imax, imin;
-uint umax, umin;
-
-vec3 x, y;    // ERROR, needs default precision
-bvec3 bv;
-
-uint uy;
-uvec2 uv2c;
-uvec2 uv2y;
-uvec2 uv2x;
-uvec4 uv4y;
-
-ivec3 iv3a;
-ivec3 iv3b;
-
-ivec4 iv4a;
-ivec4 iv4b;
-
-float f;
-
-vec2 v2a, v2b;
-vec4 v4;
-
-void main()
-{
-    // 1.3 int
-    vec3 v = mix(x, y, bv);
-    ivec4 iv10 = abs(iv4a);
-    ivec4 iv11 = sign(iv4a);
-    ivec4 iv12 = min(iv4a, iv4b);
-    ivec4 iv13 = min(iv4a, imin);
-    uvec2 u = min(uv2x, uv2y);
-    uvec4 uv = min(uv4y, uy);
-    ivec3 iv14 = max(iv3a, iv3b);
-    ivec4 iv15 = max(iv4a, imax);
-    uvec2 u10 = max(uv2x, uv2y);
-    uvec2 u11 = max(uv2x, uy);
-    ivec4 iv16 = clamp(iv4a, iv4a, iv4b);
-    ivec4 iv17 = clamp(iv4a, imin, imax);
-    uvec2 u12 = clamp(uv2x, uv2y, uv2c);
-    uvec4 uv10 = clamp(uv4y, umin, umax);
-
-    // 1.3 float
-    vec3 modfOut;
-    vec3 v11 = modf(x, modfOut);
-
-    float t = trunc(f);
-    vec2 v12 = round(v2a);
-    vec2 v13 = roundEven(v2a);
-    bvec2 b10 = isnan(v2a);
-    bvec4 b11 = isinf(v4);
-
-    // 3.3 float
-    int i = floatBitsToInt(f);
-    uvec4 uv11 = floatBitsToUint(v4);
-    vec4 v14 = intBitsToFloat(iv4a);
-    vec2 v15 = uintBitsToFloat(uv2c);
-
-    // 4.0  pack
-    uint u19 = packSnorm2x16(v2a);
-    vec2 v20 = unpackSnorm2x16(uy);
-    uint u15 = packUnorm2x16(v2a);
-    vec2 v16 = unpackUnorm2x16(uy);
-    uint u17 = packHalf2x16(v2b);
-    vec2 v18 = unpackHalf2x16(uy);
-
-    // not present
-    noise2(v18);  // ERROR, not present
-
-    float t__;  // ERROR, no __ until revision 310
-
-      // ERROR, no __ until revision 310
-    #define __D
-}

+ 0 - 58
3rdparty/bgfx/3rdparty/glslang/Test/300block.frag

@@ -1,58 +0,0 @@
-#version 300 es
-
-precision mediump float;
-
-struct S {
-    vec4 u;
-    uvec4 v;
-    lowp isampler3D sampler;
-    vec3 w;
-    struct T1 {           // ERROR
-        int a;
-    } t;
-};
-
-uniform S s;
-
-uniform fooBlock {
-    uvec4 bv;
-    uniform mat2 bm2;
-    lowp isampler2D sampler;   // ERROR
-    struct T2 {                // ERROR
-        int a;
-    } t;
-    S fbs;                     // ERROR, contains a sampler
-};
-
-uniform barBlock {
-    uvec4 nbv;
-    int ni;
-} inst;
-
-uniform barBlockArray {
-    uvec4 nbv;
-    int ni;
-} insts[4];
-
-uniform unreferenced {
-    float f;
-    uint u;
-};
-
-void main()
-{
-    texture(s.sampler, vec3(inst.ni, bv.y, insts[2].nbv.z));
-    insts[s.v.x];         // ERROR
-    fooBlock;             // ERROR
-    mat4(s);              // ERROR
-    int insts;
-    float barBlock;
-    mat4(barBlock);
-    mat4(unreferenced);   // ERROR, bad type
-    ++s;                  // ERROR
-    inst - 1;             // ERROR
-    ++barBlock;
-    2 * barBlockArray;    // ERROR
-}
-
-int fooBlock;             // ERROR, redef.

+ 0 - 19
3rdparty/bgfx/3rdparty/glslang/Test/300layout.frag

@@ -1,19 +0,0 @@
-#version 300 es
-precision mediump float;
-in vec4 pos;
-layout (location = 2) in vec4 color;  // ERROR
-
-layout(location = 1) out vec4 c;
-layout(location = 3) out vec4 p;
-layout(location = 4) out vec4 q[2];
-
-void main()
-{
-    c = color;
-    p = pos;
-    q[1] = pos;
-}
-
-layout(location = 40) out float ca[4];  // ERROR, overlap, ERROR too big
-layout(location = 41) out float cb[2];  // ERROR, overlap, ERROR too big
-layout(location = 39) out float cc[6];  // ERROR, overlap, ERROR too big

+ 0 - 57
3rdparty/bgfx/3rdparty/glslang/Test/300layout.vert

@@ -1,57 +0,0 @@
-#version 300 es
-
-struct s { vec4 v; };
-
-layout(location = 7) in vec3 c;
-layout(LocatioN = 3) in vec4 p;
-layout(LocatioN = 9) in vec4 q[4]; // ERROR, no array
-layout(LocatioN = 10) in s r[4];   // ERROR, no struct, ERROR, location overlap
-out vec4 pos;
-out vec3 color;
-
-layout(shared, column_major) uniform mat4 badm4; // ERROR
-layout(shared, column_major, row_major) uniform; // default is now shared and row_major
-
-layout(std140) uniform Transform { // layout of this block is std140
-    mat4 M1; // row_major
-    layout(column_major) mat4 M2; // column major
-    mat3 N1; // row_major
-    centroid float badf;  // ERROR
-    in float badg;        // ERROR
-    layout(std140) float bad1;
-    layout(shared) float bad2;
-    layout(packed) float bad3;
-} tblock;
-
-uniform T2 { // layout of this block is shared
-    bool b;
-    mat4 t2m;
-};
-
-layout(column_major) uniform T3 { // shared and column_major
-    mat4 M3; // column_major
-    layout(row_major) mat4 M4; // row major
-    mat3 N2; // column_major
-    int b;  // ERROR, redefinition (needs to be last member of block for testing, following members are skipped)
-};
-
-out badout {  // ERROR
-    float f;
-};
-
-layout (location = 10) out vec4 badoutA;  // ERROR
-
-void main()
-{
-    pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m);
-    color = c * tblock.N1;
-}
-
-shared vec4 compute_only;  // ERROR
-
-layout(packed) uniform;
-
-layout(packed) uniform float aoeuntaoeu;  // ERROR, packed on variable
-
-layout(location = 40) in float cd;
-layout(location = 37) in mat4x3 ce; // ERROR, overlap

+ 0 - 8
3rdparty/bgfx/3rdparty/glslang/Test/300link.frag

@@ -1,8 +0,0 @@
-#version 300 es
-
-precision highp float;
-
-out vec4 color1;
-out vec4 color2;
-
-void main() {}

+ 0 - 11
3rdparty/bgfx/3rdparty/glslang/Test/300link2.frag

@@ -1,11 +0,0 @@
-#version 300 es
-precision mediump float;
-in vec4 pos;
-
-layout(location = 1) out vec4 c;
-layout(location = 5) out vec4 p;
-layout(location = 9) out vec4 q[2];
-
-void main()
-{
-}

+ 0 - 7
3rdparty/bgfx/3rdparty/glslang/Test/300link3.frag

@@ -1,7 +0,0 @@
-#version 300 es
-
-precision highp float;
-
-out vec4 color1;
-
-void main() {}

+ 0 - 135
3rdparty/bgfx/3rdparty/glslang/Test/300operations.frag

@@ -1,135 +0,0 @@
-#version 300 es
-
-uniform block {
-    mediump float f;
-} instanceName;
-
-struct S {
-    int i;
-} s;
-
-float a[5];
-
-void main()
-{
-    bool b;
-    float f;
-    int i;
-    uint u;
-    bvec3 b3;
-    vec3 v3;
-    ivec3 iv3;
-    uvec3 uv3;
-    vec4 v4;
-    ivec4 iv4;
-    uvec4 uv4;
-    mat2 m2;
-    mat4 m4;
-
-    // These are all errors:
-    instanceName + instanceName;
-    s + s;
-    i + f;
-    u + f;
-    u + i;
-    iv3 *= iv4;
-    iv4 / uv4;
-    i - v3;
-    iv3 + uv3;
-    a * a;
-    b / b;
-
-    f % f;
-    i % f;
-    f % u;
-    instanceName++;
-    ++s;
-    a--;
-    ++b3;
-
-    iv3 < uv3;
-    m2 > m2;
-    m2 != m4;
-    i >= u;
-    a <= a;
-    b > b;
-
-    b && b3;
-    b3 ^^ b3;
-    b3 || b;
-    i && i;
-    u || u;
-    m2 ^^ m2;
-
-    !u;
-    !i;
-    !m2;
-    !v3;
-    !a;
-
-    ~f;
-    ~m4;
-    ~v3;
-    ~a;
-    ~instanceName;
-
-    i << iv3;
-    u << uv3;
-    i >> f;
-    f >> i;
-    m4 >> i;
-    a >> u;
-    iv3 >> iv4;
-
-    i & u;    
-    u &= uv3;
-    i | uv3;
-    u & f;
-    m2 | m2;
-    s ^ s;
-    (f = f) = f;
-
-    // These are all okay:
-    f * v4;
-    u + u;
-    uv4 / u;
-    iv3 -= iv3;
-    
-    i %= 3;
-    uv3 % 4u;
-    --m2;
-    iv4++;
-
-    m4 != m4;
-    m2 == m2;
-    i <= i;
-    a == a;
-    s != s;
-
-    b && b;
-    b || b;
-    b ^^ b;
-
-    !b, uv3;
-
-    ~i;
-    ~u;
-    ~uv3;
-    ~iv3;
-
-    uv3 <<= i;
-    i >> i;
-    u << u;
-    iv3 >> iv3;
-
-    i & i;
-    u | u;
-    iv3 ^ iv3;
-    u & uv3;
-    uv3 | u;
-    uv3 &= u;
-    int arr[0x222 & 0xf];
-    arr[1]; // size 2
-    int arr2[(uvec2(0, 0x2) | 0x1u).y];
-    arr2[2]; // size 3
-}

+ 0 - 41
3rdparty/bgfx/3rdparty/glslang/Test/300samplerExternal.frag

@@ -1,41 +0,0 @@
-#version 300 es
-
-#extension GL_OES_EGL_image_external_essl3 : enable
-
-uniform samplerExternalOES sExt;
-precision mediump samplerExternalOES;
-uniform samplerExternalOES mediumExt;
-uniform highp samplerExternalOES highExt;
-
-void main()
-{
-    texture2D(sExt, vec2(0.2));  // ERROR
-    texture2D(mediumExt, vec2(0.2));  // ERROR
-    texture2D(highExt, vec2(0.2));  // ERROR
-    texture2DProj(sExt, vec3(0.3));  // ERROR
-    texture2DProj(sExt, vec4(0.3));  // ERROR
-
-    int lod = 0;
-    highp float bias = 0.01;
-    textureSize(sExt, lod);
-    texture(sExt, vec2(0.2));
-    texture(sExt, vec2(0.2), bias);
-    textureProj(sExt, vec3(0.2));
-    textureProj(sExt, vec3(0.2), bias);
-    textureProj(sExt, vec4(0.2));
-    textureProj(sExt, vec4(0.2), bias);
-    texelFetch(sExt, ivec2(4), lod);
-
-    texture3D(sExt, vec3(0.3));  // ERROR
-    texture2DProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-    texture(sExt, vec3(0.3));  // ERROR
-    textureProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-}
-
-#extension GL_OES_EGL_image_external_essl3 : disable
-
-#extension GL_OES_EGL_image_external : enable
-uniform samplerExternalOES badExt;  // ERROR
-#extension GL_OES_EGL_image_external : disable
-
-uniform samplerExternalOES badExt;  // ERROR

+ 0 - 38
3rdparty/bgfx/3rdparty/glslang/Test/300samplerExternalYUV.frag

@@ -1,38 +0,0 @@
-#version 300 es
-
-#extension GL_EXT_YUV_target : enable
-
-uniform __samplerExternal2DY2YEXT sExt;
-precision mediump __samplerExternal2DY2YEXT;
-uniform __samplerExternal2DY2YEXT mediumExt;
-uniform highp __samplerExternal2DY2YEXT highExt;
-
-void main()
-{
-    texture2D(sExt, vec2(0.2));  // ERROR
-    texture2D(mediumExt, vec2(0.2));  // ERROR
-    texture2D(highExt, vec2(0.2));  // ERROR
-    texture2DProj(sExt, vec3(0.3));  // ERROR
-    texture2DProj(sExt, vec4(0.3));  // ERROR
-
-    int lod = 0;
-    highp float bias = 0.01;
-    textureSize(sExt, lod);
-    texture(sExt, vec2(0.2));
-    texture(sExt, vec2(0.2), bias);
-    textureProj(sExt, vec3(0.2));
-    textureProj(sExt, vec3(0.2), bias);
-    textureProj(sExt, vec4(0.2));
-    textureProj(sExt, vec4(0.2), bias);
-    texelFetch(sExt, ivec2(4), lod);
-
-    texture3D(sExt, vec3(0.3));  // ERROR
-    texture2DProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-    texture(sExt, vec3(0.3));  // ERROR
-    textureProjLod(sExt, vec3(0.3), 0.3);  // ERROR
-}
-
-#extension GL_EXT_YUV_target : disable
-
-uniform __samplerExternal2DY2YEXT badExt;  // ERROR
-

+ 0 - 74
3rdparty/bgfx/3rdparty/glslang/Test/300scope.vert

@@ -1,74 +0,0 @@
-#version 300 es
-
-int f(int a, int b, int c)
-{
-	int a = b;  // ERROR, redefinition
-
-    {
-		float a = float(a) + 1.0;
-    }
-
-	return a;
-}
-
-int f(int a, int b, int c);  // okay to redeclare
-
-bool b;
-float b(int a);      // ERROR: redefinition
-
-float c(int a);
-bool c;              // ERROR: redefinition
-
-float f;             // ERROR: redefinition
-float tan;           // ERROR: redefines built-in function
-float sin(float x);  // ERROR: can't redefine built-in functions
-float cos(float x)   // ERROR: can't redefine built-in functions
-{
-	return 1.0;
-}
-bool radians(bool x) // ERROR: can't overload built-in functions
-{
-    return true;
-}
-
-invariant gl_Position;
-
-void main()
-{
-    int g();    // ERROR: no local function declarations
-	g();
-
-    float sin;  // okay
-	sin;
-    sin(0.7);  // ERROR, use of hidden function
-    f(1,2,3);
-
-    float f;    // hides f()
-    f = 3.0;
-
-    gl_Position = vec4(f);
-
-    for (int f = 0; f < 10; ++f)
-        ++f;
-
-    int x = 1;
-    { 
-        float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2
-        int z = z; // ERROR: z not previously defined.
-    }
-    {
-        int x = x; // x is initialized to '1'
-    }
-
-    struct S 
-    { 
-        int x; 
-    };
-    {
-        S S = S(0); // 'S' is only visible as a struct and constructor 
-        S.x;        // 'S' is now visible as a variable
-    }
-
-    int degrees;
-    degrees(3.2);  // ERROR, use of hidden built-in function
-}

+ 0 - 256
3rdparty/bgfx/3rdparty/glslang/Test/310.comp

@@ -1,256 +0,0 @@
-#version 310 es
-
-layout(local_size_x = 2) in;
-layout(local_size_x = 16) in;     // ERROR, changing
-layout(local_size_z = 4096) in;   // ERROR, too large
-layout(local_size_x = 2) in;
-layout(local_size_y = 0) in;      // ERROR, 0 not allowed
-const int total = gl_MaxComputeWorkGroupCount.y 
-                + gl_MaxComputeUniformComponents
-                + gl_MaxComputeTextureImageUnits
-                + gl_MaxComputeImageUniforms
-                + gl_MaxComputeAtomicCounters
-                + gl_MaxComputeAtomicCounterBuffers;
-
-buffer ShaderStorageBlock
-{
-    int value;
-    float values[];
-};
-
-buffer InvalidShaderStorageBlock
-{
-    float values[];  // ERROR
-    int value;
-} invalid;
-
-void main()
-{
-    barrier();
-    memoryBarrier();
-    memoryBarrierAtomicCounter();
-    memoryBarrierBuffer();
-    memoryBarrierShared();
-    memoryBarrierImage();
-    groupMemoryBarrier();
-    value = int(values[gl_LocalInvocationIndex]);
-}
-
-layout(location = 2) in vec3 v3;      // ERROR
-in float f;                           // ERROR
-out float fo;                         // ERROR
-
-shared vec4 s;
-layout(location = 2) shared vec4 sl;  // ERROR
-shared float fs = 4.2;                // ERROR
-
-layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out;  // ERROR
-
-int arrX[gl_WorkGroupSize.x];
-int arrY[gl_WorkGroupSize.y];
-int arrZ[gl_WorkGroupSize.z];
-
-readonly buffer roblock
-{
-    int value;
-    float values[];
-} ro;
-
-void foo()
-{
-    ro.values[2] = 4.7;        // ERROR, readonly
-    ro.values.length();
-    ++s;
-}
-
-buffer vec4 v;  // ERROR
-
-uniform usampler2D us2dbad;  // ERROR, default precision
-
-precision highp usampler2D;
-precision highp iimage2DArray;
-precision highp iimage2D;
-
-uniform usampler2D us2d;
-
-uniform iimage2DArray ii2dabad;  // ERROR, not writeonly
-uniform writeonly iimage2DArray ii2da;
-
-layout(r32i) uniform iimage2D iimg2D;
-layout(rgba32i) uniform readonly iimage2D iimg2Drgba;
-layout(rgba32f) uniform readonly image2D img2Drgba;   // ERROR, no default
-layout(r32ui) uniform uimage2D uimg2D;                // ERROR, no default
-
-void qux()
-{
-    int i = 4;
-    imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310
-    imageAtomicAdd(uimg2D, ivec2(i,i), uint(i));  // ERROR no longer in 310
-    imageAtomicMin(iimg2Drgba, ivec2(i,i), i);    // ERROR no longer in 310  // ERROR iimg2Drgba does not have r32i layout
-    imageAtomicMax(img2Drgba, ivec2(i,i), i);     // ERROR no longer in 310  // ERROR img2Drgba is not integer image
-    ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
-    imageStore(ii2da, ivec3(i,i,i), ivec4(0));
-    imageLoad(img2Drgba, ivec2(i,i));
-    imageLoad(ii2da, ivec3(i,i,i));       // ERROR, drops writeonly
-}
-
-volatile float vol; // ERROR, not an image
-readonly int vol2;  // ERROR, not an image
-
-void passr(coherent readonly iimage2D image)
-{
-}
-
-layout(r32i) coherent readonly uniform iimage2D qualim1;
-layout(r32i) coherent restrict readonly uniform iimage2D qualim2;
-
-void passrc()
-{
-    passr(qualim1);   // ERROR, changing formats
-    passr(qualim2);   // ERROR, drops restrict, ERROR, changing formats
-    passr(iimg2D);    // ERROR, changing formats
-}
-
-highp layout(rg8i)     uniform readonly uimage2D i1bad; // ERROR, type mismatch
-highp layout(rgba32i)  uniform readonly image2D i2bad;  // ERROR, type mismatch
-highp layout(rgba32f)  uniform readonly uimage2D i3bad; // ERROR, type mismatch
-layout(r8_snorm) uniform readonly iimage2D i4bad; // ERROR, type mismatch
-layout(rgba32ui) uniform readonly iimage2D i5bad; // ERROR, type mismatch
-layout(r8ui)     uniform readonly iimage2D i6bad; // ERROR, type mismatch
-
-layout(binding = 0) uniform atomic_uint counter;
-
-uint func(atomic_uint c)
-{
-    return atomicCounterIncrement(c);
-}
-
-uint func2(out atomic_uint c) // ERROR, output
-{
-    return counter;           // ERROR, type mismatch
-    return atomicCounter(counter);
-}
-
-void mainAC()
-{
-     atomic_uint non_uniform_counter; // ERROR
-     uint val = atomicCounter(counter);
-     atomicCounterDecrement(counter);
-}
-
-layout(binding = 1) uniform mediump atomic_uint counterBad;  // ERROR, not highp
-
-layout(binding = 2, offset = 4) uniform atomic_uint countArr[4];
-uniform int i;
-
-void opac()
-{
-    int a[3];
-    a[counter];         // ERROR, non-integer
-    countArr[2];
-    countArr[i];
-}
-
-shared int atomi;
-shared uint atomu;
-
-void atoms()
-{
-    int origi = atomicAdd(atomi, 3);
-    uint origu = atomicAnd(atomu, 7u);
-    origi = atomicExchange(atomi, 4);
-    origu = atomicCompSwap(atomu, 10u, 8u);
-}
-
-precision highp atomic_uint;
-precision lowp atomic_uint;   // ERROR
-
-precise int pfoo;  // ERROR, reserved
-
-dmat2x4 dm;                     // ERROR
-uniform samplerCubeArray sca;   // ERROR
-uniform iimage2DRect i2dr;      // ERROR
-highp uniform image2DMS i2dms;  // ERROR
-uniform uimage2DMSArray u2dmsa; // ERROR
-
-highp layout(r32f)  coherent volatile restrict readonly writeonly uniform  image2D okay1;
-      layout(r32i)  coherent volatile restrict readonly           uniform iimage2D okay2;
-highp layout(r32ui) coherent volatile restrict          writeonly uniform uimage2D okay3;
-highp layout(r32f)  coherent volatile restrict                    uniform  image2D okay4;
- 
-highp layout(rgba32f)  coherent volatile restrict                 uniform  image2D badQ1;  // ERROR, bad qualifiers
-      layout(rgba8i)   coherent volatile restrict                 uniform iimage2D badQ2;  // ERROR, bad qualifiers
-highp layout(rgba16ui) coherent volatile restrict                 uniform uimage2D badQ3;  // ERROR, bad qualifiers
-
-writeonly buffer woblock
-{
-    int value;
-    float values[];
-} wo;
-
-void foowo()
-{
-    float g;
-    g = wo.values[2];            // ERROR, writeonly
-    float f = wo.values[2];      // ERROR, writeonly
-    ++wo.values[2];              // ERROR, writeonly
-    wo.values[2]--;              // ERROR, writeonly
-    f + wo.values[2];            // ERROR, writeonly
-    wo.values[2] - f;            // ERROR, writeonly
-    bool b;
-    b ? f : wo.values[2];        // ERROR, writeonly
-    b ? wo.values[2] : f;        // ERROR, writeonly
-    if (f == wo.values[2])       // ERROR, writeonly
-        ++f;
-    if (f >= wo.values[2])       // ERROR, writeonly
-        ++f;
-    f = vec3(wo.values[2]).x;    // ERROR, writeonly
-    ~wo.value;                   // ERROR, writeonly
-    wo.values[2] = 3.4;
-}
-
-buffer multioblock
-{
-    readonly int value;
-    writeonly float values[];
-} multio;
-
-void foomultio()
-{
-    float g;
-    g = wo.values[2];            // ERROR, writeonly
-    ~wo.value;
-    wo.values[2] = 3.4;
-    wo.value = 2;                // ERROR, readonly
-}
-
-in inb {     // ERROR
-    int a;
-} inbi;
-
-out outb {     // ERROR
-    int a;
-} outbi;
-
-float t__;  // ERROR, no __ until revision 310
-
-    // ERROR, no __ until revision 310
-#define __D
-
-shared vec4 arr[2][3][4];
-
-void devi()
-{
-    gl_DeviceIndex; // ERROR, no extension
-    gl_ViewIndex;   // ERROR, never this stage
-}
-
-#ifdef GL_EXT_device_group
-#extension GL_EXT_device_group : enable
-#endif
-
-void devie()
-{
-    gl_DeviceIndex;
-    gl_ViewIndex;   // ERROR, never this stage
-}

+ 0 - 451
3rdparty/bgfx/3rdparty/glslang/Test/310.frag

@@ -1,451 +0,0 @@
-#version 310 es
-highp float nodef3(float); // ERROR, no default precision
-precision mediump float;
-precision highp usampler2D;
-precision highp sampler2D;
-precision highp isampler2DArray;
-
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, not supported
-
-layout(location = 2) in vec3 v3;
-layout(location = 2) in mat4 yi;  // ERROR, locations conflict with xi
-
-uniform sampler2D arrayedSampler[5];
-uniform usampler2D usamp2d;
-uniform usampler2DRect samp2dr;      // ERROR, reserved
-uniform isampler2DArray isamp2DA;
-
-in vec2 c2D;
-uniform int i;
-
-void main()
-{
-    vec4 v = texture(arrayedSampler[i], c2D);  // ERROR
-
-    ivec2 offsets[4];
-    const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0));
-    uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2);  // ERROR, not supported
-    vec4 v4 = textureGather(arrayedSampler[0], c2D);
-    ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3);
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i);  // ERROR, last argument not const
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4);  // ERROR, last argument out of range
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2);
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(0.5));
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i));     // ERROR, offset not constant
-}
-
-out vec4 outp;
-void foo23()
-{
-    const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16));
-
-    textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(c2D));     // ERROR, offset not constant
-    textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[1]);
-    textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[2]);     // ERROR, offset out of range
-    textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range
-
-    if (gl_HelperInvocation)
-        ++outp;
-
-    int sum = gl_MaxVertexImageUniforms +
-              gl_MaxFragmentImageUniforms +
-              gl_MaxComputeImageUniforms +
-              gl_MaxCombinedImageUniforms +
-              gl_MaxCombinedShaderOutputResources;
-
-    bool b1, b2, b3, b;
-
-    b1 = mix(b2, b3, b);
-    uvec3 um3 = mix(uvec3(i), uvec3(i), bvec3(b));
-    ivec4 im4 = mix(ivec4(i), ivec4(i), bvec4(b));
-    1 << mix(1u, 1u, false);  // does not require folding
-}
-layout(binding=3) uniform sampler2D s1;
-layout(binding=3) uniform sampler2D s2; // ERROR: overlapping bindings?  Don't see that in the 310 spec.
-highp layout(binding=2) uniform writeonly image2D      i2D;
-      layout(binding=4) uniform readonly  image3D      i3D;    // ERROR, no default precision
-      layout(binding=5) uniform           imageCube    iCube;  // ERROR, no default precision
-      layout(binding=6) uniform           image2DArray i2DA;   // ERROR, no default precision
-      layout(binding=6) uniform coherent volatile restrict image2D i2Dqualified;    // ERROR, no default precision
-
-layout(binding = 1) uniform bb {
-    int foo;
-    layout(binding = 2) float f;     // ERROR
-} bbi;
-
-in centroid vec4 centroidIn;
-layout(location = 200000) uniform vec4 bigl;  // ERROR, location too big
-
-layout(early_fragment_tests) in;
-
-layout(location = 40) out vec4 bigout1;  // ERROR, too big
-layout(location = 40) out vec4 bigout2;  // ERROR, overlap
-layout(location = -2) out vec4 neg;      // ERROR, negative
-
-layout(std430) buffer b430 {
-    int i;
-} b430i;
-
-layout(shared) uniform bshar {
-    int i;
-} bshari;
-
-in smooth vec4 smoothIn;
-in flat int flatIn;
-
-uniform sampler2DMS s2dms;  // ERROR, no default precision qualifier
-
-void foots()
-{
-    highp ivec2 v2 = textureSize(s1, 2);
-    highp ivec3 v3 = textureSize(isamp2DA, 3);
-    v2 = textureSize(s2dms);
-    v2 = imageSize(i2D);
-    v3 = imageSize(i3D);
-    v2 = imageSize(iCube);
-    v3 = imageSize(i2DA);
-    v2 = imageSize(i2Dqualified);
-}
-
-out bool bout;          // ERROR
-highp out image2D imageOut;   // ERROR
-out mat2x3 mout;        // ERROR
-
-in bool inb;         // ERROR
-in sampler2D ino;    // ERROR
-in float ina[4];
-in float inaa[4][2]; // ERROR
-struct S { float f; };
-in S ins;
-in S[4] inasa;       // ERROR
-in S insa[4];        // ERROR
-struct SA { float f[4]; };
-in SA inSA;          // ERROR
-struct SS { float f; S s; };
-in SS inSS;          // ERROR
-
-#ifndef GL_EXT_shader_io_blocks
-#error GL_EXT_shader_io_blocks not defined
-#endif
-
-#extension GL_EXT_shader_io_blocks : enable
-
-out outbname { int a; } outbinst;   // ERROR, not out block in fragment shader
-
-in inbname {
-    int a;
-    vec4 v;
-    struct { int b; } s;     // ERROR, nested struct definition
-} inbinst;
-
-in inbname2 {
-    layout(location = 12) int aAnon;
-    layout(location = 13) centroid in vec4 vAnon;
-};
-
-in layout(location = 13) vec4 aliased; // ERROR, aliased
-
-in inbname2 {                // ERROR, reuse of block name
-    int aAnon;
-    centroid in vec4 vAnon;
-};
-
-in badmember {               // ERROR, aAnon already in global scope
-    int aAnon;
-};
-
-int inbname;                 // ERROR, redefinition of block name
-
-vec4 vAnon;                  // ERROR, anon in global scope; redefinition
-
-in arrayed {
-    float f;
-} arrayedInst[4];
-
-void fooIO()
-{
-    vec4 v = inbinst.v + vAnon;
-    v *= arrayedInst[2].f;
-    v *= arrayedInst[i].f;
-}
-
-in vec4 gl_FragCoord;
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, non-ES
-
-layout(early_fragment_tests) in;
-out float gl_FragDepth;
-layout(depth_any) out float gl_FragDepth;  // ERROR, non-ES
-
-void foo_IO()
-{
-    gl_FragDepth = 0.2;  // ERROR, early_fragment_tests declared
-    gl_Layer;            // ERROR, not present
-    gl_PrimitiveID;      // ERROR, not present
-    bool f = gl_FrontFacing;
-}
-
-out float gl_FragDepth;
-
-#extension GL_OES_geometry_shader : enable
-
-void foo_GS()
-{
-    highp int l = gl_Layer;
-    highp int p = gl_PrimitiveID;
-}
-
-in vec2 inf, ing;
-uniform ivec2 offsets[4];
-uniform sampler2D sArray[4];
-uniform int sIndex;
-layout(binding = 0) uniform atomic_uint auArray[2];
-uniform ubName { int i; } ubInst[4];
-buffer bbName { int i; } bbInst[4];
-highp uniform writeonly image2D iArray[5];
-const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));
-
-void pfooBad()
-{
-    precise vec2 h;                                            // ERROR reserved
-    h = fma(inf, ing, h);                                      // ERROR, not available
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));     // ERROR, offset not constant
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);  // ERROR, not available
-}
-
-#extension GL_OES_gpu_shader5 : enable
-
-void pfoo()
-{
-    precise vec2 h;
-    h = fma(inf, ing, h);
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);
-    textureGatherOffsets(sArray[0], vec2(0.1), offsets);       // ERROR, offset not constant
-}
-
-#extension GL_EXT_texture_cube_map_array : enable
-
-precision highp imageCubeArray        ;
-precision highp iimageCubeArray       ;
-precision highp uimageCubeArray       ;
-
-precision highp samplerCubeArray      ;
-precision highp samplerCubeArrayShadow;
-precision highp isamplerCubeArray     ;
-precision highp usamplerCubeArray     ;
-
-uniform writeonly imageCubeArray  CA1;
-uniform writeonly iimageCubeArray CA2;
-uniform writeonly uimageCubeArray CA3;
-
-#ifdef GL_EXT_texture_cube_map_array
-uniform samplerCubeArray          CA4;
-uniform samplerCubeArrayShadow    CA5;
-uniform isamplerCubeArray         CA6;
-uniform usamplerCubeArray         CA7;
-#endif
-
-void CAT()
-{
-    highp vec4 b4 = texture(CA4, vec4(0.5), 0.24);
-    highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26);
-    highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27);
-}
-
-void badSample()
-{
-    lowp     int  a1 = gl_SampleID;         // ERROR, need extension
-    mediump  vec2 a2 = gl_SamplePosition;   // ERROR, need extension
-    highp    int  a3 = gl_SampleMaskIn[0];  // ERROR, need extension
-    gl_SampleMask[0] = a3;                  // ERROR, need extension
-    mediump int n = gl_NumSamples;          // ERROR, need extension
-}
-
-#ifdef GL_OES_sample_variables
-#extension GL_OES_sample_variables : enable
-#endif
-
-void goodSample()
-{
-    lowp     int  a1 = gl_SampleID;       
-    mediump  vec2 a2 = gl_SamplePosition; 
-    highp    int  a3 = gl_SampleMaskIn[0];
-    gl_SampleMask[0] = a3;
-    mediump int n1 = gl_MaxSamples;
-    mediump int n2 = gl_NumSamples;
-}
-
-uniform layout(r32f)  highp  image2D im2Df;
-uniform layout(r32ui) highp uimage2D im2Du;
-uniform layout(r32i)  highp iimage2D im2Di;
-uniform ivec2 P;
-
-void badImageAtom()
-{
-    float datf;
-    int dati;
-    uint datu;
-
-    imageAtomicAdd(     im2Di, P, dati);        // ERROR, need extension
-    imageAtomicAdd(     im2Du, P, datu);        // ERROR, need extension
-    imageAtomicMin(     im2Di, P, dati);        // ERROR, need extension
-    imageAtomicMin(     im2Du, P, datu);        // ERROR, need extension
-    imageAtomicMax(     im2Di, P, dati);        // ERROR, need extension
-    imageAtomicMax(     im2Du, P, datu);        // ERROR, need extension
-    imageAtomicAnd(     im2Di, P, dati);        // ERROR, need extension
-    imageAtomicAnd(     im2Du, P, datu);        // ERROR, need extension
-    imageAtomicOr(      im2Di, P, dati);        // ERROR, need extension
-    imageAtomicOr(      im2Du, P, datu);        // ERROR, need extension
-    imageAtomicXor(     im2Di, P, dati);        // ERROR, need extension
-    imageAtomicXor(     im2Du, P, datu);        // ERROR, need extension
-    imageAtomicExchange(im2Di, P, dati);        // ERROR, need extension
-    imageAtomicExchange(im2Du, P, datu);        // ERROR, need extension
-    imageAtomicExchange(im2Df, P, datf);        // ERROR, need extension
-    imageAtomicCompSwap(im2Di, P,  3, dati);    // ERROR, need extension
-    imageAtomicCompSwap(im2Du, P, 5u, datu);    // ERROR, need extension
-}
-
-#ifdef GL_OES_shader_image_atomic 
-#extension GL_OES_shader_image_atomic : enable
-#endif
-
-uniform layout(rgba32f)  highp  image2D badIm2Df;  // ERROR, needs readonly or writeonly
-uniform layout(rgba8ui) highp uimage2D badIm2Du;   // ERROR, needs readonly or writeonly
-uniform layout(rgba16i)  highp iimage2D badIm2Di;  // ERROR, needs readonly or writeonly
-
-void goodImageAtom()
-{
-    float datf;
-    int dati;
-    uint datu;
-
-    imageAtomicAdd(     im2Di, P, dati);
-    imageAtomicAdd(     im2Du, P, datu);
-    imageAtomicMin(     im2Di, P, dati);
-    imageAtomicMin(     im2Du, P, datu);
-    imageAtomicMax(     im2Di, P, dati);
-    imageAtomicMax(     im2Du, P, datu);
-    imageAtomicAnd(     im2Di, P, dati);
-    imageAtomicAnd(     im2Du, P, datu);
-    imageAtomicOr(      im2Di, P, dati);
-    imageAtomicOr(      im2Du, P, datu);
-    imageAtomicXor(     im2Di, P, dati);
-    imageAtomicXor(     im2Du, P, datu);
-    imageAtomicExchange(im2Di, P, dati);
-    imageAtomicExchange(im2Du, P, datu);
-    imageAtomicExchange(im2Df, P, datf);
-    imageAtomicCompSwap(im2Di, P,  3, dati);
-    imageAtomicCompSwap(im2Du, P, 5u, datu);
-
-    imageAtomicMax(badIm2Di, P, dati);      // ERROR, not an allowed layout() on the image
-    imageAtomicMax(badIm2Du, P, datu);      // ERROR, not an allowed layout() on the image
-    imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image
-}
-
-sample in vec4 colorSampInBad;       // ERROR, reserved
-centroid out vec4 colorCentroidBad;  // ERROR
-flat out vec4 colorBadFlat;          // ERROR
-smooth out vec4 colorBadSmooth;      // ERROR
-noperspective out vec4 colorBadNo;   // ERROR
-flat centroid in vec2 colorfc;
-in float scalarIn;
-
-void badInterp()
-{
-    interpolateAtCentroid(colorfc);             // ERROR, need extension
-    interpolateAtSample(colorfc, 1);            // ERROR, need extension
-    interpolateAtOffset(colorfc, vec2(0.2));    // ERROR, need extension
-}
-
-#if defined GL_OES_shader_multisample_interpolation
-#extension GL_OES_shader_multisample_interpolation : enable
-#endif
-
-sample in vec4 colorSampIn;
-sample out vec4 colorSampleBad;     // ERROR
-flat sample in vec4 colorfsi;
-sample in vec3 sampInArray[4];
-
-void interp()
-{
-    float res;
-    vec2 res2;
-    vec3 res3;
-    vec4 res4;
-
-    res2 = interpolateAtCentroid(colorfc);
-    res4 = interpolateAtCentroid(colorSampIn);
-    res4 = interpolateAtCentroid(colorfsi);
-    res  = interpolateAtCentroid(scalarIn);
-    res3 = interpolateAtCentroid(sampInArray);         // ERROR
-    res3 = interpolateAtCentroid(sampInArray[2]);
-    res2 = interpolateAtCentroid(sampInArray[2].xy);   // ERROR
-
-    res3 = interpolateAtSample(sampInArray, 1);        // ERROR
-    res3 = interpolateAtSample(sampInArray[i], 0);
-    res2 = interpolateAtSample(sampInArray[2].xy, 2);  // ERROR
-    res  = interpolateAtSample(scalarIn, 1);
-
-    res3 = interpolateAtOffset(sampInArray, vec2(0.2));         // ERROR
-    res3 = interpolateAtOffset(sampInArray[2], vec2(0.2));
-    res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2));   // ERROR, no swizzle
-    res  = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference
-    res  = interpolateAtOffset(scalarIn, vec2(0.2));
-
-    float f;
-    res  = interpolateAtCentroid(f);           // ERROR, not interpolant
-    res4 = interpolateAtSample(outp, 0);       // ERROR, not interpolant
-}
-
-layout(blend_support_softlight) out;           // ERROR, need extension
-
-#ifdef GL_KHR_blend_equation_advanced
-#extension GL_KHR_blend_equation_advanced : enable
-#endif
-
-layout(blend_support_multiply) out;
-layout(blend_support_screen) out;
-layout(blend_support_overlay) out;
-layout(blend_support_darken, blend_support_lighten) out;
-layout(blend_support_colordodge) layout(blend_support_colorburn) out;
-layout(blend_support_hardlight) out;
-layout(blend_support_softlight) out;
-layout(blend_support_difference) out;
-layout(blend_support_exclusion) out;
-layout(blend_support_hsl_hue) out;
-layout(blend_support_hsl_saturation) out;
-layout(blend_support_hsl_color) out;
-layout(blend_support_hsl_luminosity) out;
-layout(blend_support_all_equations) out;
-
-layout(blend_support_hsl_luminosity) out;              // okay to repeat
-
-layout(blend_support_hsl_luminosity) in;                       // ERROR, only on "out"
-layout(blend_support_hsl_luminosity) out vec4;                 // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) out vec4 badout;          // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) struct badS {int i;};     // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) void blendFoo() { }       // ERROR, only on standalone
-void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone
-layout(blend_support_flizbit) out;                             // ERROR, no flizbit
-
-out vec4 outAA[2][2];  // ERROR
-
-void devi()
-{
-    gl_DeviceIndex; // ERROR, no extension
-    gl_ViewIndex;   // ERROR, no extension
-}
-
-#ifdef GL_EXT_device_group
-#extension GL_EXT_device_group : enable
-#endif
-
-#ifdef GL_EXT_multiview
-#extension GL_EXT_multiview : enable
-#endif
-
-void devie()
-{
-    gl_DeviceIndex;
-    gl_ViewIndex;
-}

+ 0 - 152
3rdparty/bgfx/3rdparty/glslang/Test/310.geom

@@ -1,152 +0,0 @@
-#version 310 es
-
-#ifdef GL_EXT_geometry_shader
-#extension GL_EXT_geometry_shader : enable
-#else
-#error no GL_EXT_geometry_shader 
-#endif
-
-#ifndef GL_OES_geometry_shader
-#error no GL_OES_geometry_shader
-#endif
-
-precision mediump float;
-
-in fromVertex {
-    in vec3 color;
-} fromV[];
-
-in vec4 nonBlockUnsized[];
-
-out toFragment {
-    out vec3 color;
-} toF;
-
-out fromVertex {  // okay to reuse a block name for another block name
-    vec3 color;
-};
-
-out fooB {        // ERROR, cannot reuse block name as block instance
-    vec2 color;
-} fromVertex;
-
-int fromVertex;   // ERROR, cannot reuse a block name for something else
-
-out fooC {        // ERROR, cannot have same name for block and instance name
-    vec2 color;
-} fooC;
-
-void main()
-{
-    EmitVertex();
-    EndPrimitive();
-    EmitStreamVertex(1);    // ERROR
-    EndStreamPrimitive(0);  // ERROR
-
-    color = fromV[0].color;
-    gl_ClipDistance[3] =              // ERROR, no ClipDistance
-        gl_in[1].gl_ClipDistance[2];  // ERROR, no ClipDistance
-    gl_Position = gl_in[0].gl_Position;
-
-    gl_PrimitiveID = gl_PrimitiveIDIn;
-    gl_Layer = 2;
-}
-
-layout(stream = 4) out vec4 ov4; // ERROR, no streams
-
-layout(line_strip, points, triangle_strip, points, triangle_strip) out;  // just means triangle_strip"
-
-out ooutb { vec4 a; } ouuaa6;
-
-layout(max_vertices = 200) out;
-layout(max_vertices = 300) out;   // ERROR, too big
-void foo(layout(max_vertices = 4) int a)  // ERROR
-{
-    ouuaa6.a = vec4(1.0);
-}
-
-layout(line_strip, points, triangle_strip, points) out;  // ERROR, changing output primitive
-layout(line_strip, points) out; // ERROR, changing output primitive
-layout(triangle_strip) in; // ERROR, not an input primitive
-layout(triangle_strip) uniform; // ERROR
-layout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable
-layout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input
-layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
-out outbn2 {
-    layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0
-    layout(max_vertices = 3) int b; // ERROR, not on a block member
-    layout(triangle_strip)   int c; // ERROR, not on a block member
-} outbi;
-
-layout(lines) out;  // ERROR, not on output
-layout(lines_adjacency) in;
-layout(triangles) in;             // ERROR, can't change it
-layout(triangles_adjacency) in;   // ERROR, can't change it
-layout(invocations = 4) in;
-
-in sameName {
-    int a15;
-} insn[];
-
-out sameName {
-    float f15;
-};
-
-uniform sameName {
-    bool b15;
-};
-
-const int summ = gl_MaxVertexAttribs +
-             gl_MaxGeometryInputComponents +
-             gl_MaxGeometryOutputComponents +
-             gl_MaxGeometryImageUniforms +
-             gl_MaxGeometryTextureImageUnits +
-             gl_MaxGeometryOutputVertices +
-             gl_MaxGeometryTotalOutputComponents +
-             gl_MaxGeometryUniformComponents +
-             gl_MaxGeometryAtomicCounters +
-             gl_MaxGeometryAtomicCounterBuffers +
-             gl_MaxVertexTextureImageUnits +
-             gl_MaxCombinedTextureImageUnits +
-             gl_MaxTextureImageUnits +
-             gl_MaxDrawBuffers;
-
-void fooe1()
-{
-    gl_ViewportIndex;  // ERROR, not in ES
-    gl_MaxViewports;   // ERROR, not in ES
-    insn.length();     // 4: lines_adjacency
-    int inv = gl_InvocationID;
-}
-
-in vec4 explArray[4];
-in vec4 explArrayBad[5];  // ERROR, wrong size
-in vec4 nonArrayed;       // ERROR, not an array
-flat out vec3 myColor1;
-centroid out vec3 myColor2;
-centroid in vec3 centr[];
-sample out vec4 perSampleColor;  // ERROR without sample extensions
-
-layout(max_vertices = 200) out;  // matching redecl
-
-layout(location = 7, component = 2) in float comp[];  // ERROR, es has no component
-
-void notHere()
-{
-    gl_MaxGeometryVaryingComponents;  // ERROR, not in ES
-    gl_VerticesIn;                    // ERROR, not in ES
-}
-
-void pointSize1()
-{
-    highp float ps = gl_in[3].gl_PointSize;  // ERROR, need point_size extension
-    gl_PointSize = ps;                       // ERROR, need point_size extension
-}
-
-#extension GL_OES_geometry_point_size : enable
-
-void pointSize2()
-{
-    highp float ps = gl_in[3].gl_PointSize;
-    gl_PointSize = ps;
-}

+ 0 - 43
3rdparty/bgfx/3rdparty/glslang/Test/310.inheritMemory.frag

@@ -1,43 +0,0 @@
-#version 310 es
-precision mediump float;
-
-struct S {
-    float buff[10];
-};
-
-layout(std430, binding=2) readonly buffer RoBuff {
-    float buff_ro[10];
-    S s_ro;
-} ro_buffer;
-
-layout(std430, binding=2) buffer Buff {
-    float buff[10];
-    S s;
-} non_ro_buffer;
-
-void non_ro_fun(float[10] buff) { }
-void non_ro_funf(float el) { }
-void non_ro_funS(S s) { }
-
-out vec4 fragColor;
-
-void main()
-{
-    S s;
-
-    non_ro_fun(s.buff);
-    non_ro_funf(s.buff[3]);
-    non_ro_funS(s);
-
-    non_ro_fun(non_ro_buffer.buff);
-    non_ro_fun(non_ro_buffer.s.buff);
-    non_ro_funf(non_ro_buffer.buff[3]);
-    non_ro_funf(non_ro_buffer.s.buff[3]);
-    non_ro_funS(non_ro_buffer.s);
-
-    non_ro_fun(ro_buffer.buff_ro);
-    non_ro_fun(ro_buffer.s_ro.buff);
-    non_ro_funf(ro_buffer.buff_ro[3]);
-    non_ro_funf(ro_buffer.s_ro.buff[3]);
-    non_ro_funS(ro_buffer.s_ro);
-}

+ 0 - 184
3rdparty/bgfx/3rdparty/glslang/Test/310.tesc

@@ -1,184 +0,0 @@
-#version 310 es
-
-#extension GL_OES_tessellation_shader : enable
-
-layout(vertices = 4) out;
-out int outa[gl_out.length()];
-
-layout(quads) in;                   // ERROR
-layout(ccw) out;                    // ERROR
-layout(fractional_even_spacing) in; // ERROR
-
-patch in vec4 patchIn;              // ERROR
-patch out vec4 patchOut;
-
-void main()
-{
-    barrier();
-
-    int a = gl_MaxTessControlInputComponents +
-            gl_MaxTessControlOutputComponents +
-            gl_MaxTessControlTextureImageUnits +
-            gl_MaxTessControlUniformComponents +
-            gl_MaxTessControlTotalOutputComponents;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
-    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    int iid = gl_InvocationID;
-
-    gl_out[gl_InvocationID].gl_Position = p;
-    gl_out[gl_InvocationID].gl_PointSize = ps;        // ERROR, need point_size extension
-    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;  // ERROR, not in ES
-
-    gl_TessLevelOuter[3] = 3.2;
-    gl_TessLevelInner[1] = 1.3;
-
-    if (a > 10)
-        barrier();           // ERROR
-    else
-        barrier();           // ERROR
-
-    barrier();
-
-    do {
-        barrier();           // ERROR
-    } while (a > 10);
-
-    switch (a) {
-    default:
-        barrier();           // ERROR
-        break;
-    }
-    a < 12 ? a : (barrier(), a); // ERROR
-    {
-        barrier();
-    }
-
-    return;
-
-    barrier();               // ERROR
-}
-
-layout(vertices = 4) in;    // ERROR, not on in
-layout(vertices = 5) out;   // ERROR, changing #
-
-void foo()
-{
-    gl_out[4].gl_Position;  // ERROR, out of range
-
-    barrier();              // ERROR, not in main
-}
-
-in vec2 ina;                // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];            // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-patch out float implA[];    // ERROR, not sized
-
-#extension GL_ARB_separate_shader_objects : enable
-
-layout(location = 3) in vec4 ivla[];
-layout(location = 4) in vec4 ivlb[];
-layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping
-
-layout(location = 3) out vec4 ovla[];
-layout(location = 4) out vec4 ovlb[];
-layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping
-
-void foop()
-{
-    precise float d;                  // ERROR without gpu_shader5
-    d = fma(d, d, d);                 // ERROR without gpu_shader5
-}
-
-patch out pinbn {
-    int a;
-} pinbi;
-
-centroid out vec3 myColor2[];
-centroid in vec3 centr[];
-sample out vec4 perSampleColor[];   // ERROR without sample extensions
-
-layout(vertices = 4) out float badlay[];   // ERROR, not on a variable
-out float misSized[5];              // ERROR, size doesn't match
-out float okaySize[4];
-
-#extension GL_OES_tessellation_point_size : enable
-
-void pointSize2()
-{
-    float ps = gl_in[1].gl_PointSize;
-    gl_out[gl_InvocationID].gl_PointSize = ps;
-}
-
-#extension GL_OES_gpu_shader5 : enable
-
-precise vec3 pv3;
-
-void goodfoop()
-{
-    precise float d;
-
-    pv3 *= pv3;
-    pv3 = fma(pv3, pv3, pv3);
-    d = fma(d, d, d);
-}
-
-void bbextBad()
-{
-    gl_BoundingBoxEXT;  // ERROR without GL_EXT_primitive_bounding_box
-    gl_BoundingBox;  // ERROR, version < 320
-}
-
-#extension GL_EXT_primitive_bounding_box : enable
-
-void bbext()
-{
-    gl_BoundingBoxEXT[0] = vec4(0.0);
-    gl_BoundingBoxEXT[1] = vec4(1.0);
-    gl_BoundingBoxEXT[2] = vec4(2.0);  // ERROR, overflow
-}
-
-void bbBad()
-{
-    gl_BoundingBoxOES;  // ERROR without GL_OES_primitive_bounding_box 
-}
-
-#extension GL_OES_primitive_bounding_box : enable
-
-void bb()
-{
-    gl_BoundingBoxOES[0] = vec4(0.0);
-    gl_BoundingBoxOES[1] = vec4(1.0);
-    gl_BoundingBoxOES[2] = vec4(2.0);  // ERROR, overflow
-}
-
-out patch badpatchBName {  // ERROR, array size required
-    float f;
-} badpatchIName[];
-
-out patch patchBName {
-    float f;
-} patchIName[4];
-
-void outputtingOutparam(out int a)
-{
-    a = 2;
-}
-
-void outputting()
-{
-    outa[gl_InvocationID] = 2;
-    outa[1] = 2;                         // ERROR, not gl_InvocationID
-    gl_out[0].gl_Position = vec4(1.0);   // ERROR, not gl_InvocationID
-    outa[1];
-    gl_out[0];
-    outputtingOutparam(outa[0]);         // ERROR, not gl_InvocationID
-    outputtingOutparam(outa[gl_InvocationID]);
-    patchIName[1].f = 3.14;
-    outa[(gl_InvocationID)] = 2;
-}

+ 0 - 128
3rdparty/bgfx/3rdparty/glslang/Test/310.tese

@@ -1,128 +0,0 @@
-#version 310 es
-
-#extension GL_EXT_tessellation_shader : enable
-#extension GL_OES_tessellation_shader : enable
-#extension GL_EXT_tessellation_shader : disable
-
-layout(vertices = 4) out; // ERROR
-layout(quads, cw) in;
-layout(triangles) in;     // ERROR
-layout(isolines) in;      // ERROR
-
-layout(ccw) in;           // ERROR
-layout(cw) in;
-
-layout(fractional_odd_spacing) in;    
-layout(equal_spacing) in;              // ERROR
-layout(fractional_even_spacing) in;    // ERROR
-
-layout(point_mode) in;
-
-patch in vec4 patchIn;
-patch out vec4 patchOut;  // ERROR
-
-void main()
-{
-    barrier(); // ERROR
-
-    int a = gl_MaxTessEvaluationInputComponents +
-            gl_MaxTessEvaluationOutputComponents +
-            gl_MaxTessEvaluationTextureImageUnits +
-            gl_MaxTessEvaluationUniformComponents +
-            gl_MaxTessPatchComponents +
-            gl_MaxPatchVertices +
-            gl_MaxTessGenLevel;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
-    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    vec3 tc = gl_TessCoord;
-    float tlo = gl_TessLevelOuter[3];
-    float tli = gl_TessLevelInner[1];
-
-    gl_Position = p;
-    gl_PointSize = ps;             // ERROR, need point_size extension
-    gl_ClipDistance[2] = cd;       // ERROR, not in ES
-}
-
-smooth patch in vec4 badp1;         // ERROR
-flat patch in vec4 badp2;           // ERROR
-noperspective patch in vec4 badp3;  // ERROR
-patch sample in vec3 badp4;         // ERROR
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in gl_PerVertex
-{
-    vec4 gl_Position;
-} gl_in[];
-
-in gl_PerVertex           // ERROR, second redeclaration of gl_in
-{
-    vec4 gl_Position;
-} gl_in[];
-
-layout(quads, cw) out;     // ERROR
-layout(triangles) out;     // ERROR
-layout(isolines) out;      // ERROR
-layout(cw) out;            // ERROR
-layout(fractional_odd_spacing) out;    // ERROR
-layout(equal_spacing) out;             // ERROR
-layout(fractional_even_spacing) out;   // ERROR
-layout(point_mode) out;                // ERROR
-
-in vec2 ina;      // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];  // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-
-in testbla {      // ERROR, not array
-    int f;
-} bla;
-
-in testblb {
-    int f;
-} blb[];
-
-in testblc { // ERROR wrong size
-    int f;
-} blc[18];
-
-in testbld {
-    int f;
-} bld[gl_MaxPatchVertices];
-
-layout(location = 23) in vec4 ivla[];
-layout(location = 24) in vec4 ivlb[];
-layout(location = 24) in vec4 ivlc[];  // ERROR, overlap
-
-layout(location = 23) out vec4 ovla[2];
-layout(location = 24) out vec4 ovlb[2];  // ERROR, overlap
-
-in float gl_TessLevelOuter[4];           // ERROR, can't redeclare
-
-patch in pinbn {
-    int a;
-} pinbi;
-
-centroid out vec3 myColor2;
-centroid in vec3 centr[];
-sample out vec4 perSampleColor;  // ERROR without sample extensions
-
-#extension GL_OES_tessellation_point_size : enable
-
-void pointSize2()
-{
-    float ps = gl_in[1].gl_PointSize;  // ERROR, not in the redeclaration, but no error on use of gl_PointSize
-    gl_PointSize = ps;
-}
-
-#extension GL_EXT_primitive_bounding_box : enable
-
-void bbbad()
-{
-    gl_BoundingBoxOES; // ERROR, wrong stage
-}

+ 0 - 403
3rdparty/bgfx/3rdparty/glslang/Test/310.vert

@@ -1,403 +0,0 @@
-#version 310 es
-
-shared vec4 s;   // ERROR
-layout(local_size_x = 2) out;  // ERROR
-buffer vec4 v;  // ERROR
-in int ini;
-layout(location = 2) uniform mat4 x;
-layout(location = 3) uniform mat4 y;
-layout(location = 2) out mat4 xi;
-layout(location = 3) out mat4 yi;  // ERROR, locations conflict with xi
-
-void main()
-{
-    uvec2 u2;
-    u2 = uaddCarry(u2, u2, u2);
-    uint u1;
-    u1 = usubBorrow(u1, u1, u1);
-    uvec4 u4;
-    umulExtended(u4, u4, u4, u4);
-    ivec4 i4;
-    imulExtended(i4, i4, i4, i4);
-    int i1;
-    i1 = bitfieldExtract(i1, 4, 5);
-    uvec3 u3;
-    u3 = bitfieldExtract(u3, 4, 5);
-    ivec3 i3;
-    i3 = bitfieldInsert(i3, i3, 4, 5);
-    u1 = bitfieldInsert(u1, u1, 4, 5);
-    ivec2 i2;
-    i2 = bitfieldReverse(i2);
-    u4 = bitfieldReverse(u4);
-    i1 = bitCount(i1);
-    i3 = bitCount(u3);
-    i2 = findLSB(i2);
-    i4 = findLSB(u4);
-    i1 = findMSB(i1);
-    i2 = findMSB(u2);
-
-    vec3 v3;
-    v3 = frexp(v3, i3);
-    vec2 v2;
-    v2 = ldexp(v2, i2);
-
-    mediump vec4 v4;
-    u1 = packUnorm4x8(v4);
-    u1 = packSnorm4x8(v4);
-    v4 = unpackUnorm4x8(u1);
-    v4 = unpackSnorm4x8(u1);
-}
-
-precision highp sampler2DMS;
-precision highp isampler2DMS;
-precision highp usampler2DMS;
-
-uniform sampler2DMS s2dms;
-uniform isampler2DMS is2dms;
-uniform usampler2DMS us2dms;
-uniform usampler2DMSArray us2dmsa;   // ERROR
-
-void foo()
-{
-    ivec2 v2;
-    v2 = textureSize(s2dms);
-    v2 = textureSize(us2dms);
-    vec4 v4 = texelFetch(s2dms, v2, 2);
-    ivec4 iv4 = texelFetch(is2dms, v2, 2);
-    textureSamples(s2dms);   // ERROR
-    float f;
-    frexp(f, ini);     // ERROR, i not writable
-}
-
-out bool outb;         // ERROR
-out sampler2D outo;    // ERROR
-out float outa[4];
-out float outaa[4][2]; // ERROR
-struct S { float f; };
-out S outs;
-out S[4] outasa;       // ERROR
-out S outsa[4];        // ERROR
-struct SA { float f[4]; };
-out SA outSA;          // ERROR
-struct SS { float f; S s; };
-out SS outSS;          // ERROR
-
-layout(std430) uniform U430 { int a; } U430i;    // ERROR
-layout(std430) buffer B430 { int a; } B430i;
-
-#ifndef GL_OES_shader_io_blocks
-#error GL_OES_shader_io_blocks not defined
-#endif
-
-#extension GL_OES_shader_io_blocks : enable
-
-out outbname {
-    int a;
-    out vec4 v;
-    highp sampler2D s;   // ERROR, opaque type
-} outbinst;
-
-out outbname2 {
-    layout(location = 12) int aAnon;
-    layout(location = 13) vec4 vAnon;
-};
-
-layout(location = 12) out highp int aliased;  // ERROR, aliasing location
-
-in inbname { int a; } inbinst;  // ERROR, no in block in vertex shader
-
-out gl_PerVertex {              // ERROR, has extra member
-    highp vec4 gl_Position;
-    highp vec4 t;
-};
-
-void foo_IO()
-{
-    int sum  = gl_VertexID +
-               gl_InstanceID;
-    gl_Position = vec4(1.0);
-    gl_PointSize = 2.0;         // ERROR, removed by redeclaration
-}
-
-out gl_PerVertex {              // ERROR, already used and already redeclared
-    highp vec4 gl_Position;
-    highp vec4 t;
-};
-
-smooth out smo {                // ERROR, no smooth on a block
-    int i;
-} smon;
-
-flat out fmo {                  // ERROR, no flat on a block
-    int i;
-} fmon;
-
-centroid out cmo {              // ERROR, no centroid on a block
-    int i;
-} cmon;
-
-invariant out imo {             // ERROR, no invariant on a block
-    int i;
-} imon;
-
-in vec2 inf, ing;
-uniform ivec2 offsets[4];
-uniform sampler2D sArray[4];
-uniform int sIndex;
-layout(binding = 0) uniform atomic_uint auArray[2];
-uniform ubName { int i; } ubInst[4];
-buffer bbName { int i; } bbInst[4];
-highp uniform writeonly image2D iArray[5];
-const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));
-
-void pfooBad()
-{
-    precise vec2 h;          // ERROR reserved
-    h = fma(inf, ing, h);    // ERROR, not available
-    sArray[sIndex + 1];      // ERRRO, not supported
-    auArray[sIndex + 1];
-    ubInst[1];
-    bbInst[2];
-    ubInst[sIndex + 1];      // ERROR, not supported
-    bbInst[sIndex];          // ERROR, not supported
-    iArray[2];
-    iArray[sIndex * 2];      // ERROR, not supported
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));     // ERROR, offset not constant
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);  // ERROR, not available
-}
-
-#extension GL_OES_gpu_shader5 : enable
-
-void pfoo()
-{
-    precise vec2 h;
-    h = fma(inf, ing, h);
-    sArray[sIndex + 1];
-    ubInst[sIndex + 1];
-    bbInst[sIndex - 2];      // ERROR, still not supported
-    iArray[2];
-    iArray[sIndex - 2];
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);
-    textureGatherOffsets(sArray[0], vec2(0.1), offsets);   // ERROR, offset not constant
-}
-
-uniform samplerBuffer  badSamp1;             // ERROR, reserved
-uniform isamplerBuffer badSamp2;             // ERROR, reserved
-uniform usamplerBuffer badSamp3;             // ERROR, reserved
-uniform writeonly imageBuffer    badSamp4;   // ERROR, reserved
-uniform writeonly iimageBuffer   badSamp5;   // ERROR, reserved
-uniform writeonly uimageBuffer   badSamp6;   // ERROR, reserved
-
-#extension GL_OES_texture_buffer : enable
-#extension GL_EXT_texture_buffer : enable
-
-uniform samplerBuffer  noPreSamp1;            // ERROR, no default precision
-uniform isamplerBuffer noPreSamp2;            // ERROR, no default precision
-uniform usamplerBuffer noPreSamp3;            // ERROR, no default precision
-uniform writeonly imageBuffer    noPreSamp4;  // ERROR, no default precision
-uniform writeonly iimageBuffer   noPreSamp5;  // ERROR, no default precision
-uniform writeonly uimageBuffer   noPreSamp6;  // ERROR, no default precision
-
-precision highp samplerBuffer; 
-precision highp isamplerBuffer;
-precision highp usamplerBuffer;
-precision highp imageBuffer;   
-precision highp iimageBuffer;  
-precision highp uimageBuffer;  
-
-#ifdef GL_OES_texture_buffer
-uniform samplerBuffer  bufSamp1;          
-uniform isamplerBuffer bufSamp2;          
-uniform usamplerBuffer bufSamp3;          
-#endif
-#ifdef GL_EXT_texture_buffer
-uniform writeonly imageBuffer    bufSamp4;
-uniform writeonly iimageBuffer   bufSamp5;
-uniform writeonly uimageBuffer   bufSamp6;
-#endif
-
-void bufferT()
-{
-    highp int s1 = textureSize(bufSamp1);
-    highp int s2 = textureSize(bufSamp2);
-    highp int s3 = textureSize(bufSamp3);
-
-    highp int s4 = imageSize(bufSamp4);
-    highp int s5 = imageSize(bufSamp5);
-    highp int s6 = imageSize(bufSamp6);
-    
-    highp vec4 f1 = texelFetch(bufSamp1, s1);
-    highp ivec4 f2 = texelFetch(bufSamp2, s2);
-    highp uvec4 f3 = texelFetch(bufSamp3, s3);
-}
-
-uniform writeonly imageCubeArray  badCA1;  // ERROR, reserved
-uniform writeonly iimageCubeArray badCA2;  // ERROR, reserved
-uniform writeonly uimageCubeArray badCA3;  // ERROR, reserved
-
-uniform samplerCubeArray          badCA4;  // ERROR, reserved
-uniform samplerCubeArrayShadow    badCA5;  // ERROR, reserved
-uniform isamplerCubeArray         badCA6;  // ERROR, reserved
-uniform usamplerCubeArray         badCA7;  // ERROR, reserved
-
-#extension GL_OES_texture_cube_map_array : enable
-
-uniform writeonly imageCubeArray  noPreCA1;   // ERROR, no default precision
-uniform writeonly iimageCubeArray noPreCA2;   // ERROR, no default precision
-uniform writeonly uimageCubeArray noPreCA3;   // ERROR, no default precision
-
-uniform samplerCubeArray          noPreCA4;   // ERROR, no default precision
-uniform samplerCubeArrayShadow    noPreCA5;   // ERROR, no default precision
-uniform isamplerCubeArray         noPreCA6;   // ERROR, no default precision
-uniform usamplerCubeArray         noPreCA7;   // ERROR, no default precision
-
-precision highp imageCubeArray        ;
-precision highp iimageCubeArray       ;
-precision highp uimageCubeArray       ;
-
-precision highp samplerCubeArray      ;
-precision highp samplerCubeArrayShadow;
-precision highp isamplerCubeArray     ;
-precision highp usamplerCubeArray     ;
-
-uniform writeonly imageCubeArray  CA1;
-uniform writeonly iimageCubeArray CA2;
-uniform writeonly uimageCubeArray CA3;
-
-layout(rgba16f) uniform readonly imageCubeArray  rCA1;
-layout(rgba32i) uniform readonly iimageCubeArray rCA2;
-layout(r32ui) uniform readonly uimageCubeArray rCA3;
-
-#ifdef GL_OES_texture_cube_map_array
-uniform samplerCubeArray          CA4;
-uniform samplerCubeArrayShadow    CA5;
-uniform isamplerCubeArray         CA6;
-uniform usamplerCubeArray         CA7;
-#endif
-
-void CAT()
-{
-    highp ivec3 s4 = textureSize(CA4, 1);
-    highp ivec3 s5 = textureSize(CA5, 1);
-    highp ivec3 s6 = textureSize(CA6, 1);
-    highp ivec3 s7 = textureSize(CA7, 1);
-    
-    highp vec4 t4 = texture(CA4, vec4(0.5));
-    highp float t5 = texture(CA5, vec4(0.5), 3.0);
-    highp ivec4 t6 = texture(CA6, vec4(0.5));
-    highp uvec4 t7 = texture(CA7, vec4(0.5));
-
-    highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24);
-    highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26);
-    highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27);
-
-    highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2));
-    highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2));
-    highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2));
-
-    highp vec4 gath4 = textureGather(CA4, vec4(0.5));
-    highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2);
-    highp ivec4 gath6 = textureGather(CA6, vec4(0.5));
-    highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1);
-    highp uvec4 gath7 = textureGather(CA7, vec4(0.5));
-    highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0);
-
-    highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5);
-
-    highp ivec3 s1 = imageSize(CA1);
-    highp ivec3 s2 = imageSize(CA2);
-    highp ivec3 s3 = imageSize(CA3);
-
-    imageStore(CA1, s3, vec4(1));
-    imageStore(CA2, s3, ivec4(1));
-    imageStore(CA3, s3, uvec4(1));
-
-    highp vec4 cl1 = imageLoad(rCA1, s3);
-    highp ivec4 cl2 = imageLoad(rCA2, s3);
-    highp uvec4 cl3 = imageLoad(rCA3, s3);
-}
-
-uniform sampler2DMSArray  bad2DMS;    // ERROR, reserved
-uniform isampler2DMSArray bad2DMSi;   // ERROR, reserved
-uniform usampler2DMSArray bad2DMSu;   // ERROR, reserved
-
-#extension GL_OES_texture_storage_multisample_2d_array : enable
-
-#ifdef GL_OES_texture_storage_multisample_2d_array
-
-uniform sampler2DMSArray  noPrec2DMS;    // ERROR, no default
-uniform isampler2DMSArray noPrec2DMSi;   // ERROR, no default
-uniform usampler2DMSArray noPrec2DMSu;   // ERROR, no default
-
-#endif
-
-precision highp sampler2DMSArray;
-precision highp isampler2DMSArray;
-precision highp usampler2DMSArray;
-
-uniform sampler2DMSArray  samp2DMSA;
-uniform isampler2DMSArray samp2DMSAi;
-uniform usampler2DMSArray samp2DMSAu;
-
-void MSA()
-{
-    vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2);
-    ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2);
-    uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2);
-    
-    ivec3 tfs = textureSize(samp2DMSA);
-    ivec3 tfsi = textureSize(samp2DMSAi);
-    ivec3 tfsb = textureSize(samp2DMSAi, 4);  // ERROR, no lod
-    ivec3 tfsu = textureSize(samp2DMSAu);
-}
-
-#ifdef GL_OES_shader_image_atomic 
-#extension GL_OES_shader_image_atomic : enable
-#endif
-
-uniform layout(r32f)  highp  image2D im2Df;
-uniform layout(r32ui) highp uimage2D im2Du;
-uniform layout(r32i)  highp iimage2D im2Di;
-uniform ivec2 P;
-
-void goodImageAtom()
-{
-    float datf;
-    int dati;
-    uint datu;
-
-    imageAtomicAdd(     im2Di, P, dati);
-    imageAtomicAdd(     im2Du, P, datu);
-    imageAtomicMin(     im2Di, P, dati);
-    imageAtomicMin(     im2Du, P, datu);
-    imageAtomicMax(     im2Di, P, dati);
-    imageAtomicMax(     im2Du, P, datu);
-    imageAtomicAnd(     im2Di, P, dati);
-    imageAtomicAnd(     im2Du, P, datu);
-    imageAtomicOr(      im2Di, P, dati);
-    imageAtomicOr(      im2Du, P, datu);
-    imageAtomicXor(     im2Di, P, dati);
-    imageAtomicXor(     im2Du, P, datu);
-    imageAtomicExchange(im2Di, P, dati);
-    imageAtomicExchange(im2Du, P, datu);
-    imageAtomicExchange(im2Df, P, datf);
-    imageAtomicCompSwap(im2Di, P,  3, dati);
-    imageAtomicCompSwap(im2Du, P, 5u, datu);
-}
-
-sample out vec4 colorSampInBad;       // ERROR, reserved
-
-#extension GL_OES_shader_multisample_interpolation : enable
-
-sample out vec4 colorSample;
-flat sample out vec4 colorfsi;
-sample out vec3 sampInArray[4];
-in vec4 inv4;
-
-void badInterp()
-{
-    interpolateAtCentroid(inv4);             // ERROR, wrong stage
-    interpolateAtSample(inv4, 1);            // ERROR, need extension
-    interpolateAtOffset(inv4, vec2(0.2));    // ERROR, need extension
-}

+ 0 - 121
3rdparty/bgfx/3rdparty/glslang/Test/310AofA.vert

@@ -1,121 +0,0 @@
-#version 310 es
-
-// Check name mangling of functions with parameters that are multi-dimensional arrays.
-
-#define NX 2
-#define NY 3
-#define NZ 4
-void f(bool a, float b, uint[4] c, int[NY][NX] d) {
-}
-
-void main() {
-  int[NY][NX] d;
-  f(false, 12.1, uint[NZ](uint(0),uint(1),uint(1),uint(2)), d);
-}
-
-buffer b {
-    float u[];  // ERROR
-    vec4 v[];
-} name[3];
-
-uniform ub {
-    float u;
-    vec4 v[];   // ERROR
-} uname[3];
-
-buffer b2 {
-    float u;
-    vec4 v[][];  // ERROR
-} name2[3];
-
-buffer b3 {
-    float u; 
-    vec4 v[][7];
-} name3[3];
-
-// General arrays of arrays
-
-float[4][5][6] many[1][2][3];
-
-float gu[][7];     // ERROR, size required
-float g4[4][7];
-float g5[5][7];
-
-float[4][7] foo(float a[5][7])
-{
-    float r[7];
-    r = a[2];
-    float[](a[0], a[1], r, a[3]);              // ERROR, too few dims
-    float[4][7][4](a[0], a[1], r, a[3]);       // ERROR, too many dims
-    return float[4][7](a[0], a[1], r, a[3]);
-    return float[][](a[0], a[1], r, a[3]);
-    return float[][7](a[0], a[1], a[2], a[3]);
-}
-
-void bar(float[5][7]) {}
-
-void foo2()
-{
-    {
-        float gu[3][4][2];
-
-        gu[2][4][1] = 4.0;                     // ERROR, overflow
-    }
-    vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)),
-                              vec4[2](vec4(0.0), vec4(1.0)),
-                              vec4[2](vec4(0.0), vec4(1.0)));
-    vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)));
-    vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)));
-    vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                               vec4[2](vec4(4.0), vec4(2.0)),
-                               vec4[2](vec4(4.0), vec4(2.0)));
-
-    g4 = foo(g5);
-    g5 = g4;           // ERROR, wrong types
-    gu = g4;           // ERROR, not yet sized
-
-    foo(gu);           // ERROR, not yet sized
-    bar(g5);
-
-    if (foo(g5) == g4)
-        ;
-    if (foo(g5) == g5)  // ERROR, different types
-        ;
-
-    float u[5][7];
-    u[5][2] = 5.0;      // ERROR
-    foo(u);
-
-    vec4 badAss[3];
-    name[1].v[-1];     // ERROR
-    name[1].v[1] = vec4(4.3);
-    name[1].v = badAss;  // ERROR, bad assignemnt
-
-    name3[0].v[1].length();  // 7
-    name3[0].v.length();     // run time
-}
-
-struct badS {
-    int sa[];     // ERROR
-    int a[][];    // ERROR
-    int b[][2];   // ERROR
-    int c[2][];   // ERROR
-    int d[][4];   // ERROR
-};
-
-in float inArray[2][3];    // ERROR
-out float outArray[2][3];  // ERROR
-
-uniform ubaa {
-    int a;
-} ubaaname[2][3];  // ERROR
-
-vec3 func(in mat3[2] x[3])
-{
-	mat3 a0 = x[2][1];
-    return a0[2];
-}

+ 0 - 8
3rdparty/bgfx/3rdparty/glslang/Test/310implicitSizeArrayError.vert

@@ -1,8 +0,0 @@
-#version 310 es
-layout (binding=0) uniform Block {
-  highp int a[];
-} uni;
-layout (location=0) out highp int o;
-void main() {
-  o = uni.a[2];
-}

+ 0 - 18
3rdparty/bgfx/3rdparty/glslang/Test/310runtimeArray.vert

@@ -1,18 +0,0 @@
-#version 310 es
-
-precision highp float;
-layout(location=0) out float o;
-
-struct S  { float f; };
-buffer b1 { S s[]; };
-buffer b2 { S s[]; } b2name;
-buffer b3 { S s[]; } b3name[];
-buffer b4 { S s[]; } b4name[4];
-
-void main()
-{
-  o = s[5].f;
-  o += b2name.s[6].f;
-  o += b3name[3].s[7].f;
-  o += b4name[2].s[8].f;
-}

+ 0 - 17
3rdparty/bgfx/3rdparty/glslang/Test/320.comp

@@ -1,17 +0,0 @@
-#version 320 es
-
-float fX;
-float fY;
-
-void main()
-{
-    dFdx(fX);
-    dFdy(fY);
-    fwidth(fX);
-    dFdxCoarse(fX);
-    dFdyCoarse(fY);
-    fwidthCoarse(fX);
-    dFdxFine(fX);
-    dFdyFine(fY);
-    fwidthFine(fX);
-}

+ 0 - 225
3rdparty/bgfx/3rdparty/glslang/Test/320.frag

@@ -1,225 +0,0 @@
-#version 320 es
-
-out outbname { int a; } outbinst;   // ERROR, not out block in fragment shader
-
-in inbname {
-    int a;
-    vec4 v;
-    struct { int b; } s;     // ERROR, nested struct definition
-} inbinst;
-
-in inbname2 {
-    layout(location = 12) int aAnon;
-    layout(location = 13) centroid in vec4 vAnon;
-};
-
-in layout(location = 13) vec4 aliased; // ERROR, aliased
-
-in inbname2 {                // ERROR, reuse of block name
-    int aAnon;
-    centroid in vec4 vAnon;
-};
-
-in badmember {               // ERROR, aAnon already in global scope
-    int aAnon;
-};
-
-int inbname;                 // ERROR, redefinition of block name
-
-vec4 vAnon;                  // ERROR, anon in global scope; redefinition
-
-in arrayed {
-    float f;
-} arrayedInst[4];
-uniform int i;
-void fooIO()
-{
-    vec4 v = inbinst.v + vAnon;
-    v *= arrayedInst[2].f;
-    v *= arrayedInst[i].f;
-}
-
-in vec4 gl_FragCoord;
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, non-ES
-
-layout(early_fragment_tests) in;
-out float gl_FragDepth;
-layout(depth_any) out float gl_FragDepth;  // ERROR, non-ES
-
-void main()
-{
-    gl_FragDepth = 0.2;  // ERROR, early_fragment_tests declared
-    bool f = gl_FrontFacing;
-}
-
-out float gl_FragDepth;
-
-void foo_GS()
-{
-    highp int l = gl_Layer;
-    highp int p = gl_PrimitiveID;
-}
-
-in vec2 inf, ing;
-uniform ivec2 offsets[4];
-uniform sampler2D sArray[4];
-uniform int sIndex;
-layout(binding = 0) uniform atomic_uint auArray[2];
-uniform ubName { int i; } ubInst[4];
-buffer bbName { int i; } bbInst[4];
-highp uniform writeonly image2D iArray[5];
-const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));
-
-void pfoo()
-{
-    precise vec2 h;
-    h = fma(inf, ing, h);
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);
-    textureGatherOffsets(sArray[0], vec2(0.1), offsets);       // ERROR, offset not constant
-}
-
-precision highp imageCubeArray        ;
-precision highp iimageCubeArray       ;
-precision highp uimageCubeArray       ;
-
-precision highp samplerCubeArray      ;
-precision highp samplerCubeArrayShadow;
-precision highp isamplerCubeArray     ;
-precision highp usamplerCubeArray     ;
-
-uniform writeonly imageCubeArray  CA1;
-uniform writeonly iimageCubeArray CA2;
-uniform writeonly uimageCubeArray CA3;
-
-#ifdef GL_EXT_texture_cube_map_array
-uniform samplerCubeArray          CA4;
-uniform samplerCubeArrayShadow    CA5;
-uniform isamplerCubeArray         CA6;
-uniform usamplerCubeArray         CA7;
-#endif
-
-void CAT()
-{
-    highp vec4 b4 = texture(CA4, vec4(0.5), 0.24);
-    highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26);
-    highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27);
-}
-
-void goodSample()
-{
-    lowp     int  a1 = gl_SampleID;       
-    mediump  vec2 a2 = gl_SamplePosition; 
-    highp    int  a3 = gl_SampleMaskIn[0];
-    gl_SampleMask[0] = a3;
-    mediump int n1 = gl_MaxSamples;
-    mediump int n2 = gl_NumSamples;
-}
-
-uniform layout(r32f)  highp  image2D im2Df;
-uniform layout(r32ui) highp uimage2D im2Du;
-uniform layout(r32i)  highp iimage2D im2Di;
-uniform ivec2 P;
-
-uniform layout(rgba32f)  highp  image2D badIm2Df;  // ERROR, needs readonly or writeonly
-uniform layout(rgba8ui) highp uimage2D badIm2Du;   // ERROR, needs readonly or writeonly
-uniform layout(rgba16i)  highp iimage2D badIm2Di;  // ERROR, needs readonly or writeonly
-
-void goodImageAtom()
-{
-    float datf;
-    int dati;
-    uint datu;
-
-    imageAtomicAdd(     im2Di, P, dati);
-    imageAtomicAdd(     im2Du, P, datu);
-    imageAtomicMin(     im2Di, P, dati);
-    imageAtomicMin(     im2Du, P, datu);
-    imageAtomicMax(     im2Di, P, dati);
-    imageAtomicMax(     im2Du, P, datu);
-    imageAtomicAnd(     im2Di, P, dati);
-    imageAtomicAnd(     im2Du, P, datu);
-    imageAtomicOr(      im2Di, P, dati);
-    imageAtomicOr(      im2Du, P, datu);
-    imageAtomicXor(     im2Di, P, dati);
-    imageAtomicXor(     im2Du, P, datu);
-    imageAtomicExchange(im2Di, P, dati);
-    imageAtomicExchange(im2Du, P, datu);
-    imageAtomicExchange(im2Df, P, datf);
-    imageAtomicCompSwap(im2Di, P,  3, dati);
-    imageAtomicCompSwap(im2Du, P, 5u, datu);
-
-    imageAtomicMax(badIm2Di, P, dati);      // ERROR, not an allowed layout() on the image
-    imageAtomicMax(badIm2Du, P, datu);      // ERROR, not an allowed layout() on the image
-    imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image
-}
-
-centroid out vec4 colorCentroidBad;  // ERROR
-flat out vec4 colorBadFlat;          // ERROR
-smooth out vec4 colorBadSmooth;      // ERROR
-noperspective out vec4 colorBadNo;   // ERROR
-flat centroid in vec2 colorfc;
-in float scalarIn;
-
-sample in vec4 colorSampIn;
-sample out vec4 colorSampleBad;     // ERROR
-flat sample in vec4 colorfsi;
-sample in vec3 sampInArray[4];
-
-void interp()
-{
-    float res;
-    vec2 res2;
-    vec3 res3;
-    vec4 res4;
-
-    res2 = interpolateAtCentroid(colorfc);
-    res4 = interpolateAtCentroid(colorSampIn);
-    res4 = interpolateAtCentroid(colorfsi);
-    res  = interpolateAtCentroid(scalarIn);
-    res3 = interpolateAtCentroid(sampInArray);         // ERROR
-    res3 = interpolateAtCentroid(sampInArray[2]);
-    res2 = interpolateAtCentroid(sampInArray[2].xy);   // ERROR
-
-    res3 = interpolateAtSample(sampInArray, 1);        // ERROR
-    res3 = interpolateAtSample(sampInArray[i], 0);
-    res2 = interpolateAtSample(sampInArray[2].xy, 2);  // ERROR
-    res  = interpolateAtSample(scalarIn, 1);
-
-    res3 = interpolateAtOffset(sampInArray, vec2(0.2));         // ERROR
-    res3 = interpolateAtOffset(sampInArray[2], vec2(0.2));
-    res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2));   // ERROR, no swizzle
-    res  = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference
-    res  = interpolateAtOffset(scalarIn, vec2(0.2));
-
-    float f;
-    res  = interpolateAtCentroid(f);           // ERROR, not interpolant
-    res4 = interpolateAtSample(outp, 0);       // ERROR, not interpolant
-}
-
-layout(blend_support_multiply) out;
-layout(blend_support_screen) out;
-layout(blend_support_overlay) out;
-layout(blend_support_darken, blend_support_lighten) out;
-layout(blend_support_colordodge) layout(blend_support_colorburn) out;
-layout(blend_support_hardlight) out;
-layout(blend_support_softlight) out;
-layout(blend_support_difference) out;
-layout(blend_support_exclusion) out;
-layout(blend_support_hsl_hue) out;
-layout(blend_support_hsl_saturation) out;
-layout(blend_support_hsl_color) out;
-layout(blend_support_hsl_luminosity) out;
-layout(blend_support_all_equations) out;
-
-layout(blend_support_hsl_luminosity) out;              // okay to repeat
-
-layout(blend_support_hsl_luminosity) in;                       // ERROR, only on "out"
-layout(blend_support_hsl_luminosity) out vec4;                 // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) out vec4 badout;          // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) struct badS {int i;};     // ERROR, only on standalone
-layout(blend_support_hsl_luminosity) void blendFoo() { }       // ERROR, only on standalone
-void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone
-layout(blend_support_flizbit) out;                             // ERROR, no flizbit
-
-out vec4 outAA[2][2];  // ERROR

+ 0 - 134
3rdparty/bgfx/3rdparty/glslang/Test/320.geom

@@ -1,134 +0,0 @@
-#version 320 es
-
-precision mediump float;
-
-in fromVertex {
-    in vec3 color;
-} fromV[];
-
-in vec4 nonBlockUnsized[];
-
-out toFragment {
-    out vec3 color;
-} toF;
-
-out fromVertex {  // okay to reuse a block name for another block name
-    vec3 color;
-};
-
-out fooB {        // ERROR, cannot reuse block name as block instance
-    vec2 color;
-} fromVertex;
-
-int fromVertex;   // ERROR, cannot reuse a block name for something else
-
-out fooC {        // ERROR, cannot have same name for block and instance name
-    vec2 color;
-} fooC;
-
-void main()
-{
-    EmitVertex();
-    EndPrimitive();
-    EmitStreamVertex(1);    // ERROR
-    EndStreamPrimitive(0);  // ERROR
-
-    color = fromV[0].color;
-    gl_ClipDistance[3] =              // ERROR, no ClipDistance
-        gl_in[1].gl_ClipDistance[2];  // ERROR, no ClipDistance
-    gl_Position = gl_in[0].gl_Position;
-
-    gl_PrimitiveID = gl_PrimitiveIDIn;
-    gl_Layer = 2;
-}
-
-layout(stream = 4) out vec4 ov4; // ERROR, no streams
-
-layout(line_strip, points, triangle_strip, points, triangle_strip) out;  // just means triangle_strip"
-
-out ooutb { vec4 a; } ouuaa6;
-
-layout(max_vertices = 200) out;
-layout(max_vertices = 300) out;   // ERROR, too big
-void foo(layout(max_vertices = 4) int a)  // ERROR
-{
-    ouuaa6.a = vec4(1.0);
-}
-
-layout(line_strip, points, triangle_strip, points) out;  // ERROR, changing output primitive
-layout(line_strip, points) out; // ERROR, changing output primitive
-layout(triangle_strip) in; // ERROR, not an input primitive
-layout(triangle_strip) uniform; // ERROR
-layout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable
-layout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input
-layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
-out outbn2 {
-    layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0
-    layout(max_vertices = 3) int b; // ERROR, not on a block member
-    layout(triangle_strip)   int c; // ERROR, not on a block member
-} outbi;
-
-layout(lines) out;  // ERROR, not on output
-layout(lines_adjacency) in;
-layout(triangles) in;             // ERROR, can't change it
-layout(triangles_adjacency) in;   // ERROR, can't change it
-layout(invocations = 4) in;
-
-in sameName {
-    int a15;
-} insn[];
-
-out sameName {
-    float f15;
-};
-
-uniform sameName {
-    bool b15;
-};
-
-const int summ = gl_MaxVertexAttribs +
-             gl_MaxGeometryInputComponents +
-             gl_MaxGeometryOutputComponents +
-             gl_MaxGeometryImageUniforms +
-             gl_MaxGeometryTextureImageUnits +
-             gl_MaxGeometryOutputVertices +
-             gl_MaxGeometryTotalOutputComponents +
-             gl_MaxGeometryUniformComponents +
-             gl_MaxGeometryAtomicCounters +
-             gl_MaxGeometryAtomicCounterBuffers +
-             gl_MaxVertexTextureImageUnits +
-             gl_MaxCombinedTextureImageUnits +
-             gl_MaxTextureImageUnits +
-             gl_MaxDrawBuffers;
-
-void fooe1()
-{
-    gl_ViewportIndex;  // ERROR, not in ES
-    gl_MaxViewports;   // ERROR, not in ES
-    insn.length();     // 4: lines_adjacency
-    int inv = gl_InvocationID;
-}
-
-in vec4 explArray[4];
-in vec4 explArrayBad[5];  // ERROR, wrong size
-in vec4 nonArrayed;       // ERROR, not an array
-flat out vec3 myColor1;
-centroid out vec3 myColor2;
-centroid in vec3 centr[];
-sample out vec4 perSampleColor;  // ERROR without sample extensions
-
-layout(max_vertices = 200) out;  // matching redecl
-
-layout(location = 7, component = 2) in float comp[];  // ERROR, es has no component
-
-void notHere()
-{
-    gl_MaxGeometryVaryingComponents;  // ERROR, not in ES
-    gl_VerticesIn;                    // ERROR, not in ES
-}
-
-void pointSize2()
-{
-    highp float ps = gl_in[3].gl_PointSize;  // ERROR, need extension
-    gl_PointSize = ps;                       // ERROR, need extension
-}

+ 0 - 161
3rdparty/bgfx/3rdparty/glslang/Test/320.tesc

@@ -1,161 +0,0 @@
-#version 320 es
-
-layout(vertices = 4) out;
-out int outa[gl_out.length()];
-
-layout(quads) in;                   // ERROR
-layout(ccw) out;                    // ERROR
-layout(fractional_even_spacing) in; // ERROR
-
-patch in vec4 patchIn;              // ERROR
-patch out vec4 patchOut;
-
-void main()
-{
-    barrier();
-
-    int a = gl_MaxTessControlInputComponents +
-            gl_MaxTessControlOutputComponents +
-            gl_MaxTessControlTextureImageUnits +
-            gl_MaxTessControlUniformComponents +
-            gl_MaxTessControlTotalOutputComponents;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
-    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    int iid = gl_InvocationID;
-
-    gl_out[gl_InvocationID].gl_Position = p;
-    gl_out[gl_InvocationID].gl_PointSize = ps;        // ERROR, need point_size extension
-    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;  // ERROR, not in ES
-
-    gl_TessLevelOuter[3] = 3.2;
-    gl_TessLevelInner[1] = 1.3;
-
-    if (a > 10)
-        barrier();           // ERROR
-    else
-        barrier();           // ERROR
-
-    barrier();
-
-    do {
-        barrier();           // ERROR
-    } while (a > 10);
-
-    switch (a) {
-    default:
-        barrier();           // ERROR
-        break;
-    }
-    a < 12 ? a : (barrier(), a); // ERROR
-    {
-        barrier();
-    }
-
-    return;
-
-    barrier();               // ERROR
-}
-
-layout(vertices = 4) in;    // ERROR, not on in
-layout(vertices = 5) out;   // ERROR, changing #
-
-void foo()
-{
-    gl_out[4].gl_Position;  // ERROR, out of range
-
-    barrier();              // ERROR, not in main
-}
-
-in vec2 ina;                // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];            // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-patch out float implA[];    // ERROR, not sized
-
-#extension GL_ARB_separate_shader_objects : enable
-
-layout(location = 3) in vec4 ivla[];
-layout(location = 4) in vec4 ivlb[];
-layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping
-
-layout(location = 3) out vec4 ovla[];
-layout(location = 4) out vec4 ovlb[];
-layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping
-
-patch out pinbn {
-    int a;
-} pinbi;
-
-centroid out vec3 myColor2[];
-centroid in vec3 centr[];
-sample out vec4 perSampleColor[];
-
-layout(vertices = 4) out float badlay[];   // ERROR, not on a variable
-out float misSized[5];              // ERROR, size doesn't match
-out float okaySize[4];
-
-void pointSize2()
-{
-    float ps = gl_in[1].gl_PointSize;  // ERROR, need point_size extension
-    gl_out[gl_InvocationID].gl_PointSize = ps;   // ERROR, need point_size extension
-}
-
-precise vec3 pv3;
-
-void goodfoop()
-{
-    precise float d;
-
-    pv3 *= pv3;
-    pv3 = fma(pv3, pv3, pv3);
-    d = fma(d, d, d);
-}
-
-void bb()
-{
-    gl_BoundingBoxEXT[0] = vec4(0.0); // ERROR without GL_EXT_primitive_bounding_box 
-    gl_BoundingBoxOES[0] = vec4(0.0); // ERROR without GL_OES_primitive_bounding_box 
-    gl_BoundingBox[0] = vec4(1.0);
-    gl_BoundingBox[1] = vec4(1.0);
-    gl_BoundingBox[2] = vec4(2.0);  // ERROR, overflow
-}
-
-#extension GL_EXT_primitive_bounding_box : enable
-#extension GL_OES_primitive_bounding_box : enable
-
-void bbext()
-{
-    gl_BoundingBoxEXT[1] = vec4(0.0);
-    gl_BoundingBoxOES[1] = vec4(0.0);
-}
-
-out patch badpatchBName {  // ERROR, array size required
-    float f;
-} badpatchIName[];
-
-out patch patchBName {
-    float f;
-} patchIName[4];
-
-void outputtingOutparam(out int a)
-{
-    a = 2;
-}
-
-void outputting()
-{
-    outa[gl_InvocationID] = 2;
-    outa[1] = 2;                         // ERROR, not gl_InvocationID
-    gl_out[0].gl_Position = vec4(1.0);   // ERROR, not gl_InvocationID
-    outa[1];
-    gl_out[0];
-    outputtingOutparam(outa[0]);         // ERROR, not gl_InvocationID
-    outputtingOutparam(outa[gl_InvocationID]);
-    patchIName[1].f = 3.14;
-    outa[(gl_InvocationID)] = 2;
-}

+ 0 - 114
3rdparty/bgfx/3rdparty/glslang/Test/320.tese

@@ -1,114 +0,0 @@
-#version 320 es
-
-layout(vertices = 4) out; // ERROR
-layout(quads, cw) in;
-layout(triangles) in;     // ERROR
-layout(isolines) in;      // ERROR
-
-layout(ccw) in;           // ERROR
-layout(cw) in;
-
-layout(fractional_odd_spacing) in;    
-layout(equal_spacing) in;              // ERROR
-layout(fractional_even_spacing) in;    // ERROR
-
-layout(point_mode) in;
-
-patch in vec4 patchIn;
-patch out vec4 patchOut;  // ERROR
-
-void main()
-{
-    barrier(); // ERROR
-
-    int a = gl_MaxTessEvaluationInputComponents +
-            gl_MaxTessEvaluationOutputComponents +
-            gl_MaxTessEvaluationTextureImageUnits +
-            gl_MaxTessEvaluationUniformComponents +
-            gl_MaxTessPatchComponents +
-            gl_MaxPatchVertices +
-            gl_MaxTessGenLevel;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
-    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    vec3 tc = gl_TessCoord;
-    float tlo = gl_TessLevelOuter[3];
-    float tli = gl_TessLevelInner[1];
-
-    gl_Position = p;
-    gl_PointSize = ps;             // ERROR, need point_size extension
-    gl_ClipDistance[2] = cd;       // ERROR, not in ES
-}
-
-smooth patch in vec4 badp1;         // ERROR
-flat patch in vec4 badp2;           // ERROR
-noperspective patch in vec4 badp3;  // ERROR
-patch sample in vec3 badp4;         // ERROR
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in gl_PerVertex
-{
-    vec4 gl_Position;
-} gl_in[];
-
-in gl_PerVertex           // ERROR, second redeclaration of gl_in
-{
-    vec4 gl_Position;
-} gl_in[];
-
-layout(quads, cw) out;     // ERROR
-layout(triangles) out;     // ERROR
-layout(isolines) out;      // ERROR
-layout(cw) out;            // ERROR
-layout(fractional_odd_spacing) out;    // ERROR
-layout(equal_spacing) out;             // ERROR
-layout(fractional_even_spacing) out;   // ERROR
-layout(point_mode) out;                // ERROR
-
-in vec2 ina;      // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];  // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-
-in testbla {      // ERROR, not array
-    int f;
-} bla;
-
-in testblb {
-    int f;
-} blb[];
-
-in testblc { // ERROR wrong size
-    int f;
-} blc[18];
-
-in testbld {
-    int f;
-} bld[gl_MaxPatchVertices];
-
-layout(location = 23) in vec4 ivla[];
-layout(location = 24) in vec4 ivlb[];
-layout(location = 24) in vec4 ivlc[];  // ERROR, overlap
-
-layout(location = 23) out vec4 ovla[2];
-layout(location = 24) out vec4 ovlb[2];  // ERROR, overlap
-
-in float gl_TessLevelOuter[4];           // ERROR, can't redeclare
-
-patch in pinbn {
-    int a;
-} pinbi;
-
-centroid out vec3 myColor2;
-centroid in vec3 centr[];
-sample out vec4 perSampleColor;
-
-void bbbad()
-{
-    gl_BoundingBoxOES; // ERROR, wrong stage
-}

+ 0 - 255
3rdparty/bgfx/3rdparty/glslang/Test/320.vert

@@ -1,255 +0,0 @@
-#version 320 es
-
-out outbname {
-    int a;
-    out vec4 v;
-    highp sampler2D s;   // ERROR, opaque type
-} outbinst;
-
-out outbname2 {
-    layout(location = 12) int aAnon;
-    layout(location = 13) vec4 vAnon;
-};
-
-layout(location = 12) out highp int aliased;  // ERROR, aliasing location
-
-in inbname { int a; } inbinst;  // ERROR, no in block in vertex shader
-
-out gl_PerVertex {              // ERROR, has extra member
-    highp vec4 gl_Position;
-    highp vec4 t;
-};
-
-void main()
-{
-    int sum  = gl_VertexID +
-               gl_InstanceID;
-    gl_Position = vec4(1.0);
-    gl_PointSize = 2.0;         // ERROR, removed by redeclaration
-}
-
-out gl_PerVertex {              // ERROR, already used and already redeclared
-    highp vec4 gl_Position;
-    highp vec4 t;
-};
-
-smooth out smo {                // ERROR, no smooth on a block
-    int i;
-} smon;
-
-flat out fmo {                  // ERROR, no flat on a block
-    int i;
-} fmon;
-
-centroid out cmo {              // ERROR, no centroid on a block
-    int i;
-} cmon;
-
-invariant out imo {             // ERROR, no invariant on a block
-    int i;
-} imon;
-
-in vec2 inf, ing;
-uniform ivec2 offsets[4];
-uniform sampler2D sArray[4];
-uniform int sIndex;
-layout(binding = 0) uniform atomic_uint auArray[2];
-uniform ubName { int i; } ubInst[4];
-buffer bbName { int i; } bbInst[4];
-highp uniform writeonly image2D iArray[5];
-const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4));
-
-void pfoo()
-{
-    precise vec2 h;
-    h = fma(inf, ing, h);
-    sArray[sIndex + 1];
-    ubInst[sIndex + 1];
-    bbInst[sIndex - 2];      // ERROR, still not supported
-    iArray[2];
-    iArray[sIndex - 2];
-    textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf));
-    textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);
-    textureGatherOffsets(sArray[0], vec2(0.1), offsets);   // ERROR, offset not constant
-}
-
-uniform samplerBuffer  noPreSamp1;            // ERROR, no default precision
-uniform isamplerBuffer noPreSamp2;            // ERROR, no default precision
-uniform usamplerBuffer noPreSamp3;            // ERROR, no default precision
-uniform writeonly imageBuffer    noPreSamp4;  // ERROR, no default precision
-uniform writeonly iimageBuffer   noPreSamp5;  // ERROR, no default precision
-uniform writeonly uimageBuffer   noPreSamp6;  // ERROR, no default precision
-
-precision highp samplerBuffer; 
-precision highp isamplerBuffer;
-precision highp usamplerBuffer;
-precision highp imageBuffer;   
-precision highp iimageBuffer;  
-precision highp uimageBuffer;  
-
-#ifdef GL_OES_texture_buffer
-uniform samplerBuffer  bufSamp1;          
-uniform isamplerBuffer bufSamp2;          
-uniform usamplerBuffer bufSamp3;          
-#endif
-#ifdef GL_EXT_texture_buffer
-uniform writeonly imageBuffer    bufSamp4;
-uniform writeonly iimageBuffer   bufSamp5;
-uniform writeonly uimageBuffer   bufSamp6;
-#endif
-
-void bufferT()
-{
-    highp int s1 = textureSize(bufSamp1);
-    highp int s2 = textureSize(bufSamp2);
-    highp int s3 = textureSize(bufSamp3);
-
-    highp int s4 = imageSize(bufSamp4);
-    highp int s5 = imageSize(bufSamp5);
-    highp int s6 = imageSize(bufSamp6);
-    
-    highp vec4 f1 = texelFetch(bufSamp1, s1);
-    highp ivec4 f2 = texelFetch(bufSamp2, s2);
-    highp uvec4 f3 = texelFetch(bufSamp3, s3);
-}
-
-uniform writeonly imageCubeArray  noPreCA1;   // ERROR, no default precision
-uniform writeonly iimageCubeArray noPreCA2;   // ERROR, no default precision
-uniform writeonly uimageCubeArray noPreCA3;   // ERROR, no default precision
-
-uniform samplerCubeArray          noPreCA4;   // ERROR, no default precision
-uniform samplerCubeArrayShadow    noPreCA5;   // ERROR, no default precision
-uniform isamplerCubeArray         noPreCA6;   // ERROR, no default precision
-uniform usamplerCubeArray         noPreCA7;   // ERROR, no default precision
-
-precision highp imageCubeArray        ;
-precision highp iimageCubeArray       ;
-precision highp uimageCubeArray       ;
-
-precision highp samplerCubeArray      ;
-precision highp samplerCubeArrayShadow;
-precision highp isamplerCubeArray     ;
-precision highp usamplerCubeArray     ;
-
-uniform writeonly imageCubeArray  CA1;
-uniform writeonly iimageCubeArray CA2;
-uniform writeonly uimageCubeArray CA3;
-
-layout(rgba16f) uniform readonly imageCubeArray  rCA1;
-layout(rgba32i) uniform readonly iimageCubeArray rCA2;
-layout(r32ui) uniform readonly uimageCubeArray rCA3;
-
-#ifdef GL_OES_texture_cube_map_array
-uniform samplerCubeArray          CA4;
-uniform samplerCubeArrayShadow    CA5;
-uniform isamplerCubeArray         CA6;
-uniform usamplerCubeArray         CA7;
-#endif
-
-void CAT()
-{
-    highp ivec3 s4 = textureSize(CA4, 1);
-    highp ivec3 s5 = textureSize(CA5, 1);
-    highp ivec3 s6 = textureSize(CA6, 1);
-    highp ivec3 s7 = textureSize(CA7, 1);
-    
-    highp vec4 t4 = texture(CA4, vec4(0.5));
-    highp float t5 = texture(CA5, vec4(0.5), 3.0);
-    highp ivec4 t6 = texture(CA6, vec4(0.5));
-    highp uvec4 t7 = texture(CA7, vec4(0.5));
-
-    highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24);
-    highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26);
-    highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27);
-
-    highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2));
-    highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2));
-    highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2));
-
-    highp vec4 gath4 = textureGather(CA4, vec4(0.5));
-    highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2);
-    highp ivec4 gath6 = textureGather(CA6, vec4(0.5));
-    highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1);
-    highp uvec4 gath7 = textureGather(CA7, vec4(0.5));
-    highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0);
-
-    highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5);
-
-    highp ivec3 s1 = imageSize(CA1);
-    highp ivec3 s2 = imageSize(CA2);
-    highp ivec3 s3 = imageSize(CA3);
-
-    imageStore(CA1, s3, vec4(1));
-    imageStore(CA2, s3, ivec4(1));
-    imageStore(CA3, s3, uvec4(1));
-
-    highp vec4 cl1 = imageLoad(rCA1, s3);
-    highp ivec4 cl2 = imageLoad(rCA2, s3);
-    highp uvec4 cl3 = imageLoad(rCA3, s3);
-}
-
-uniform sampler2DMSArray  noPrec2DMS;    // ERROR, no default
-uniform isampler2DMSArray noPrec2DMSi;   // ERROR, no default
-uniform usampler2DMSArray noPrec2DMSu;   // ERROR, no default
-
-precision highp sampler2DMSArray;
-precision highp isampler2DMSArray;
-precision highp usampler2DMSArray;
-
-uniform sampler2DMSArray  samp2DMSA;
-uniform isampler2DMSArray samp2DMSAi;
-uniform usampler2DMSArray samp2DMSAu;
-
-void MSA()
-{
-    vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2);
-    ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2);
-    uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2);
-    
-    ivec3 tfs = textureSize(samp2DMSA);
-    ivec3 tfsi = textureSize(samp2DMSAi);
-    ivec3 tfsb = textureSize(samp2DMSAi, 4);  // ERROR, no lod
-    ivec3 tfsu = textureSize(samp2DMSAu);
-}
-
-uniform layout(r32f)  highp  image2D im2Df;
-uniform layout(r32ui) highp uimage2D im2Du;
-uniform layout(r32i)  highp iimage2D im2Di;
-uniform ivec2 P;
-
-void goodImageAtom()
-{
-    float datf;
-    int dati;
-    uint datu;
-
-    imageAtomicAdd(     im2Di, P, dati);
-    imageAtomicAdd(     im2Du, P, datu);
-    imageAtomicMin(     im2Di, P, dati);
-    imageAtomicMin(     im2Du, P, datu);
-    imageAtomicMax(     im2Di, P, dati);
-    imageAtomicMax(     im2Du, P, datu);
-    imageAtomicAnd(     im2Di, P, dati);
-    imageAtomicAnd(     im2Du, P, datu);
-    imageAtomicOr(      im2Di, P, dati);
-    imageAtomicOr(      im2Du, P, datu);
-    imageAtomicXor(     im2Di, P, dati);
-    imageAtomicXor(     im2Du, P, datu);
-    imageAtomicExchange(im2Di, P, dati);
-    imageAtomicExchange(im2Du, P, datu);
-    imageAtomicExchange(im2Df, P, datf);
-    imageAtomicCompSwap(im2Di, P,  3, dati);
-    imageAtomicCompSwap(im2Du, P, 5u, datu);
-}
-
-sample out vec4 colorSample;
-flat sample out vec4 colorfsi;
-sample out vec3 sampInArray[4];
-in vec4 inv4;
-
-void badInterp()
-{
-    interpolateAtCentroid(inv4);             // ERROR, wrong stage
-    interpolateAtSample(inv4, 1);            // ERROR, need extension
-    interpolateAtOffset(inv4, vec2(0.2));    // ERROR, need extension
-}

+ 0 - 165
3rdparty/bgfx/3rdparty/glslang/Test/330.frag

@@ -1,165 +0,0 @@
-#version 330 compatibility
-
-in vec4 inVar;
-layout(location=0, index=0) out vec4 outVar;
-
-varying vec4 varyingVar;
-
-void main()
-{
-    gl_FragColor = varyingVar;  // link ERROR: user output was used
-    gl_FragData[1] = inVar;     // link ERROR: user output was used
-    int buffer = 4;
-}
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in gl_PerFragment {
-    vec4 gl_Color;
-};
-
-void foo()
-{
-    vec4 c = gl_Color;
-    outVar = inVar;
-}
-
-in gl_block { // ERROR
-    int gl_i;
-} gl_name;
-
-in myBlock {
-    int gl_i;  // ERROR
-} gl_name;     // ERROR
-
-in gl_PerVertex {  // ERROR
-    vec4 gl_FragCoord;
-} gl_in[];
-
-in gl_PerVertex {  // ERROR
-    vec4 gl_FragCoord;
-};  // ERROR
-
-const int start = 6;
-layout(location = -2) in vec4 v1;         // ERROR
-layout(location = start + 2) in vec4 v2;  // ERROR
-layout(location = 4.7e10) in vec4 v20;    // ERROR
-layout(location = +60) in float v21;      // ERROR
-layout(location = (2)) in float v22;      // ERROR
-
-struct S {
-    float f1;
-    layout(location = 3) float f2;        // ERROR
-};
-
-layout(location = 1) in inblock {         // ERROR
-    float f1;
-    layout(location = 3) float f2;        // ERROR
-};
-
-layout(location = 1) uniform ublock {     // ERROR
-    float f1;
-    layout(location = 3) float f2;        // ERROR
-} uinst;
-
-#extension GL_ARB_enhanced_layouts : enable
-
-layout(location = start) in vec4 v3;
-layout(location = -2) in vec4 v4;         // ERROR
-layout(location = -start) in vec4 v5;     // ERROR
-layout(location = start*start - 2 - 4) in vec4 v6;
-layout(location = +61) in float v23;
-layout(location = (62)) in float v24;
-
-struct S2 {
-    float f1;
-    layout(location = 3) float f2;        // ERROR
-};
-
-layout(location = 28) in inblock2 {
-    bool b1;
-    float f1;
-    layout(location = 25) float f2;
-    vec4 f3;
-    layout(location = 21) S2 s2;
-    vec4 f4;
-    vec4 f5;
-} ininst2;
-
-layout(location = 13) uniform ublock2 {   // ERROR
-    float f1;
-    layout(location = 3) float f2;        // ERROR
-} uinst2;
-
-in inblock3 {                             // ERROR, mix of location internal with no location external
-    float f1;
-    layout(location = 40) float f2;
-} in3;
-
-in ublock4 {
-    layout(location = 50) float f1;
-    layout(location = 51) float f2;
-} in4;
-
-layout(location = 33) in struct SS {
-    vec3 a;    // gets location 33
-    mat2 b;    // gets locations 34 and 35
-    vec4 c[2]; // gets locations 36 and 37
-    layout (location = 38) vec2 A; // ERROR, can't use on struct member
-} s;
-
-layout(location = 44) in block {
-    vec4 d; // gets location 44
-    vec4 e; // gets location 45
-    layout(location = 47) vec4 f; // gets location 47
-    vec4 g; // gets location 48
-    layout (location = 41) vec4 h; // gets location 41
-    vec4 i; // gets location 42
-    vec4 j; // gets location 43
-    vec4 k; // ERROR, location 44 already used
-};
-
-layout(index=0) out vec4 outVar2; // ERROR: missing explicit location
-layout(location=0, index=1) out vec4 outVar3; // no error even though location is overlapping
-layout(location=0, index=1) out vec4 outVar4; // ERROR overlapping
-layout(location=27, index=0) in vec4 indexIn; // ERROR, not on in
-layout(location=0, index=0) in; // ERROR, not just on in
-layout(location=0, index=0) out; // ERROR, need a variable
-layout(location=26, index=0) out indexBlock { int a; } indexBlockI; // ERROR, not on a block
-
-uniform sampler1D samp1D;
-uniform sampler2DShadow samp2Ds;
-
-void qlod()
-{
-    vec2 lod;
-    float pf;
-    vec2 pf2;
-    vec3 pf3;
-
-    lod = textureQueryLod(samp1D, pf);      // ERROR, not until 400
-    lod = textureQueryLod(samp2Ds, pf2);    // ERROR, not until 400
-}
-
-int precise;                // okay, not a keyword yet
-struct SKeyMem { int precise; } KeyMem; // okay, not a keyword yet
-
-void fooKeyMem()
-{
-    KeyMem.precise;
-}
-
-layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range
-
-layout(location=4) uniform vec4 ucolor0; // ERROR: extension is not enabled
-
-#extension GL_ARB_explicit_uniform_location : enable
-
-layout(location=5) uniform vec4 ucolor1;
-
-layout(location=6) uniform ColorsBuffer // ERROR: location cannot be applied in uniform buffer block
-{
-    vec4 colors[128];
-} colorsBuffer;
-
-

+ 0 - 12
3rdparty/bgfx/3rdparty/glslang/Test/330comp.frag

@@ -1,12 +0,0 @@
-#version 330 compatibility
-
-in vec4 inVar;
-out vec4 outVar;
-
-varying vec4 varyingVar;
-
-void main()
-{
-    gl_FragColor = varyingVar;
-    gl_FragData[1] = inVar * gl_ModelViewMatrix;
-}

+ 0 - 201
3rdparty/bgfx/3rdparty/glslang/Test/400.frag

@@ -1,201 +0,0 @@
-#version 400 core
-
-in vec2 c2D;
-flat in int i;
-out vec4 outp;
-uniform sampler2D arrayedSampler[5];
-uniform usampler2DRect samp2dr;
-uniform isampler2DArray isamp2DA;
-
-void main()
-{
-    vec4 v;
-    v = texture(arrayedSampler[i], c2D);
-    outp.x = gl_ClipDistance[1];
-
-    ivec2 offsets[4];
-    const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0));
-    uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2);  // ERROR, offsets not constant
-    uv4 = textureGatherOffsets(samp2dr, c2D, constOffsets, 2);
-    vec4 v4 = textureGather(arrayedSampler[0], c2D);
-    ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3);
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i);  // ERROR, last argument not const
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4);  // ERROR, last argument out of range
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2);
-    iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i));
-
-    vec4 c = gl_FragCoord;
-}
-
-layout(location = 4) in vec4 vl; // ERROR, not supported
-
-#ifdef GL_ARB_separate_shader_objects
-#extension GL_ARB_separate_shader_objects : enable
-#endif
-
-layout(location = 6) in vec4 vl2;
-
-layout(location = 3) uniform vec3 uv3;
-
-layout(location = 5) in vec4 gl_Color;      // ERROR, layout
-noperspective in float gl_ClipDistance[4];  // ERROR, can't change qualifier
-
-layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR, declared after use
-
-uniform sampler2DRectShadow u2drs;
-
-void foo23()
-{
-    const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16));
-
-    textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(c2D));     // ERROR, offset not constant
-    textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]);
-    textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[2]);     // ERROR, offset out of range
-    textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range
-}
-
-patch in vec4 patchIn;              // ERROR
-patch out vec4 patchOut;            // ERROR
-
-void foo24()
-{
-    dvec3 df, di;
-    df = modf(dvec3(outp.xyz), di);
-}
-
-in float in1;
-in vec2 in2;
-in vec3 in3;
-in vec4 in4;
-
-void foodc1()
-{
-    vec2 v2 = dFdxFine(in2);           // ERROR
-    vec3 v3 = dFdyCoarse(in3);         // ERROR
-    vec4 v4 = fwidthCoarse(in4) + fwidthFine(in4);   // ERROR
-}
-
-#extension GL_ARB_derivative_control : enable
-
-void foodc2()
-{
-    vec2 v2 = dFdxFine(in2);
-    vec3 v3 = dFdyCoarse(in3);
-    vec4 v4 = fwidthCoarse(in4) + fwidthFine(in4);
-
-    uint u1;
-    ivec3 i3;
-    ivec2 i2;
-    v2 = frexp(v2, i2);
-    v3 = ldexp(v3, i3);
-
-    u1 = packUnorm4x8(v4);
-    u1 = packSnorm4x8(v4);
-    v4 = unpackUnorm4x8(u1);
-    v4 = unpackSnorm4x8(u1);
-
-    double d;
-    uvec2 u2;
-    d = packDouble2x32(u2);
-    u2 = unpackDouble2x32(d);
-}
-
-sample in vec4 colorSampIn;
-sample out vec4 colorSampleBad;     // ERROR
-noperspective in vec4 colorfsi;
-sample in vec3 sampInArray[4];
-smooth in float scalarIn;
-flat centroid in vec2 colorfc;
-
-struct S {
-    float x;
-};
-
-in S s1;
-sample S s2;
-
-void interp()
-{
-    interpolateAtCentroid(colorfc);
-    interpolateAtCentroid(colorSampIn);
-    interpolateAtCentroid(colorfsi);
-    interpolateAtCentroid(scalarIn);
-    interpolateAtCentroid(sampInArray);         // ERROR
-    interpolateAtCentroid(sampInArray[2]);
-    interpolateAtCentroid(sampInArray[2].xy);   // ERROR
-
-    interpolateAtSample(sampInArray, 1);        // ERROR
-    interpolateAtSample(sampInArray[i], 0);
-    interpolateAtSample(s1.x, 2);
-    interpolateAtSample(scalarIn, 1);
-
-    interpolateAtOffset(sampInArray, vec2(0.2));         // ERROR
-    interpolateAtOffset(sampInArray[2], vec2(0.2));
-    interpolateAtOffset(sampInArray[2].xy, vec2(0.2));   // ERROR, no swizzle
-    interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference
-    interpolateAtOffset(s2.x, vec2(0.2));      // ERROR
-
-    float f;
-    interpolateAtCentroid(f);           // ERROR, not interpolant
-    interpolateAtSample(outp, 0);       // ERROR, not interpolant
-}
-
-uniform sampler1D samp1D;
-uniform isampler2D isamp2D;
-uniform usampler3D usamp3D;
-uniform samplerCube sampCube; 
-uniform isampler1DArray isamp1DA;
-uniform usampler2DArray usamp2DA;
-uniform isamplerCubeArray isampCubeA;
-
-uniform sampler1DShadow samp1Ds;
-uniform sampler2DShadow samp2Ds;
-uniform samplerCubeShadow sampCubes;
-uniform sampler1DArrayShadow samp1DAs;
-uniform sampler2DArrayShadow samp2DAs;
-uniform samplerCubeArrayShadow sampCubeAs;
-
-uniform samplerBuffer sampBuf;
-uniform sampler2DRect sampRect;
-
-void qlod()
-{
-    vec2 lod;
-    float pf;
-    vec2 pf2;
-    vec3 pf3;
-
-    lod = textureQueryLod(samp1D, pf);
-    lod = textureQueryLod(isamp2D, pf2);
-    lod = textureQueryLod(usamp3D, pf3);
-    lod = textureQueryLod(sampCube, pf3);
-    lod = textureQueryLod(isamp1DA, pf);
-    lod = textureQueryLod(usamp2DA, pf2);
-    lod = textureQueryLod(isampCubeA, pf3);
-
-    lod = textureQueryLod(samp1Ds, pf);
-    lod = textureQueryLod(samp2Ds, pf2);
-    lod = textureQueryLod(sampCubes, pf3);
-    lod = textureQueryLod(samp1DAs, pf);
-    lod = textureQueryLod(samp2DAs, pf2);
-    lod = textureQueryLod(sampCubeAs, pf3);
-
-    lod = textureQueryLod(sampBuf, pf);     // ERROR
-    lod = textureQueryLod(sampRect, pf2);   // ERROR
-}
-
-uniform uint uu;
-out uint iout;
-
-void bitwiseConv()
-{
-    iout = uu & i;
-    iout += uu ^ i;
-    iout += i | uu;
-}
-
-subroutine(subT1, subT2);
-subroutine float subT1() { return 1.0; }
-subroutine float subT2() { return 1.0; }
-
-struct SKeyMem { int precise; } KeyMem;     // ERROR, keyword can't be a member

+ 0 - 330
3rdparty/bgfx/3rdparty/glslang/Test/400.geom

@@ -1,330 +0,0 @@
-#version 400 core
-
-void main()
-{
-    EmitStreamVertex(1);
-    EndStreamPrimitive(0);
-    EmitVertex();
-    EndPrimitive();
-    int id = gl_InvocationID;
-}
-
-layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block
-layout(max_vertices = 127) out;
-layout(invocations = 4) in;
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in gl_PerVertex {      // testing input arrays with a block redeclaration, see 420.geom for without
-    vec4 gl_Position;
-    layout(std140, location = 3) patch float gl_PointSize; // ERRORs...
-} gl_in[];
-
-void foo()
-{
-    gl_in.length();  // ERROR
-    gl_in[1].gl_Position;
-}
-
-in vec4 color[];
-in vec4 color2[];
-in vec4 colorS[3];
-in vec4 colorBad[4];
-
-void foo2()
-{
-    color.length(); // ERROR
-    colorS.length();
-}
-
-layout(triangles) in;  // give ERROR just for colorBad
-
-in vec4 color[3];
-in vec4 color2[3];
-in vec4 colorbad2[2];  // ERROR
-
-void foo3()
-{
-    gl_in.length();
-    color.length();
-    color2.length();
-    colorS.length();
-}
-
-layout(location = 4) in vec4 cva[3];
-layout(location = 5) in vec4 cvb[3];
-layout(location = 2) in mat3 cmc[3];  // ERROR, collision
-
-patch in vec4 patchIn[];            // ERROR
-patch out vec4 patchOut;            // ERROR
-
-in float scalar;  // ERROR, no array
-
-layout(max_vertices = 127, invocations = 4) out;      // ERROR
-layout(invocations = 4, max_vertices = 127) in;       // ERROR
-layout(max_vertices = 127, invocations = 4) uniform;  // 2 ERRORs
-
-in inblockscalar {
-    int a;
-} inbls;  // ERROR, not an array
-
-in inblocka {
-    int a;
-} inbla[17];  // ERROR, wrong array size
-
-void bits()
-{
-    uvec2 u2;
-    u2 = uaddCarry(u2, u2, u2);
-    uint u1;
-    u1 = usubBorrow(u1, u1, u1);
-    uvec4 u4;
-    umulExtended(u4, u4, u4, u4);
-    ivec4 i4;
-    imulExtended(i4, i4, i4, i4);
-    int i1;
-    i1 = bitfieldExtract(i1, 4, 5);
-    uvec3 u3;
-    u3 = bitfieldExtract(u3, 4, 5);
-    ivec3 i3;
-    i3 = bitfieldInsert(i3, i3, 4, 5);
-    u1 = bitfieldInsert(u1, u1, 4, 5);
-    ivec2 i2;
-    i2 = bitfieldReverse(i2);
-    u4 = bitfieldReverse(u4);
-    i1 = bitCount(i1);
-    i3 = bitCount(u3);
-    i2 = findLSB(i2);
-    i4 = findLSB(u4);
-    i1 = findMSB(i1);
-    i2 = findMSB(u2);
-}
-
-layout(location = 7, index = 1) out vec4 indexedOut;
-
-uniform sampler1D samp1D;
-uniform sampler2DShadow samp2Ds;
-
-void qlod()
-{
-    vec2 lod;
-    float pf;
-    vec2 pf2;
-    vec3 pf3;
-
-    lod = textureQueryLod(samp1D, pf);      // ERROR, only in fragment
-    lod = textureQueryLod(samp2Ds, pf2);    // ERROR, only in fragment
-}
-
-void doubles()
-{
-    double doublev;
-    dvec2 dvec2v;
-    dvec3 dvec3v;
-    dvec4 dvec4v;
-
-    bool boolv;
-    bvec2 bvec2v;
-    bvec3 bvec3v;
-    bvec4 bvec4v;
-
-    doublev = sqrt(2.9);
-    dvec2v  = sqrt(dvec2(2.7));
-    dvec3v  = sqrt(dvec3(2.0));
-    dvec4v  = sqrt(dvec4(2.1));
-
-    doublev += inversesqrt(doublev);
-    dvec2v  += inversesqrt(dvec2v);
-    dvec3v  += inversesqrt(dvec3v);
-    dvec4v  += inversesqrt(dvec4v);
-
-    doublev += abs(doublev);
-    dvec2v  += abs(dvec2v);
-    dvec3v  += abs(dvec3v);
-    dvec4v  += abs(dvec4v);
-
-    doublev += sign(doublev);
-    dvec2v  += sign(dvec2v);
-    dvec3v  += sign(dvec3v);
-    dvec4v  += sign(dvec4v);
-
-    doublev += floor(doublev);
-    dvec2v  += floor(dvec2v);
-    dvec3v  += floor(dvec3v);
-    dvec4v  += floor(dvec4v);
-
-    doublev += trunc(doublev);
-    dvec2v  += trunc(dvec2v);
-    dvec3v  += trunc(dvec3v);
-    dvec4v  += trunc(dvec4v);
-
-    doublev += round(doublev);
-    dvec2v  += round(dvec2v);
-    dvec3v  += round(dvec3v);
-    dvec4v  += round(dvec4v);
-
-    doublev += roundEven(doublev);
-    dvec2v  += roundEven(dvec2v);
-    dvec3v  += roundEven(dvec3v);
-    dvec4v  += roundEven(dvec4v);
-
-    doublev += ceil(doublev);
-    dvec2v  += ceil(dvec2v);
-    dvec3v  += ceil(dvec3v);
-    dvec4v  += ceil(dvec4v);
-
-    doublev += fract(doublev);
-    dvec2v  += fract(dvec2v);
-    dvec3v  += fract(dvec3v);
-    dvec4v  += fract(dvec4v);
-
-    doublev += mod(doublev, doublev);
-    dvec2v  += mod(dvec2v, doublev);
-    dvec3v  += mod(dvec3v, doublev);
-    dvec4v  += mod(dvec4v, doublev);
-    dvec2v  += mod(dvec2v, dvec2v);
-    dvec3v  += mod(dvec3v, dvec3v);
-    dvec4v  += mod(dvec4v, dvec4v);
-
-    doublev += modf(doublev, doublev);
-    dvec2v  += modf(dvec2v,  dvec2v);
-    dvec3v  += modf(dvec3v,  dvec3v);
-    dvec4v  += modf(dvec4v,  dvec4v);
-
-    doublev += min(doublev, doublev);
-    dvec2v  += min(dvec2v, doublev);
-    dvec3v  += min(dvec3v, doublev);
-    dvec4v  += min(dvec4v, doublev);
-    dvec2v  += min(dvec2v, dvec2v);
-    dvec3v  += min(dvec3v, dvec3v);
-    dvec4v  += min(dvec4v, dvec4v);
-
-    doublev += max(doublev, doublev);
-    dvec2v  += max(dvec2v, doublev);
-    dvec3v  += max(dvec3v, doublev);
-    dvec4v  += max(dvec4v, doublev);
-    dvec2v  += max(dvec2v, dvec2v);
-    dvec3v  += max(dvec3v, dvec3v);
-    dvec4v  += max(dvec4v, dvec4v);
-
-    doublev += clamp(doublev, doublev, doublev);
-    dvec2v  += clamp(dvec2v, doublev, doublev);
-    dvec3v  += clamp(dvec3v, doublev, doublev);
-    dvec4v  += clamp(dvec4v, doublev, doublev);
-    dvec2v  += clamp(dvec2v, dvec2v, dvec2v);
-    dvec3v  += clamp(dvec3v, dvec3v, dvec3v);
-    dvec4v  += clamp(dvec4v, dvec4v, dvec4v);
-
-    doublev += mix(doublev, doublev, doublev);
-    dvec2v  += mix(dvec2v, dvec2v, doublev);
-    dvec3v  += mix(dvec3v, dvec3v, doublev);
-    dvec4v  += mix(dvec4v, dvec4v, doublev);
-    dvec2v  += mix(dvec2v, dvec2v, dvec2v);
-    dvec3v  += mix(dvec3v, dvec3v, dvec3v);
-    dvec4v  += mix(dvec4v, dvec4v, dvec4v);
-    doublev += mix(doublev, doublev, boolv);
-    dvec2v  += mix(dvec2v, dvec2v, bvec2v);
-    dvec3v  += mix(dvec3v, dvec3v, bvec3v);
-    dvec4v  += mix(dvec4v, dvec4v, bvec4v);
-
-    doublev += step(doublev, doublev);
-    dvec2v  += step(dvec2v, dvec2v);
-    dvec3v  += step(dvec3v, dvec3v);
-    dvec4v  += step(dvec4v, dvec4v);
-    dvec2v  += step(doublev, dvec2v);
-    dvec3v  += step(doublev, dvec3v);
-    dvec4v  += step(doublev, dvec4v);
-
-    doublev += smoothstep(doublev, doublev, doublev);
-    dvec2v  += smoothstep(dvec2v, dvec2v, dvec2v);
-    dvec3v  += smoothstep(dvec3v, dvec3v, dvec3v);
-    dvec4v  += smoothstep(dvec4v, dvec4v, dvec4v);
-    dvec2v  += smoothstep(doublev, doublev, dvec2v);
-    dvec3v  += smoothstep(doublev, doublev, dvec3v);
-    dvec4v  += smoothstep(doublev, doublev, dvec4v);
-
-    boolv  = isnan(doublev);
-    bvec2v = isnan(dvec2v);
-    bvec3v = isnan(dvec3v);
-    bvec4v = isnan(dvec4v);
-
-    boolv  = boolv ? isinf(doublev) : false;
-    bvec2v = boolv ? isinf(dvec2v)  : bvec2(false);
-    bvec3v = boolv ? isinf(dvec3v)  : bvec3(false);
-    bvec4v = boolv ? isinf(dvec4v)  : bvec4(false);
-
-    doublev += length(doublev);
-    doublev += length(dvec2v);
-    doublev += length(dvec3v);
-    doublev += length(dvec4v);
-
-    doublev += distance(doublev, doublev);
-    doublev += distance(dvec2v, dvec2v);
-    doublev += distance(dvec3v, dvec3v);
-    doublev += distance(dvec4v, dvec4v);
-
-    doublev += dot(doublev, doublev);
-    doublev += dot(dvec2v, dvec2v);
-    doublev += dot(dvec3v, dvec3v);
-    doublev += dot(dvec4v, dvec4v);
-
-    dvec3v += cross(dvec3v, dvec3v);
-
-    doublev += normalize(doublev);
-    dvec2v  += normalize(dvec2v);
-    dvec3v  += normalize(dvec3v);
-    dvec4v  += normalize(dvec4v);
-
-    doublev += faceforward(doublev, doublev, doublev);
-    dvec2v  += faceforward(dvec2v, dvec2v, dvec2v);
-    dvec3v  += faceforward(dvec3v, dvec3v, dvec3v);
-    dvec4v  += faceforward(dvec4v, dvec4v, dvec4v);
-
-    doublev += reflect(doublev, doublev);
-    dvec2v  += reflect(dvec2v, dvec2v);
-    dvec3v  += reflect(dvec3v, dvec3v);
-    dvec4v  += reflect(dvec4v, dvec4v);
-
-    doublev += refract(doublev, doublev, doublev);
-    dvec2v  += refract(dvec2v, dvec2v, doublev);
-    dvec3v  += refract(dvec3v, dvec3v, doublev);
-    dvec4v  += refract(dvec4v, dvec4v, doublev);
-
-    dmat2   dmat2v   = outerProduct(dvec2v, dvec2v);
-    dmat3   dmat3v   = outerProduct(dvec3v, dvec3v);
-    dmat4   dmat4v   = outerProduct(dvec4v, dvec4v);
-    dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v);
-    dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v);
-    dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v);
-    dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v);
-    dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v);
-    dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v);
-
-    dmat2v *= matrixCompMult(dmat2v, dmat2v);
-    dmat3v *= matrixCompMult(dmat3v, dmat3v);
-    dmat4v *= matrixCompMult(dmat4v, dmat4v);
-    dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v);
-    dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v);
-    dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v);
-    dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v);
-    dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v);
-    dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v);
-
-    dmat2v   *= transpose(dmat2v);
-    dmat3v   *= transpose(dmat3v);
-    dmat4v   *= transpose(dmat4v);
-    dmat2x3v  = transpose(dmat3x2v);
-    dmat3x2v  = transpose(dmat2x3v);
-    dmat2x4v  = transpose(dmat4x2v);
-    dmat4x2v  = transpose(dmat2x4v);
-    dmat3x4v  = transpose(dmat4x3v);
-    dmat4x3v  = transpose(dmat3x4v);
-
-    doublev += determinant(dmat2v);
-    doublev += determinant(dmat3v);
-    doublev += determinant(dmat4v);
-
-    dmat2v *= inverse(dmat2v);
-    dmat3v *= inverse(dmat3v);
-    dmat4v *= inverse(dmat4v);
-}

+ 0 - 125
3rdparty/bgfx/3rdparty/glslang/Test/400.tesc

@@ -1,125 +0,0 @@
-#version 400 core
-
-layout(vertices = 4) out;
-int outa[gl_out.length()];
-
-layout(quads) in;                   // ERROR
-layout(ccw) out;                    // ERROR
-layout(fractional_even_spacing) in; // ERROR
-
-patch in vec4 patchIn;              // ERROR
-patch out vec4 patchOut;
-
-void main()
-{
-    barrier();
-
-    int a = gl_MaxTessControlInputComponents +
-            gl_MaxTessControlOutputComponents +
-            gl_MaxTessControlTextureImageUnits +
-            gl_MaxTessControlUniformComponents +
-            gl_MaxTessControlTotalOutputComponents;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;
-    float cd = gl_in[1].gl_ClipDistance[2];
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    int iid = gl_InvocationID;
-
-    gl_out[gl_InvocationID].gl_Position = p;
-    gl_out[gl_InvocationID].gl_PointSize = ps;
-    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;
-
-    gl_TessLevelOuter[3] = 3.2;
-    gl_TessLevelInner[1] = 1.3;
-
-    if (a > 10)
-        barrier();           // ERROR
-    else
-        barrier();           // ERROR
-
-    barrier();
-
-    do {
-        barrier();           // ERROR
-    } while (a > 10);
-
-    switch (a) {
-    default:
-        barrier();           // ERROR
-        break;
-    }
-    a < 12 ? a : (barrier(), a); // ERROR
-    {
-        barrier();
-    }
-
-    return;
-
-    barrier();               // ERROR
-}
-
-layout(vertices = 4) in;    // ERROR
-layout(vertices = 5) out;   // ERROR
-
-void foo()
-{
-    gl_out[4].gl_PointSize;  // ERROR
-
-    barrier();                // ERROR
-}
-
-in vec2 ina;   // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];  // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-
-#extension GL_ARB_separate_shader_objects : enable
-
-layout(location = 3) in vec4 ivla[];
-layout(location = 4) in vec4 ivlb[];
-layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping
-
-layout(location = 3) out vec4 ovla[];
-layout(location = 4) out vec4 ovlb[];
-layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping
-
-precise vec3 pv3;
-
-void foop()
-{
-    precise double d;
-
-    pv3 *= pv3;
-    pv3 = fma(pv3, pv3, pv3);
-    d = fma(d, d, d);
-}
-
-patch out pinbn {
-    int a;
-} pinbi;
-
-invariant precise out vec4 badOrder[]; // ERROR, precise must appear first
-void badp(out precise float f);        // ERROR, precise must appear first
-
-void devi()
-{
-    gl_DeviceIndex; // ERROR, no extension
-    gl_ViewIndex;   // ERROR, no extension
-}
-
-#ifdef GL_EXT_device_group
-#extension GL_EXT_device_group : enable
-#endif
-
-#ifdef GL_EXT_multiview
-#extension GL_EXT_multiview : enable
-#endif
-
-void devie()
-{
-    gl_DeviceIndex;
-    gl_ViewIndex;
-}

+ 0 - 125
3rdparty/bgfx/3rdparty/glslang/Test/400.tese

@@ -1,125 +0,0 @@
-#version 400 core
-
-layout(vertices = 4) out; // ERROR
-layout(quads, cw) in;
-layout(triangles) in;     // ERROR
-layout(isolines) in;      // ERROR
-
-layout(ccw) in;           // ERROR
-layout(cw) in;
-
-layout(fractional_odd_spacing) in;    
-layout(equal_spacing) in;              // ERROR
-layout(fractional_even_spacing) in;    // ERROR
-
-layout(point_mode) in;
-
-patch in vec4 patchIn;
-patch out vec4 patchOut;  // ERROR
-
-void main()
-{
-    barrier(); // ERROR
-
-    int a = gl_MaxTessEvaluationInputComponents +
-            gl_MaxTessEvaluationOutputComponents +
-            gl_MaxTessEvaluationTextureImageUnits +
-            gl_MaxTessEvaluationUniformComponents +
-            gl_MaxTessPatchComponents +
-            gl_MaxPatchVertices +
-            gl_MaxTessGenLevel;
-
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;
-    float cd = gl_in[1].gl_ClipDistance[2];
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    vec3 tc = gl_TessCoord;
-    float tlo = gl_TessLevelOuter[3];
-    float tli = gl_TessLevelInner[1];
-
-    gl_Position = p;
-    gl_PointSize = ps;
-    gl_ClipDistance[2] = cd;
-}
-
-smooth patch in vec4 badp1;         // ERROR
-flat patch in vec4 badp2;           // ERROR
-noperspective patch in vec4 badp3;  // ERROR
-patch sample in vec3 badp4;         // ERROR
-
-#extension GL_ARB_separate_shader_objects : enable
-
-in gl_PerVertex
-{
-    float gl_ClipDistance[1];
-} gl_in[];
-
-in gl_PerVertex            // ERROR, second redeclaration of gl_in
-{
-    float gl_ClipDistance[1];
-} gl_in[];
-
-layout(quads, cw) out;     // ERROR
-layout(triangles) out;     // ERROR
-layout(isolines) out;      // ERROR
-layout(cw) out;            // ERROR
-layout(fractional_odd_spacing) out;    // ERROR
-layout(equal_spacing) out;             // ERROR
-layout(fractional_even_spacing) out;   // ERROR
-layout(point_mode) out;                // ERROR
-
-in vec2 ina;   // ERROR, not array
-in vec2 inb[];
-in vec2 inc[18];  // ERROR, wrong size
-in vec2 ind[gl_MaxPatchVertices];
-
-in testbla {
-    int f;
-} bla;        // ERROR, not array
-
-in testblb {
-    int f;
-} blb[];
-
-in testblc {
-    int f;
-} blc[18]; // ERROR wrong size
-
-in testbld {
-    int f;
-} bld[gl_MaxPatchVertices];
-
-layout(location = 23) in vec4 ivla[];
-layout(location = 24) in vec4 ivlb[];
-layout(location = 24) in vec4 ivlc[];  // ERROR
-
-layout(location = 23) out vec4 ovla[2];
-layout(location = 24) out vec4 ovlb[2];  // ERROR
-
-in float gl_TessLevelOuter[4];           // ERROR, can't redeclare
-
-patch in pinbn {
-    int a;
-} pinbi;
-
-void devi()
-{
-    gl_DeviceIndex; // ERROR, no extension
-    gl_ViewIndex;   // ERROR, no extension
-}
-
-#ifdef GL_EXT_device_group
-#extension GL_EXT_device_group : enable
-#endif
-
-#ifdef GL_EXT_multiview
-#extension GL_EXT_multiview : enable
-#endif
-
-void devie()
-{
-    gl_DeviceIndex;
-    gl_ViewIndex;
-}

+ 0 - 106
3rdparty/bgfx/3rdparty/glslang/Test/400.vert

@@ -1,106 +0,0 @@
-#version 400 core
-
-in double d;   // ERROR, no doubles
-in dvec3 d3;   // ERROR, no doubles
-in dmat4 dm4;  // ERROR, no doubles
-
-// function selection under type conversion
-void foo1(double a, uint b)  {}
-void foo1(double a, int b)   {}
-void foo1(double a, float b) {}
-void foo1(double a, double b){}
-
-void foo2(double a, float b) {}
-void foo2(double a, double b){}
-
-void foo3(double a, float b) {}
-void foo3(float a, double b) {}
-
-void ftd(  int,  float, double) {}
-void ftd( uint,  float, double) {}
-void ftd(float, double, double) {}
-
-void main()
-{
-    double d;
-	uint u;
-	int i;
-	float f;
-
-	foo1(d, d);
-	foo1(d, u);
-	foo1(d, i);
-	foo1(d, f);
-
-	foo1(f, d);
-	foo1(f, u);
-	foo1(f, i);
-	foo1(f, f);
-
-	foo1(u, d);
-	foo1(u, u);
-	foo1(u, i);
-	foo1(u, f);
-
-	foo1(i, d);
-	foo1(i, u);
-	foo1(i, i);
-	foo1(i, f);
-
-	foo2(d, d);
-	foo2(d, u);
-	foo2(d, i);
-	foo2(d, f);
-
-	foo2(f, d);
-	foo2(f, u);
-	foo2(f, i);
-	foo2(f, f);
-
-	foo2(u, d);
-	foo2(u, u);
-	foo2(u, i);
-	foo2(u, f);
-
-	foo2(i, d);
-	foo2(i, u);
-	foo2(i, i);
-	foo2(i, f);
-
-	foo3(d, d);  // ERROR, no match
-	foo3(d, u);
-	foo3(d, i);
-	foo3(d, f);
-
-	foo3(f, d);
-	foo3(f, u); // ERROR, ambiguous
-	foo3(f, i); // ERROR, ambiguous
-	foo3(f, f); // ERROR, ambiguous
-
-	foo3(u, d);
-	foo3(u, u); // ERROR, ambiguous
-	foo3(u, i); // ERROR, ambiguous
-	foo3(u, f); // ERROR, ambiguous
-
-	foo3(i, d);
-	foo3(i, u); // ERROR, ambiguous
-	foo3(i, i); // ERROR, ambiguous
-	foo3(i, f); // ERROR, ambiguous
-
-	ftd(i, f, f);
-	ftd(u, f, f);
-}
-
-void itf(int, float, int);
-void itf(int, double, int);
-
-void tf()
-{
-    double d;
-	uint u;
-	int i;
-	float f;
-	
-	itf(i, i, i);
-	itf(i, u, i);
-}

+ 0 - 39
3rdparty/bgfx/3rdparty/glslang/Test/410.geom

@@ -1,39 +0,0 @@
-#version 410 core
-
-void main()
-{
-    gl_ViewportIndex = 7;
-}
-
-in gl_PerVertex {
-    float gl_PointSize;
-} myIn[];  // ERROR, can't redeclare a different name
-
-in gl_PerVertex {
-    float gl_PointSize;
-} gl_myIn[];  // ERROR, can't redeclare a different name
-
-in gl_PerVertex {
-    float gl_PointSize;
-} gl_in[];
-
-in gl_PerVertex {
-    float gl_PointSize;
-} gl_in[];     // ERROR, can't do it again
-
-out gl_PerVertex {
-    float gl_PointSize;
-};
-
-void foo()
-{
-    float p = gl_in[1].gl_PointSize;  // use of redeclared
-    gl_PointSize = p;                 // use of redeclared
-    vec4 v = gl_in[1].gl_Position;    // ERROR, not included in the redeclaration
-    gl_Position = vec4(1.0);          // ERROR, not included in the redeclaration
-}
-
-float foo5()
-{
-    return 4;  // implicit conversion of return type
-}

+ 0 - 11
3rdparty/bgfx/3rdparty/glslang/Test/410.tesc

@@ -1,11 +0,0 @@
-#version 400 core
-
-// no layout(vertices = ...) out;
-int outa[gl_out.length()];  // ERROR
-
-patch out vec4 patchOut;
-
-void main()
-{
-
-}

+ 0 - 9
3rdparty/bgfx/3rdparty/glslang/Test/410.vert

@@ -1,9 +0,0 @@
-#version 410 core
-
-in double d;
-in dvec3 d3;
-in dmat4 dm4;
-
-void main()
-{
-}

+ 0 - 30
3rdparty/bgfx/3rdparty/glslang/Test/420.comp

@@ -1,30 +0,0 @@
-#version 420
-
-layout(local_size_x = 2) in;  // ERROR, no compute
-
-#extension GL_ARB_compute_shader : enable
-
-layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in;
-
-shared vec3 sfoo;
-
-void main()
-{
-    sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z);
-    sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID;
-    sfoo *= gl_LocalInvocationIndex;
-    sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize;
-    sfoo *= gl_MaxComputeUniformComponents +
-            gl_MaxComputeTextureImageUnits +
-            gl_MaxComputeImageUniforms +
-            gl_MaxComputeAtomicCounters +
-            gl_MaxComputeAtomicCounterBuffers;
-
-    barrier();
-    memoryBarrier();
-    memoryBarrierAtomicCounter();
-    memoryBarrierBuffer();
-    memoryBarrierImage();
-    memoryBarrierShared();
-    groupMemoryBarrier();
-}

+ 0 - 14
3rdparty/bgfx/3rdparty/glslang/Test/420.frag

@@ -1,14 +0,0 @@
-#version 420 core
-
-layout(depth_any) out float gl_FragDepth;
-layout(depth_greater) out float gl_FragDepth; // ERROR: redeclaration with different qualifier
-
-void main()
-{
-    gl_FragDepth = 0.3;
-}
-
-layout(depth_less) in float depth; // ERROR: depth_less only applies to gl_FragDepth
-layout(depth_any) out float gl_FragDepth;  // ERROR, done after use
-
-layout(binding=0) uniform atomic_uint a[];

+ 0 - 55
3rdparty/bgfx/3rdparty/glslang/Test/420.geom

@@ -1,55 +0,0 @@
-#version 420 core
-
-// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with
-
-int i;
-
-void foo()
-{
-    gl_in.length();  // ERROR
-    gl_in[1].gl_Position;
-    gl_in[i].gl_Position;  // ERROR
-}
-
-layout(triangles) in;
-
-in vec4 color3[3];
-
-void foo3()
-{
-    gl_in.length();
-    gl_in[i].gl_Position;
-    color3.length();
-}
-
-uniform sampler2D s2D;
-in vec2 coord[];
-uniform vec4 v4;
-
-void foo4()
-{
-    const ivec2 offsets[5] =
-    {
-        ivec2(0,1),
-        ivec2(1,-2),
-        ivec2(0,3),
-        ivec2(-3,0),
-        ivec2(2,1)
-    };
-
-    vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy);
-
-    offsets[i].xy = ivec2(3);  // ERROR
-    v4.x = 3.2;                // ERROR
-    v4.xy;   // should have non-uniform type
-}
-
-out gl_PerVertex {
-    float gl_PointSize[1];  // ERROR, adding array
-    float gl_ClipDistance;  // ERROR, removing array
-};
-
-float foo5()
-{
-    return i;  // implicit conversion of return type
-}

+ 0 - 43
3rdparty/bgfx/3rdparty/glslang/Test/420.tesc

@@ -1,43 +0,0 @@
-#version 420 core
-
-#extension GL_ARB_separate_shader_objects : enable
-
-layout(vertices = 4) out;
-
-out gl_PerVertex {
-    vec4 gl_Position;
-} gl_out[3];                 // ERROR, wrong size
-
-out int a[gl_out.length()];
-out int outb[5];             // ERROR, wrong size
-out int outc[];
-
-void main()
-{
-    vec4 p = gl_in[1].gl_Position;
-    float ps = gl_in[1].gl_PointSize;
-    float cd = gl_in[1].gl_ClipDistance[2];
-
-    int pvi = gl_PatchVerticesIn;
-    int pid = gl_PrimitiveID;
-    int iid = gl_InvocationID;
-
-    gl_out[gl_InvocationID].gl_Position = p;
-    gl_out[gl_InvocationID].gl_PointSize = ps;        // ERROR
-}
-
-out float outf;  // ERROR, no array
-
-layout (location = 0) in dmat2x4 vs_tcs_first[];
-layout (location = 12) in dmat2x4 vs_tcs_last[];
-
-void foo()
-{
- if ((dmat2x4(dvec4(-0.625, -0.5, -0.375lf, -0.25), dvec4(-0.375, -0.25, -0.125, 0)) != vs_tcs_first[0]) ||
-        (dmat2x4(dvec4(0.375, 0.5, 0.625, 0.75), dvec4(0.625, 0.75, 0.875, -0.625)) != vs_tcs_last[0]))
-    {
-        ;
-    }
-}
-
-layout(vertices = 0) out;  // ERROR, can't be 0

+ 0 - 90
3rdparty/bgfx/3rdparty/glslang/Test/420.tese

@@ -1,90 +0,0 @@
-#version 420 core
-
-const mat2x2 a = mat2( vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) );
-mat2x2 b = { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) };
-const mat2x2 c = { { 1.0, 0.0, }, { 0.0, 1.0 } };
-
-float a2[2] = { 3.4, 4.2, 5.0 }; // illegal
-vec2 b2 = { 1.0, 2.0, 3.0 }; // illegal
-mat3x3 c2 = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal
-mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting
-
-struct {
-    float a;
-    int b;
-} e = { 1.2, 2, };
-
-struct {
-    float a;
-    int b;
-} e2 = { 1, 3 }; // legal, first initializer is converted
-
-struct {
-    float a;
-    int b;
-} e3 = { 1.2, 2, 3 }; // illegal
-
-int a3 = true; // illegal
-vec4 b3[2] = { vec4(0.0), 1.0 }; // illegal
-vec4 b4[2] = vec4[2](vec4(0.0), mat2x2(1.0)); // illegal
-mat4x2 c3 = { vec3(0.0), vec3(1.0) }; // illegal
-
-struct S1 {
-    vec4 a;
-    vec4 b;
-};
-
-struct {
-    float s;
-    float t;
-} d2[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal
-
-float b5[] = { 3.4, 4.2, 5.0, 5.2, 1.1 };
-
-struct S3 {
-    float f;
-    mat2x3 m23;
-};
-
-struct S4 {
-    uvec2 uv2;
-    S3 s[2];
-};
-
-struct Single1 { int f; };
-Single1 single1 = { 10 };
-
-struct Single2 { uvec2 v; };
-Single2 single2 = { { 1, 2 } };
-
-struct Single3 { Single1 s1; };
-Single3 single3 = { { 3 } };
-
-struct Single4 { Single2 s1; };
-Single4 single4 = { { { 4u, 5u } } };
-
-const S4 constructed = S4(uvec2(1, 2), 
-                          S3[2](S3(3.0, mat2x3(4.0)), 
-                                S3(5.0, mat2x3(6.0))));
-
-const S4 curlybad1 = { {1, 2},
-                       { {3,   {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } },       // ERROR, the mat2x3 isn't isolated
-                         {5.0, {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } }; 
-
-const S4 curlyInit = { {1, 2},
-                       { {3,   { {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } } },
-                         {5.0, { {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } } }; 
-
-float vc1, vc2, vc3;
-vec3 av3 = vec3(vc1, vc2, vc3);
-vec3 bv3 = { vc1, vc2, vc3 };
-
-void main()
-{
-    memoryBarrier();
-
-    if (constructed == curlybad1)
-        ;
-    if (constructed == curlyInit)
-        ;
-}

+ 0 - 161
3rdparty/bgfx/3rdparty/glslang/Test/420.vert

@@ -1,161 +0,0 @@
-#version 420 core
-#version 420 core
-varying vec2 v2;               // ERROR, varying reserved
-in vec4 bad[10];
-highp in vec4 badorder;
-out invariant vec4 badorder2;
-in centroid vec4 badorder4;    // ERROR, no centroid input to vertex stage
-out flat vec4 badorder3;
-void bar(in const float a);
-void bar2(highp in float b);
-smooth flat out vec4 rep;      // ERROR, replicating interpolation qualification
-centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification
-in uniform vec4 rep3;          // ERROR, replicating storage qualification
-
-int anonconst;
-const int aconst = 5;
-const int a = aconst;
-const int b = anonconst;       // ERROR at global scope
-
-const int foo()                // ERROR, no const functions
-{
-    const int a = aconst;
-    const int b = anonconst;
-    const int c = a;          // still compile-time const
-    const int d = b;          // not a compile-time const
-    float x[c];               // okay
-    float y[d];               // ERROR
-
-    return b;
-}
-
-void main()
-{
-    int i;
-    if (i == 3)
-        int j = i;
-    else
-        int k = j;              // ERROR, j is undeclared
-    int m = k;                  // ERROR, k is undeclared
-    int n = j;                  // ERROR, j is undeclared
-
-    while (true)
-        int jj;
-    int kk = jj;                // ERROR, jj is undeclared
-}
-
-const float cx = 4.20;
-const float dx = 4.20;
-
-void bar(in highp volatile vec4 v)
-{
-    int s;
-    s.x;       // okay
-    s.y;       // ERROR
-    if (bad[0].x == cx.x)
-        ;
-    if (cx.x == dx.x)
-        badorder3 = bad[0];
-
-    float f;
-    vec3 smeared = f.xxx;
-    f.xxxxx;   // ERROR
-    f.xxy;     // ERROR
-}
-
-layout(binding = 3) uniform;  // ERROR
-layout(binding = 3) uniform boundblock { int aoeu; } boundInst;
-layout(binding = 7) uniform anonblock { int aoeu; } ;
-layout(location = 1) in;      // ERROR
-layout(binding = 1) in inblock { int aoeua; };       // ERROR
-layout(binding = 100000) uniform anonblock2 { int aooeu; } ;
-layout(binding = 4) uniform sampler2D sampb1;
-layout(binding = 5) uniform sampler2D sampb2[10];
-layout(binding = 80) uniform sampler2D sampb3; // ERROR, binding too big
-layout(binding = 31) uniform sampler2D sampb4;
-layout(binding = 79) uniform sampler2D sampb5[2]; // ERROR, binding too big
-
-int fgfg(float f, mediump int i);
-int fgfg(float f, highp int i);
-
-out gl_PerVertex {
-    float gl_ClipDistance[4];
-};
-
-patch in vec4 patchIn;              // ERROR
-patch out vec4 patchOut;            // ERROR
-
-void bar23444()
-{
-    mat4x3 m43;  \
-    float a1 = m43[3].y;
-    vec3 v3;
-    int a2 = m43.length();
-    a2 += m43[1].length();
-    a2 += v3.length();
-    const float b = 2 * a1;
-    int a = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset;
-}
-
-const int comma0 = (2, 3);  // ERROR
-int comma1[(2, 3)];   // ERROR
-
-layout(r32i) uniform iimage2D iimg2D;
-layout(rgba32i) uniform iimage2D iimg2Drgba;
-layout(rgba32f) uniform image2D img2Drgba;
-layout(r32ui) uniform uimage2D uimg2D;
-uniform image2DMS img2DMS; // ERROR image variables not declared writeonly must have format layout qualifier
-uniform writeonly image2DMS img2DMSWO;
-void qux()
-{
-    int i = aoeu;
-    imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);
-    imageAtomicAdd(uimg2D, ivec2(i,i), uint(i));
-    imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR iimg2Drgba does not have r32i layout
-    imageAtomicMax(img2Drgba, ivec2(i,i), i);  // ERROR img2Drgba is not integer image
-    ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
-    vec4 col = imageLoad(img2DMS, ivec2(i,i), i);
-    imageStore(img2DMSWO, ivec2(i,i), i, vec4(0));
-    imageLoad(img2DMSWO, ivec2(i,i), i);       // ERROR, drops writeonly
-}
-
-volatile float vol; // ERROR, not an image
-readonly int vol2;  // ERROR, not an image
-
-void passr(coherent readonly iimage2D image)
-{
-}
-
-layout(r32i) coherent readonly uniform iimage2D qualim1;
-layout(r32i) coherent volatile readonly uniform iimage2D qualim2;
-
-void passrc()
-{
-    passr(qualim1);   // ERROR, changing formats
-    passr(qualim2);   // ERROR, drops volatile, ERROR, changing formats
-    passr(iimg2D);    // ERROR, changing formats
-}
-
-layout(rg8i) uniform uimage2D i1bad;     // ERROR, type mismatch
-layout(rgba32i) uniform image2D i2bad;   // ERROR, type mismatch
-layout(rgba32f) uniform uimage2D i3bad;  // ERROR, type mismatch
-layout(r8_snorm) uniform iimage2D i4bad; // ERROR, type mismatch
-layout(rgba32ui) uniform iimage2D i5bad; // ERROR, type mismatch
-layout(r8ui) uniform iimage2D i6bad;     // ERROR, type mismatch
-
-uniform offcheck {
-    layout(offset = 16) int foo;   // ERROR
-} offcheckI;
-
-uniform sampler1D samp1D;
-uniform sampler1DShadow samp1Ds;
-
-void qlod()
-{
-    int levels;
-
-    levels = textureQueryLevels(samp1D);   // ERROR, not until 430
-    levels = textureQueryLevels(samp1Ds);  // ERROR, not until 430
-}
-
-layout(binding=0) writeonly uniform image1D badArray[];

+ 0 - 21
3rdparty/bgfx/3rdparty/glslang/Test/420_size_gl_in.geom

@@ -1,21 +0,0 @@
-#version 420 core
-
-// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with
-
-int i;
-
-layout(triangles) in;
-in vec4 colorun[];
-in vec4 color3[3];
-
-void foo()
-{
-    gl_in.length();
-    gl_in[1].gl_Position;
-    gl_in.length();
-    gl_in[i].gl_Position;   // should be sized to 3 by 'triangles'
-}
-
-in gl_PerVertex {  // ERROR, already used
-    vec4 gl_Position;
-} gl_in[];

+ 0 - 90
3rdparty/bgfx/3rdparty/glslang/Test/430.comp

@@ -1,90 +0,0 @@
-#version 430 core
-
-layout(local_size_x = 2) in;
-layout(local_size_x = 16) in;     // ERROR, changing
-layout(local_size_z = 4096) in;   // ERROR, too large
-layout(local_size_x = 2) in;
-
-const int total = gl_MaxComputeWorkGroupCount.y 
-                + gl_MaxComputeUniformComponents
-                + gl_MaxComputeTextureImageUnits
-                + gl_MaxComputeImageUniforms
-                + gl_MaxComputeAtomicCounters
-                + gl_MaxComputeAtomicCounterBuffers;
-
-buffer ShaderStorageBlock
-{
-    int value;
-    float values[];
-};
-
-buffer InvalidShaderStorageBlock
-{
-    float values[];
-    int value;
-} invalid;
-
-void main()
-{
-    barrier();
-    memoryBarrier();
-    memoryBarrierAtomicCounter();
-    memoryBarrierBuffer();
-    memoryBarrierShared();
-    memoryBarrierImage();
-    groupMemoryBarrier();
-    value = int(values[gl_LocalInvocationIndex]);
-
-    int a;
-    if (a > 10)
-        barrier();
-}
-
-layout(location = 2) in vec3 v3;      // ERROR
-in float f;                           // ERROR
-out float fo;                         // ERROR
-
-shared vec4 s;
-layout(location = 2) shared vec4 sl;  // ERROR
-shared float fs = 4.2;                // ERROR
-
-layout(local_size_y = 1) in;
-layout(local_size_y = 2) in;     // ERROR, changing
-layout(local_size_y = 1) in;
-layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out;  // ERROR
-
-int arrX[gl_WorkGroupSize.x];
-int arrY[gl_WorkGroupSize.y];
-int arrZ[gl_WorkGroupSize.z];
-
-readonly buffer roblock
-{
-    int value;
-    float values[];
-} ro;
-
-void foo()
-{
-    ro.values[2] = 4.7;             // ERROR, readonly
-    ro.values.length();
-    barrier();
-}
-
-uniform double roll;
-uniform writeonly image2D destTex;
-void fooaoeu() {
-     ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
-     double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0);
-     dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4);
-     double globalCoef = 1.0;
-     int i = globalCoef;            // ERROR, can't convert from double to int
-     double di = i;
-}
-
-in inb {     // ERROR
-    int a;
-} inbi;
-
-out outb {     // ERROR
-    int a;
-} outbi;

+ 0 - 223
3rdparty/bgfx/3rdparty/glslang/Test/430.vert

@@ -1,223 +0,0 @@
-#version 430 core
-
-layout(location = 3) vec4 v4;  // ERROR
-
-layout(location = 4) uniform vec4 uv4;
-
-layout(location = 2) in   inb1 { vec4 v; } b1;  // ERROR
-layout(location = 2) out outb1 { vec4 v; } b2;  // ERROR
-
-out gl_PerVertex {
-    float gl_ClipDistance[];
-};
-
-void foo()
-{
-    gl_ClipDistance[2] = 3.7;
-}
-
-struct sp {
-    highp float f;
-    in float g;             // ERROR
-    uniform float h;        // ERROR
-    invariant float i;      // ERROR
-    volatile float j;       // ERROR
-    layout(row_major) mat3 m3; // ERROR
-};
-
-void foo3(invariant vec4 v4,                 // ERROR
-          volatile vec3 v3,
-          layout(location = 3) vec2 v2,      // ERROR
-          centroid vec3 cv3)                 // ERROR
-{
-}
-
-struct S {
-    mat3x2 m[7];  // needs 7*3 locations
-    float f;      // needs 1 location
-};                // needs 22 locations
-
-layout(location = 10) out S cs[2];     // 10 through 10 + 2 * 22 - 1 = 53
-layout(location = 54) out float cf;
-layout(location = 53) out float cg; // ERROR, collision at 31
-
-layout(location = 10) in vec4 alias1;
-layout(location = 10) in vec4 alias2;  // okay for vertex input on desktop
-
-out float gl_ClipDistance[17];  // ERROR, size too big
-
-// enhanced_layouts (most tests are in 440.*)
-
-layout(location = start*start - 2 - 4) in vec4 v6e;    // ERROR
-
-layout(location = 28) in inblock2e {
-    layout(location = 25) float f2;                     // ERROR
-} ininst2e;
-
-in ublock4e {
-    layout(location = 50) float f1;                      // ERROR
-    layout(location = 51) float f2;                      // ERROR
-} in4e;
-
-layout(align=16, std140) uniform  ubl4e { int a; } inst4e;// ERROR
-
-layout(align=32) uniform ubl9e {                          // ERROR
-    layout(offset=12, align=4) float f;                   // ERROR
-    layout(offset=20) float g;                            // ERROR
-} inst9e;
-
-layout(std140) uniform blocke {
-                        vec4   a;
-    layout(offset = 32) vec3   b;                          // ERROR
-} spinste;
-
-int aconste[gl_MaxTransformFeedbackBuffers];               // ERROR
-int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR
-
-out bblck2 {
-    layout(xfb_offset=64) vec4 bbv;                              // ERROR
-} bbinst2;
-
-layout(xfb_buffer = 3, xfb_stride = 64) out;                     // ERROR
-
-layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR
-layout(              xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR
-
-layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR
-    vec4 bbv1;
-    vec4 bbv2;
-} bbinst4e;
-
-out bblck5e {
-    layout(xfb_offset=0) vec4 bbv1;                               // ERROR
-    layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR
-} bbinst5e;
-
-#extension GL_ARB_enhanced_layouts : enable
-
-layout(align=16, std140) uniform  ubl4 { int a; } inst4;
-layout(std430) uniform;
-
-layout(align=32) uniform ubl9 {
-    layout(offset=12, align=4) float f;
-    layout(offset=20) float g;
-} inst9;
-
-layout(std140) uniform block {
-                        vec4   a;     // a takes offsets 0-15
-    layout(offset = 32) vec3   b;     // b takes offsets 32-43
-} spinst;
-
-int aconst[gl_MaxTransformFeedbackBuffers];
-int bconst[gl_MaxTransformFeedbackInterleavedComponents];
-
-const int start2 = 5;
-layout(location = start2 * start2 - 2 - 4) in vec4 v6;
-
-layout(location = 28) in inblock2 {  // ERROR, input block in vertex shader, other errors are valid checks still...
-    bool b1;
-    float f1;
-    layout(location = 25) float f2;
-} ininst2;
-
-in ublock4 {                         // ERROR, input block in vertex shader, other errors are valid checks still...
-    layout(location = 50) float f1;
-    layout(location = 51) float f2;
-} in4;
-
-out bblck2g {
-    layout(xfb_offset=64) vec4 bbv;
-} bbinst2g;
-
-layout(xfb_buffer = 1, xfb_stride = 80) out;  // default buffer is 3
-
-layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg;
-layout(              xfb_offset=32, xfb_stride=80) out vec4 bh;
-
-layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 {
-    vec4 bbv1;
-} bbinst4;
-
-out bblck5 {
-    layout(xfb_offset=0) vec4 bbv1;
-    layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2;
-} bbinst5;
-
-shared vec4 sharedv;                // ERROR
-
-void fooBarrier()
-{
-    barrier();                       // ERROR
-    memoryBarrier();
-    memoryBarrierAtomicCounter();
-    memoryBarrierBuffer();
-    memoryBarrierShared();           // ERROR
-    memoryBarrierImage();
-    groupMemoryBarrier();            // ERROR
-}
-
-buffer vec4 v;  // ERROR
-
-uniform sampler2DMS s2dms;
-uniform usampler2DMSArray us2dmsa;
-layout(rgba32i) uniform iimage2DMS ii2dms;
-layout(rgba32f) uniform image2DMSArray i2dmsa;
-
-void fooq()
-{
-    int s = textureSamples(s2dms); // ERROR
-    s += textureSamples(us2dmsa);  // ERROR
-    s += imageSamples(ii2dms);     // ERROR
-    s += imageSamples(i2dmsa);     // ERROR
-}
-
-#extension GL_ARB_shader_texture_image_samples : enable
-
-void fooq2()
-{
-    int s = textureSamples(s2dms);
-    s += textureSamples(us2dmsa); 
-    s += imageSamples(ii2dms);    
-    s += imageSamples(i2dmsa);    
-}
-
-uniform sampler1D samp1D;
-uniform usampler2D usamp2D;
-uniform isampler3D isamp3D;
-uniform isamplerCube isampCube; 
-uniform isampler1DArray isamp1DA;
-uniform sampler2DArray samp2DA;
-uniform usamplerCubeArray usampCubeA;
-
-uniform sampler1DShadow samp1Ds;
-uniform sampler2DShadow samp2Ds;
-uniform samplerCubeShadow sampCubes;
-uniform sampler1DArrayShadow samp1DAs;
-uniform sampler2DArrayShadow samp2DAs;
-uniform samplerCubeArrayShadow sampCubeAs;
-
-uniform samplerBuffer sampBuf;
-uniform sampler2DRect sampRect;
-
-void qlod()
-{
-    int levels;
-
-    levels = textureQueryLevels(samp1D);
-    levels = textureQueryLevels(usamp2D);
-    levels = textureQueryLevels(isamp3D);
-    levels = textureQueryLevels(isampCube);
-    levels = textureQueryLevels(isamp1DA);
-    levels = textureQueryLevels(samp2DA);
-    levels = textureQueryLevels(usampCubeA);
-
-    levels = textureQueryLevels(samp1Ds);
-    levels = textureQueryLevels(samp2Ds);
-    levels = textureQueryLevels(sampCubes);
-    levels = textureQueryLevels(samp1DAs);
-    levels = textureQueryLevels(samp2DAs);
-    levels = textureQueryLevels(sampCubeAs);
-
-    levels = textureQueryLevels(sampBuf);    // ERROR
-    levels = textureQueryLevels(sampRect);   // ERROR
-}

+ 0 - 108
3rdparty/bgfx/3rdparty/glslang/Test/430AofA.frag

@@ -1,108 +0,0 @@
-#version 430
-
-float[4][5][6] many[1][2][3];
-
-float gu[][7];
-float gimp[][];    // ERROR, implicit inner
-float g4[4][7];
-float g5[5][7];
-
-float[4][7] foo(float a[5][7])
-{
-    float r[7];
-    r = a[2];
-    float[](a[0], a[1], r, a[3]);              // ERROR, too few dims
-    float[4][7][4](a[0], a[1], r, a[3]);       // ERROR, too many dims
-    return float[4][7](a[0], a[1], r, a[3]);
-    return float[][](a[0], a[1], r, a[3]);
-    return float[][7](a[0], a[1], a[2], a[3]);
-}
-
-void bar(float[5][7]) {}
-
-void main()
-{
-    {
-        float gu[3][4][2];
-
-        gu[2][4][1] = 4.0;                     // ERROR, overflow
-    }
-    vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)),
-                              vec4[2](vec4(0.0), vec4(1.0)),
-                              vec4[2](vec4(0.0), vec4(1.0)));
-    vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)));
-    vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)),
-                              vec4[2](vec4(4.0), vec4(2.0)));
-    vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)),
-                               vec4[2](vec4(4.0), vec4(2.0)),
-                               vec4[2](vec4(4.0), vec4(2.0)));
-
-    vec4 a4[3][2] = {vec4[](vec4(0.0), vec4(1.0)),
-                     vec4[2](vec4(0.0), vec4(1.0)),
-                     vec4[2](vec4(0.0), vec4(1.0)) };
-    vec4 aim[][2] = {vec4[2](vec4(4.0), vec4(2.0)),
-                     vec4[](vec4(4.0), vec4(2.0)),
-                     vec4[2](vec4(4.0), vec4(2.0)) };
-    vec4 aim2[][] = {vec4[2](vec4(4.0), vec4(2.0)),
-                     vec4[2](vec4(4.0), vec4(2.0)),
-                     vec4[](vec4(4.0), vec4(2.0)) };
-    vec4 aim3[3][] = {vec4[2](vec4(4.0), vec4(2.0)),
-                      vec4[2](vec4(4.0), vec4(2.0)),
-                      vec4[2](vec4(4.0), vec4(2.0)) };
-
-    vec4 bad2[3][] = {vec4[2](vec4(4.0), vec4(2.0)),              // ERROR
-                      vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)),
-                      vec4[2](vec4(4.0), vec4(2.0)) };
-
-    vec4 bad3[3][] = {vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)),   // ERROR
-                      vec4[2](vec4(4.0), vec4(2.0)),
-                      vec4[2](vec4(4.0), vec4(2.0)) };
-
-    vec4 bad4[4][] = {vec4[2](vec4(4.0), vec4(2.0)),              // ERROR
-                      vec4[2](vec4(4.0), vec4(2.0)),
-                      vec4[2](vec4(4.0), vec4(2.0)) };
-
-
-    g4 = foo(g5);
-    g5 = g4;           // ERROR, wrong types
-    gu = g4;           // ERROR, not yet sized
-
-    foo(gu);           // ERROR, not yet sized
-    bar(g5);
-
-    if (foo(g5) == g4)
-        ;
-    if (foo(g5) == g5)  // ERROR, different types
-        ;
-
-    float u[][7];
-    u[2][2] = 3.0;
-    float u[5][7];
-    u[5][2] = 5.0;      // ERROR
-    foo(u);
-}
-
-void foo3()
-{
-    float resize1[][5][7];
-    resize1.length();           // ERROR
-    resize1[1][4][5] = 2.0;
-    resize1.length();           // ERROR
-    float resize1[3][5][7];
-    resize1.length();           // 3 in AST
-    resize1[1].length();        // 5 in AST
-    resize1[1][1].length();     // 7 in AST
-    resize1[1][1][1].length();  // ERROR
-
-    float resize2[][5][7];
-    float resize2[3][4][7];     // ERROR, inner dim change
-
-    float resize3[][5][7];
-    float resize3[3][5][9];     // ERROR, inner dim changed
-
-    float resize4[][5][7];
-    int  resize4[3][5][7];      // ERROR, element type
-}

+ 0 - 74
3rdparty/bgfx/3rdparty/glslang/Test/430scope.vert

@@ -1,74 +0,0 @@
-#version 430 core
-
-int f(int a, int b, int c)
-{
-	int a = b;  // ERROR, redefinition
-
-    {
-		float a = float(a) + 1.0; // okay
-    }
-
-	return a;
-}
-
-int f(int a, int b, int c);  // okay to redeclare
-
-bool b;
-float b(int a);      // ERROR: redefinition
-
-float c(int a);
-bool c;              // ERROR: redefinition
-
-float f;             // ERROR: redefinition
-float tan;           // okay, hides built-in function
-float sin(float x);  // okay, can redefine built-in functions
-float cos(float x)   // okay, can redefine built-in functions
-{
-	return 1.0;
-}
-bool radians(bool x) // okay, can overload built-in functions
-{
-    return true;
-}
-
-invariant gl_Position;
-
-void main()
-{
-    int g();    // okay
-    g();
-
-    float sin; // okay
-    sin;
-    sin(0.7);  // ERROR, use of hidden function
-    f(1,2,3);
-
-    float f;    // hides f()
-    f = 3.0;
-
-    gl_Position = vec4(f);
-
-    for (int f = 0; f < 10; ++f)
-        ++f;
-
-    int x = 1;
-    { 
-        float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2
-        int z = z; // ERROR: z not previously defined.
-    }
-    {
-        int x = x; // x is initialized to '1'
-    }
-
-    struct S 
-    { 
-        int x; 
-    };
-    {
-        S S = S(0); // 'S' is only visible as a struct and constructor 
-        S.x;        // 'S' is now visible as a variable
-    }
-
-    int degrees;
-    degrees(3.2);  // ERROR, use of hidden built-in function
-}

+ 0 - 2
3rdparty/bgfx/3rdparty/glslang/Test/435.vert

@@ -1,2 +0,0 @@
-#version 435
-void main() {}

+ 0 - 153
3rdparty/bgfx/3rdparty/glslang/Test/440.frag

@@ -1,153 +0,0 @@
-#version 440
-
-// Note 'location'-only tests for enhanced layouts are in 330.frag
-// Generic 'component' tests are in 440.vert
-
-// a consumes components 2 and 3 of location 4
-layout(location = 4, component = 2) in vec2 a; 
-
-// b consumes component 1 of location 4
-layout(location = 4, component = 1) in float b; 
-layout(location = 4, component = 2) in vec2 h;  // ERROR, component overlap not okay for fragment in
-
-layout(location = 3, component = 2) in vec3 c;  // ERROR: c overflows components 2 and 3
-
-// e consumes beginning (components 0, 1 and 2) of each of 6 slots
-layout(location = 20, component = 0) in vec3 e[6];
-
-// f consumes last component of the same 6 slots 
-layout(location = 20, component = 3) in float f[6];
-
-layout(location = 30, component = 3) out int be;
-layout(location = 30, component = 0) out vec3 bf;  // ERROR, not the same basic type
-
-writeonly uniform;          // ERROR
-readonly in;                // ERROR
-flat out;                   // ERROR
-mediump uniform;
-
-layout(offset=12) uniform;  // ERROR
-layout(offset=12) in;       // ERROR
-layout(offset=12) out;      // ERROR
-
-layout(align=16) uniform;   // ERROR
-layout(align=16) in;        // ERROR
-layout(align=16) out;       // ERROR
-
-layout(offset=12) uniform  ubl1 { int a; } inst1;  // ERROR
-layout(offset=12)      in inbl2 { int a; } inst2;  // ERROR
-layout(offset=12)     out inbl3 { int a; } inst3;  // ERROR
-
-layout(align=16, std140) uniform  ubl4 { int a; } inst4;
-layout(align=16) uniform  ubl8 { int a; } inst8;  // ERROR, no packing
-layout(align=16)      in inbl5 { int a; } inst5;  // ERROR
-layout(align=16)     out inbl6 { int a; } inst6;  // ERROR
-
-layout(offset=12) uniform vec4 v1;  // ERROR
-layout(offset=12)      in vec4 v2;  // ERROR
-layout(offset=12)     out vec4 v3;  // ERROR
-
-layout(align=16) uniform vec4 v4;   // ERROR
-layout(align=16)      in vec4 v5;   // ERROR
-layout(align=16)     out vec4 v6;   // ERROR
-
-layout(std140) in;                  // ERROR
-layout(std140) uniform vec4 v7;     // ERROR
-
-layout(align=48) uniform ubl7 {          // ERROR, not power of 2
-    layout(offset=12, align=4) float f;  // ERROR, no packing
-} inst7;
-
-in ibl10 {
-    layout(offset=12) float f;  // ERROR
-    layout(align=4) float g;    // ERROR
-} inst10;
-
-layout(std430) uniform;
-
-layout(align=32) uniform ubl9 {
-    float e;
-    layout(offset=12, align=4) float f;
-    layout(offset=20) float g;
-    float h;
-} inst9;
-
-uniform ubl11 {
-    layout(offset=12, align=4) float f;
-    float g;
-} inst11;
-
-layout(std140) uniform block {
-                        vec4   a;     // a takes offsets 0-15
-    layout(offset = 32) vec3   b;     // b takes offsets 32-43
-    layout(offset = 40) vec2   c;     // ERROR, lies within previous member
-    layout(align = 6)   double g;     // ERROR, 6 is not a power of 2
-    layout(offset=68)   double h;     // ERROR, offset not aligned
-} specExampleErrors;
-
-layout(std140) uniform block2 {
-                        vec4   a;     // a takes offsets 0-15
-    layout(offset = 32) vec3   b;     // b takes offsets 32-43
-    layout(offset = 48) vec2   d;     // d takes offsets 48-55
-    layout(align = 16)  float  e;     // e takes offsets 64-67
-    layout(align = 2)   double f;     // f takes offsets 72-79
-    layout(offset = 80) float  h;     // h takes offsets 80-83
-    layout(align = 64)  dvec3  i;     // i takes offsets 128-151
-    layout(offset = 164, align = 8) float  j;     // j takes offsets 168-171
-} specExample;
-
-layout(std430) buffer block430 {
-                        vec4   a;     // a takes offsets 0-15
-    layout(offset = 32) vec3   b;     // b takes offsets 32-43
-    layout(offset = 40) vec2   c;     // ERROR, lies within previous member
-    layout(align = 6)   double g;     // ERROR, 6 is not a power of 2
-    layout(offset=68)   double h;     // ERROR, offset not aligned
-    layout(align = 0)   double i;     // ERROR, 0 not a power of 2
-} specExampleErrors430;
-
-layout(std430) buffer block2430 {
-                        vec4   a;     // a takes offsets 0-15
-    layout(offset = 32) vec3   b;     // b takes offsets 32-43
-    layout(offset = 48) vec2   d;     // d takes offsets 48-55
-    layout(align = 16)  float  e;     // e takes offsets 64-67
-    layout(align = 2)   double f;     // f takes offsets 72-79
-    layout(offset = 80) float  h;     // h takes offsets 80-83
-    layout(align = 64)  dvec3  i;     // i takes offsets 128-151
-    layout(offset = 164, align = 8) float  j;     // j takes offsets 168-171
-} specExample430;
-
-layout(std430, align = 128) buffer block24300 {
-    vec4   a;
-    vec3   b;
-    vec2   d;
-    float  e;
-    double f;
-    float  h;
-    dvec3  i;
-} specExample4300;
-
-layout(std430, align = 128) buffer block24301 {
-    vec4   a;
-    vec3   b;
-    vec2   d;
-    layout(offset=388) float  e;
-    layout(align=8) double f;
-    float  h;
-    dvec3  i;
-} specExample4301;
-
-int aconst[gl_MaxTransformFeedbackBuffers];
-int bconst[gl_MaxTransformFeedbackInterleavedComponents];
-
-sample in vec3 sampInArray[4];
-
-void interp()
-{
-    interpolateAtCentroid(sampInArray[2].xy);
-    interpolateAtSample(sampInArray[2].x.x, 2);
-}
-
-int layer()
-{
-    return gl_Layer;
-}

+ 0 - 197
3rdparty/bgfx/3rdparty/glslang/Test/440.vert

@@ -1,197 +0,0 @@
-#version 440
-
-// Note 'location' tests for enhanced layouts are in 330.frag
-
-layout(location = 2, component = 2) in vec2 a; 
-layout(location = 2, component = 1) in float b; 
-
-layout(location = 3, component = 2) in vec3 c;      // ERROR: c overflows components 2 and 3
-
-layout(location = 0, component = 3) in float d[4]; 
-
-layout(location = 4, component = 0) in vec3 e[5];
-layout(location = 4, component = 3) in float f[5];
-
-layout(location = 9, component = 4) in float g[6];   // ERROR, component too big
-
-layout(location = 4, component = 2) in vec2 h;       // component overlap okay for vertex in
-
-layout(location = 3, component = 2) out vec2 i;
-layout(location = 3, component = 0) out vec2 j;
-
-layout(location = 4, component = 2) out vec2 k;
-layout(location = 4, component = 2) out vec2 m;      // ERROR, component overlap
-
-layout(location = 2, component = 2) out vec2 n;
-layout(location = 2, component = 0) out vec3 p;      // ERROR, component overlap
-
-layout(location = 10, component = 3) out float q[6]; 
-layout(location = 10, component = 0) out vec3 r[6];
-
-layout(location = 15, component = 3) out float s;    // ERROR, overlap
-layout(location = 10, component = 1) out float t;    // ERROR, overlap
-
-layout(location = 20, component = 2) out float u;
-layout(location = 20, component = 0) out float v;
-layout(location = 20, component = 3) out float w;
-layout(location = 20, component = 1) out vec2 x;     // ERROR, overlap
-
-layout(location = 30, component = 3) out vec2 y;     // ERROR, goes to component 4
-layout(location = 31, component = 1) out vec4 z;     // ERROR, goes to component 4
-
-layout(location = 32, component = 1) out mat4 ba;               // ERROR
-layout(location = 33, component = 1) out struct S {int a;} Ss;  // ERROR
-layout(location = 34, component = 1) out bn { int a;} bb;       // ERROR
-
-layout(component = 1) out float bc;    // ERROR, no location
-
-out blockname {
-    layout(location = 40, component = 2) out float u;
-    layout(location = 40, component = 0) out float v;
-    layout(location = 40, component = 3) out float w;
-    layout(location = 40, component = 1) out vec2 x;     // ERROR, overlap
-
-    layout(location = 41, component = 3) out vec2 y;     // ERROR, goes to component 4
-    layout(location = 42, component = 1) out vec4 z;     // ERROR, goes to component 4
-
-    layout(location = 42, component = 1) out mat4 ba;    // ERROR
-    layout(location = 43, component = 1) out S Ss;       // ERROR
-} bd;
-
-layout(location = 1, component = 1) out;                 // ERROR, no global setting
-
-layout(location = 50, component = 3) out int be;
-layout(location = 50, component = 0) out vec3 bf;
-
-layout(location = 51, component = 1) out double dfo;     // ERROR, odd component
-layout(location = 52, component = 2) out dvec2 dvo;      // ERROR, overflow
-layout(location = 53) out double dfo2;
-layout(location = 53, component = 2) out vec2 ffv2;      // okay, fits
-layout(location = 54) out dvec4 dvec4out;                // uses up location 55 too
-layout(location = 55) out float overf;                   // ERROR, collides with previous dvec4
-layout(location = 56, component = 1) out vec2 df2o;
-layout(location = 56, component = 3) out float sf2o;
-layout(location = 57, component = 2) out vec2 dv3o;
-layout(location = 57, component = 3) out float sf4o;     // ERROR, overlapping component
-layout(location=58) out flat dvec3 dv3o2;                // uses part of location 59
-layout(location=59, component=2) out flat double dfo3;   // okay, fits
-layout(location=59, component=0) out flat double dfo4;   // ERROR, overlaps the dvec3 in starting in 58
-
-out bblck1 {
-    vec4 bbv;
-} bbinst1;
-
-out bblck2 {
-    layout(xfb_offset=64) vec4 bbv;
-} bbinst2;
-
-layout(xfb_buffer = 3, xfb_stride = 64) out;  // default buffer is 3
-
-out bblck3 {
-    layout(xfb_offset=16) vec4 bbv;  // in xfb_buffer 3
-} bbinst3;
-
-uniform ubblck3 {
-    layout(xfb_offset=16) vec4 bbv;  // ERROR, not in a uniform
-} ubbinst3;
-
-layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bg;
-layout(              xfb_offset=32, xfb_stride=64) out vec4 bh;
-
-layout(xfb_offset=48) out; // ERROR
-
-layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4 {
-    vec4 bbv1;
-    vec4 bbv2;
-} bbinst4;
-
-out bblck5 {
-    layout(xfb_offset=0) vec4 bbv1;
-    layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2;
-    layout(xfb_buffer=2) vec4 bbv3;                               // ERROR, wrong buffer
-} bbinst5;
-
-out layout(xfb_buffer=2) bblck6 {
-    layout(xfb_offset=0) vec4 bbv1;
-    layout(xfb_stride=64, xfb_buffer=3, xfb_offset=32) vec4 bbv2; // ERROR, overlap 32 from bh, and buffer contradiction
-    layout(xfb_buffer=2, xfb_offset=0) vec4 bbv3;                 // ERROR, overlap 0 from bbinst5
-    layout(xfb_buffer=2) vec4 bbv5;
-    layout(xfb_offset=24) float bbf6;                             // ERROR, overlap 24 from bbv1 in bbinst4
-} bbinst6;
-
-layout(xfb_stride=48) out;                   // ERROR, stride of buffer 3
-
-layout(xfb_buffer=1) out;  // default buffer is 1
-layout(xfb_offset=4) out float bj;
-layout(xfb_offset=0) out ivec2 bk;           // ERROR, overlap 4
-
-layout(xfb_buffer=3, xfb_stride=48) out;     // ERROR, stride of buffer 3 (default is now 3)
-layout(xfb_stride=48) out float bl;          // ERROR, stride of buffer 3
-
-layout(xfb_stride=48) out bblck7 {           // ERROR, stride of buffer 3
-    layout(xfb_stride=64) vec4 bbv1;
-    layout(xfb_stride=32) vec4 bbv2;         // ERROR, stride of buffer 3
-} bbinst7;
-
-struct S5 {
-    int i;    // 4 bytes plus 4 byte hole
-    double d; // 8 bytes
-    float f;  // 4 bytes
-};  // total size = 20
-
-struct T {
-    bool b;   // 4 plus 4 byte hole
-    S5 s;     // 20 
-    vec2 v2;  // 8
-};  // total size = 36
-
-out layout(xfb_buffer=0, xfb_offset=0, xfb_stride=92) bblck8 {  // ERROR, stride not multiple of 8
-    bool b;    // offset 0
-    T t;       // offset 8, size 40
-    int i;     // offset 40 + 4 = 48
-    mat3x3 m3; // offset 52
-    float f;   // offset 52 + 9*4 = 88
-    float g;   // ERROR, overflow stride
-} bbinst8;
-
-out layout(xfb_buffer=4) bblck9 {
-    layout(xfb_offset=1) bool b;     // ERROR
-    layout(xfb_offset=12) T t;       // ERROR
-    layout(xfb_offset=52) mat3x3 m3; // non-multiple of 8 okay
-    layout(xfb_offset=90) int i;     // ERROR
-    layout(xfb_offset=98) double d;  // ERROR
-    layout(xfb_offset=108) S s;      // non-multiple of 8 okay
-} bbinst9;
-
-layout(xfb_buffer=5, xfb_stride=6) out;     // link ERROR, stride not multiple of 4
-layout(xfb_offset=0) out float bm;
-
-layout(xfb_buffer=6, xfb_stride=2000) out;  // ERROR, stride too big
-
-out layout(xfb_buffer=7, xfb_offset=0) bblck10 {  // link ERROR, implicit stride too big
-    dmat4x4 m1;
-    dmat4x4 m2;
-    float f;
-} bbinst10;
-
-layout(xfb_buffer = 3) out;
-layout(xfb_offset = 32) out gl_PerVertex {
-    layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer
-    vec4 gl_Position;
-};
-
-int drawParamsBad()
-{
-    return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested
-}
-
-#extension GL_ARB_shader_draw_parameters: enable
-
-int drawParams()
-{
-    return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB;
-    gl_BaseVertexARB = 3;       // ERROR, can't write to shader 'in'
-    gl_BaseInstanceARB = 3;     // ERROR, can't write to shader 'in'
-    gl_DrawIDARB = 3;           // ERROR, can't write to shader 'in'
-    glBaseInstanceARB;          // ERROR, not defined
-}

+ 0 - 6
3rdparty/bgfx/3rdparty/glslang/Test/450.comp

@@ -1,6 +0,0 @@
-#version 450 core
-layout(local_size_x = 0) in; // ERROR, 0 not allowed
-void main()
-{
-    shared float f;   // ERROR shared must be global
-}

+ 0 - 68
3rdparty/bgfx/3rdparty/glslang/Test/450.frag

@@ -1,68 +0,0 @@
-#version 450 core
-
-in float in1;
-in vec2 in2;
-in vec3 in3;
-in vec4 in4;
-
-void main()
-{
-    vec2 v2 = dFdxFine(in2);
-    vec3 v3 = dFdyCoarse(in3);
-    vec4 v4 = fwidth(in4);
-    v4 = dFdyFine(in4);
-    v3 = dFdyFine(in3);
-    float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1);
-    v4 = fwidthCoarse(in4) + fwidthFine(in4);
-
-    float cull = gl_CullDistance[2];
-    float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;
-
-    if (gl_HelperInvocation)
-        ++v4;
-
-    int sum = gl_MaxVertexImageUniforms +
-              gl_MaxFragmentImageUniforms +
-              gl_MaxComputeImageUniforms +
-              gl_MaxCombinedImageUniforms +
-              gl_MaxCombinedShaderOutputResources;
-
-    bool b1, b3, b;
-    uint uin;
-    bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b));
-    uint um = mix(uin, uin, b);
-    ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b));
-}
-
-uniform sampler2DMS s2dms;
-uniform usampler2DMSArray us2dmsa;
-layout(rgba32i) uniform iimage2DMS ii2dms;
-layout(rgba32f) uniform image2DMSArray i2dmsa;
-
-void foo()
-{
-    int s = textureSamples(s2dms);
-    s += textureSamples(us2dmsa);
-    s += imageSamples(ii2dms);
-    s += imageSamples(i2dmsa);
-    float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5);
-}
-
-in float gl_CullDistance[6];
-
-float cull(int i)
-{
-    return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i];
-}
-
-layout(location = 6) in bName1 {
-    float f;
-    layout(location = 7) float g;
-    mat4 m;
-} bInst1;
-layout(location = 12) in bName2 {
-    float f;
-    layout(location = 13) float g;  // ERROR, location on array
-} bInst2[3];
-
-layout(early_fragment_tests) in float f; // ERROR, must be standalone

+ 0 - 19
3rdparty/bgfx/3rdparty/glslang/Test/450.geom

@@ -1,19 +0,0 @@
-#version 450 core
-
-in gl_PerVertex {
-    float gl_CullDistance[3];
-} gl_in[];
-
-out gl_PerVertex {
-    float gl_CullDistance[3];
-};
-
-layout(triangles) in;
-
-void main()
-{
-    gl_in[3].gl_Position; // ERROR, out of range
-    gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];
-}
-
-layout(points) in float f[3];  // ERROR, must be standalone

Some files were not shown because too many files changed in this diff