Skip to content

Commit

Permalink
Streamline SDK 1.1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbishop committed Jul 17, 2022
1 parent 105e42d commit c5d0d50
Show file tree
Hide file tree
Showing 68 changed files with 806 additions and 3,155 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Streamline (SL) - Version 1.0.4
# Streamline (SL) - Version 1.1.0
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.

This repo contains the SDK for integrating Streamline into your application.
Expand All @@ -17,8 +17,8 @@ For a high level overview, see the [NVIDIA Developer Streamline page](https://de
> **IMPORTANT:**
> Current version of SDK does not support Vulkan properly, this is still work in progress
#### Windows
- Install latest graphics driver
- Install VS Code or VS2017/VS2019 with [SDK 10.17763+](https://go.microsoft.com/fwlink/?LinkID=2023014)
- Install latest graphics driver (**if using NVIDIA GPU it MUST be 512.15 or newer**)
- Install VS Code or VS2017/VS2019 with [SDK 10.0.19041+](https://go.microsoft.com/fwlink/?LinkID=2023014)
- Install "git".
- Clone your fork to a local hard drive, make sure to use a NTFS drive on Windows (SL uses symbolic links)
- Execute `./setup.bat` with `{vs2017|vs2019}` (`vs2017` is default)
Expand Down Expand Up @@ -51,8 +51,8 @@ Please read [Debugging.md](docs/Debugging.md) to learn how to debug and troubles
Please read [ProgrammingGuideDLSS.md](docs/ProgrammingGuideDLSS.md) to learn about DLSS specific integration in games.
## Programming Guide - NRD
Please read [ProgrammingGuideNRD.md](docs/ProgrammingGuideNRD.md) to learn about NRD specific integration in games.
## Programming Guide - Latency
Please read [ProgrammingGuideLatency.md](docs/ProgrammingGuideLatency.md) to learn about low-latency specific integration in games.
## Programming Guide - Reflex
Please read [ProgrammingGuideReflex.md](docs/ProgrammingGuideReflex.md) to learn about low-latency specific Reflex integration in games.
## Programming Guide - NIS
Please read [ProgrammingGuideNIS.md](docs/ProgrammingGuideNIS.md) to learn about NIS specific integration in games.

Expand Down
2 changes: 1 addition & 1 deletion bin/x64/NRD.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/development/sl.common.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/development/sl.dlss.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/development/sl.interposer.dll
Git LFS file not shown
3 changes: 0 additions & 3 deletions bin/x64/development/sl.latency.dll

This file was deleted.

4 changes: 2 additions & 2 deletions bin/x64/development/sl.nis.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/development/sl.nrd.dll
Git LFS file not shown
3 changes: 3 additions & 0 deletions bin/x64/development/sl.reflex.dll
Git LFS file not shown
File renamed without changes.
4 changes: 2 additions & 2 deletions bin/x64/sl.common.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/sl.dlss.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/sl.interposer.dll
Git LFS file not shown
3 changes: 0 additions & 3 deletions bin/x64/sl.latency.dll

This file was deleted.

4 changes: 2 additions & 2 deletions bin/x64/sl.nis.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/x64/sl.nrd.dll
Git LFS file not shown
3 changes: 3 additions & 0 deletions bin/x64/sl.reflex.dll
Git LFS file not shown
29 changes: 27 additions & 2 deletions docs/Debugging.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
# Debugging
> **NOTE:**
> This document applies to non-production, development builds only which can be found in `bin/x64/development` directory. JSON configuration is disabled in production builds.
> This document applies to non-production, development builds only. JSON configuration is disabled in production builds.
> Additionally, you will need to turn off any checks for signed libraries when loading Streamline libraries in order to be able to load the non-production libraries.
## JSON Config File(s)

### Location of the JSON

Note that the `sl.interposer.json` file is loaded from the current working directory of the app at the point at which the app calls `slInit`. This may not match the app's executable directory.

### "Commenting-out" Lines
Note that the example configuration JSON files (located in `./scripts/`) include some tags that are disabled, but visible as a form of "comment"; this is done by prefixing the correct/expected tag name with underscore (_):

Functional:
```json
{
"enableInterposer": false,
}
```

Non-functional "comment":
```json
{
"_enableInterposer": false,
}
```

## How to toggle SL on/off

Place the `sl.interposer.json` file (located in `./scripts/`) in the game's working directory. Edit the following line(s):
Expand Down Expand Up @@ -91,4 +114,6 @@ Place the `sl.common.json` file (located in `./scripts/`) in the game's working
}
]
}
```
```

Note that `"key"` lines specify the *decimal* number of the Windows Virtual Key Code (`VK_*`) for the desired key.
45 changes: 28 additions & 17 deletions docs/ProgrammingGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Streamline - SL
=======================

Version 1.0.4
Version 1.1.0
------

