diff --git a/3rd-party-licenses.md b/3rd-party-licenses.md
index 6dd76b5..6556460 100644
--- a/3rd-party-licenses.md
+++ b/3rd-party-licenses.md
@@ -30,26 +30,31 @@ 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.
#### 2. Nlohmann's JSON
- * SWIPAT bug: https://nvbugs/3247318
- * License url: https://github.com/nlohmann/json#license
+ * License url: https://github.com/nlohmann/json/blob/develop/LICENSE.MIT
---
-The class is licensed under the MIT License:
+MIT License
-Copyright � 2013-2021 Niels Lohmann
+Copyright (c) 2013-2022 Niels Lohmann
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED �AS IS�, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the MIT License (see above). Copyright � 2008-2009 Bj�rn Hoehrmann bjoern@hoehrmann.de
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
-The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the MIT License (see above). Copyright � 2009 Florian Loitsch
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
-The class contains a copy of Hedley from Evan Nemerson which is licensed as CC0-1.0.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
---
diff --git a/README.md b/README.md
index 77d73f4..a1fa597 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Streamline (SL) - Version 2.2.0
+# Streamline (SL) - Version 2.2.1
Streamline is an open-sourced cross-IHV solution that simplifies integration of the latest NVIDIA and other independent hardware vendors’ super resolution technologies into applications and games. This framework allows developers to easily implement one single integration and enable multiple super-resolution technologies and other graphics effects supported by the hardware vendor.
@@ -83,7 +83,10 @@ The packaged SDK can be found in the generated `_sdk` folder.
## Debugging
-Please read [Debugging.md](docs/Debugging.md) to learn how to debug and troubleshoot issues.
+Streamline offers several ways to debug and troubleshoot issues. Please see the following pages for more information.
+* Using SL ImGui: [Debugging - SL ImGUI (Realtime Data Inspection).md](docs/Debugging - SL ImGUI %28Realtime Data Inspection%29.md)
+* Using JSON configuration files: [Debugging - JSON Configs (Plugin Configs).md](docs/Debugging - JSON Configs %28Plugin Configs%29.md)
+* Using NRD's validation layer: [Debugging - NRD.md](docs/Debugging - NRD.md)
## General Programming Guide
diff --git a/bin/x64/NRD.dll b/bin/x64/NRD.dll
index f832d88..c6081fe 100644
--- a/bin/x64/NRD.dll
+++ b/bin/x64/NRD.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a632789aea6e58698bcb580c4b9e5e25697fa4af33f5c323715302eb49fa56fd
+oid sha256:534dc58a4832771571840e9b7ba5332f3a40e83ba4ba132dae2d9099f173295b
size 15539680
diff --git a/bin/x64/NvLowLatencyVk.dll b/bin/x64/NvLowLatencyVk.dll
index 81dcd24..25cbb28 100644
--- a/bin/x64/NvLowLatencyVk.dll
+++ b/bin/x64/NvLowLatencyVk.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d4c5d609d71ff8f92300899b89ce3e1839eb03521bae7940e8541dc6c4bd99fe
-size 57816
+oid sha256:bed3318e4521cb04d11bc592ac0d32328b458dc8ec2934c3d69d72340382af25
+size 57824
diff --git a/bin/x64/buildInfo.txt b/bin/x64/buildInfo.txt
index 5a9c024..036fe0a 100644
Binary files a/bin/x64/buildInfo.txt and b/bin/x64/buildInfo.txt differ
diff --git a/bin/x64/development/NvLowLatencyVk.dll b/bin/x64/development/NvLowLatencyVk.dll
index 155971d..af6b0f1 100644
--- a/bin/x64/development/NvLowLatencyVk.dll
+++ b/bin/x64/development/NvLowLatencyVk.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ef4996a89ef12e7ab0dba6b36fff407dbec3d915293d81885bbd6ad7ac04fa2f
+oid sha256:f2db41dbaf14c29ce3208ac30732b72d18a8d7dbeccfe05eac83129f3d1ddd99
size 57824
diff --git a/bin/x64/development/nvngx_dlss.dll b/bin/x64/development/nvngx_dlss.dll
index ad57e0c..93bbdab 100644
--- a/bin/x64/development/nvngx_dlss.dll
+++ b/bin/x64/development/nvngx_dlss.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:84e11f148663ea5abde521d25c2e68f43f544079976699fb052d8d68c7e5d7dd
-size 51860024
+oid sha256:02cd367eafd40cd0acce1e700dedb517c1938d59948a835137892e398fc3cb4b
+size 53850152
diff --git a/bin/x64/development/nvngx_dlssg.dll b/bin/x64/development/nvngx_dlssg.dll
index 3ced171..0c0845d 100644
--- a/bin/x64/development/nvngx_dlssg.dll
+++ b/bin/x64/development/nvngx_dlssg.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d6b2297511ad9f109cee048b23ac78b6e56ba53ffea11d0797101bb617e5a229
-size 12592680
+oid sha256:3219bafa171787ecf3bdc758104f3a4373278859ec09dafb446b83c01a03622d
+size 11716648
diff --git a/bin/x64/development/sl.common.dll b/bin/x64/development/sl.common.dll
index ae3e052..a92b9eb 100644
--- a/bin/x64/development/sl.common.dll
+++ b/bin/x64/development/sl.common.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c3d604931d4ed098de57754edc3a51cdb0dcbc12b536ef08b3a5962a6ddd224e
-size 692192
+oid sha256:384b3d47ce9dac29e424c5a71a20b6ad3782860e2b79a8a984ea074dabb4bb17
+size 721376
diff --git a/bin/x64/development/sl.dlss.dll b/bin/x64/development/sl.dlss.dll
index 99fb0f4..642b6ca 100644
--- a/bin/x64/development/sl.dlss.dll
+++ b/bin/x64/development/sl.dlss.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bf5e55c86f3ffb753bdfc6845f44db33cd1c7683e5c8e30c4cedb28f2e32b805
-size 245208
+oid sha256:d3fe2501c36afb0ecb6e1be5ef1c6fd48f2d9e82a1f041e20f881a8964d99aa6
+size 273376
diff --git a/bin/x64/development/sl.dlss_g.dll b/bin/x64/development/sl.dlss_g.dll
index fad21a2..ac4057d 100644
--- a/bin/x64/development/sl.dlss_g.dll
+++ b/bin/x64/development/sl.dlss_g.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bdc1cbf146545296fe299ead61a44c3b5486179f75221c427af1995c2c29dfc5
-size 547288
+oid sha256:0ce885720ae530e88fa887199d1d819c29bade8342d0bf5d192f5a4d878be381
+size 587744
diff --git a/bin/x64/development/sl.imgui.dll b/bin/x64/development/sl.imgui.dll
index d421e00..db8d529 100644
--- a/bin/x64/development/sl.imgui.dll
+++ b/bin/x64/development/sl.imgui.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:630a27b6dc3d2b74a144df288cb7c51d8f5cfb4e4f0e9be1a97aac2366a2b15f
-size 1029592
+oid sha256:64ba2b8f7115d3e76829637fef471f14795a4fc884553ac1361807b33b24d68c
+size 1058784
diff --git a/bin/x64/development/sl.interposer.dll b/bin/x64/development/sl.interposer.dll
index 30cd46c..2ea2ee6 100644
--- a/bin/x64/development/sl.interposer.dll
+++ b/bin/x64/development/sl.interposer.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:65f7caa315bfa0e62016b4b8d342233ba317d38aae8e849c604155bd80c41d68
-size 553432
+oid sha256:794e985174ff5b681ed16ef32c563e639765ad60c34c9317850e9a0c17525a9b
+size 561120
diff --git a/bin/x64/development/sl.nis.dll b/bin/x64/development/sl.nis.dll
index 9442389..0b62f7b 100644
--- a/bin/x64/development/sl.nis.dll
+++ b/bin/x64/development/sl.nis.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0898cce1ca60d87e02a9634aa559748346660eaef21cac87a8d1d6912cb36468
-size 970720
+oid sha256:df9ccf3d78e2ddbae11c6a2b4fa11d606b0d177022b57b3c1af733f40b1ca9cf
+size 998360
diff --git a/bin/x64/development/sl.nrd.dll b/bin/x64/development/sl.nrd.dll
index db3f78d..2493937 100644
--- a/bin/x64/development/sl.nrd.dll
+++ b/bin/x64/development/sl.nrd.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f0d62e449bb7d689a93829461bd90a6b1d0ce7f6fed0571c90a6eb2a1836714a
-size 246752
+oid sha256:7cb4b4ba5c3f1319edb112c353a25aefd56b56c44e57e0762d37aa236e9dde24
+size 278496
diff --git a/bin/x64/development/sl.reflex.dll b/bin/x64/development/sl.reflex.dll
index 0ba4cd6..add6750 100644
--- a/bin/x64/development/sl.reflex.dll
+++ b/bin/x64/development/sl.reflex.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f722536f90588080365eebb0ffa2369a63d44a909025bc3ee91cd71669951c22
-size 191456
+oid sha256:609280a546af395cc5e791050c55f8c9876f528d0061bab17db76de2630f2a6f
+size 220640
diff --git a/bin/x64/nvngx_dlss.dll b/bin/x64/nvngx_dlss.dll
index 332519b..58f0ebc 100644
--- a/bin/x64/nvngx_dlss.dll
+++ b/bin/x64/nvngx_dlss.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a4b34aa5fc2f8bfb4c91875b53012508b407ac84cecfa145ee6805337c416caa
-size 51716136
+oid sha256:085c955f29d1e789a3713674d139961e9e685bb6f65b8911bd450984139c8c9e
+size 53689400
diff --git a/bin/x64/nvngx_dlssg.dll b/bin/x64/nvngx_dlssg.dll
index 9bb7e29..276dbe4 100644
--- a/bin/x64/nvngx_dlssg.dll
+++ b/bin/x64/nvngx_dlssg.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ce1afe3b0bb7b6ac35668a3919df849afe6f1d8e721a6f2d40accbce8dfd79fd
-size 12582456
+oid sha256:3234d77dacbedfe4946f31626cb13114a9d2e514436cf149378660da8e9bdb79
+size 11698216
diff --git a/bin/x64/sl.common.dll b/bin/x64/sl.common.dll
index b4e72ba..e1715a6 100644
--- a/bin/x64/sl.common.dll
+++ b/bin/x64/sl.common.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b07ca43d0f01470103157a920c5bf87014ba07b8ef31559cc92e960da1ff86b5
-size 615384
+oid sha256:89757451c31aaef5c6e9787ef340e5e47948b69a3a6ab23aa52449b2deb9be5a
+size 643544
diff --git a/bin/x64/sl.dlss.dll b/bin/x64/sl.dlss.dll
index b53c60a..eebb3a2 100644
--- a/bin/x64/sl.dlss.dll
+++ b/bin/x64/sl.dlss.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:53eef1cd412372b75d17920f51c1b42f3c223f9098469c22f66c31fc9fffc25c
-size 204256
+oid sha256:7b37f59c3f3c58bd5547404e07a4376399bfa23d8d5a834d7e43dac106169bc8
+size 233952
diff --git a/bin/x64/sl.dlss_g.dll b/bin/x64/sl.dlss_g.dll
index 1e60dfb..07e50e2 100644
--- a/bin/x64/sl.dlss_g.dll
+++ b/bin/x64/sl.dlss_g.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:386223439ecc85e2a6f119b6c9d4824f8f4d74c15b8410ba041965792a1911cb
-size 365024
+oid sha256:3d32f80af91d4219541d3b1fa76f1d30e3338032aef1f79904e7d428308d7fe3
+size 403424
diff --git a/bin/x64/sl.interposer.dll b/bin/x64/sl.interposer.dll
index 688c01c..f43a3ca 100644
--- a/bin/x64/sl.interposer.dll
+++ b/bin/x64/sl.interposer.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ad7c12437ee3cc176749da7a548678598732762dd8a0556c84c1ff46379492c1
-size 510936
+oid sha256:b15b4060b25a57f9c3293582489720b4ee1895e0610b20b3aa0f2e3f6c151106
+size 519640
diff --git a/bin/x64/sl.nis.dll b/bin/x64/sl.nis.dll
index 0b615de..5c0a7b8 100644
--- a/bin/x64/sl.nis.dll
+++ b/bin/x64/sl.nis.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:98e0f4652e6736941429b6f168c850d3136b01ed4d29cfdf2545961276da44db
-size 926176
+oid sha256:e8b8cf44364a8c02fe9489fbf723447e427601d3fdba883284c6238bf2354457
+size 954336
diff --git a/bin/x64/sl.nrd.dll b/bin/x64/sl.nrd.dll
index b7cbb54..e6d37e5 100644
--- a/bin/x64/sl.nrd.dll
+++ b/bin/x64/sl.nrd.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:73de492ba434c2408fe7b84e42c9752bdb7655d1c6425058d2840a2cd4eaf7e7
-size 218080
+oid sha256:b8d3edd0b75be8f9e2fcc62c1446b072010be40f6d5c0e8b630e6820028df660
+size 249312
diff --git a/bin/x64/sl.reflex.dll b/bin/x64/sl.reflex.dll
index 602963a..79bfb4e 100644
--- a/bin/x64/sl.reflex.dll
+++ b/bin/x64/sl.reflex.dll
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:42586a3c1667d1785bd73643cd03bc83becd16b91273f0cf7ee2f4b640bdf9a9
-size 144864
+oid sha256:a069419c7e4cad6dad443515af3a61112e16f9a442914c274c09fc8a8c4dba2b
+size 175576
diff --git a/build_all.bat b/build_all.bat
index 835fcea..fda36c8 100644
--- a/build_all.bat
+++ b/build_all.bat
@@ -2,4 +2,4 @@ call build.bat -debug
call build.bat -release
call build.bat -production
call build.bat -profiling
-call build.bat -relextdev
\ No newline at end of file
+call build.bat -relextdev
diff --git a/changelog.txt b/changelog.txt
index 80dd89d..399120c 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,39 @@
+======== Release 2.2.1 Entries ========
+
+ * Added support for DLSS Frame Generation Dynamic Frame Generation.
+ See section 22.0 "Dynamic Frame Generation" in `ProgrammingGuideDLSS_G.md`
+ for more information.
+
+ * Added two new buffer types:
+ - `sl::kBufferTypeTransparencyLayer`
+ - `sl::kBufferTypeTransparencyLayerOpacity`
+ See section 4.1.10 "Transparency Overlay" in `ProgrammingGuideDLSS_RR.md`
+ for more information.
+
+ * Added new buffer type `sl::kBufferTypeBidirectionalDistortionField` for
+ post-processed distortion patterns applied to the backbuffer and
+ `sl::kBufferTypeUIColorAndAlpha`.
+ See section 5.0 "TAG ALL REQUIRED RESOURCES" in `ProgrammingGuideDLSS_G.md`
+ for more information.
+
+ * Added a new `sl::Constants` field `minRelativeLinearDepthObjectSeparation`
+ for describing the minimum depth difference between two objects in screen-space.
+
+ * Added a new structure `sl::PrecsisionInfo` for specifying floating-point
+ precision bias for a `sl::Resource`.
+ See section 2.8 "TAGGING RESOURCES" in `ProgrammingGuide.md` for more
+ information.
+
+ * Fixed a bug where `sl.interposer.dll` would crash if plugins were located
+ in paths containing wide characters.
+
+ * Fixed a bug where verbose logging would not include additional information for OTA Updates.
+
+ * Updated documentation for `sl::DLSSGMode::eOff` to match current behavior.
+ See section 5.0 "TURN DLSS-G ON/OFF/AUTO AND PROVIDE OTHER DLSS-G OPTIONS" in
+ `ProgrammingGuideDLSS_G.md` for more information.
+
+
======== Release 2.2.0 Entries ========
* Added support for multiple viewports to the sl.nis plugin.
diff --git a/docs/Debugging - NRD.md b/docs/Debugging - NRD.md
index 7a87fe8..3e4f16a 100644
--- a/docs/Debugging - NRD.md
+++ b/docs/Debugging - NRD.md
@@ -34,4 +34,4 @@ where:
- Viewport 8 - number of accumulated frames for diffuse signal (red = `history reset`)
- Viewport 11 - number of accumulated frames for specular signal (red = `history reset`)
- Viewport 12 - input normalized `hitT` for diffuse signal (ambient occlusion, AO)
-- Viewport 15 - input normalized `hitT` for specular signal (specular occlusion, SO)
\ No newline at end of file
+- Viewport 15 - input normalized `hitT` for specular signal (specular occlusion, SO)
diff --git a/docs/ProgrammingGuide.md b/docs/ProgrammingGuide.md
index beeee18..85b9e85 100644
--- a/docs/ProgrammingGuide.md
+++ b/docs/ProgrammingGuide.md
@@ -2,7 +2,7 @@
Streamline - SL
=======================
-Version 2.2.0
+Version 2.2.1
=======
1 SETTING UP
@@ -963,6 +963,60 @@ slSetTag(viewport, &depthTag, 1);
For the complete list of the required buffer tags for a given feature please call `slGetFeatureRequirements`.
+### Resource extensions
+Some resource extensions can be supplied to `ResourceTag` to pass extra information. Extensions can be supplied in 2 ways:
+* **Member variable**: Member variable to the `ResourceTag`, with the appropriate struct version number
+* **Chain extension**: As part of the `ResouceTag` chain, in its `next` pointer member variable
+
+>**NOTE:**
+Chain extensions should all come immediately after the tag they belong to.
+
+#### Resource `Extent` (member variable, `kStructVersion1`)
+When a resource is suballocated as part of a bigger resource, please properly populate the `Extent` member variable as part of the `ResourceTag`. The `Extent` should indicate the top-left corner of the subresource relative to the tagged resource, as well as the width and height of the subresource.
+
+```cpp
+
+// Example extent: resource that starts in the middle of the tagged resource, and is at 1/8th of the tagged resource's resolution.
+// Illustration: The xxx represent the subresource that the extents define
+// -----------------
+// -----------------
+// -----------------
+// --------xxxx-----
+// --------xxxx-----
+// -----------------
+// -----------------
+
+Extent depthExtent{};
+depthExtent.top = depthResourceHeight / 2;
+depthExtent.left = depthResourceWidth / 2;
+depthExtent.height = depthResourceHeight / 4;
+depthExtent.width= depthResourceWidth / 4;
+
+ResourceTag depthTag{};
+depthTag.extent = depthExtent;
+```
+#### Resource `PrecisionInfo` (chain extension)
+Some buffers (e.g., `kBufferTypeBidirectionalDistortionField`) can be supplied with a `PrecisionInfo` struct as an extension (`next` ptr) to the `ResourceTag`. This struct allows a plugin to internally convert the low-precision buffer data to a higher-precision format, for better image quality purposes.
+
+Populating the `PrecisionInfo` accurately requires knowing the bounds the high-precision data, so that good `scale` and `bias` values are supplied.
+
+```cpp
+// These max and min values should be computed as part of a reduction phase, and should be used to convert
+// the high-precision data to a low-precision format
+// The conversion, using a linear transform, could look like the following:
+// lowPrecisionData = (hiPrecisionData - bufferMinVal) / (bufferMaxVal - bufferMinVal)
+float bufferMaxVal; // max value in the high-precision format
+float bufferMinVal; // min value in the high-precision format
+
+PrecisionInfo bufferPrecisionInfo{};
+bufferPrecisionInfo.conversionFormula = PrecisionFormula::eLinearTransform;
+bufferPrecisionInfo.bias = bufferMinVal;
+bufferPrecisionInfo.scale = bufferMaxVal - bufferMinVal;
+
+ResourceTag tag{};
+tag.next = &bufferPrecisionInfo;
+```
+
### 2.9 FRAME TRACKING
SL requires correct frame tracking since host application could be working on multiple frames at the same time and various SL inputs must be matched with the frame that is actually being presented. When the simulation phase for the new frame is starting in the host application the frame tracking handle for that specific frame should be obtained from the SL (this would be the exact same place where normally the `sl::ReflexMarker::eSimulationStart` would be placed, see [Reflex guide](./ProgrammingGuideReflex.md) for more details)).
diff --git a/docs/ProgrammingGuideDLSS.md b/docs/ProgrammingGuideDLSS.md
index d5da03c..2ad7dbd 100644
--- a/docs/ProgrammingGuideDLSS.md
+++ b/docs/ProgrammingGuideDLSS.md
@@ -5,7 +5,7 @@ Streamline - DLSS
>The focus of this guide is on using Streamline to integrate DLSS into an application. For more information about DLSS itself, please visit the [NVIDIA Developer DLSS Page](https://developer.nvidia.com/rtx/dlss)
>For information on user interface considerations when using the DLSS plugin, please see the "RTX UI Developer Guidelines.pdf" document included in the DLSS SDK.
-Version 2.2.0
+Version 2.2.1
=======
### 1.0 INITIALIZE AND SHUTDOWN
@@ -319,4 +319,4 @@ If the DLSS output does not look right please check the following:
* If your motion vectors are in normalized -1,1 space then scaling factors `sl::Constants::mvecScale` should be {1, 1}
* Make sure that jitter offset values are in pixel space
* `NVSDK_NGX_Parameter_FreeMemOnRelease` is replaced with `slFreeResources`
-* `NVSDK_NGX_DLSS_Feature_Flags_MVLowRes` is handled automatically based on tagged motion vector buffer's size and extent.
\ No newline at end of file
+* `NVSDK_NGX_DLSS_Feature_Flags_MVLowRes` is handled automatically based on tagged motion vector buffer's size and extent.
diff --git a/docs/ProgrammingGuideDLSS_G.md b/docs/ProgrammingGuideDLSS_G.md
index 25aa893..c3f20c0 100644
--- a/docs/ProgrammingGuideDLSS_G.md
+++ b/docs/ProgrammingGuideDLSS_G.md
@@ -4,7 +4,7 @@ Streamline - DLSS-G
NVIDIA DLSS Frame Generation (“DLSS-FG” or “DLSS-G”) is an AI based technology that infers frames based on rendered frames coming from a game engine or rendering pipeline. This document explains how to integrate DLSS-G into a renderer.
-Version 2.2.0
+Version 2.2.1
=======
### 0.0 Integration checklist
@@ -193,6 +193,7 @@ Depth | - Same depth data used to generate motion vector data
- `sl::Consta
Motion Vectors | - Dense motion vector field (i.e. includes camera motion, and motion of dynamic objects)
- *Note: this is the same set of requirements as DLSS-SR, and the same motion vectors can be used for both* | ![dlssg_mvec](./media/dlssg_docs_mvec.png "DLSSG Input Example: Motion Vectors")
Hudless | - Should contain the full viewable scene, **without any HUD/UI elements in it**. If some HUD/UI elements are unavoidably included, expect some image quality degradation on those elements
- Same color space and post-processing effects (e.g tonemapping, blur etc.) as color backbuffer
- When appropriate buffer extents are *not* provided, needs to have the same dimensions as the color backbuffer
| ![dlssg_hudless](./media/dlssg_docs_hudless.png "DLSSG Input Example: Hudless")
UI Color and Alpha | - Should **only** contain pixels that denote the UI/HUD, along with appropriate alpha values (described below)
- Alpha is *zero* on all pixels that do *not* have UI on them
- Alpha is *non-zero* on all pixels that do have UI on them
- RGB is as close as possible to respecting the following blending formula: `UI.RGB x UI.Alpha + (1 - UI.Alpha) x Hudless.RGB = Final_Color.RGB`
- When appropriate buffer extents are *not* provided, needs to have the same dimensions as the color backbuffer
| ![dlssg_ui_color_and_alpha](./media/dlssg_docs_ui_color_and_alpha.png "DLSSG Input Example: UI Color and Alpha")
+Bidirectional Distortion Field | - Optional buffer, **only needed when strong distortion effects are applied as post-processing filters**
- Refer to [pseudo-code below ](#bidirectional-distortion-field-buffer-generation-code-sample) for an example on how to generate this optional buffer
- When this buffer is tagged, Mvec and Depth need to be **undistorted**
- When this buffer is tagged, the FinalColor is should be **distorted**
- When this buffer is tagged, Hudless and UIColorAndAlpha need to be such that `Blend(Hudless, UIColorAndAlpha) = FinalColor`. This may mean that Hudless needs to be equally distorted, and in rare cases that UIColorAndAlpha is also equally distorted
- **Resolution**: we recommend using half of the FinalColor's resolution's width and height
- **Channel count**: 4 channels
- **RG channels**: UV coordinates of the corresponding **undistorted** pixel, as an offset relative to the source UV coordinate
- **BA channels**: UV coordinates of the corresponding **distorted** pixel, as an offset relative to the source UV coordinate
- **Units**: the buffer values should be in normalized pixel space `[0,1]`. These should be the same scale as the input MVecs
- **Channel precision and format:** Signed format, equal bit-count per channel (i.e. R10G10B10A2 is NOT allowed). We recommend a minimum of 8 bits per channel, with precision scale and bias (`PrecisionInfo`) passed in as part of the `ResourceTag` |
**Barrel distortion, RGB channels** ![dlssg_bidirectional_distortion_field](./media/dlssg_docs_bidirectional_distortion_field.png "DLSSG Input Example: Bidirectional Distortion Field")
**Barrel distortion, absolute value of RG channels** ![dlssg_docs_bidirectional_distortion_field_rg_abs](./media/dlssg_docs_bidirectional_distortion_field_rg_abs.png "DLSSG Input Example: Bidirectional Distortion Field, RG channels, Absolute value")
#### **Tagging recommendations**
@@ -222,8 +223,8 @@ It is important to emphasize that **the overuse of `sl::ResourceLifecycle::eOnly
// NOTE: As an example we are tagging depth as immutable and mvec as volatile, this needs to be adjusted based on how your engine works
sl::Resource depth = {sl::ResourceType::Tex2d, myDepthBuffer, nullptr, nullptr, depthState, nullptr};
sl::Resource mvec = {sl::ResourceType::Tex2d, myMotionVectorsBuffer, nullptr, mvecState, nullptr, nullptr};
-sl::ResourceTag depthTag = sl::ResourceTag {&depth, sl::kBufferTypeDepth, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent }; // valid all the time
-sl::ResourceTag mvecTag = sl::ResourceTag {&mvec, sl::kBufferTypeMvec, sl::ResourceLifecycle::eOnlyValidNow, &fullExtent }; // reused for something else later on
+sl::ResourceTag depthTag = sl::ResourceTag {&depth, sl::kBufferTypeDepth, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent, nullptr }; // valid all the time
+sl::ResourceTag mvecTag = sl::ResourceTag {&mvec, sl::kBufferTypeMvec, sl::ResourceLifecycle::eOnlyValidNow, &fullExtent, nullptr }; // reused for something else later on
// Normally depth and mvec are available at a similar point in the pipeline so tagging them together
// If this is not the case simply tag them separately when they are available
@@ -233,16 +234,24 @@ slSetTag(viewport, inputs, _countof(inputs), cmdList);
// After post-processing pass but before UI/HUD is added tag the hud-less buffer
//
sl::Resource hudLess = {sl::ResourceType::Tex2d, myHUDLessBuffer, nullptr, nullptr, hudlessState, nullptr};
-sl::ResourceTag hudLessTag = sl::ResourceTag {&hudLess, sl::kBufferTypeHUDLessColor, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent }; // valid all the time
+sl::ResourceTag hudLessTag = sl::ResourceTag {&hudLess, sl::kBufferTypeHUDLessColor, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent, nullptr }; // valid all the time
sl::Resource inputs[] = {hudLessTag};
slSetTag(viewport, inputs, _countof(inputs), cmdList);
// UI buffer with color and alpha channel
//
sl::Resource ui = {sl::ResourceType::Tex2d, myUIBuffer, nullptr, nullptr, uiTextureState, nullptr};
-sl::ResourceTag uiTag = sl::ResourceTag {&ui, sl::kBufferTypeUIColorAndAlpha, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent }; // valid all the time
+sl::ResourceTag uiTag = sl::ResourceTag {&ui, sl::kBufferTypeUIColorAndAlpha, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent, nullptr }; // valid all the time
sl::Resource inputs[] = {uiTag};
slSetTag(viewport, inputs, _countof(inputs), cmdList);
+
+// OPTIONAL! Only need the Bidirectional distortion field when strong distortion effects are applied during post-processing
+//
+sl::Resource bidirectionalDistortionField = {sl::ResourceType::Tex2d, myBidirectionalDistortionBuffer, nullptr, nullptr, bidirectionalDistortionState, nullptr};
+// Note: here `precisionInfo` refers to the transform needed to be applied to the buffer values to convert from a low-precision format (e.g. 8-bits) to a high-precision format (e.g. 16-bits). Refer to
+sl::ResourceTag bidirectionalDistortionTag = sl::ResourceTag {&bidirectionalDistortionField, sl::kBufferTypeBidirectionalDistortionField, sl::ResourceLifecycle::eValidUntilPresent, &fullExtent, &precisionInfo }; // valid all the time
+sl::Resource inputs[] = {bidirectionalDistortionTag};
+slSetTag(viewport, inputs, _countof(inputs), cmdList);
```
> **NOTE:**
@@ -251,11 +260,72 @@ slSetTag(viewport, inputs, _countof(inputs), cmdList);
> **IMPORTANT:**
> If validity of tagged resources cannot be guaranteed (for example game is loading, paused, in menu, playing a video cut scene etc.) **all tags should be set to null pointers to avoid stability or IQ issues**.
-### 6.0 TURN DLSS-G ON/OFF AND PROVIDE OTHER DLSS-G OPTIONS
+#### **Bidirectional Distortion Field buffer generation code sample**
+The following is pseudo-code that should guide the generation of the bidirectional distortion field buffer. The example distortion illustrated is barrel distortion.
+
+```cpp
+const float distortionAlpha = -0.5f;
+
+float2 barrelDistortion(float2 UV)
+{
+ // Barrel distortion assumes UVs relative to center (0,0), so we transform
+ // to [-1, 1]
+ float2 UV11 = (UV * 2.0f) - 1.0f;
+
+ // Squared norm of distorted distance to center
+ float r2 = UV11.x * UV11.x + UV11.y * UV11.y;
+
+ // Reference: http://www.cs.ait.ac.th/~mdailey/papers/Bukhari-RadialDistortion.pdf
+ float x = UV11.x / (1.0f + distortionAlpha * r2);
+ float y = UV11.y / (1.0f + distortionAlpha * r2);
+
+ // Transform back to [0, 1]
+ float2 outUV = vec2(x, y);
+ return (outUV + 1.0f) / 2.0f;
+}
+
+float2 inverseBarrelDistortion(float2 UV)
+{
+ // Barrel distortion assumes UVs relative to center (0,0), so we transform
+ // to [-1, 1]
+ float2 UV11 = (UV * 2.0f) - 1.0f;
+
+ // Squared norm of undistorted distance to center
+ float ru2 = UV11.x * UV11.x + UV11.y * UV11.y;
+
+ // Solve for distorted distance to center, using quadratic formula
+ float num = sqrt(1.0f - 4.0f * distortionAlpha * ru2) - 1.0f;
+ float denom = 2.0f * distortionAlpha * sqrt(ru2);
+ float rd = -num / denom;
+
+ // Reference: http://www.cs.ait.ac.th/~mdailey/papers/Bukhari-RadialDistortion.pdf
+ float x = UV11.x * (rd / sqrt(ru2));
+ float y = UV11.y * (rd / sqrt(ru2));
+
+ // Transform back to [0, 1]
+ float2 outUV = vec2(x, y);
+ return (outUV + 1.0f) / 2.0f;
+}
+
+float2 generateBidirectionalDistortionField(Texture2D output, float2 UV)
+{
+ // Assume UV is in [0, 1]
+ float2 rg = barrelDistortion(UV) - UV;
+ float2 ba = inverseBarrelDistortion(UV) - UV;
+
+ // rg and ba needs to be in the same canonical format as the motion vectors
+ // i.e. a displacement of rg or ba needs to to be in the same scale as (Mvec.x, Mvec.y)
+
+ // The output can be outside of the [0, 1] range
+ Texture2D[UV] = float4(rg, ba); // needs to be signed
+}
+```
+
+### 6.0 TURN DLSS-G ON/OFF/AUTO AND PROVIDE OTHER DLSS-G OPTIONS
**NOTE: By default DLSS-G interpolation is off, even if the feature is loaded and the required items tagged. DLSS-G must be explicitly turned on by the application using the DLSS-G-specific constants function.**
-DLSS-G options must be set so that the DLSS-G plugin can track any changes made by the user, and to enable DLSS-G interpolation. To enable interpolation, be sure to set `mode` to `sl::DLSSGMode::eOn`. While DLSS-G can be turned on/off in development builds via a hotkey, it is best for the application not to rely on this, even during development.
+DLSS-G options must be set so that the DLSS-G plugin can track any changes made by the user, and to enable DLSS-G interpolation. To enable interpolation, be sure to set `mode` to `sl::DLSSGMode::eOn` or `sl::DLSSGMode::eAuto` if using [Dynamic Frame Generation](#220-dynamic-frame-generation). While DLSS-G can be turned on/off/auto in development builds via a hotkey, it is best for the application not to rely on this, even during development.
```cpp
@@ -272,7 +342,7 @@ if(SL_FAILED(result, slDLSSGSetOptions(viewport, options)))
```
> **NOTE:**
-> To turn off DLSS-G set `sl::DLSSGOptions.mode` to `sl::DLSSGMode::eOff`, note that this does NOT release any resources, for that please use `slFreeResources`
+> Setting`sl::DLSSGOptions.mode` to `sl::DLSSGMode::eOff` currently releases all resources. Then if you set it back to `sl::DLSSGMode::eOn` - this will allocate resources again, which will result in small (perhaps 200 ms) stutter. Currently there is no way to pause the feature without releasing the resources. The option to pause the feature without releasing the resources is going to be added in future releases.
#### 6.1 HOW TO SETUP A CALLBACK TO RECEIVE API ERRORS (OPTIONAL)
@@ -353,7 +423,7 @@ When using non-production (development) builds of `sl.dlss_g.dll`, there are num
* `"stats"` (default `Shift-Ctrl-VK_HOME`)
* Toggle performance stats
* `"dlssg-toggle"` (default `VK_OEM_2` `/?` for US)
- * Toggle DLSS-G on/off (override app setting)
+ * Toggle DLSS-G on/off/auto (override app setting)
* `"write-stats"` (default `Ctrl-Alt-'O'`)
* Write performance stats to file
@@ -605,9 +675,9 @@ Here is some pseudo code showing how this can be done:
```cpp
void onDLSSGModeChange(sl::DLSSGMode mode)
{
- if(mode == sl::DLSSGMode::eOn)
+ if(mode == sl::DLSSGMode::eOn || mode == sl::DLSSGMode::eAuto)
{
- // DLSS-G was off, now we are turning it on
+ // DLSS-G was off, now we are turning it on or set the mode to auto
// Make sure no work is pending on GPU
waitForIdle();
@@ -706,3 +776,13 @@ In developer DLSS-FG variants ASCD displays on-screen hints for:
3. No scene change detected with the reset flag.
The hints present as text blurbs in the center of screen, messages in the DLSS-FG log file, and in scenario 1, a screen goldenrod yellow tint.
+
+### 22.0 DYNAMIC FRAME GENERATION
+
+Dynamic Frame Generation leverages stochastic control to automatically trigger DLSS-G. This adaptive monitoring mechanism activates frame generation only when it boosts performance beyond the native framerate production of the game. Otherwise, DLSS-G remains disabled to ensure optimal framerate performance.
+
+#### 22.1 DLSS-G AUTO MODE
+
+Dynamic Frame Generation is enabled when DLSS-G is in auto mode. To activate Dynamic Frame Generation, set `mode` to `sl::DLSSGMode::eAuto`.
+
+When using non-production (development) builds of `sl.dlss_g.dll`, the status of Dynamic Frame Generation and the current state of DLSS-G is displayed on the DLSS-G status window.
\ No newline at end of file
diff --git a/docs/ProgrammingGuideManualHooking.md b/docs/ProgrammingGuideManualHooking.md
index 64f39bb..25a1884 100644
--- a/docs/ProgrammingGuideManualHooking.md
+++ b/docs/ProgrammingGuideManualHooking.md
@@ -2,7 +2,7 @@
Streamline - Manual Hooking
=======================
-Version 2.2.0
+Version 2.2.1
=======
The automated global hooking is a great way to quickly enable SL features in any application. However, this can lead to unnecessary overhead caused by the entire API redirection through SL proxies and problems with tools and 3rd party libraries which do not expect to receive SL proxies as inputs.
diff --git a/docs/ProgrammingGuideNIS.md b/docs/ProgrammingGuideNIS.md
index 8a84bde..25b1ce0 100644
--- a/docs/ProgrammingGuideNIS.md
+++ b/docs/ProgrammingGuideNIS.md
@@ -5,7 +5,7 @@ Streamline - NIS
>The focus of this guide is on using Streamline to integrate the NVIDIA Image Scaling (NIS) SDK into an application. For more information about NIS itself, please visit the [NVIDIA Image Scaling SDK Github Page](https://github.com/NVIDIAGameWorks/NVIDIAImageScaling)
>For information on user interface considerations when using the NIS plugin, please see the "RTX UI Developer Guidelines.pdf" document included in the NIS SDK.
-Version 2.2.0
+Version 2.2.1
=======
### Introduction
diff --git a/docs/ProgrammingGuideNRD.md b/docs/ProgrammingGuideNRD.md
index 0fae90d..6be2d4b 100644
--- a/docs/ProgrammingGuideNRD.md
+++ b/docs/ProgrammingGuideNRD.md
@@ -4,7 +4,7 @@ Streamline - NRD (Beta)
>The focus of this guide is on using Streamline to integrate NVIDIA Real-Time Denoisers (NRD) into an application. For more information about NRD itself, please visit the [NVIDIA Developer NRD Page](https://developer.nvidia.com/rtx/ray-tracing/rt-denoisers)
-Version 2.2.0
+Version 2.2.1
=======
### 1.0 INITIALIZE AND SHUTDOWN
diff --git a/docs/ProgrammingGuideReflex.md b/docs/ProgrammingGuideReflex.md
index acaaf39..81075bd 100644
--- a/docs/ProgrammingGuideReflex.md
+++ b/docs/ProgrammingGuideReflex.md
@@ -4,7 +4,7 @@ Streamline - Reflex
>The focus of this guide is on using Streamline to integrate Reflex into an application. For more information about Reflex itself, please visit the [NVIDIA Developer Reflex Page](https://developer.nvidia.com/performance-rendering-tools/reflex)
-Version 2.2.0
+Version 2.2.1
=======
Here is an overview list of sub-features in the Reflex plugin:
diff --git a/docs/RTX UI Developer Guidelines.pdf b/docs/RTX UI Developer Guidelines.pdf
index 47bcacc..7023eb0 100644
Binary files a/docs/RTX UI Developer Guidelines.pdf and b/docs/RTX UI Developer Guidelines.pdf differ
diff --git a/docs/Streamline 2.2 Developer Guide.pdf b/docs/Streamline 2.2 Developer Guide.pdf
deleted file mode 100644
index 82cb86e..0000000
Binary files a/docs/Streamline 2.2 Developer Guide.pdf and /dev/null differ
diff --git a/docs/Streamline 2.2.1 Developer Guide.pdf b/docs/Streamline 2.2.1 Developer Guide.pdf
new file mode 100644
index 0000000..d93ec4c
Binary files /dev/null and b/docs/Streamline 2.2.1 Developer Guide.pdf differ
diff --git a/docs/media/dlssg_docs_bidirectional_distortion_field.png b/docs/media/dlssg_docs_bidirectional_distortion_field.png
new file mode 100644
index 0000000..be82b4f
--- /dev/null
+++ b/docs/media/dlssg_docs_bidirectional_distortion_field.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:15986c9aea1d930a8966c2ce054ed8e47b12b45396ac8626b9e9455b8b082f1a
+size 411941
diff --git a/docs/media/dlssg_docs_bidirectional_distortion_field_rg_abs.png b/docs/media/dlssg_docs_bidirectional_distortion_field_rg_abs.png
new file mode 100644
index 0000000..dd065b2
--- /dev/null
+++ b/docs/media/dlssg_docs_bidirectional_distortion_field_rg_abs.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67dfe0c39ed5878134139c67d76c1c2d5afea141dc7cca9ad1be2bd95ff1ce66
+size 577820
diff --git a/external/json/LICENSE.MIT b/external/json/LICENSE.MIT
new file mode 100644
index 0000000..7f019ad
--- /dev/null
+++ b/external/json/LICENSE.MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013-2022 Niels Lohmann
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/external/json/include/nlohmann/adl_serializer.hpp b/external/json/include/nlohmann/adl_serializer.hpp
new file mode 100644
index 0000000..48348cc
--- /dev/null
+++ b/external/json/include/nlohmann/adl_serializer.hpp
@@ -0,0 +1,55 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
+#pragma once
+
+#include
+
+#include
+#include
+#include
+#include
+
+NLOHMANN_JSON_NAMESPACE_BEGIN
+
+/// @sa https://json.nlohmann.me/api/adl_serializer/
+template
+struct adl_serializer
+{
+ /// @brief convert a JSON value to any value type
+ /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/
+ template
+ static auto from_json(BasicJsonType && j, TargetType& val) noexcept(
+ noexcept(::nlohmann::from_json(std::forward(j), val)))
+ -> decltype(::nlohmann::from_json(std::forward(j), val), void())
+ {
+ ::nlohmann::from_json(std::forward(j), val);
+ }
+
+ /// @brief convert a JSON value to any value type
+ /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/
+ template
+ static auto from_json(BasicJsonType && j) noexcept(
+ noexcept(::nlohmann::from_json(std::forward(j), detail::identity_tag {})))
+ -> decltype(::nlohmann::from_json(std::forward(j), detail::identity_tag {}))
+ {
+ return ::nlohmann::from_json(std::forward(j), detail::identity_tag {});
+ }
+
+ /// @brief convert any value type to a JSON value
+ /// @sa https://json.nlohmann.me/api/adl_serializer/to_json/
+ template
+ static auto to_json(BasicJsonType& j, TargetType && val) noexcept(
+ noexcept(::nlohmann::to_json(j, std::forward(val))))
+ -> decltype(::nlohmann::to_json(j, std::forward(val)), void())
+ {
+ ::nlohmann::to_json(j, std::forward(val));
+ }
+};
+
+NLOHMANN_JSON_NAMESPACE_END
diff --git a/external/json/include/nlohmann/byte_container_with_subtype.hpp b/external/json/include/nlohmann/byte_container_with_subtype.hpp
new file mode 100644
index 0000000..bd4f491
--- /dev/null
+++ b/external/json/include/nlohmann/byte_container_with_subtype.hpp
@@ -0,0 +1,103 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
+#pragma once
+
+#include // uint8_t, uint64_t
+#include // tie
+#include // move
+
+#include
+
+NLOHMANN_JSON_NAMESPACE_BEGIN
+
+/// @brief an internal type for a backed binary type
+/// @sa https://json.nlohmann.me/api/byte_container_with_subtype/
+template
+class byte_container_with_subtype : public BinaryType
+{
+ public:
+ using container_type = BinaryType;
+ using subtype_type = std::uint64_t;
+
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/
+ byte_container_with_subtype() noexcept(noexcept(container_type()))
+ : container_type()
+ {}
+
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/
+ byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b)))
+ : container_type(b)
+ {}
+
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/
+ byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))))
+ : container_type(std::move(b))
+ {}
+
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/
+ byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b)))
+ : container_type(b)
+ , m_subtype(subtype_)
+ , m_has_subtype(true)
+ {}
+
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/
+ byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))))
+ : container_type(std::move(b))
+ , m_subtype(subtype_)
+ , m_has_subtype(true)
+ {}
+
+ bool operator==(const byte_container_with_subtype& rhs) const
+ {
+ return std::tie(static_cast(*this), m_subtype, m_has_subtype) ==
+ std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype);
+ }
+
+ bool operator!=(const byte_container_with_subtype& rhs) const
+ {
+ return !(rhs == *this);
+ }
+
+ /// @brief sets the binary subtype
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/set_subtype/
+ void set_subtype(subtype_type subtype_) noexcept
+ {
+ m_subtype = subtype_;
+ m_has_subtype = true;
+ }
+
+ /// @brief return the binary subtype
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/subtype/
+ constexpr subtype_type subtype() const noexcept
+ {
+ return m_has_subtype ? m_subtype : static_cast(-1);
+ }
+
+ /// @brief return whether the value has a subtype
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/has_subtype/
+ constexpr bool has_subtype() const noexcept
+ {
+ return m_has_subtype;
+ }
+
+ /// @brief clears the binary subtype
+ /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/clear_subtype/
+ void clear_subtype() noexcept
+ {
+ m_subtype = 0;
+ m_has_subtype = false;
+ }
+
+ private:
+ subtype_type m_subtype = 0;
+ bool m_has_subtype = false;
+};
+
+NLOHMANN_JSON_NAMESPACE_END
diff --git a/external/json/include/nlohmann/detail/abi_macros.hpp b/external/json/include/nlohmann/detail/abi_macros.hpp
new file mode 100644
index 0000000..1e4e165
--- /dev/null
+++ b/external/json/include/nlohmann/detail/abi_macros.hpp
@@ -0,0 +1,100 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
+#pragma once
+
+// This file contains all macro definitions affecting or depending on the ABI
+
+#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
+ #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
+ #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 2
+ #warning "Already included a different version of the library!"
+ #endif
+ #endif
+#endif
+
+#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
+
+#ifndef JSON_DIAGNOSTICS
+ #define JSON_DIAGNOSTICS 0
+#endif
+
+#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
+#endif
+
+#if JSON_DIAGNOSTICS
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
+#else
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
+#endif
+
+#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
+#else
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
+ #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
+#endif
+
+// Construct the namespace ABI tags component
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
+
+#define NLOHMANN_JSON_ABI_TAGS \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT( \
+ NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
+ NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
+
+// Construct the namespace version component
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
+ _v ## major ## _ ## minor ## _ ## patch
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
+
+#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
+#define NLOHMANN_JSON_NAMESPACE_VERSION
+#else
+#define NLOHMANN_JSON_NAMESPACE_VERSION \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
+ NLOHMANN_JSON_VERSION_MINOR, \
+ NLOHMANN_JSON_VERSION_PATCH)
+#endif
+
+// Combine namespace components
+#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
+#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
+ NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
+
+#ifndef NLOHMANN_JSON_NAMESPACE
+#define NLOHMANN_JSON_NAMESPACE \
+ nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION)
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
+#define NLOHMANN_JSON_NAMESPACE_BEGIN \
+ namespace nlohmann \
+ { \
+ inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION) \
+ {
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_END
+#define NLOHMANN_JSON_NAMESPACE_END \
+ } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
+ } // namespace nlohmann
+#endif
diff --git a/external/json/include/nlohmann/detail/conversions/from_json.hpp b/external/json/include/nlohmann/detail/conversions/from_json.hpp
new file mode 100644
index 0000000..4ccfcd3
--- /dev/null
+++ b/external/json/include/nlohmann/detail/conversions/from_json.hpp
@@ -0,0 +1,497 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
+#pragma once
+
+#include // transform
+#include // array
+#include // forward_list
+#include // inserter, front_inserter, end
+#include