1 SETTING UP
Expand Down Expand Up @@ -102,10 +102,14 @@ All modules provided in the `./bin/x64` SDK folder are digitally signed by NVIDI
***It is strongly recommended*** to use the provided `sl.interposer.dll` binary and follow the above guidelines. The prebuilt binary automatically performs the above steps when loading SL plugins to ensure maximum security. If you decide to build your own `sl.interposer.dll`, make sure to enforce your own strict security policies.
* Note that if using provided development SL DLLs or if using self-built SL DLLs, they will not be signed. In these cases (which should be used ONLY in development/debugging situations and never shipped), you will need to temporarily disable the app's signature-checking.
### 2.2 INITIALIZING SL
#### 2.2.1 SL FEATURE LIFECYCLE
Here is the typical lifecycle for SL features:
* Requested feature DLLs are loaded during `slInit` call.
* This is (and must be) done before any DX/VK APIs are invoked (which is why the app must call slInit very early in its initialization)
* The feature "request" process is detailed in [featuresToLoad in preferences](#222-preferences)
Expand Down Expand Up @@ -410,7 +414,7 @@ enabled in development by setting `Preferences::showConsole` to true. In the deb
### 2.3 CHECKING IF A FEATURE IS SUPPORTED
SL supports the following features:
SL provides an enum with an entry for each supported feature:
```cpp
//! Features supported with this SDK
Expand All @@ -423,11 +427,15 @@ enum Feature
//! NVIDIA Image Scaling
eFeatureNIS = 2,
//! Low-Latency
eFeatureLatency = 3,
eFeatureReflex = 3,
.
.
.
//! Common feature, NOT intended to be used directly
eFeatureCommon = UINT_MAX
};
```
The set of features will change over time, so please see the enum definition in `sl.h` for the list of currently supported features.

To check if a specific feature is available on the specific display adapter(s), you can call:

Expand Down Expand Up @@ -461,8 +469,8 @@ if((adapterBitMask & (1 << myAdapterIndex)) != 0)
// It is OK to create a device on this adapter since feature we need is supported
}
```
> **NOTE:**
> If `slIsFeatureSupported` returns false, you can enable the console window or use `logMessagesCallback` to find out why the specific feature is not supported.
> **NOTE:**
> If `slIsFeatureSupported` returns false, you can enable the console window or use `logMessagesCallback` to find out why the specific feature is not supported.
> If `slIsFeatureSupported` returns true, it means that the feature is supported by some adapter in the system. In a multi-adapter system, you MUST check the bitmask to determine if the feature is supported on the desired adapter!
### 2.4 ENABLING OR DISABLING FEATURES
Expand All @@ -473,7 +481,8 @@ All loaded features are enabled by default. To explicitly enable or disable a sp
//! Sets the specified feature to either enabled or disabled state.
//!
//! Call this method to enable or disable certain eFeature*.
//! All supported features are enabled by default and have to be disabled explicitly if needed.
//!
//! NOTE: All loaded features are enabled by default and have to be disabled explicitly if needed.
//!
//! @param feature Specifies which feature to check
//! @param enabled Value specifying if feature should be enabled or disabled.
Expand All @@ -494,7 +503,7 @@ You may also query whether a particular feature is currently enabled or not with
//! Checks if specified feature is enabled or not.
//!
//! Call this method to check if feature is enabled.
//! All supported features are enabled by default and have to be disabled explicitly if needed.
//! All loaded features are enabled by default and have to be disabled explicitly if needed.
//!
//! @param feature Specifies which feature to check
//! @return false if feature is disabled, not supported on the system or if device has not been created yet, true otherwise.
Expand Down Expand Up @@ -578,6 +587,8 @@ enum BufferType : uint32_t
eBufferTypeReflectionMotionVectors,
//! Optional - Position, in same space as eBufferTypeNormals
eBufferTypePosition,
//! Optional - Indicates (via non-zero value) which pixels have motion/depth values that do not match the final color content at that pixel (e.g. overlaid, opaque Picture-in-Picture)
eBufferTypeInvalidDepthMotionHint
};

//! Tags resource
Expand Down Expand Up @@ -653,6 +664,7 @@ The following hints are optional but should be provided if they are easy to obta
* `eBufferTypeReflectionHint` - boolean mask indicating which pixels represent the transparency area
* `eBufferTypeParticleHint` - boolean mask indicating which pixels represent the reflections area
* `eBufferTypeTransparencyHint` - boolean mask indicating which pixels represent the particles
* `eBufferTypeInvalidDepthMotionHint` -- boolean mask indicating pixels where the color content does not match the depth and/or motion vector content (e.g. picture-in-picture)

> **NOTE:**
> Tagged buffers should not be used for other purposes within a frame execution because SL plugins might need them at different stages. If that cannot be guaranteed, please make a copy and tag it instead of the original buffer.
Expand All @@ -667,9 +679,9 @@ Some additional information should be provided so that SL features can operate c
struct Constants
{
//! IMPORTANT: All matrices are row major (see float4x4 definition) and
//! must NOT contain temporal AA jitter offset (if any). Clip space jitter offset
//! must NOT contain temporal AA jitter offset (if any). Any jitter offset
//! should be provided as the additional parameter Constants::jitterOffset (see below)
//! Specifies matrix transformation from the camera view to the clip space.
float4x4 cameraViewToClip;
//! Specifies matrix transformation from the clip space to the camera view space.
Expand All @@ -682,8 +694,8 @@ struct Constants
//! Specifies matrix transformation from the previous clip to the current clip space.
//! prevClipToClip = clipToPrevClip.inverse()
float4x4 prevClipToClip;
//! Specifies clip space jitter offset

//! Specifies pixel space jitter offset
float2 jitterOffset;
//! Specifies scale factors used to normalize motion vectors (so the values are in [-1,1] range)
float2 mvecScale;
Expand All @@ -697,7 +709,7 @@ struct Constants
float3 cameraRight;
//! Specifies camera forward vector in world space.
float3 cameraFwd;

//! Specifies camera near view plane distance.
float cameraNear = INVALID_FLOAT;
//! Specifies camera far view plane distance.
Expand Down Expand Up @@ -731,15 +743,14 @@ struct Constants
void* ext = {};
};


//! Sets common constants.
//!
//! Call this method to provide the required data (SL will keep a copy).
//!
//! @param values Common constants required by SL plugins (SL will keep a copy)
//! @param frameIndex Index of the current frame
//! @param id Unique id (can be viewport id | instance id etc.)
//! @return false if constants cannot be set or if device has not beeing created yet, true otherwise.
//! @return false if constants cannot be set or if device has not been created yet, true otherwise.
//!
//! This method is thread safe and requires DX/VK device to be created before calling it.
SL_API bool slSetConstants(const sl::Constants& values, uint32_t frameIndex, uint32_t id = 0);
Expand All @@ -761,7 +772,7 @@ Each feature requires specific data which is defined in a corresponding `sl_<fe
//! @param consts Pointer to the feature specific constants (SL will keep a copy)
//! @param frameIndex Index of the current frame
//! @param id Unique id (can be viewport id | instance id etc.)
//! @return false if constants cannot be set or if device has not beeing created yet, true otherwise.
//! @return false if constants cannot be set or if device has not been created yet, true otherwise.
//!
//! This method is thread safe and requires DX/VK device to be created before calling it.
SL_API bool slSetFeatureConstants(sl::Feature feature, const void *consts, uint32_t frameIndex, uint32_t id = 0);
Expand All @@ -782,7 +793,7 @@ Some features provide feedback to the host application specifying which renderin
//! @param feature Feature we are working with
//! @param consts Pointer to the feature specific constants
//! @param settings Pointer to the returned feature specific settings
//! @return false if feature does not have settings or if device has not beeing created yet, true otherwise.
//! @return false if feature does not have settings or if device has not been created yet, true otherwise.
//!
//! This method is NOT thread safe and requires DX/VK device to be created before calling it.
SL_API bool slGetFeatureSettings(sl::Feature feature, const void* consts, void* settings);
Expand Down Expand Up @@ -823,7 +834,7 @@ By design, SL SDK enables `host assisted replacement or injection of specific re
//! @param feature Feature we are working with
//! @param frameIndex Current frame index (can be 0 if not needed)
//! @param id Unique id (can be viewport id | instance id etc.)
//! @return false if feature event cannot be injected in the command buffer or if device has not beeing created yet, true otherwise.
//! @return false if feature event cannot be injected in the command buffer or if device has not been created yet, true otherwise.
//!
//! IMPORTANT: frameIndex and id must match whatever is used to set common and or feature constants (if any)
//!
Expand Down
10 changes: 8 additions & 2 deletions docs/ProgrammingGuideDLSS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
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)
>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 1.0.4
Version 1.1.0
------

### 1.0 INITIALIZE AND SHUTDOWN
Expand Down Expand Up @@ -65,11 +65,15 @@ Next, we need to find out the rendering resolution and the optimal sharpness lev

```cpp
sl::DLSSSettings dlssSettings{};
sl::DLSSSettings1 dlssSettings1{};
dlssSettings.ext = &dlssSettings1;

sl::DLSSConstants dlssConsts{};
// These are populated based on user selection in the UI
dlssConsts.mode = myUI->getDLSSMode(); // e.g. sl::eDLSSModeBalanced;
dlssConsts.outputWidth = myUI->getOutputWidth(); // e.g 1920;
dlssConsts.outputHeight = myUI->getOutputHeight(); // e.g. 1080;

// Now let's check what should our rendering resolution be
if(!slGetFeatureSettings(sl::eFeatureDLSS, &dlssConsts, &dlssSettings))
{
Expand All @@ -79,6 +83,8 @@ if(!slGetFeatureSettings(sl::eFeatureDLSS, &dlssConsts, &dlssSettings))
myViewport->setSize(dlssSettings.optimalRenderWidth, dlssSettings.optimalRenderHeight);
```
Note that the structure pointed to by `sl::DLSSSettings::ext`, i.e. `dlssSettings1` above (if ext is non-null) will upon return from `slGetFeatureSettings` contain information pertinent to DLSS dynamic resolution min and max source image sizes (if dynamic resolution is supported).
### 4.0 TAG ALL REQUIRED RESOURCES
DLSS requires depth, motion vectors, render-res input color and final-res output color buffers.
Expand Down
Loading

0 comments on commit c5d0d50

Please sign in to comment.