From 0b62ae31f6acbbfd47fa85a1fa3cc2a401dc9add Mon Sep 17 00:00:00 2001 From: Conn O'Griofa Date: Tue, 30 May 2023 01:00:52 +0100 Subject: [PATCH 001/576] windows: fix header conflict for msys2-w32api-headers 11.0.1+ (#1332) --- src/platform/windows/publish.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/platform/windows/publish.cpp b/src/platform/windows/publish.cpp index 3d9383f7e49..187868b6fa7 100644 --- a/src/platform/windows/publish.cpp +++ b/src/platform/windows/publish.cpp @@ -29,9 +29,8 @@ using namespace std::literals; #define SV(quote) __SV(quote) extern "C" { -constexpr auto DNS_REQUEST_PENDING = 9506L; - #ifndef __MINGW32__ +constexpr auto DNS_REQUEST_PENDING = 9506L; constexpr auto DNS_QUERY_REQUEST_VERSION1 = 0x1; constexpr auto DNS_QUERY_RESULTS_VERSION1 = 0x1; #endif From fbc3f00ba7c44edbe53047ba69ca6d700acc7ce7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 07:11:33 -0400 Subject: [PATCH 002/576] build(deps): bump bootstrap from 5.2.3 to 5.3.0 (#1339) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b6d33ada01..c47a364ca81 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@fortawesome/fontawesome-free": "6.4.0", - "bootstrap": "5.2.3", + "bootstrap": "5.3.0", "vue": "2.6.12" } } From 90606521539043362c5f352b8420dd5f8864663a Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 31 May 2023 22:07:26 -0400 Subject: [PATCH 003/576] docs(badges): force badges to use svg (#1342) --- README.rst | 14 +++++---- docs/source/about/third_party_packages.rst | 34 ++++++++++------------ 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/README.rst b/README.rst index 0a8d1eb8c91..b84bfa29ee7 100644 --- a/README.rst +++ b/README.rst @@ -92,11 +92,11 @@ Integrations :alt: GitHub Workflow Status (localize) :target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Anightly -.. image:: https://img.shields.io/readthedocs/sunshinestream?label=Docs&style=for-the-badge&logo=readthedocs +.. image:: https://img.shields.io/readthedocs/sunshinestream.svg?label=Docs&style=for-the-badge&logo=readthedocs :alt: Read the Docs :target: http://sunshinestream.readthedocs.io/ -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=localized&style=for-the-badge&query=%24.progress..data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json&logo=crowdin +.. image:: https://img.shields.io/badge/dynamic/json.svg?color=blue&label=localized&style=for-the-badge&query=%24.progress..data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json&logo=crowdin :alt: CrowdIn :target: https://crowdin.com/project/sunshinestream @@ -109,17 +109,21 @@ Our support methods are listed in our Downloads --------- -.. image:: https://img.shields.io/github/downloads/lizardbyte/sunshine/total?style=for-the-badge&logo=github +.. image:: https://img.shields.io/github/downloads/lizardbyte/sunshine/total.svg?style=for-the-badge&logo=github :alt: GitHub Releases :target: https://github.com/LizardByte/Sunshine/releases/latest -.. image:: https://img.shields.io/docker/pulls/lizardbyte/sunshine?style=for-the-badge&logo=docker +.. image:: https://img.shields.io/docker/pulls/lizardbyte/sunshine.svg?style=for-the-badge&logo=docker :alt: Docker :target: https://hub.docker.com/r/lizardbyte/sunshine +.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=Winget&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27winget%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=microsoft + :alt: Winget Version + :target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine + Stats ------ -.. image:: https://img.shields.io/github/stars/lizardbyte/sunshine?logo=github&style=for-the-badge +.. image:: https://img.shields.io/github/stars/lizardbyte/sunshine.svg?logo=github&style=for-the-badge :alt: GitHub stars :target: https://github.com/LizardByte/Sunshine diff --git a/docs/source/about/third_party_packages.rst b/docs/source/about/third_party_packages.rst index fb921c9360a..69204dc266e 100644 --- a/docs/source/about/third_party_packages.rst +++ b/docs/source/about/third_party_packages.rst @@ -3,59 +3,57 @@ Third Party Packages .. Danger:: These packages are not maintained by LizardByte. Use at your own risk. +AOSC +---- + +.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=AOSC&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27aosc%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAMAAABPMuDPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAMAUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAP/AAABwwP/////LAMkAAI0AAIhnAP/CAP/JAP/IAMcAAMsAAAEAAMwAAAB3zMoAAAAIDsEAAMIAAP/MAABptP/GAMQAAAByxP/KAABxwsgAAABzxsYAAMMAAAB1yf/EAAgGAQwAAAgAAAUBAAB2ywB0x/m9AAECBCQAAC0AAFoAAB4WAL8AAKYAAKEA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version + :target: https://packages.aosc.io/packages/sunshine + AUR --- -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fapp.lizardbyte.dev%2Funo%2Faur%2Fsunshine.json&logo=archlinux +.. image:: https://img.shields.io/badge/dynamic/json.svg?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fapp.lizardbyte.dev%2Funo%2Faur%2Fsunshine.json&logo=archlinux :alt: AUR votes :target: https://aur.archlinux.org/packages/sunshine Chocolatey ---------- -.. image:: https://img.shields.io/chocolatey/v/sunshine?style=for-the-badge&logo=chocolatey +.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=chocolatey&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27chocolatey%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=chocolatey :alt: Chocolatey Version :target: https://community.chocolatey.org/packages/sunshine -.. image:: https://img.shields.io/chocolatey/dt/sunshine?style=for-the-badge&logo=chocolatey - :alt: Chocolatey - nixpkgs ------- -.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos +.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos :alt: nixpgs Version - :target: https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sunshine/default.nix + :target: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/servers/sunshine/default.nix Scoop ----- -.. image:: https://img.shields.io/scoop/v/sunshine?bucket=extras&style=for-the-badge +.. image:: https://img.shields.io/scoop/v/sunshine.svg?bucket=extras&style=for-the-badge&logo=data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAGAAhAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAuhJREFUOE9tk1tIFFEYx7+ZXdfbrhdMElJLFCykCxL20MUW9UkkqeiOFGSWYW75EvjgVlJmlpkaJV5SMtQlMYjEROqpQoiMMEpRW2/p6q67bTuXM2dmOjPu2moNDHPm4/v/Zs7//D9KlmUNAMjkBoqiJOVJapTyqqzXXn49tCohzbRSVERPSi7tokFOSkne2rmzoED4H6C0pHwjT2G2qspsU7U+wBuzWTs8M9mlpen0YEOoMS/73DjrnMuhXFyiLEmjwZH6vmufR5DDNtHBI7b9cWNNpw9AgcVCtw6+P8R43KdkjHMM+vDqI/tywyiN5oy46KQpLEogiG0149+7rG5HGRK5o01N9VYVoPxm/ZXCOMrD95NloihiOj4qhs1K3R8IbqQFogVJAuRifrXNT3wactkGmpvrbni9UregQu7nn87X0XB3w+ZYfcruHRAVJgNtE0EclmCGM8CYC2DE5UK8TJXtzT1ZZTRSeJUHiqOvW29Vb89KKw4kYgEvgIQFGHurg3l7AlitS8CzAohYZgQB5ZU9Ovx8FcBkMkdcKEx5GL1ee1yWGcKjgWMQfHgVDVOjNPD88qHwHAYOe57GbHOcLSoqQiunYC4tT4tL0NYmbwkOx1hO1ukABITg40AkOO0BJCgiYFEAl9sBjGj/pl+nyairq5xdAdy50xbKuH+eFyUMkijdJtHQCAIGxiOQYC0nguMYmJqeVJJW29vfU7wqSErDzeuV6aQ5lUPoIjn7RI5FRIRUMQkbLC05YN42txgaEpTd89IyuNZEaGlpCZqdXsjHAj5Avp7h+c2CIIiqGGMMMzNTgDD/oLev57I3vX+T6IttRUVNvNvpusey3EGeE5QtAkI82B12YFjmXagh5ER39zOrfw7UWfDPvcl0ddP0j+lGjucylDoiZhIbvkboDccsL9q/+Hr/2YI/JDMzZ4/IIyMhRyh1XYBmKCEptqOhoWFlyHwAZZxX/YHXNK/3/tiVUfcV6T8hxMYSf1PeGAAAAABJRU5ErkJggg== :alt: Scoop Version (extras bucket) :target: https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine Solus ----- -.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus +.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus :alt: Solus Version :target: https://dev.getsol.us/source/sunshine -Winget ------- -.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Winget&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27winget%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=microsoft - :alt: Winget Version - :target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine - Legacy GitHub Repo ------------------ .. Attention:: This repo is not maintained. Thank you to Loki for bringing this amazing project to life! -.. image:: https://img.shields.io/static/v1?label=repo&message=loki-47-6F-64/sunshine&color=blue&style=for-the-badge&logo=github +.. image:: https://img.shields.io/static/v1.svg?label=repo&message=loki-47-6F-64/sunshine&color=blue&style=for-the-badge&logo=github :alt: GitHub Maintainer :target: https://github.com/loki-47-6F-64/sunshine/releases -.. image:: https://img.shields.io/github/last-commit/loki-47-6F-64/sunshine?style=for-the-badge&logo=github +.. image:: https://img.shields.io/github/last-commit/loki-47-6F-64/sunshine.svg?style=for-the-badge&logo=github :alt: GitHub last commit -.. image:: https://img.shields.io/github/release-date/loki-47-6F-64/sunshine?style=for-the-badge&logo=github +.. image:: https://img.shields.io/github/release-date/loki-47-6F-64/sunshine.svg?style=for-the-badge&logo=github :alt: GitHub Release Date From eb221deac3bf11b80fc7a71dd8c93c0d41b48b31 Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Wed, 7 Jun 2023 00:31:15 +0200 Subject: [PATCH 004/576] Fix WebUI Stable Update notification (#1358) --- src_assets/common/assets/web/index.html | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index fb8dc940c9b..140643db95c 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -9,10 +9,10 @@

Version {{version}}

Loading Latest Release...
-
+
Thank you for helping to make Sunshine a better software! 🌇
-
+
You're running the latest version of Sunshine
@@ -89,7 +89,7 @@

Legal

try { this.version = (await fetch("/api/config").then((r) => r.json())).version; this.githubVersion = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/releases/latest").then((r) => r.json())); - if (this.buildVersionIsNightly()) { + if (this.buildVersionIsNightly) { this.nightlyData = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/actions/workflows/CI.yml/runs?branch=nightly&status=success&per_page=1").then((r) => r.json())).workflow_runs[0]; } } catch(e){ @@ -97,9 +97,6 @@

Legal

this.loading = false; }, computed: { - runningDirtyBuild() { - return this.buildVersionIsDirty() - }, stableBuildAvailable() { // If we can't get versions, return false if (!this.githubVersion || !this.version) return false; @@ -109,32 +106,30 @@

Legal

if (v.indexOf("v") === 0) v = v.substring(1); // if nightly or dirty, we do an additional check to make sure it's an actual upgrade. - if (this.buildVersionIsNightly() || this.buildVersionIsDirty()) { + if (this.buildVersionIsNightly || this.buildVersionIsDirty) { const stableVersion = this.version.split('.').slice(0, 3).join('.'); return this.githubVersion.tag_name.substring(1) > stableVersion; } // return true if the version is different, otherwise false - return v !== this.version.split(".")[0]; + return v !== this.version; }, nightlyBuildAvailable() { // Verify nightly data is available and the build version is not stable // This is important to ensure the UI does not try to load undefined values. - if (!this.nightlyData || this.buildVersionIsStable()) return false; + if (!this.nightlyData || this.buildVersionIsStable) return false; // If built with dirty git tree, return false - if (this.buildVersionIsDirty()) return false; + if (this.buildVersionIsDirty) return false; // Get the commit hash let commit = this.version?.split(".").pop(); // return true if the commit hash is different, otherwise false return this.nightlyData.head_sha.indexOf(commit) !== 0; - } - }, - methods: { - buildVersionIsDirty() { + }, + buildVersionIsDirty() { return this.version?.split(".").length === 5 && this.version.indexOf("dirty") !== -1 }, - buildVersionIsNightly() { + buildVersionIsNightly() { return this.version?.split(".").length === 4 }, buildVersionIsStable() { From a575c4b27f0eed91e64f75f589f58b5cfb80f0a2 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:48:02 -0400 Subject: [PATCH 005/576] docs: add linux ssh example (#1388) --- docs/source/about/usage.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index fa680ba6c2d..3e956559d6e 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -21,6 +21,14 @@ Usage .. Attention:: The configuration file specified will be created if it doesn't exist. + **Start Sunshine over SSH (Linux/X11)** + .. code-block:: bash + + ssh -t @ 'startx &; export DISPLAY=:0; sunshine' + + .. Note:: You could also utilize the ``~/.bash_profile`` or ``~/.bashrc`` files to setup the ``DISPLAY`` + variable. + #. Configure Sunshine in the web ui The web ui is available on `https://localhost:47990 `_ by default. You may replace From a806032a84e7d38acfe0318a9f0d1bf8e43d9231 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 24 Jun 2023 17:00:46 -0400 Subject: [PATCH 006/576] docs(linux): add information about mesa (#1393) --- docs/source/troubleshooting/linux.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/source/troubleshooting/linux.rst b/docs/source/troubleshooting/linux.rst index 5c2d7c8a37c..3234d63e4bf 100644 --- a/docs/source/troubleshooting/linux.rst +++ b/docs/source/troubleshooting/linux.rst @@ -1,6 +1,28 @@ Linux ===== +Hardware Encoding fails +----------------------- +Due to legal concerns, Mesa has disabled hardware decoding and encoding by default. + +.. code-block:: text + + Error: Could not open codec [h264_vaapi]: Function not implemented + +If you see the above error in the Sunshine logs, compiling `Mesa` +manually, may be required. See the official Mesa3D `Compiling and Installing `_ +documentation for instructions. + +.. Important:: You must re-enable the disabled encoders. You can do so, by passing the following argument to the build + system. You may also want to enable decoders, however that is not required for Sunshine and is not covered here. + + .. code-block:: bash + + -Dvideo-codecs=h264enc,h265enc + +.. Note:: Other build options are listed in the + `meson options `_ file. + KMS Streaming fails ------------------- If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting. From 4863039b3b2f46c3538890c42f8ad980234e1521 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 25 Jun 2023 17:10:35 -0400 Subject: [PATCH 007/576] fix(ui): fix nightly release notifications (#1394) --- src_assets/common/assets/web/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index 140643db95c..e83d43ee351 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -90,7 +90,7 @@

Legal

this.version = (await fetch("/api/config").then((r) => r.json())).version; this.githubVersion = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/releases/latest").then((r) => r.json())); if (this.buildVersionIsNightly) { - this.nightlyData = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/actions/workflows/CI.yml/runs?branch=nightly&status=success&per_page=1").then((r) => r.json())).workflow_runs[0]; + this.nightlyData = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/actions/workflows/CI.yml/runs?branch=nightly&event=push&exclude_pull_requests=true&per_page=1").then((r) => r.json())).workflow_runs[0]; } } catch(e){ } From e80cfdfbd7361f6d653c31ee92489d5e2e9b64f5 Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Mon, 26 Jun 2023 17:50:10 +0200 Subject: [PATCH 008/576] fix(deps): replace libboost chrono and thread with standard chrono and thread (#1364) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .github/workflows/CI.yml | 2 -- CMakeLists.txt | 2 -- docker/debian-bullseye.dockerfile | 1 - docker/ubuntu-20.04.dockerfile | 1 - docker/ubuntu-22.04.dockerfile | 1 - docs/source/building/linux.rst | 3 --- src/input.cpp | 7 +++---- 7 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a2d7f99fb44..bcf9df8476d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -285,7 +285,6 @@ jobs: libboost-locale1.71-dev \ libboost-log1.71-dev \ libboost-regex1.71-dev \ - libboost-thread1.71-dev \ libboost-program-options1.71-dev # Install cmake @@ -311,7 +310,6 @@ jobs: libboost-filesystem-dev \ libboost-locale-dev \ libboost-log-dev \ - libboost-thread-dev \ libboost-program-options-dev fi diff --git a/CMakeLists.txt b/CMakeLists.txt index ccca6fcec60..d9574c8ef8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -906,7 +906,6 @@ elseif(UNIX) libboost-locale${Boost_VERSION}, \ libboost-log${Boost_VERSION}, \ libboost-program-options${Boost_VERSION}, \ - libboost-thread${Boost_VERSION}, \ libcap2, \ libcurl4, \ libdrm2, \ @@ -926,7 +925,6 @@ elseif(UNIX) boost-locale >= ${Boost_VERSION}, \ boost-log >= ${Boost_VERSION}, \ boost-program-options >= ${Boost_VERSION}, \ - boost-thread >= ${Boost_VERSION}, \ libcap >= 2.22, \ libcurl >= 7.0, \ libdrm >= 2.4.97, \ diff --git a/docker/debian-bullseye.dockerfile b/docker/debian-bullseye.dockerfile index 7c4396184ae..0ba3fdf0ce5 100644 --- a/docker/debian-bullseye.dockerfile +++ b/docker/debian-bullseye.dockerfile @@ -38,7 +38,6 @@ apt-get install -y --no-install-recommends \ libboost-locale-dev=1.74.* \ libboost-log-dev=1.74.* \ libboost-program-options-dev=1.74.* \ - libboost-thread-dev=1.74.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile index 5689ba7134b..3cb049ac60b 100644 --- a/docker/ubuntu-20.04.dockerfile +++ b/docker/ubuntu-20.04.dockerfile @@ -40,7 +40,6 @@ apt-get install -y --no-install-recommends \ libboost-locale-dev=1.71.* \ libboost-log-dev=1.71.* \ libboost-program-options-dev=1.71.* \ - libboost-thread-dev=1.71.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index 143fc1e4b24..f007f26725f 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -39,7 +39,6 @@ apt-get install -y --no-install-recommends \ libboost-locale-dev=1.74.* \ libboost-log-dev=1.74.* \ libboost-program-options-dev=1.74.* \ - libboost-thread-dev=1.74.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst index 2f629efbb7b..80dcd81d406 100644 --- a/docs/source/building/linux.rst +++ b/docs/source/building/linux.rst @@ -19,7 +19,6 @@ Install Requirements libboost-locale-dev \ libboost-log-dev \ libboost-program-options-dev \ - libboost-thread-dev \ libcap-dev \ # KMS libcurl4-openssl-dev \ libdrm-dev \ # KMS @@ -100,7 +99,6 @@ Install Requirements libboost-filesystem-dev \ libboost-locale-dev \ libboost-log-dev \ - libboost-thread-dev \ libboost-program-options-dev \ libcap-dev \ # KMS libdrm-dev \ # KMS @@ -149,7 +147,6 @@ Install Requirements libboost-filesystem-dev \ libboost-locale-dev \ libboost-log-dev \ - libboost-thread-dev \ libboost-program-options-dev \ libcap-dev \ # KMS libdrm-dev \ # KMS diff --git a/src/input.cpp b/src/input.cpp index a9a38e2d91c..91f6ab813d9 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -10,6 +10,8 @@ extern "C" { } #include +#include +#include #include #include "config.h" @@ -19,9 +21,6 @@ extern "C" { #include "thread_pool.h" #include "utility.h" -#include -#include - using namespace std::literals; namespace input { @@ -738,7 +737,7 @@ namespace input { platf::gamepad(platf_input, gamepad.id, state); // Sleep for a short time to allow the input to be detected - boost::this_thread::sleep_for(boost::chrono::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Release Home button state.buttonFlags &= ~platf::HOME; From 639447866875630e46dda76d54fcff1b6820ee52 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 26 Jun 2023 20:33:01 -0500 Subject: [PATCH 009/576] Pull in latest protocol extension from moonlight-common-c --- third-party/moonlight-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/moonlight-common-c b/third-party/moonlight-common-c index c9426a6a71c..28d63b11ddb 160000 --- a/third-party/moonlight-common-c +++ b/third-party/moonlight-common-c @@ -1 +1 @@ -Subproject commit c9426a6a71c4162e65dde8c0c71a25f1dbca46ba +Subproject commit 28d63b11ddb808662f0a7d90674a1376d99059c4 From 07ae3d0926f563e02fec0f25600426c4a3e034bb Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 26 Jun 2023 21:00:53 -0500 Subject: [PATCH 010/576] Implement input batching for reduced latency --- src/input.cpp | 358 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 353 insertions(+), 5 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 91f6ab813d9..80e7a75c19f 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -11,6 +11,7 @@ extern "C" { #include #include +#include #include #include @@ -145,6 +146,9 @@ namespace input { safe::mail_raw_t::event_t touch_port_event; platf::rumble_queue_t rumble_queue; + std::list> input_queue; + std::mutex input_queue_lock; + thread_pool_util::ThreadPool::task_id_t mouse_left_button_timeout; input::touch_port_t touch_port; @@ -760,12 +764,347 @@ namespace input { gamepad.gamepad_state = gamepad_state; } + enum class batch_result_e { + batched, // This entry was batched with the source entry + not_batchable, // Not eligible to batch but continue attempts to batch + terminate_batch, // Stop trying to batch with this entry + }; + + /** + * @brief Batch two relative mouse messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PNV_REL_MOUSE_MOVE_PACKET dest, PNV_REL_MOUSE_MOVE_PACKET src) { + short deltaX, deltaY; + + // Batching is safe as long as the result doesn't overflow a 16-bit integer + if (!__builtin_add_overflow(util::endian::big(dest->deltaX), util::endian::big(src->deltaX), &deltaX)) { + return batch_result_e::terminate_batch; + } + if (!__builtin_add_overflow(util::endian::big(dest->deltaY), util::endian::big(src->deltaY), &deltaY)) { + return batch_result_e::terminate_batch; + } + + // Take the sum of deltas + dest->deltaX = util::endian::big(deltaX); + dest->deltaY = util::endian::big(deltaY); + return batch_result_e::batched; + } + + /** + * @brief Batch two absolute mouse messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PNV_ABS_MOUSE_MOVE_PACKET dest, PNV_ABS_MOUSE_MOVE_PACKET src) { + // Batching must only happen if the reference width and height don't change + if (dest->width != src->width || dest->height != src->height) { + return batch_result_e::terminate_batch; + } + + // Take the latest absolute position + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two vertical scroll messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PNV_SCROLL_PACKET dest, PNV_SCROLL_PACKET src) { + short scrollAmt; + + // Batching is safe as long as the result doesn't overflow a 16-bit integer + if (!__builtin_add_overflow(util::endian::big(dest->scrollAmt1), util::endian::big(src->scrollAmt1), &scrollAmt)) { + return batch_result_e::terminate_batch; + } + + // Take the sum of delta + dest->scrollAmt1 = util::endian::big(scrollAmt); + dest->scrollAmt2 = util::endian::big(scrollAmt); + return batch_result_e::batched; + } + + /** + * @brief Batch two horizontal scroll messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PSS_HSCROLL_PACKET dest, PSS_HSCROLL_PACKET src) { + short scrollAmt; + + // Batching is safe as long as the result doesn't overflow a 16-bit integer + if (!__builtin_add_overflow(util::endian::big(dest->scrollAmount), util::endian::big(src->scrollAmount), &scrollAmt)) { + return batch_result_e::terminate_batch; + } + + // Take the sum of delta + dest->scrollAmount = util::endian::big(scrollAmt); + return batch_result_e::batched; + } + + /** + * @brief Batch two controller state messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PNV_MULTI_CONTROLLER_PACKET dest, PNV_MULTI_CONTROLLER_PACKET src) { + // Do not allow batching if the active controllers change + if (dest->activeGamepadMask != src->activeGamepadMask) { + return batch_result_e::terminate_batch; + } + + // We can only batch entries for the same controller, but allow batching attempts to continue + // in case we have more packets for this controller later in the queue. + if (dest->controllerNumber != src->controllerNumber) { + return batch_result_e::not_batchable; + } + + // Do not allow batching if the button state changes on this controller + if (dest->buttonFlags != src->buttonFlags || dest->buttonFlags2 != src->buttonFlags2) { + return batch_result_e::terminate_batch; + } + + // Take the latest state + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two touch messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PSS_TOUCH_PACKET dest, PSS_TOUCH_PACKET src) { + // Only batch hover or move events + if (dest->eventType != LI_TOUCH_EVENT_MOVE && + dest->eventType != LI_TOUCH_EVENT_HOVER) { + return batch_result_e::terminate_batch; + } + + // Don't batch beyond state changing events + if (src->eventType != LI_TOUCH_EVENT_MOVE && + src->eventType != LI_TOUCH_EVENT_HOVER) { + return batch_result_e::terminate_batch; + } + + // Batched events must be the same pointer ID + if (dest->pointerId != src->pointerId) { + return batch_result_e::not_batchable; + } + + // The pointer must be in the same state + if (dest->eventType != src->eventType) { + return batch_result_e::terminate_batch; + } + + // Take the latest state + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two pen messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PSS_PEN_PACKET dest, PSS_PEN_PACKET src) { + // Only batch hover or move events + if (dest->eventType != LI_TOUCH_EVENT_MOVE && + dest->eventType != LI_TOUCH_EVENT_HOVER) { + return batch_result_e::terminate_batch; + } + + // Batched events must be the same type + if (dest->eventType != src->eventType) { + return batch_result_e::terminate_batch; + } + + // Do not allow batching if the button state changes + if (dest->penButtons != src->penButtons) { + return batch_result_e::terminate_batch; + } + + // Do not batch beyond tool changes + if (dest->toolType != src->toolType) { + return batch_result_e::terminate_batch; + } + + // Take the latest state + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two controller touch messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PSS_CONTROLLER_TOUCH_PACKET dest, PSS_CONTROLLER_TOUCH_PACKET src) { + // Only batch hover or move events + if (dest->eventType != LI_TOUCH_EVENT_MOVE && + dest->eventType != LI_TOUCH_EVENT_HOVER) { + return batch_result_e::terminate_batch; + } + + // We can only batch entries for the same controller, but allow batching attempts to continue + // in case we have more packets for this controller later in the queue. + if (dest->controllerNumber != src->controllerNumber) { + return batch_result_e::not_batchable; + } + + // Don't batch beyond state changing events + if (src->eventType != LI_TOUCH_EVENT_MOVE && + src->eventType != LI_TOUCH_EVENT_HOVER) { + return batch_result_e::terminate_batch; + } + + // Batched events must be the same pointer ID + if (dest->pointerId != src->pointerId) { + return batch_result_e::not_batchable; + } + + // The pointer must be in the same state + if (dest->eventType != src->eventType) { + return batch_result_e::terminate_batch; + } + + // Take the latest state + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two controller motion messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PSS_CONTROLLER_MOTION_PACKET dest, PSS_CONTROLLER_MOTION_PACKET src) { + // We can only batch entries for the same controller, but allow batching attempts to continue + // in case we have more packets for this controller later in the queue. + if (dest->controllerNumber != src->controllerNumber) { + return batch_result_e::not_batchable; + } + + // Batched events must be the same sensor + if (dest->motionType != src->motionType) { + return batch_result_e::not_batchable; + } + + // Take the latest state + *dest = *src; + return batch_result_e::batched; + } + + /** + * @brief Batch two input messages. + * @param dest The original packet to batch into. + * @param src A later packet to attempt to batch. + * @return `batch_result_e` : The status of the batching operation. + */ + batch_result_e + batch(PNV_INPUT_HEADER dest, PNV_INPUT_HEADER src) { + // We can only batch if the packet types are the same + if (dest->magic != src->magic) { + return batch_result_e::terminate_batch; + } + + // We can only batch certain message types + switch (util::endian::little(dest->magic)) { + case MOUSE_MOVE_REL_MAGIC_GEN5: + return batch((PNV_REL_MOUSE_MOVE_PACKET) dest, (PNV_REL_MOUSE_MOVE_PACKET) src); + case MOUSE_MOVE_ABS_MAGIC: + return batch((PNV_ABS_MOUSE_MOVE_PACKET) dest, (PNV_ABS_MOUSE_MOVE_PACKET) src); + case SCROLL_MAGIC_GEN5: + return batch((PNV_SCROLL_PACKET) dest, (PNV_SCROLL_PACKET) src); + case SS_HSCROLL_MAGIC: + return batch((PSS_HSCROLL_PACKET) dest, (PSS_HSCROLL_PACKET) src); + case MULTI_CONTROLLER_MAGIC_GEN5: + return batch((PNV_MULTI_CONTROLLER_PACKET) dest, (PNV_MULTI_CONTROLLER_PACKET) src); + case SS_TOUCH_MAGIC: + return batch((PSS_TOUCH_PACKET) dest, (PSS_TOUCH_PACKET) src); + case SS_PEN_MAGIC: + return batch((PSS_PEN_PACKET) dest, (PSS_PEN_PACKET) src); + case SS_CONTROLLER_TOUCH_MAGIC: + return batch((PSS_CONTROLLER_TOUCH_PACKET) dest, (PSS_CONTROLLER_TOUCH_PACKET) src); + case SS_CONTROLLER_MOTION_MAGIC: + return batch((PSS_CONTROLLER_MOTION_PACKET) dest, (PSS_CONTROLLER_MOTION_PACKET) src); + default: + // Not a batchable message type + return batch_result_e::terminate_batch; + } + } + + /** + * @brief Called on a thread pool thread to process an input message. + * @param input The input context pointer. + */ void - passthrough_helper(std::shared_ptr input, std::vector &&input_data) { - void *payload = input_data.data(); - auto header = (PNV_INPUT_HEADER) payload; + passthrough_next_message(std::shared_ptr input) { + // 'entry' backs the 'payload' pointer, so they must remain in scope together + std::vector entry; + PNV_INPUT_HEADER payload; + + // Lock the input queue while batching, but release it before sending + // the input to the OS. This avoids potentially lengthy lock contention + // in the control stream thread while input is being processed by the OS. + { + std::lock_guard lg(input->input_queue_lock); + + // If all entries have already been processed, nothing to do + if (input->input_queue.empty()) { + return; + } - switch (util::endian::little(header->magic)) { + // Pop off the first entry, which we will send + entry = input->input_queue.front(); + payload = (PNV_INPUT_HEADER) entry.data(); + input->input_queue.pop_front(); + + // Try to batch with remaining items on the queue + auto i = input->input_queue.begin(); + while (i != input->input_queue.end()) { + auto batchable_entry = *i; + auto batchable_payload = (PNV_INPUT_HEADER) batchable_entry.data(); + + auto batch_result = batch(payload, batchable_payload); + if (batch_result == batch_result_e::terminate_batch) { + // Stop batching + break; + } + else if (batch_result == batch_result_e::batched) { + // Erase this entry since it was batched + i = input->input_queue.erase(i); + } + else { + // We couldn't batch this entry, but try to batch later entries. + i++; + } + } + } + + // Send the batched input to the OS + switch (util::endian::little(payload->magic)) { case MOUSE_MOVE_REL_MAGIC_GEN5: passthrough(input, (PNV_REL_MOUSE_MOVE_PACKET) payload); break; @@ -795,9 +1134,18 @@ namespace input { } } + /** + * @brief Called on the control stream thread to queue an input message. + * @param input The input context pointer. + * @param input_data The input message. + */ void passthrough(std::shared_ptr &input, std::vector &&input_data) { - task_pool.push(passthrough_helper, input, move_by_copy_util::cmove(input_data)); + { + std::lock_guard lg(input->input_queue_lock); + input->input_queue.push_back(std::move(input_data)); + } + task_pool.push(passthrough_next_message, input); } void From 2da44a35aeaf51d8f94d6252ce59de349367598d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 26 Jun 2023 21:10:36 -0500 Subject: [PATCH 011/576] Move input packet debug prints off the control stream thread The control stream thread is extremely performance-sensitive. --- src/input.cpp | 3 +++ src/stream.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 80e7a75c19f..fb862325d09 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1103,6 +1103,9 @@ namespace input { } } + // Print the final input packet + input::print((void *) payload); + // Send the batched input to the OS switch (util::endian::little(payload->magic)) { case MOUSE_MOVE_REL_MAGIC_GEN5: diff --git a/src/stream.cpp b/src/stream.cpp index 18c1473cdad..236797c57e9 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -759,7 +759,6 @@ namespace stream { std::copy(payload.end() - 16, payload.end(), std::begin(iv)); } - input::print(plaintext.data()); input::passthrough(session->input, std::move(plaintext)); }); @@ -818,7 +817,6 @@ namespace stream { constexpr auto skip = sizeof(std::uint16_t) * 2; plaintext.erase(std::begin(plaintext), std::begin(plaintext) + skip); - input::print(plaintext.data()); input::passthrough(session->input, std::move(plaintext)); }); From c8aee6265bdbb8c5695df1b4afc0edaa156b4238 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jun 2023 17:35:56 -0500 Subject: [PATCH 012/576] Implement extended controller button support --- src/input.cpp | 5 +++-- src/platform/common.h | 38 ++++++++++++++++++++-------------- src/platform/windows/input.cpp | 3 +++ 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index fb862325d09..3de6c327dc6 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -254,7 +254,7 @@ namespace input { << "--begin controller packet--"sv << std::endl << "controllerNumber ["sv << packet->controllerNumber << ']' << std::endl << "activeGamepadMask ["sv << util::hex(packet->activeGamepadMask).to_string_view() << ']' << std::endl - << "buttonFlags ["sv << util::hex(packet->buttonFlags).to_string_view() << ']' << std::endl + << "buttonFlags ["sv << util::hex((uint32_t) packet->buttonFlags | (packet->buttonFlags2 << 16)).to_string_view() << ']' << std::endl << "leftTrigger ["sv << util::hex(packet->leftTrigger).to_string_view() << ']' << std::endl << "rightTrigger ["sv << util::hex(packet->rightTrigger).to_string_view() << ']' << std::endl << "leftStickX ["sv << packet->leftStickX << ']' << std::endl @@ -691,8 +691,9 @@ namespace input { } std::uint16_t bf = packet->buttonFlags; + std::uint32_t bf2 = packet->buttonFlags2; platf::gamepad_state_t gamepad_state { - bf, + bf | (bf2 << 16), packet->leftTrigger, packet->rightTrigger, packet->leftStickX, diff --git a/src/platform/common.h b/src/platform/common.h index cdb5785e076..07f4c9d3fc0 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -49,21 +49,27 @@ namespace video { namespace platf { constexpr auto MAX_GAMEPADS = 32; - constexpr std::uint16_t DPAD_UP = 0x0001; - constexpr std::uint16_t DPAD_DOWN = 0x0002; - constexpr std::uint16_t DPAD_LEFT = 0x0004; - constexpr std::uint16_t DPAD_RIGHT = 0x0008; - constexpr std::uint16_t START = 0x0010; - constexpr std::uint16_t BACK = 0x0020; - constexpr std::uint16_t LEFT_STICK = 0x0040; - constexpr std::uint16_t RIGHT_STICK = 0x0080; - constexpr std::uint16_t LEFT_BUTTON = 0x0100; - constexpr std::uint16_t RIGHT_BUTTON = 0x0200; - constexpr std::uint16_t HOME = 0x0400; - constexpr std::uint16_t A = 0x1000; - constexpr std::uint16_t B = 0x2000; - constexpr std::uint16_t X = 0x4000; - constexpr std::uint16_t Y = 0x8000; + constexpr std::uint32_t DPAD_UP = 0x0001; + constexpr std::uint32_t DPAD_DOWN = 0x0002; + constexpr std::uint32_t DPAD_LEFT = 0x0004; + constexpr std::uint32_t DPAD_RIGHT = 0x0008; + constexpr std::uint32_t START = 0x0010; + constexpr std::uint32_t BACK = 0x0020; + constexpr std::uint32_t LEFT_STICK = 0x0040; + constexpr std::uint32_t RIGHT_STICK = 0x0080; + constexpr std::uint32_t LEFT_BUTTON = 0x0100; + constexpr std::uint32_t RIGHT_BUTTON = 0x0200; + constexpr std::uint32_t HOME = 0x0400; + constexpr std::uint32_t A = 0x1000; + constexpr std::uint32_t B = 0x2000; + constexpr std::uint32_t X = 0x4000; + constexpr std::uint32_t Y = 0x8000; + constexpr std::uint32_t PADDLE1 = 0x010000; + constexpr std::uint32_t PADDLE2 = 0x020000; + constexpr std::uint32_t PADDLE3 = 0x040000; + constexpr std::uint32_t PADDLE4 = 0x080000; + constexpr std::uint32_t TOUCHPAD_BUTTON = 0x100000; + constexpr std::uint32_t MISC_BUTTON = 0x200000; struct rumble_t { KITTY_DEFAULT_CONSTR(rumble_t) @@ -154,7 +160,7 @@ namespace platf { }; struct gamepad_state_t { - std::uint16_t buttonFlags; + std::uint32_t buttonFlags; std::uint8_t lt; std::uint8_t rt; std::int16_t lsX; diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index c94904267b3..737fb9e3fbc 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -520,6 +520,9 @@ namespace platf { if (gamepad_state.buttonFlags & HOME) buttons |= DS4_SPECIAL_BUTTON_PS; + // Allow either PS4/PS5 clickpad button or Xbox Series X share button to activate DS4 clickpad + if (gamepad_state.buttonFlags & (TOUCHPAD_BUTTON | MISC_BUTTON)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD; + return (DS4_SPECIAL_BUTTONS) buttons; } From 51512c2f7be09a46b574a06b797a2d2363c6c9a2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jun 2023 17:36:44 -0500 Subject: [PATCH 013/576] Fix max gamepad count to match protocol limitation --- src/platform/common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/common.h b/src/platform/common.h index 07f4c9d3fc0..d9af3b18647 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -47,7 +47,8 @@ namespace video { } // namespace video namespace platf { - constexpr auto MAX_GAMEPADS = 32; + // Limited by bits in activeGamepadMask + constexpr auto MAX_GAMEPADS = 16; constexpr std::uint32_t DPAD_UP = 0x0001; constexpr std::uint32_t DPAD_DOWN = 0x0002; From bdc929ba38b4a095c336ac01996f105d90a289f4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jun 2023 20:16:26 -0500 Subject: [PATCH 014/576] Implement controller arrival metadata support --- docs/source/about/advanced_usage.rst | 9 ++-- src/input.cpp | 63 +++++++++++++++++++++++- src/platform/common.h | 17 ++++++- src/platform/linux/input.cpp | 21 ++++++-- src/platform/macos/input.cpp | 10 +++- src/platform/windows/input.cpp | 58 +++++++++++++++++----- src_assets/common/assets/web/config.html | 5 +- 7 files changed, 159 insertions(+), 24 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index 088d9045c29..88e000594c9 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -140,17 +140,18 @@ gamepad ===== =========== Value Description ===== =========== - x360 xbox 360 controller - ds4 dualshock controller (PS4) + auto Selected based on information from client + x360 Xbox 360 controller + ds4 DualShock 4 controller (PS4) ===== =========== **Default** - ``x360`` + ``auto`` **Example** .. code-block:: text - gamepad = x360 + gamepad = auto back_button_timeout ^^^^^^^^^^^^^^^^^^^ diff --git a/src/input.cpp b/src/input.cpp index 3de6c327dc6..f12ff28e284 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -264,6 +264,21 @@ namespace input { << "--end controller packet--"sv; } + /** + * @brief Prints a controller arrival packet. + * @param packet The controller arrival packet. + */ + void + print(PSS_CONTROLLER_ARRIVAL_PACKET packet) { + BOOST_LOG(debug) + << "--begin controller arrival packet--"sv << std::endl + << "controllerNumber ["sv << (uint32_t) packet->controllerNumber << ']' << std::endl + << "type ["sv << util::hex(packet->type).to_string_view() << ']' << std::endl + << "capabilities ["sv << util::hex(packet->capabilities).to_string_view() << ']' << std::endl + << "supportedButtonFlags ["sv << util::hex(packet->supportedButtonFlags).to_string_view() << ']' << std::endl + << "--end controller arrival packet--"sv; + } + void print(void *payload) { auto header = (PNV_INPUT_HEADER) payload; @@ -295,6 +310,9 @@ namespace input { case MULTI_CONTROLLER_MAGIC_GEN5: print((PNV_MULTI_CONTROLLER_PACKET) payload); break; + case SS_CONTROLLER_ARRIVAL_MAGIC: + print((PSS_CONTROLLER_ARRIVAL_PACKET) payload); + break; } } @@ -643,7 +661,7 @@ namespace input { return -1; } - if (platf::alloc_gamepad(platf_input, id, rumble_queue)) { + if (platf::alloc_gamepad(platf_input, id, {}, rumble_queue)) { free_id(gamepadMask, id); // allocating a gamepad failed: solution: ignore gamepads // The implementations of platf::alloc_gamepad already has logging @@ -658,6 +676,46 @@ namespace input { return 0; } + /** + * @brief Called to pass a controller arrival message to the platform backend. + * @param input The input context pointer. + * @param packet The controller arrival packet. + */ + void + passthrough(std::shared_ptr &input, PSS_CONTROLLER_ARRIVAL_PACKET packet) { + if (!config::input.controller) { + return; + } + + if (packet->controllerNumber >= gamepadMask.size()) { + // Invalid controller number + return; + } + + if (gamepadMask[packet->controllerNumber]) { + // There's already a gamepad in this slot + return; + } + + platf::gamepad_arrival_t arrival { + packet->controllerNumber, + packet->type, + util::endian::little(packet->capabilities), + util::endian::little(packet->supportedButtonFlags), + }; + + gamepadMask[packet->controllerNumber] = true; + input->active_gamepad_state |= (1 << packet->controllerNumber); + + // Allocate a new gamepad + if (platf::alloc_gamepad(platf_input, packet->controllerNumber, arrival, input->rumble_queue)) { + free_id(gamepadMask, packet->controllerNumber); + return; + } + + input->gamepads[packet->controllerNumber].id = packet->controllerNumber; + } + void passthrough(std::shared_ptr &input, PNV_MULTI_CONTROLLER_PACKET packet) { if (!config::input.controller) { @@ -1135,6 +1193,9 @@ namespace input { case MULTI_CONTROLLER_MAGIC_GEN5: passthrough(input, (PNV_MULTI_CONTROLLER_PACKET) payload); break; + case SS_CONTROLLER_ARRIVAL_MAGIC: + passthrough(input, (PSS_CONTROLLER_ARRIVAL_PACKET) payload); + break; } } diff --git a/src/platform/common.h b/src/platform/common.h index d9af3b18647..b291c707abf 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -170,6 +170,13 @@ namespace platf { std::int16_t rsY; }; + struct gamepad_arrival_t { + std::uint8_t gamepadNumber; + std::uint8_t type; + std::uint16_t capabilities; + std::uint32_t supportedButtons; + }; + class deinit_t { public: virtual ~deinit_t() = default; @@ -455,8 +462,16 @@ namespace platf { void unicode(input_t &input, char *utf8, int size); + /** + * @brief Creates a new virtual gamepad. + * @param input The input context. + * @param nr The assigned controller number. + * @param metadata Controller metadata from client (empty if none provided). + * @param rumble_queue The queue for posting rumble messages to the client. + * @return 0 on success. + */ int - alloc_gamepad(input_t &input, int nr, rumble_queue_t rumble_queue); + alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, rumble_queue_t rumble_queue); void free_gamepad(input_t &input, int nr); diff --git a/src/platform/linux/input.cpp b/src/platform/linux/input.cpp index 85980ef37b5..0e96d1a6cac 100644 --- a/src/platform/linux/input.cpp +++ b/src/platform/linux/input.cpp @@ -770,8 +770,15 @@ namespace platf { return 0; } + /** + * @brief Creates a new virtual gamepad. + * @param nr The assigned controller number. + * @param metadata Controller metadata from client (empty if none provided). + * @param rumble_queue The queue for posting rumble messages to the client. + * @return 0 on success. + */ int - alloc_gamepad(int nr, rumble_queue_t &&rumble_queue) { + alloc_gamepad(int nr, const gamepad_arrival_t &metadata, rumble_queue_t &&rumble_queue) { TUPLE_2D_REF(input, gamepad_state, gamepads[nr]); int err = libevdev_uinput_create_from_device(gamepad_dev.get(), LIBEVDEV_UINPUT_OPEN_MANAGED, &input); @@ -1480,9 +1487,17 @@ namespace platf { keyboard_ev(kb, KEY_LEFTCTRL, 0); } + /** + * @brief Creates a new virtual gamepad. + * @param input The input context. + * @param nr The assigned controller number. + * @param metadata Controller metadata from client (empty if none provided). + * @param rumble_queue The queue for posting rumble messages to the client. + * @return 0 on success. + */ int - alloc_gamepad(input_t &input, int nr, rumble_queue_t rumble_queue) { - return ((input_raw_t *) input.get())->alloc_gamepad(nr, std::move(rumble_queue)); + alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, rumble_queue_t rumble_queue) { + return ((input_raw_t *) input.get())->alloc_gamepad(nr, metadata, std::move(rumble_queue)); } void diff --git a/src/platform/macos/input.cpp b/src/platform/macos/input.cpp index 78079e3f386..c5b20e58d8c 100644 --- a/src/platform/macos/input.cpp +++ b/src/platform/macos/input.cpp @@ -288,8 +288,16 @@ const KeyCodeMap kKeyCodesMap[] = { BOOST_LOG(info) << "unicode: Unicode input not yet implemented for MacOS."sv; } + /** + * @brief Creates a new virtual gamepad. + * @param input The input context. + * @param nr The assigned controller number. + * @param metadata Controller metadata from client (empty if none provided). + * @param rumble_queue The queue for posting rumble messages to the client. + * @return 0 on success. + */ int - alloc_gamepad(input_t &input, int nr, rumble_queue_t rumble_queue) { + alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, rumble_queue_t rumble_queue) { BOOST_LOG(info) << "alloc_gamepad: Gamepad not yet implemented for MacOS."sv; return -1; } diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 737fb9e3fbc..f26c6c9e1cc 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -26,15 +26,6 @@ namespace platf { using client_t = util::safe_ptr<_VIGEM_CLIENT_T, vigem_free>; using target_t = util::safe_ptr<_VIGEM_TARGET_T, vigem_target_free>; - static VIGEM_TARGET_TYPE - map(const std::string_view &gp) { - if (gp == "x360"sv) { - return Xbox360Wired; - } - - return DualShock4Wired; - } - void CALLBACK x360_notify( client_t::pointer client, @@ -423,15 +414,54 @@ namespace platf { } } + /** + * @brief Creates a new virtual gamepad. + * @param input The input context. + * @param nr The assigned controller number. + * @param metadata Controller metadata from client (empty if none provided). + * @param rumble_queue The queue for posting rumble messages to the client. + * @return 0 on success. + */ int - alloc_gamepad(input_t &input, int nr, rumble_queue_t rumble_queue) { + alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, rumble_queue_t rumble_queue) { auto raw = (input_raw_t *) input.get(); if (!raw->vigem) { return 0; } - return raw->vigem->alloc_gamepad_interal(nr, rumble_queue, map(config::input.gamepad)); + VIGEM_TARGET_TYPE selectedGamepadType; + + if (config::input.gamepad == "x360"sv) { + BOOST_LOG(info) << "Gamepad " << nr << " will be Xbox 360 controller (manual selection)"sv; + selectedGamepadType = Xbox360Wired; + } + else if (config::input.gamepad == "ps4"sv || config::input.gamepad == "ds4"sv) { + BOOST_LOG(info) << "Gamepad " << nr << " will be DualShock 4 controller (manual selection)"sv; + selectedGamepadType = DualShock4Wired; + } + else if (metadata.type == LI_CTYPE_PS) { + BOOST_LOG(info) << "Gamepad " << nr << " will be DualShock 4 controller (auto-selected by client-reported type)"sv; + selectedGamepadType = DualShock4Wired; + } + else if (metadata.type == LI_CTYPE_XBOX) { + BOOST_LOG(info) << "Gamepad " << nr << " will be Xbox 360 controller (auto-selected by client-reported type)"sv; + selectedGamepadType = Xbox360Wired; + } + else if (metadata.capabilities & (LI_CCAP_ACCEL | LI_CCAP_GYRO)) { + BOOST_LOG(info) << "Gamepad " << nr << " will be DualShock 4 controller (auto-selected by motion sensor presence)"sv; + selectedGamepadType = DualShock4Wired; + } + else if (metadata.capabilities & LI_CCAP_TOUCHPAD) { + BOOST_LOG(info) << "Gamepad " << nr << " will be DualShock 4 controller (auto-selected by touchpad presence)"sv; + selectedGamepadType = DualShock4Wired; + } + else { + BOOST_LOG(info) << "Gamepad " << nr << " will be Xbox 360 controller (default)"sv; + selectedGamepadType = Xbox360Wired; + } + + return raw->vigem->alloc_gamepad_interal(nr, rumble_queue, selectedGamepadType); } void @@ -591,11 +621,15 @@ namespace platf { delete input; } + /** + * @brief Gets the supported gamepads for this platform backend. + * @return Vector of gamepad type strings. + */ std::vector & supported_gamepads() { // ds4 == ps4 static std::vector gps { - "x360"sv, "ds4"sv, "ps4"sv + "auto"sv, "x360"sv, "ds4"sv, "ps4"sv }; return gps; diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 4433d463539..1258c35e33a 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -94,10 +94,11 @@

Configuration

-
Choose which type of gamepad to Emulate on the host
+
Choose which type of gamepad to emulate on the host
@@ -1029,7 +1030,7 @@

Configuration

"dwmflush": "enabled", "encoder": "", "fps": "[10,30,60,90,120]", - "gamepad": "x360", + "gamepad": "auto", "hevc_mode": 0, "key_rightalt_to_key_win": "disabled", "keyboard": "enabled", From a6931fbe54cae6fb38f1c047a241d393144d3f14 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 4 Jul 2023 14:40:53 -0500 Subject: [PATCH 015/576] Allow use of multiple ENet channels --- src/network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network.cpp b/src/network.cpp index f65bdfaae89..c27075ea9a4 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -106,7 +106,7 @@ namespace net { enet_address_set_host(&addr, "0.0.0.0"); enet_address_set_port(&addr, port); - return host_t { enet_host_create(AF_INET, &addr, peers, 1, 0, 0) }; + return host_t { enet_host_create(AF_INET, &addr, peers, 0, 0, 0) }; } void From dad83ace990cea35fd4d39ae3efef4a41067fca2 Mon Sep 17 00:00:00 2001 From: aetheryx Date: Thu, 6 Jul 2023 19:41:19 +0200 Subject: [PATCH 016/576] fix: consider link-local addresses as LAN --- src/network.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network.cpp b/src/network.cpp index c27075ea9a4..f530b0f3b24 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -19,7 +19,8 @@ namespace net { ip_block("192.168.0.0/16"sv), ip_block("172.16.0.0/12"sv), ip_block("10.0.0.0/8"sv), - ip_block("100.64.0.0/10"sv) + ip_block("100.64.0.0/10"sv), + ip_block("169.254.0.0/16"sv) }; std::uint32_t From defce8287946b3dd87ce0f03e0f94f8b253eb8ad Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 7 Jul 2023 19:25:03 -0500 Subject: [PATCH 017/576] Clear additional disk space for Flatpak builds --- .github/workflows/CI.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bcf9df8476d..d629f8be173 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -178,6 +178,13 @@ jobs: org.freedesktop.Sdk.Extension.node18/${{ matrix.arch }}/${PLATFORM_VERSION} \ " + - name: Create Additional Disk Space + run: | + df -h + sudo rm -rf /usr/share/dotnet + sudo docker rmi $(docker images -a -q) + df -h + - name: Cache Flatpak build uses: actions/cache@v3 with: From 51923625ceec8e70b65df3474b3bb8eec1e3971b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 1 Jul 2023 01:09:37 -0500 Subject: [PATCH 018/576] Refactor gamepad emulation code to use the DS4 extended report format This has the side-effect of fixing #1407 due to the incorrect assumption that it's safe to cast our gamepad_state_t to a XUSB_REPORT. --- src/platform/windows/input.cpp | 300 +++++++++++++++++++++++++++------ 1 file changed, 250 insertions(+), 50 deletions(-) diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index f26c6c9e1cc..fc55b71b7b2 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -42,6 +42,122 @@ namespace platf { DS4_LIGHTBAR_COLOR /* led_color */, void *userdata); + struct gamepad_context_t { + target_t gp; + rumble_queue_t rumble_queue; + + union { + XUSB_REPORT x360; + DS4_REPORT_EX ds4; + } report; + }; + + constexpr float EARTH_G = 9.80665f; + +#define MPS2_TO_DS4_ACCEL(x) (int32_t)(((x) / EARTH_G) * 8192) +#define DPS_TO_DS4_GYRO(x) (int32_t)((x) * (1024 / 64)) + +#define APPLY_CALIBRATION(val, bias, scale) (int32_t)(((float) (val) + (bias)) / (scale)) + + constexpr DS4_TOUCH ds4_touch_unused = { + .bPacketCounter = 0, + .bIsUpTrackingNum1 = 0x80, + .bTouchData1 = { 0x00, 0x00, 0x00 }, + .bIsUpTrackingNum2 = 0x80, + .bTouchData2 = { 0x00, 0x00, 0x00 }, + }; + + // See https://github.com/ViGEm/ViGEmBus/blob/22835473d17fbf0c4d4bb2f2d42fd692b6e44df4/sys/Ds4Pdo.cpp#L153-L164 + constexpr DS4_REPORT_EX ds4_report_init_ex = { + { { .bThumbLX = 0x80, + .bThumbLY = 0x80, + .bThumbRX = 0x80, + .bThumbRY = 0x80, + .wButtons = DS4_BUTTON_DPAD_NONE, + .bSpecial = 0, + .bTriggerL = 0, + .bTriggerR = 0, + .wTimestamp = 0, + .bBatteryLvl = 99, + .wGyroX = 0, + .wGyroY = 0, + .wGyroZ = 0, + .wAccelX = 0, + .wAccelY = 0, + .wAccelZ = 0, + ._bUnknown1 = { 0x00, 0x00, 0x00, 0x00, 0x00 }, + .bBatteryLvlSpecial = 0x10, // Wired + ._bUnknown2 = { 0x00, 0x00 }, + .bTouchPacketsN = 0, + .sCurrentTouch = ds4_touch_unused, + .sPreviousTouch = { ds4_touch_unused, ds4_touch_unused } } } + }; + + /** + * @brief Updates the DS4 input report with the provided motion data. + * @details Acceleration is in m/s^2 and gyro is in deg/s. + * @param gamepad The gamepad to update. + * @param motion_type The type of motion data. + * @param x X component of motion. + * @param y Y component of motion. + * @param z Z component of motion. + */ + static void + ds4_update_motion(gamepad_context_t &gamepad, uint8_t motion_type, float x, float y, float z) { + auto &report = gamepad.report.ds4.Report; + + // Use int32 to process this data, so we can clamp if needed. + int32_t intX, intY, intZ; + + switch (motion_type) { + case LI_MOTION_TYPE_ACCEL: + // Convert to the DS4's accelerometer scale + intX = MPS2_TO_DS4_ACCEL(x); + intY = MPS2_TO_DS4_ACCEL(y); + intZ = MPS2_TO_DS4_ACCEL(z); + + // Apply the inverse of ViGEmBus's calibration data + intX = APPLY_CALIBRATION(intX, -297, 1.010796f); + intY = APPLY_CALIBRATION(intY, -42, 1.014614f); + intZ = APPLY_CALIBRATION(intZ, -512, 1.024768f); + break; + case LI_MOTION_TYPE_GYRO: + // Convert to the DS4's gyro scale + intX = DPS_TO_DS4_GYRO(x); + intY = DPS_TO_DS4_GYRO(y); + intZ = DPS_TO_DS4_GYRO(z); + + // Apply the inverse of ViGEmBus's calibration data + intX = APPLY_CALIBRATION(intX, 1, 0.977596f); + intY = APPLY_CALIBRATION(intY, 0, 0.972370f); + intZ = APPLY_CALIBRATION(intZ, 0, 0.971550f); + break; + default: + return; + } + + // Clamp the values to the range of the data type + intX = std::clamp(intX, INT16_MIN, INT16_MAX); + intY = std::clamp(intY, INT16_MIN, INT16_MAX); + intZ = std::clamp(intZ, INT16_MIN, INT16_MAX); + + // Populate the report + switch (motion_type) { + case LI_MOTION_TYPE_ACCEL: + report.wAccelX = (int16_t) intX; + report.wAccelY = (int16_t) intY; + report.wAccelZ = (int16_t) intZ; + break; + case LI_MOTION_TYPE_GYRO: + report.wGyroX = (int16_t) intX; + report.wGyroY = (int16_t) intY; + report.wGyroZ = (int16_t) intZ; + break; + default: + return; + } + } + class vigem_t { public: int @@ -62,32 +178,47 @@ namespace platf { return 0; } + /** + * @brief Attaches a new gamepad. + * @param nr The gamepad index. + * @param rumble_queue The queue to publish rumble packets. + * @param gp_type The type of gamepad. + * @return 0 on success. + */ int - alloc_gamepad_interal(int nr, rumble_queue_t &rumble_queue, VIGEM_TARGET_TYPE gp_type) { - auto &[rumble, gp] = gamepads[nr]; - assert(!gp); + alloc_gamepad_internal(int nr, rumble_queue_t &rumble_queue, VIGEM_TARGET_TYPE gp_type) { + auto &gamepad = gamepads[nr]; + assert(!gamepad.gp); if (gp_type == Xbox360Wired) { - gp.reset(vigem_target_x360_alloc()); + gamepad.gp.reset(vigem_target_x360_alloc()); + XUSB_REPORT_INIT(&gamepad.report.x360); } else { - gp.reset(vigem_target_ds4_alloc()); + gamepad.gp.reset(vigem_target_ds4_alloc()); + + // There is no equivalent DS4_REPORT_EX_INIT() + gamepad.report.ds4 = ds4_report_init_ex; + + // Set initial accelerometer and gyro state + ds4_update_motion(gamepad, LI_MOTION_TYPE_ACCEL, 0.0f, EARTH_G, 0.0f); + ds4_update_motion(gamepad, LI_MOTION_TYPE_GYRO, 0.0f, 0.0f, 0.0f); } - auto status = vigem_target_add(client.get(), gp.get()); + auto status = vigem_target_add(client.get(), gamepad.gp.get()); if (!VIGEM_SUCCESS(status)) { BOOST_LOG(error) << "Couldn't add Gamepad to ViGEm connection ["sv << util::hex(status).to_string_view() << ']'; return -1; } - rumble = std::move(rumble_queue); + gamepad.rumble_queue = std::move(rumble_queue); if (gp_type == Xbox360Wired) { - status = vigem_target_x360_register_notification(client.get(), gp.get(), x360_notify, this); + status = vigem_target_x360_register_notification(client.get(), gamepad.gp.get(), x360_notify, this); } else { - status = vigem_target_ds4_register_notification(client.get(), gp.get(), ds4_notify, this); + status = vigem_target_ds4_register_notification(client.get(), gamepad.gp.get(), ds4_notify, this); } if (!VIGEM_SUCCESS(status)) { @@ -97,38 +228,51 @@ namespace platf { return 0; } + /** + * @brief Detaches the specified gamepad + * @param nr The gamepad. + */ void free_target(int nr) { - auto &[_, gp] = gamepads[nr]; + auto &gamepad = gamepads[nr]; - if (gp && vigem_target_is_attached(gp.get())) { - auto status = vigem_target_remove(client.get(), gp.get()); + if (gamepad.gp && vigem_target_is_attached(gamepad.gp.get())) { + auto status = vigem_target_remove(client.get(), gamepad.gp.get()); if (!VIGEM_SUCCESS(status)) { BOOST_LOG(warning) << "Couldn't detach gamepad from ViGEm ["sv << util::hex(status).to_string_view() << ']'; } } - gp.reset(); + gamepad.gp.reset(); } + /** + * @brief Pass rumble data back to the host. + * @param target The gamepad. + * @param smallMotor The small motor. + * @param largeMotor The large motor. + */ void rumble(target_t::pointer target, std::uint8_t smallMotor, std::uint8_t largeMotor) { for (int x = 0; x < gamepads.size(); ++x) { - auto &[rumble_queue, gp] = gamepads[x]; + auto &gamepad = gamepads[x]; - if (gp.get() == target) { - rumble_queue->raise(x, ((std::uint16_t) smallMotor) << 8, ((std::uint16_t) largeMotor) << 8); + if (gamepad.gp.get() == target) { + gamepad.rumble_queue->raise(x, ((std::uint16_t) smallMotor) << 8, ((std::uint16_t) largeMotor) << 8); return; } } } + /** + * @brief vigem_t destructor. + */ ~vigem_t() { if (client) { - for (auto &[_, gp] : gamepads) { - if (gp && vigem_target_is_attached(gp.get())) { - auto status = vigem_target_remove(client.get(), gp.get()); + for (auto &gamepad : gamepads) { + if (gamepad.gp && vigem_target_is_attached(gamepad.gp.get())) { + auto status = vigem_target_remove(client.get(), gamepad.gp.get()); if (!VIGEM_SUCCESS(status)) { BOOST_LOG(warning) << "Couldn't detach gamepad from ViGEm ["sv << util::hex(status).to_string_view() << ']'; } @@ -139,7 +283,7 @@ namespace platf { } } - std::vector> gamepads; + std::vector gamepads; client_t client; }; @@ -461,7 +605,7 @@ namespace platf { selectedGamepadType = Xbox360Wired; } - return raw->vigem->alloc_gamepad_interal(nr, rumble_queue, selectedGamepadType); + return raw->vigem->alloc_gamepad_internal(nr, rumble_queue, selectedGamepadType); } void @@ -475,11 +619,53 @@ namespace platf { raw->vigem->free_target(nr); } - static VIGEM_ERROR - x360_update(client_t::pointer client, target_t::pointer gp, const gamepad_state_t &gamepad_state) { - auto &xusb = *(PXUSB_REPORT) &gamepad_state; + /** + * @brief Converts the standard button flags into X360 format. + * @param gamepad_state The gamepad button/axis state sent from the client. + * @return XUSB_BUTTON flags. + */ + static XUSB_BUTTON + x360_buttons(const gamepad_state_t &gamepad_state) { + int buttons {}; + + auto flags = gamepad_state.buttonFlags; + // clang-format off + if(flags & DPAD_UP) buttons |= XUSB_GAMEPAD_DPAD_UP; + if(flags & DPAD_DOWN) buttons |= XUSB_GAMEPAD_DPAD_DOWN; + if(flags & DPAD_LEFT) buttons |= XUSB_GAMEPAD_DPAD_LEFT; + if(flags & DPAD_RIGHT) buttons |= XUSB_GAMEPAD_DPAD_RIGHT; + if(flags & START) buttons |= XUSB_GAMEPAD_START; + if(flags & BACK) buttons |= XUSB_GAMEPAD_BACK; + if(flags & LEFT_STICK) buttons |= XUSB_GAMEPAD_LEFT_THUMB; + if(flags & RIGHT_STICK) buttons |= XUSB_GAMEPAD_RIGHT_THUMB; + if(flags & LEFT_BUTTON) buttons |= XUSB_GAMEPAD_LEFT_SHOULDER; + if(flags & RIGHT_BUTTON) buttons |= XUSB_GAMEPAD_RIGHT_SHOULDER; + if(flags & HOME) buttons |= XUSB_GAMEPAD_GUIDE; + if(flags & A) buttons |= XUSB_GAMEPAD_A; + if(flags & B) buttons |= XUSB_GAMEPAD_B; + if(flags & X) buttons |= XUSB_GAMEPAD_X; + if(flags & Y) buttons |= XUSB_GAMEPAD_Y; + // clang-format on + + return (XUSB_BUTTON) buttons; + } - return vigem_target_x360_update(client, gp, xusb); + /** + * @brief Updates the X360 input report with the provided gamepad state. + * @param gamepad The gamepad to update. + * @param gamepad_state The gamepad button/axis state sent from the client. + */ + static void + x360_update_state(gamepad_context_t &gamepad, const gamepad_state_t &gamepad_state) { + auto &report = gamepad.report.x360; + + report.wButtons = x360_buttons(gamepad_state); + report.bLeftTrigger = gamepad_state.lt; + report.bRightTrigger = gamepad_state.rt; + report.sThumbLX = gamepad_state.lsX; + report.sThumbLY = gamepad_state.lsY; + report.sThumbRX = gamepad_state.rsX; + report.sThumbRY = gamepad_state.rsY; } static DS4_DPAD_DIRECTIONS @@ -520,25 +706,30 @@ namespace platf { return DS4_BUTTON_DPAD_NONE; } + /** + * @brief Converts the standard button flags into DS4 format. + * @param gamepad_state The gamepad button/axis state sent from the client. + * @return DS4_BUTTONS flags. + */ static DS4_BUTTONS ds4_buttons(const gamepad_state_t &gamepad_state) { int buttons {}; auto flags = gamepad_state.buttonFlags; // clang-format off - if(flags & LEFT_STICK) buttons |= DS4_BUTTON_THUMB_LEFT; - if(flags & RIGHT_STICK) buttons |= DS4_BUTTON_THUMB_RIGHT; - if(flags & LEFT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_LEFT; - if(flags & RIGHT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_RIGHT; - if(flags & START) buttons |= DS4_BUTTON_OPTIONS; - if(flags & BACK) buttons |= DS4_BUTTON_SHARE; - if(flags & A) buttons |= DS4_BUTTON_CROSS; - if(flags & B) buttons |= DS4_BUTTON_CIRCLE; - if(flags & X) buttons |= DS4_BUTTON_SQUARE; - if(flags & Y) buttons |= DS4_BUTTON_TRIANGLE; - - if(gamepad_state.lt > 0) buttons |= DS4_BUTTON_TRIGGER_LEFT; - if(gamepad_state.rt > 0) buttons |= DS4_BUTTON_TRIGGER_RIGHT; + if(flags & LEFT_STICK) buttons |= DS4_BUTTON_THUMB_LEFT; + if(flags & RIGHT_STICK) buttons |= DS4_BUTTON_THUMB_RIGHT; + if(flags & LEFT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_LEFT; + if(flags & RIGHT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_RIGHT; + if(flags & START) buttons |= DS4_BUTTON_OPTIONS; + if(flags & BACK) buttons |= DS4_BUTTON_SHARE; + if(flags & A) buttons |= DS4_BUTTON_CROSS; + if(flags & B) buttons |= DS4_BUTTON_CIRCLE; + if(flags & X) buttons |= DS4_BUTTON_SQUARE; + if(flags & Y) buttons |= DS4_BUTTON_TRIANGLE; + + if(gamepad_state.lt > 0) buttons |= DS4_BUTTON_TRIGGER_LEFT; + if(gamepad_state.rt > 0) buttons |= DS4_BUTTON_TRIGGER_RIGHT; // clang-format on return (DS4_BUTTONS) buttons; @@ -568,13 +759,16 @@ namespace platf { return new_v == 0 ? 0xFF : (std::uint8_t) new_v; } - static VIGEM_ERROR - ds4_update(client_t::pointer client, target_t::pointer gp, const gamepad_state_t &gamepad_state) { - DS4_REPORT report; + /** + * @brief Updates the DS4 input report with the provided gamepad state. + * @param gamepad The gamepad to update. + * @param gamepad_state The gamepad button/axis state sent from the client. + */ + static void + ds4_update_state(gamepad_context_t &gamepad, const gamepad_state_t &gamepad_state) { + auto &report = gamepad.report.ds4.Report; - DS4_REPORT_INIT(&report); - DS4_SET_DPAD(&report, ds4_dpad(gamepad_state)); - report.wButtons |= ds4_buttons(gamepad_state); + report.wButtons = ds4_buttons(gamepad_state) | ds4_dpad(gamepad_state); report.bSpecial = ds4_special_buttons(gamepad_state); report.bTriggerL = gamepad_state.lt; @@ -585,10 +779,14 @@ namespace platf { report.bThumbRX = to_ds4_triggerX(gamepad_state.rsX); report.bThumbRY = to_ds4_triggerY(gamepad_state.rsY); - - return vigem_target_ds4_update(client, gp, report); } + /** + * @brief Updates virtual gamepad with the provided gamepad state. + * @param input The input context. + * @param nr The gamepad index to update. + * @param gamepad_state The gamepad button/axis state sent from the client. + */ void gamepad(input_t &input, int nr, const gamepad_state_t &gamepad_state) { auto vigem = ((input_raw_t *) input.get())->vigem; @@ -598,15 +796,17 @@ namespace platf { return; } - auto &[_, gp] = vigem->gamepads[nr]; + auto &gamepad = vigem->gamepads[nr]; VIGEM_ERROR status; - if (vigem_target_get_type(gp.get()) == Xbox360Wired) { - status = x360_update(vigem->client.get(), gp.get(), gamepad_state); + if (vigem_target_get_type(gamepad.gp.get()) == Xbox360Wired) { + x360_update_state(gamepad, gamepad_state); + status = vigem_target_x360_update(vigem->client.get(), gamepad.gp.get(), gamepad.report.x360); } else { - status = ds4_update(vigem->client.get(), gp.get(), gamepad_state); + ds4_update_state(gamepad, gamepad_state); + status = vigem_target_ds4_update_ex(vigem->client.get(), gamepad.gp.get(), gamepad.report.ds4); } if (!VIGEM_SUCCESS(status)) { From 4485b10dd15824688504fd86a62d9dee71f26870 Mon Sep 17 00:00:00 2001 From: Casey Korver Date: Mon, 3 Jul 2023 15:13:13 -0500 Subject: [PATCH 019/576] Correct typos in comments --- src/platform/common.h | 4 ++-- src/platform/linux/cuda.cpp | 2 +- src/platform/linux/cuda.cu | 8 ++++---- src/platform/linux/graphics.cpp | 2 +- src/platform/linux/kmsgrab.cpp | 6 +++--- src/platform/linux/publish.cpp | 6 +++--- src/platform/macos/nv12_zero_device.cpp | 2 +- src/platform/macos/publish.cpp | 6 +++--- src/platform/windows/display_vram.cpp | 2 +- src/platform/windows/misc.cpp | 2 +- src/thread_safe.h | 8 ++++---- src/video.cpp | 2 +- third-party/nvfbc/NvFBC.h | 8 ++++---- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/platform/common.h b/src/platform/common.h index b291c707abf..91fced164f8 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -298,7 +298,7 @@ namespace platf { * from the pool. If backend uses multiple threads, calls to this * callback must be synchronized. Calls to this callback and * push_captured_image_cb must be synchronized as well. - * bool *cursor --> A pointer to the flag that indicates wether the cursor should be captured as well + * bool *cursor --> A pointer to the flag that indicates whether the cursor should be captured as well * * Returns either: * capture_e::ok when stopping @@ -383,7 +383,7 @@ namespace platf { /** * display_name --> The name of the monitor that SHOULD be displayed * If display_name is empty --> Use the first monitor that's compatible you can find - * If you require to use this parameter in a seperate thread --> make a copy of it. + * If you require to use this parameter in a separate thread --> make a copy of it. * * config --> Stream configuration * diff --git a/src/platform/linux/cuda.cpp b/src/platform/linux/cuda.cpp index c2a2e0fd591..63012dc14ae 100644 --- a/src/platform/linux/cuda.cpp +++ b/src/platform/linux/cuda.cpp @@ -183,7 +183,7 @@ namespace cuda { int width, height; - // When heigth and width don't change, it's not necessary to use linear interpolation + // When height and width don't change, it's not necessary to use linear interpolation bool linear_interpolation; sws_t sws; diff --git a/src/platform/linux/cuda.cu b/src/platform/linux/cuda.cu index 107075d99cd..e1dd8160f14 100644 --- a/src/platform/linux/cuda.cu +++ b/src/platform/linux/cuda.cu @@ -198,10 +198,10 @@ __global__ void RGBA_to_NV12( dstUV[0] = uv.x; dstUV[1] = uv.y; - dstY0[0] = calcY(rgb_lt, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visisble - dstY0[1] = calcY(rgb_rt, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visisble - dstY1[0] = calcY(rgb_lb, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visisble - dstY1[1] = calcY(rgb_rb, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visisble + dstY0[0] = calcY(rgb_lt, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visible + dstY0[1] = calcY(rgb_rt, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visible + dstY1[0] = calcY(rgb_lb, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visible + dstY1[1] = calcY(rgb_rb, color_matrix) * 245.0f; // 245.0f is a magic number to ensure slight changes in luminosity are more visible } int tex_t::copy(std::uint8_t *src, int height, int pitch) { diff --git a/src/platform/linux/graphics.cpp b/src/platform/linux/graphics.cpp index fcb7ab234be..a0506554bf8 100644 --- a/src/platform/linux/graphics.cpp +++ b/src/platform/linux/graphics.cpp @@ -193,7 +193,7 @@ namespace gl { ctx.AttachShader(program.handle(), frag.handle()); // p_handle stores a copy of the program handle, since program will be moved before - // the fail guard funcion is called. + // the fail guard function is called. auto fg = util::fail_guard([p_handle = program.handle(), &vert, &frag]() { ctx.DetachShader(p_handle, vert.handle()); ctx.DetachShader(p_handle, frag.handle()); diff --git a/src/platform/linux/kmsgrab.cpp b/src/platform/linux/kmsgrab.cpp index 094aee5f4e9..867d9bf055f 100644 --- a/src/platform/linux/kmsgrab.cpp +++ b/src/platform/linux/kmsgrab.cpp @@ -550,7 +550,7 @@ namespace platf { }); if (pos == std::end(card_descriptors)) { - // This code path shouldn't happend, but it's there just in case. + // This code path shouldn't happen, but it's there just in case. // card_descriptors is part of the guesswork after all. BOOST_LOG(error) << "Couldn't find ["sv << entry.path() << "]: This shouldn't have happened :/"sv; return -1; @@ -592,7 +592,7 @@ namespace platf { offset_y = viewport.offset_y; } - // This code path shouldn't happend, but it's there just in case. + // This code path shouldn't happen, but it's there just in case. // crtc_to_monitor is part of the guesswork after all. else { BOOST_LOG(warning) << "Couldn't find crtc_id, this shouldn't have happened :\\"sv; @@ -1023,7 +1023,7 @@ namespace platf { // Try to convert names in the format: // {type}-{index} - // {index} is n'th occurence of {type} + // {index} is n'th occurrence of {type} auto index_begin = name.find_last_of('-'); std::uint32_t index; diff --git a/src/platform/linux/publish.cpp b/src/platform/linux/publish.cpp index 367c7aa3a20..e83bfb7009e 100644 --- a/src/platform/linux/publish.cpp +++ b/src/platform/linux/publish.cpp @@ -55,10 +55,10 @@ namespace avahi { ERR_NOT_FOUND = -30, /**< Not found */ ERR_INVALID_CONFIG = -31, /**< Configuration error */ - ERR_VERSION_MISMATCH = -32, /**< Verson mismatch */ + ERR_VERSION_MISMATCH = -32, /**< Version mismatch */ ERR_INVALID_SERVICE_SUBTYPE = -33, /**< Invalid service subtype */ ERR_INVALID_PACKET = -34, /**< Invalid packet */ - ERR_INVALID_DNS_ERROR = -35, /**< Invlaid DNS return code */ + ERR_INVALID_DNS_ERROR = -35, /**< Invalid DNS return code */ ERR_DNS_FORMERR = -36, /**< DNS Error: Form error */ ERR_DNS_SERVFAIL = -37, /**< DNS Error: Server Failure */ ERR_DNS_NXDOMAIN = -38, /**< DNS Error: No such domain */ @@ -107,7 +107,7 @@ namespace avahi { }; enum EntryGroupState { - ENTRY_GROUP_UNCOMMITED, /**< The group has not yet been commited, the user must still call avahi_entry_group_commit() */ + ENTRY_GROUP_UNCOMMITED, /**< The group has not yet been committed, the user must still call avahi_entry_group_commit() */ ENTRY_GROUP_REGISTERING, /**< The entries of the group are currently being registered */ ENTRY_GROUP_ESTABLISHED, /**< The entries have successfully been established */ ENTRY_GROUP_COLLISION, /**< A name collision for one of the entries in the group has been detected, the entries have been withdrawn */ diff --git a/src/platform/macos/nv12_zero_device.cpp b/src/platform/macos/nv12_zero_device.cpp index 21046be3054..5c4effd1943 100644 --- a/src/platform/macos/nv12_zero_device.cpp +++ b/src/platform/macos/nv12_zero_device.cpp @@ -82,7 +82,7 @@ namespace platf { this->resolution_fn = resolution_fn; // we never use this pointer but it's existence is checked/used - // by the platform independed code + // by the platform independent code data = this; return 0; diff --git a/src/platform/macos/publish.cpp b/src/platform/macos/publish.cpp index 4cb80b8dbdb..8fca07b848a 100644 --- a/src/platform/macos/publish.cpp +++ b/src/platform/macos/publish.cpp @@ -55,10 +55,10 @@ namespace avahi { ERR_NOT_FOUND = -30, /**< Not found */ ERR_INVALID_CONFIG = -31, /**< Configuration error */ - ERR_VERSION_MISMATCH = -32, /**< Verson mismatch */ + ERR_VERSION_MISMATCH = -32, /**< Version mismatch */ ERR_INVALID_SERVICE_SUBTYPE = -33, /**< Invalid service subtype */ ERR_INVALID_PACKET = -34, /**< Invalid packet */ - ERR_INVALID_DNS_ERROR = -35, /**< Invlaid DNS return code */ + ERR_INVALID_DNS_ERROR = -35, /**< Invalid DNS return code */ ERR_DNS_FORMERR = -36, /**< DNS Error: Form error */ ERR_DNS_SERVFAIL = -37, /**< DNS Error: Server Failure */ ERR_DNS_NXDOMAIN = -38, /**< DNS Error: No such domain */ @@ -107,7 +107,7 @@ namespace avahi { }; enum EntryGroupState { - ENTRY_GROUP_UNCOMMITED, /**< The group has not yet been commited, the user must still call avahi_entry_group_commit() */ + ENTRY_GROUP_UNCOMMITED, /**< The group has not yet been committed, the user must still call avahi_entry_group_commit() */ ENTRY_GROUP_REGISTERING, /**< The entries of the group are currently being registered */ ENTRY_GROUP_ESTABLISHED, /**< The entries have successfully been established */ ENTRY_GROUP_COLLISION, /**< A name collision for one of the entries in the group has been detected, the entries have been withdrawn */ diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 376a58521da..4519243a1af 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -1070,7 +1070,7 @@ namespace platf::dxgi { auto d3d_img = std::static_pointer_cast(img); // Finish creating the image (if it hasn't happened already), - // also creates synchonization primitives for shared access from multiple direct3d devices. + // also creates synchronization primitives for shared access from multiple direct3d devices. if (complete_img(d3d_img.get(), dummy)) return { nullptr, nullptr }; // This image is shared between capture direct3d device and encoders direct3d devices, diff --git a/src/platform/windows/misc.cpp b/src/platform/windows/misc.cpp index d16c1d6bdbb..c5bdc4fc523 100644 --- a/src/platform/windows/misc.cpp +++ b/src/platform/windows/misc.cpp @@ -751,7 +751,7 @@ namespace platf { for (DWORD i = 0; i < wlan_interface_list->dwNumberOfItems; i++) { if (wlan_interface_list->InterfaceInfo[i].isState == wlan_interface_state_connected) { // Enable media streaming mode for 802.11 wireless interfaces to reduce latency and - // unneccessary background scanning operations that cause packet loss and jitter. + // unnecessary background scanning operations that cause packet loss and jitter. // // https://docs.microsoft.com/en-us/windows-hardware/drivers/network/oid-wdi-set-connection-quality // https://docs.microsoft.com/en-us/previous-versions/windows/hardware/wireless/native-802-11-media-streaming diff --git a/src/thread_safe.h b/src/thread_safe.h index d745bf0886f..f4713bcf014 100644 --- a/src/thread_safe.h +++ b/src/thread_safe.h @@ -38,7 +38,7 @@ namespace safe { _cv.notify_all(); } - // pop and view shoud not be used interchangeably + // pop and view should not be used interchangeably status_t pop() { std::unique_lock ul { _lock }; @@ -60,7 +60,7 @@ namespace safe { return val; } - // pop and view shoud not be used interchangeably + // pop and view should not be used interchangeably template status_t pop(std::chrono::duration delay) { @@ -81,7 +81,7 @@ namespace safe { return val; } - // pop and view shoud not be used interchangeably + // pop and view should not be used interchangeably const status_t & view() { std::unique_lock ul { _lock }; @@ -101,7 +101,7 @@ namespace safe { return _status; } - // pop and view shoud not be used interchangeably + // pop and view should not be used interchangeably template status_t view(std::chrono::duration delay) { diff --git a/src/video.cpp b/src/video.cpp index 545e2fbdfea..33649c18738 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1971,7 +1971,7 @@ namespace video { /** * This is called once at startup and each time a stream is launched to - * ensure the best encoder is selected. Encoder availablility can change + * ensure the best encoder is selected. Encoder availability can change * at runtime due to all sorts of things from driver updates to eGPUs. * * This is only safe to call when there is no client actively streaming. diff --git a/third-party/nvfbc/NvFBC.h b/third-party/nvfbc/NvFBC.h index 42d0d04b945..e230555381d 100644 --- a/third-party/nvfbc/NvFBC.h +++ b/third-party/nvfbc/NvFBC.h @@ -654,7 +654,7 @@ typedef struct _NVFBC_CREATE_HANDLE_PARAMS { /*! * [in] Whether NvFBC should not create and manage its own graphics context * - * NvFBC internally uses OpenGL to perfom graphics operations on the + * NvFBC internally uses OpenGL to perform graphics operations on the * captured frames. By default, NvFBC will create and manage (e.g., make * current, detect new threads, etc.) its own OpenGL context. * @@ -866,7 +866,7 @@ typedef struct _NVFBC_CREATE_CAPTURE_SESSION_PARAMS { /*! * [in] Whether NvFBC should not attempt to recover from modesets. * - * NvFBC is able to detect when a modeset event occured and can automatically + * NvFBC is able to detect when a modeset event occurred and can automatically * re-create a capture session with the same settings as before, then resume * its frame capture session transparently. * @@ -1562,7 +1562,7 @@ NvFBCCreateHandle(NVFBC_SESSION_HANDLE *pSessionHandle, NVFBC_CREATE_HANDLE_PARA * * This function implicitly calls NvFBCReleaseContext(). * - * After this fucntion returns, it is not possible to use this session handle + * After this function returns, it is not possible to use this session handle * for any further API call. * * \param [in] sessionHandle @@ -1643,7 +1643,7 @@ NvFBCBindContext(const NVFBC_SESSION_HANDLE sessionHandle, NVFBC_BIND_CONTEXT_PA * If the FBC context is bound to a different thread, ::NVFBC_ERR_CONTEXT is * returned. * - * If the FBC context is already released, this functino has no effects. + * If the FBC context is already released, this function has no effects. * * \param [in] sessionHandle * FBC session handle. From 225df30e13f869901063f8a84968782917f4c3fd Mon Sep 17 00:00:00 2001 From: Casey Korver Date: Mon, 3 Jul 2023 15:16:06 -0500 Subject: [PATCH 020/576] Correct typos in logging --- src/platform/linux/input.cpp | 2 +- src/platform/macos/input.cpp | 2 +- src/system_tray.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/linux/input.cpp b/src/platform/linux/input.cpp index 0e96d1a6cac..d266ed5ebda 100644 --- a/src/platform/linux/input.cpp +++ b/src/platform/linux/input.cpp @@ -884,7 +884,7 @@ namespace platf { // on error if (polls_recv[x].revents & (POLLHUP | POLLRDHUP | POLLERR)) { - BOOST_LOG(warning) << "Gamepad ["sv << x << "] file discriptor closed unexpectedly"sv; + BOOST_LOG(warning) << "Gamepad ["sv << x << "] file descriptor closed unexpectedly"sv; polls.erase(poll); effects.erase(effect_it); diff --git a/src/platform/macos/input.cpp b/src/platform/macos/input.cpp index c5b20e58d8c..0ca85e75c72 100644 --- a/src/platform/macos/input.cpp +++ b/src/platform/macos/input.cpp @@ -478,7 +478,7 @@ const KeyCodeMap kKeyCodesMap[] = { macos_input->last_mouse_event[2][0] = 0; macos_input->last_mouse_event[2][1] = 0; - BOOST_LOG(debug) << "Display "sv << macos_input->display << ", pixel dimention: " << CGDisplayPixelsWide(macos_input->display) << "x"sv << CGDisplayPixelsHigh(macos_input->display); + BOOST_LOG(debug) << "Display "sv << macos_input->display << ", pixel dimension: " << CGDisplayPixelsWide(macos_input->display) << "x"sv << CGDisplayPixelsHigh(macos_input->display); return result; } diff --git a/src/system_tray.cpp b/src/system_tray.cpp index ed66357a6ac..bc082f158cb 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -100,7 +100,7 @@ namespace system_tray { */ void tray_quit_cb(struct tray_menu *item) { - BOOST_LOG(info) << "Quiting from system tray"sv; + BOOST_LOG(info) << "Quitting from system tray"sv; #ifdef _WIN32 // If we're running in a service, return a special status to From 13a3b192d132aa1458bc1a67aa4577fae878015e Mon Sep 17 00:00:00 2001 From: Casey Korver Date: Mon, 3 Jul 2023 15:16:18 -0500 Subject: [PATCH 021/576] Correct typos on web portal --- src_assets/common/assets/web/apps.html | 2 +- src_assets/common/assets/web/config.html | 2 +- src_assets/common/assets/web/troubleshooting.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index f3243036f96..54a3bebfbe4 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -190,7 +190,7 @@

Applications

v-model="editForm.cmd" />
- The main application, if it is not specified, a processs is started + The main application, if it is not specified, a process is started that sleeps indefinitely
diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 1258c35e33a..489398fc58c 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -928,7 +928,7 @@

Configuration

diff --git a/src_assets/common/assets/web/troubleshooting.html b/src_assets/common/assets/web/troubleshooting.html index 3fe0ada0d0a..0ada5a8ae33 100644 --- a/src_assets/common/assets/web/troubleshooting.html +++ b/src_assets/common/assets/web/troubleshooting.html @@ -13,7 +13,7 @@

Force Close

Application Closed Successfully!
- Error while closing Appplication + Error while closing Application
+ + +
+ + + + +
+

Sunshine

+ +
+ + + + +
+ + + + +
+
+

+ Sunshine is a self-hosted game stream host for Moonlight. Offering low latency, cloud gaming + server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware encoding. Software + encoding is also available. You can connect to Sunshine from any Moonlight client on a variety + of devices. A web UI is provided to allow configuration, and client pairing, from your favorite + web browser. Pair from the local server or any mobile device. +

+
+
+ + +
+
+

Features

+ +
+
+
+
+
+
+ +
+
+
Self-hosted
+

+ Run Sunshine on your own hardware. No need to pay monthly fees to a + cloud gaming provider. +

+
+
+
+
+
+
+
+
+
+
+ +
+
+
Moonlight Support
+

+ Connect to Sunshine from any Moonlight client. Moonlight is available + for Windows, macOS, Linux, Android, iOS, Xbox, and more. +

+
+
+
+
+
+
+
+
+
+
+ +
+
+
Hardware Encoding
+

+ Sunshine supports AMD, Intel, and Nvidia GPUs for hardware encoding. + Software encoding is also available. +

+
+
+
+
+
+
+
+
+
+
+ +
+
+
Low Latency
+

+ Sunshine is designed to provide the lowest latency possible to achieve optimal gaming performance. +

+
+
+
+
+
+
+
+
+
+
+ +
+
+
Control
+

+ Sunshine emulates an Xbox 360 or DS4 controller. Use nearly any + controller on your Moonlight client!
+ +

    +
  • DS4 emulation is only available on Windows.
  • +
  • Gamepad emulation is not currently supported on macOS.
  • +
+ +

+
+
+
+
+
+
+
+
+
+
+ +
+
+
Configurable
+

+ Sunshine offers many configuration options to customize your experience. +

+
+
+
+
+
+
+
+
+ + +
+ + + + + +
+
+
+
+
+
Support Center
+
Find answers and ask questions.
+
+
+

+ The one who knows all the answers has not been asked all the questions. + – Confucius. +

+ +
+
+
+
+
+ + + +
+ + + + + + + + + + + + + + + From f9ae6e23eca1ce5464d8eb415aa47447d730a437 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 21 Jul 2023 08:48:15 -0400 Subject: [PATCH 041/576] build(deps): use submodule for nvapi opensource (#1458) --- .gitmodules | 4 + CMakeLists.txt | 4 +- third-party/nvapi-open-source-sdk | 1 + .../nvapi-opensource/NvApiDriverSettings.c | 956 - .../nvapi-opensource/NvApiDriverSettings.h | 1161 - third-party/nvapi-opensource/nvapi.h | 25148 ---------------- .../nvapi-opensource/nvapi_interface.h | 490 - third-party/nvapi-opensource/readme.txt | 3 - third-party/nvapi-opensource/version-R530 | 0 9 files changed, 7 insertions(+), 27760 deletions(-) create mode 160000 third-party/nvapi-open-source-sdk delete mode 100644 third-party/nvapi-opensource/NvApiDriverSettings.c delete mode 100644 third-party/nvapi-opensource/NvApiDriverSettings.h delete mode 100644 third-party/nvapi-opensource/nvapi.h delete mode 100644 third-party/nvapi-opensource/nvapi_interface.h delete mode 100644 third-party/nvapi-opensource/readme.txt delete mode 100644 third-party/nvapi-opensource/version-R530 diff --git a/.gitmodules b/.gitmodules index a3e39729c0a..1a81975269c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -50,3 +50,7 @@ path = third-party/tray url = https://github.com/dmikushin/tray branch = master +[submodule "third-party/nvapi-open-source-sdk"] + path = third-party/nvapi-open-source-sdk + url = https://github.com/LizardByte/nvapi-open-source-sdk + branch = sdk diff --git a/CMakeLists.txt b/CMakeLists.txt index fee22c8f7c9..04e3720cef0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,9 +157,9 @@ if(WIN32) add_compile_definitions(SUNSHINE_PLATFORM="windows") add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now - include_directories(SYSTEM third-party/nvapi-opensource) + include_directories(SYSTEM third-party/nvapi-open-source-sdk) file(GLOB NVPREFS_FILES CONFIGURE_DEPENDS - "third-party/nvapi-opensource/*.h" + "third-party/nvapi-open-source-sdk/*.h" "src/platform/windows/nvprefs/*.cpp" "src/platform/windows/nvprefs/*.h") diff --git a/third-party/nvapi-open-source-sdk b/third-party/nvapi-open-source-sdk new file mode 160000 index 00000000000..c0f5f7b64d2 --- /dev/null +++ b/third-party/nvapi-open-source-sdk @@ -0,0 +1 @@ +Subproject commit c0f5f7b64d2ef13b1155f078a2eec156611f2415 diff --git a/third-party/nvapi-opensource/NvApiDriverSettings.c b/third-party/nvapi-opensource/NvApiDriverSettings.c deleted file mode 100644 index 8cf9d9449cd..00000000000 --- a/third-party/nvapi-opensource/NvApiDriverSettings.c +++ /dev/null @@ -1,956 +0,0 @@ -/*****************************************************************************\ -|* *| -|* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. *| -|* *| -|* 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. *| -|* *| -|* *| -\*****************************************************************************/ - -#include "NvApiDriverSettings.h" - -EValues_OGL_AA_LINE_GAMMA g_valuesOGL_AA_LINE_GAMMA[OGL_AA_LINE_GAMMA_NUM_VALUES] = -{ - OGL_AA_LINE_GAMMA_DISABLED, - OGL_AA_LINE_GAMMA_ENABLED, - OGL_AA_LINE_GAMMA_MIN, - OGL_AA_LINE_GAMMA_MAX, -}; - -EValues_OGL_CPL_GDI_COMPATIBILITY g_valuesOGL_CPL_GDI_COMPATIBILITY[OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES] = -{ - OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED, - OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED, - OGL_CPL_GDI_COMPATIBILITY_AUTO, -}; - -EValues_OGL_CPL_PREFER_DXPRESENT g_valuesOGL_CPL_PREFER_DXPRESENT[OGL_CPL_PREFER_DXPRESENT_NUM_VALUES] = -{ - OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED, - OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED, - OGL_CPL_PREFER_DXPRESENT_AUTO, -}; - -EValues_OGL_DEEP_COLOR_SCANOUT g_valuesOGL_DEEP_COLOR_SCANOUT[OGL_DEEP_COLOR_SCANOUT_NUM_VALUES] = -{ - OGL_DEEP_COLOR_SCANOUT_DISABLE, - OGL_DEEP_COLOR_SCANOUT_ENABLE, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL g_valuesOGL_DEFAULT_SWAP_INTERVAL[OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_TEAR, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC, - OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON, - OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED, - OGL_DEFAULT_SWAP_INTERVAL_DISABLE, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL[OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES, -}; - -EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN[OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES] = -{ - OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE, -}; - -EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD[OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES] = -{ - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL, -}; - -EValues_OGL_FORCE_BLIT g_valuesOGL_FORCE_BLIT[OGL_FORCE_BLIT_NUM_VALUES] = -{ - OGL_FORCE_BLIT_ON, - OGL_FORCE_BLIT_OFF, -}; - -EValues_OGL_FORCE_STEREO g_valuesOGL_FORCE_STEREO[OGL_FORCE_STEREO_NUM_VALUES] = -{ - OGL_FORCE_STEREO_OFF, - OGL_FORCE_STEREO_ON, -}; - -const wchar_t * g_valuesOGL_IMPLICIT_GPU_AFFINITY[OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES] = -{ - OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT -}; - -EValues_OGL_OVERLAY_PIXEL_TYPE g_valuesOGL_OVERLAY_PIXEL_TYPE[OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES] = -{ - OGL_OVERLAY_PIXEL_TYPE_NONE, - OGL_OVERLAY_PIXEL_TYPE_CI, - OGL_OVERLAY_PIXEL_TYPE_RGBA, - OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA, -}; - -EValues_OGL_OVERLAY_SUPPORT g_valuesOGL_OVERLAY_SUPPORT[OGL_OVERLAY_SUPPORT_NUM_VALUES] = -{ - OGL_OVERLAY_SUPPORT_OFF, - OGL_OVERLAY_SUPPORT_ON, - OGL_OVERLAY_SUPPORT_FORCE_SW, -}; - -EValues_OGL_QUALITY_ENHANCEMENTS g_valuesOGL_QUALITY_ENHANCEMENTS[OGL_QUALITY_ENHANCEMENTS_NUM_VALUES] = -{ - OGL_QUALITY_ENHANCEMENTS_HQUAL, - OGL_QUALITY_ENHANCEMENTS_QUAL, - OGL_QUALITY_ENHANCEMENTS_PERF, - OGL_QUALITY_ENHANCEMENTS_HPERF, -}; - -EValues_OGL_SINGLE_BACKDEPTH_BUFFER g_valuesOGL_SINGLE_BACKDEPTH_BUFFER[OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES] = -{ - OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE, - OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE, - OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT, -}; - -EValues_OGL_SLI_CFR_MODE g_valuesOGL_SLI_CFR_MODE[OGL_SLI_CFR_MODE_NUM_VALUES] = -{ - OGL_SLI_CFR_MODE_DISABLE, - OGL_SLI_CFR_MODE_ENABLE, - OGL_SLI_CFR_MODE_CLASSIC_SFR, -}; - -EValues_OGL_SLI_MULTICAST g_valuesOGL_SLI_MULTICAST[OGL_SLI_MULTICAST_NUM_VALUES] = -{ - OGL_SLI_MULTICAST_DISABLE, - OGL_SLI_MULTICAST_ENABLE, - OGL_SLI_MULTICAST_FORCE_DISABLE, - OGL_SLI_MULTICAST_ALLOW_MOSAIC, -}; - -EValues_OGL_THREAD_CONTROL g_valuesOGL_THREAD_CONTROL[OGL_THREAD_CONTROL_NUM_VALUES] = -{ - OGL_THREAD_CONTROL_ENABLE, - OGL_THREAD_CONTROL_DISABLE, -}; - -EValues_OGL_TMON_LEVEL g_valuesOGL_TMON_LEVEL[OGL_TMON_LEVEL_NUM_VALUES] = -{ - OGL_TMON_LEVEL_DISABLE, - OGL_TMON_LEVEL_CRITICAL, - OGL_TMON_LEVEL_WARNING, - OGL_TMON_LEVEL_INFORMATION, - OGL_TMON_LEVEL_MOST, - OGL_TMON_LEVEL_VERBOSE, -}; - -EValues_OGL_TRIPLE_BUFFER g_valuesOGL_TRIPLE_BUFFER[OGL_TRIPLE_BUFFER_NUM_VALUES] = -{ - OGL_TRIPLE_BUFFER_DISABLED, - OGL_TRIPLE_BUFFER_ENABLED, -}; - -EValues_AA_BEHAVIOR_FLAGS g_valuesAA_BEHAVIOR_FLAGS[AA_BEHAVIOR_FLAGS_NUM_VALUES] = -{ - AA_BEHAVIOR_FLAGS_NONE, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE, - AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE, - AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE, - AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING, - AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING, - AA_BEHAVIOR_FLAGS_DISABLE_CPLAA, - AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE, - AA_BEHAVIOR_FLAGS_DISABLE_SLIAA, - AA_BEHAVIOR_FLAGS_DEFAULT, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT, - AA_BEHAVIOR_FLAGS_MASK, -}; - -EValues_AA_MODE_ALPHATOCOVERAGE g_valuesAA_MODE_ALPHATOCOVERAGE[AA_MODE_ALPHATOCOVERAGE_NUM_VALUES] = -{ - AA_MODE_ALPHATOCOVERAGE_MODE_MASK, - AA_MODE_ALPHATOCOVERAGE_MODE_OFF, - AA_MODE_ALPHATOCOVERAGE_MODE_ON, - AA_MODE_ALPHATOCOVERAGE_MODE_MAX, -}; - -EValues_AA_MODE_GAMMACORRECTION g_valuesAA_MODE_GAMMACORRECTION[AA_MODE_GAMMACORRECTION_NUM_VALUES] = -{ - AA_MODE_GAMMACORRECTION_MASK, - AA_MODE_GAMMACORRECTION_OFF, - AA_MODE_GAMMACORRECTION_ON_IF_FOS, - AA_MODE_GAMMACORRECTION_ON_ALWAYS, - AA_MODE_GAMMACORRECTION_MAX, - AA_MODE_GAMMACORRECTION_DEFAULT, - AA_MODE_GAMMACORRECTION_DEFAULT_TESLA, - AA_MODE_GAMMACORRECTION_DEFAULT_FERMI, -}; - -EValues_AA_MODE_METHOD g_valuesAA_MODE_METHOD[AA_MODE_METHOD_NUM_VALUES] = -{ - AA_MODE_METHOD_NONE, - AA_MODE_METHOD_SUPERSAMPLE_2X_H, - AA_MODE_METHOD_SUPERSAMPLE_2X_V, - AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5, - AA_MODE_METHOD_FREE_0x03, - AA_MODE_METHOD_FREE_0x04, - AA_MODE_METHOD_SUPERSAMPLE_4X, - AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN, - AA_MODE_METHOD_FREE_0x08, - AA_MODE_METHOD_FREE_0x09, - AA_MODE_METHOD_SUPERSAMPLE_9X, - AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS, - AA_MODE_METHOD_SUPERSAMPLE_16X, - AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL, - AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX, - AA_MODE_METHOD_MULTISAMPLE_4X, - AA_MODE_METHOD_FREE_0x11, - AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN, - AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP, - AA_MODE_METHOD_FREE_0x14, - AA_MODE_METHOD_FREE_0x15, - AA_MODE_METHOD_MIXEDSAMPLE_6X, - AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP, - AA_MODE_METHOD_MIXEDSAMPLE_8X, - AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP, - AA_MODE_METHOD_MIXEDSAMPLE_16X, - AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA, - AA_MODE_METHOD_MULTISAMPLE_16X, - AA_MODE_METHOD_VCAA_32X_8v24, - AA_MODE_METHOD_CORRUPTION_CHECK, - AA_MODE_METHOD_6X_CT, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA, - AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA, - AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA, - AA_MODE_METHOD_MULTISAMPLE_8X, - AA_MODE_METHOD_VCAA_8X_4v4, - AA_MODE_METHOD_VCAA_16X_4v12, - AA_MODE_METHOD_VCAA_16X_8v8, - AA_MODE_METHOD_MIXEDSAMPLE_32X, - AA_MODE_METHOD_SUPERVCAA_64X_4v12, - AA_MODE_METHOD_SUPERVCAA_64X_8v8, - AA_MODE_METHOD_MIXEDSAMPLE_64X, - AA_MODE_METHOD_MIXEDSAMPLE_128X, - AA_MODE_METHOD_COUNT, - AA_MODE_METHOD_METHOD_MASK, - AA_MODE_METHOD_METHOD_MAX, -}; - -EValues_AA_MODE_REPLAY g_valuesAA_MODE_REPLAY[AA_MODE_REPLAY_NUM_VALUES] = -{ - AA_MODE_REPLAY_SAMPLES_MASK, - AA_MODE_REPLAY_SAMPLES_ONE, - AA_MODE_REPLAY_SAMPLES_TWO, - AA_MODE_REPLAY_SAMPLES_FOUR, - AA_MODE_REPLAY_SAMPLES_EIGHT, - AA_MODE_REPLAY_SAMPLES_MAX, - AA_MODE_REPLAY_MODE_MASK, - AA_MODE_REPLAY_MODE_OFF, - AA_MODE_REPLAY_MODE_ALPHA_TEST, - AA_MODE_REPLAY_MODE_PIXEL_KILL, - AA_MODE_REPLAY_MODE_DYN_BRANCH, - AA_MODE_REPLAY_MODE_OPTIMAL, - AA_MODE_REPLAY_MODE_ALL, - AA_MODE_REPLAY_MODE_MAX, - AA_MODE_REPLAY_TRANSPARENCY, - AA_MODE_REPLAY_DISALLOW_TRAA, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI, - AA_MODE_REPLAY_MASK, -}; - -EValues_AA_MODE_SELECTOR g_valuesAA_MODE_SELECTOR[AA_MODE_SELECTOR_NUM_VALUES] = -{ - AA_MODE_SELECTOR_MASK, - AA_MODE_SELECTOR_APP_CONTROL, - AA_MODE_SELECTOR_OVERRIDE, - AA_MODE_SELECTOR_ENHANCE, - AA_MODE_SELECTOR_MAX, -}; - -EValues_AA_MODE_SELECTOR_SLIAA g_valuesAA_MODE_SELECTOR_SLIAA[AA_MODE_SELECTOR_SLIAA_NUM_VALUES] = -{ - AA_MODE_SELECTOR_SLIAA_DISABLED, - AA_MODE_SELECTOR_SLIAA_ENABLED, -}; - -EValues_ANISO_MODE_LEVEL g_valuesANISO_MODE_LEVEL[ANISO_MODE_LEVEL_NUM_VALUES] = -{ - ANISO_MODE_LEVEL_MASK, - ANISO_MODE_LEVEL_NONE_POINT, - ANISO_MODE_LEVEL_NONE_LINEAR, - ANISO_MODE_LEVEL_MAX, - ANISO_MODE_LEVEL_DEFAULT, -}; - -EValues_ANISO_MODE_SELECTOR g_valuesANISO_MODE_SELECTOR[ANISO_MODE_SELECTOR_NUM_VALUES] = -{ - ANISO_MODE_SELECTOR_MASK, - ANISO_MODE_SELECTOR_APP, - ANISO_MODE_SELECTOR_USER, - ANISO_MODE_SELECTOR_COND, - ANISO_MODE_SELECTOR_MAX, - ANISO_MODE_SELECTOR_DEFAULT, -}; - -EValues_ANSEL_ALLOW g_valuesANSEL_ALLOW[ANSEL_ALLOW_NUM_VALUES] = -{ - ANSEL_ALLOW_DISALLOWED, - ANSEL_ALLOW_ALLOWED, -}; - -EValues_ANSEL_ALLOWLISTED g_valuesANSEL_ALLOWLISTED[ANSEL_ALLOWLISTED_NUM_VALUES] = -{ - ANSEL_ALLOWLISTED_DISALLOWED, - ANSEL_ALLOWLISTED_ALLOWED, -}; - -EValues_ANSEL_ENABLE g_valuesANSEL_ENABLE[ANSEL_ENABLE_NUM_VALUES] = -{ - ANSEL_ENABLE_OFF, - ANSEL_ENABLE_ON, -}; - -EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT[APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES] = -{ - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES, -}; - -EValues_BATTERY_BOOST_APP_FPS g_valuesBATTERY_BOOST_APP_FPS[BATTERY_BOOST_APP_FPS_NUM_VALUES] = -{ - BATTERY_BOOST_APP_FPS_MIN, - BATTERY_BOOST_APP_FPS_MAX, - BATTERY_BOOST_APP_FPS_NO_OVERRIDE, -}; - -EValues_CPL_HIDDEN_PROFILE g_valuesCPL_HIDDEN_PROFILE[CPL_HIDDEN_PROFILE_NUM_VALUES] = -{ - CPL_HIDDEN_PROFILE_DISABLED, - CPL_HIDDEN_PROFILE_ENABLED, -}; - -const wchar_t * g_valuesCUDA_EXCLUDED_GPUS[CUDA_EXCLUDED_GPUS_NUM_VALUES] = -{ - CUDA_EXCLUDED_GPUS_NONE -}; - -const wchar_t * g_valuesD3DOGL_GPU_MAX_POWER[D3DOGL_GPU_MAX_POWER_NUM_VALUES] = -{ - D3DOGL_GPU_MAX_POWER_DEFAULTPOWER -}; - -EValues_EXPORT_PERF_COUNTERS g_valuesEXPORT_PERF_COUNTERS[EXPORT_PERF_COUNTERS_NUM_VALUES] = -{ - EXPORT_PERF_COUNTERS_OFF, - EXPORT_PERF_COUNTERS_ON, -}; - -EValues_EXTERNAL_QUIET_MODE g_valuesEXTERNAL_QUIET_MODE[EXTERNAL_QUIET_MODE_NUM_VALUES] = -{ - EXTERNAL_QUIET_MODE_ON, - EXTERNAL_QUIET_MODE_OFF, -}; - -EValues_FRL_FPS g_valuesFRL_FPS[FRL_FPS_NUM_VALUES] = -{ - FRL_FPS_DISABLED, - FRL_FPS_MIN, - FRL_FPS_MAX, -}; - -EValues_FXAA_ALLOW g_valuesFXAA_ALLOW[FXAA_ALLOW_NUM_VALUES] = -{ - FXAA_ALLOW_DISALLOWED, - FXAA_ALLOW_ALLOWED, -}; - -EValues_FXAA_ENABLE g_valuesFXAA_ENABLE[FXAA_ENABLE_NUM_VALUES] = -{ - FXAA_ENABLE_OFF, - FXAA_ENABLE_ON, -}; - -EValues_FXAA_INDICATOR_ENABLE g_valuesFXAA_INDICATOR_ENABLE[FXAA_INDICATOR_ENABLE_NUM_VALUES] = -{ - FXAA_INDICATOR_ENABLE_OFF, - FXAA_INDICATOR_ENABLE_ON, -}; - -EValues_LATENCY_INDICATOR_AUTOALIGN g_valuesLATENCY_INDICATOR_AUTOALIGN[LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES] = -{ - LATENCY_INDICATOR_AUTOALIGN_DISABLED, - LATENCY_INDICATOR_AUTOALIGN_ENABLED, -}; - -EValues_MCSFRSHOWSPLIT g_valuesMCSFRSHOWSPLIT[MCSFRSHOWSPLIT_NUM_VALUES] = -{ - MCSFRSHOWSPLIT_DISABLED, - MCSFRSHOWSPLIT_ENABLED, -}; - -EValues_NV_QUALITY_UPSCALING g_valuesNV_QUALITY_UPSCALING[NV_QUALITY_UPSCALING_NUM_VALUES] = -{ - NV_QUALITY_UPSCALING_OFF, - NV_QUALITY_UPSCALING_ON, -}; - -EValues_OPTIMUS_MAXAA g_valuesOPTIMUS_MAXAA[OPTIMUS_MAXAA_NUM_VALUES] = -{ - OPTIMUS_MAXAA_MIN, - OPTIMUS_MAXAA_MAX, -}; - -EValues_PHYSXINDICATOR g_valuesPHYSXINDICATOR[PHYSXINDICATOR_NUM_VALUES] = -{ - PHYSXINDICATOR_DISABLED, - PHYSXINDICATOR_ENABLED, -}; - -EValues_PREFERRED_PSTATE g_valuesPREFERRED_PSTATE[PREFERRED_PSTATE_NUM_VALUES] = -{ - PREFERRED_PSTATE_ADAPTIVE, - PREFERRED_PSTATE_PREFER_MAX, - PREFERRED_PSTATE_DRIVER_CONTROLLED, - PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE, - PREFERRED_PSTATE_PREFER_MIN, - PREFERRED_PSTATE_OPTIMAL_POWER, - PREFERRED_PSTATE_MIN, - PREFERRED_PSTATE_MAX, -}; - -EValues_PREVENT_UI_AF_OVERRIDE g_valuesPREVENT_UI_AF_OVERRIDE[PREVENT_UI_AF_OVERRIDE_NUM_VALUES] = -{ - PREVENT_UI_AF_OVERRIDE_OFF, - PREVENT_UI_AF_OVERRIDE_ON, -}; - -EValues_SHIM_MCCOMPAT g_valuesSHIM_MCCOMPAT[SHIM_MCCOMPAT_NUM_VALUES] = -{ - SHIM_MCCOMPAT_INTEGRATED, - SHIM_MCCOMPAT_ENABLE, - SHIM_MCCOMPAT_USER_EDITABLE, - SHIM_MCCOMPAT_MASK, - SHIM_MCCOMPAT_VIDEO_MASK, - SHIM_MCCOMPAT_VARYING_BIT, - SHIM_MCCOMPAT_AUTO_SELECT, - SHIM_MCCOMPAT_OVERRIDE_BIT, -}; - -EValues_SHIM_RENDERING_MODE g_valuesSHIM_RENDERING_MODE[SHIM_RENDERING_MODE_NUM_VALUES] = -{ - SHIM_RENDERING_MODE_INTEGRATED, - SHIM_RENDERING_MODE_ENABLE, - SHIM_RENDERING_MODE_USER_EDITABLE, - SHIM_RENDERING_MODE_MASK, - SHIM_RENDERING_MODE_VIDEO_MASK, - SHIM_RENDERING_MODE_VARYING_BIT, - SHIM_RENDERING_MODE_AUTO_SELECT, - SHIM_RENDERING_MODE_OVERRIDE_BIT, -}; - -EValues_SHIM_RENDERING_OPTIONS g_valuesSHIM_RENDERING_OPTIONS[SHIM_RENDERING_OPTIONS_NUM_VALUES] = -{ - SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE, - SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT, - SHIM_RENDERING_OPTIONS_EHSHELL_DETECT, - SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT, - SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT, - SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES, - SHIM_RENDERING_OPTIONS_RESERVED1, - SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT, - SHIM_RENDERING_OPTIONS_RESERVED2, - SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE, - SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS, - SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS, - SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS, - SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING, - SHIM_RENDERING_OPTIONS_DISABLE_CUDA, - SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS, - SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT, - SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO, - SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID, - SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD, - SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT, - SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG, - SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP, - SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH, - SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH, - SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY, -}; - -EValues_SLI_GPU_COUNT g_valuesSLI_GPU_COUNT[SLI_GPU_COUNT_NUM_VALUES] = -{ - SLI_GPU_COUNT_AUTOSELECT, - SLI_GPU_COUNT_ONE, - SLI_GPU_COUNT_TWO, - SLI_GPU_COUNT_THREE, - SLI_GPU_COUNT_FOUR, -}; - -EValues_SLI_PREDEFINED_GPU_COUNT g_valuesSLI_PREDEFINED_GPU_COUNT[SLI_PREDEFINED_GPU_COUNT_NUM_VALUES] = -{ - SLI_PREDEFINED_GPU_COUNT_AUTOSELECT, - SLI_PREDEFINED_GPU_COUNT_ONE, - SLI_PREDEFINED_GPU_COUNT_TWO, - SLI_PREDEFINED_GPU_COUNT_THREE, - SLI_PREDEFINED_GPU_COUNT_FOUR, -}; - -EValues_SLI_PREDEFINED_GPU_COUNT_DX10 g_valuesSLI_PREDEFINED_GPU_COUNT_DX10[SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES] = -{ - SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT, - SLI_PREDEFINED_GPU_COUNT_DX10_ONE, - SLI_PREDEFINED_GPU_COUNT_DX10_TWO, - SLI_PREDEFINED_GPU_COUNT_DX10_THREE, - SLI_PREDEFINED_GPU_COUNT_DX10_FOUR, -}; - -EValues_SLI_PREDEFINED_MODE g_valuesSLI_PREDEFINED_MODE[SLI_PREDEFINED_MODE_NUM_VALUES] = -{ - SLI_PREDEFINED_MODE_AUTOSELECT, - SLI_PREDEFINED_MODE_FORCE_SINGLE, - SLI_PREDEFINED_MODE_FORCE_AFR, - SLI_PREDEFINED_MODE_FORCE_AFR2, - SLI_PREDEFINED_MODE_FORCE_SFR, - SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_SLI_PREDEFINED_MODE_DX10 g_valuesSLI_PREDEFINED_MODE_DX10[SLI_PREDEFINED_MODE_DX10_NUM_VALUES] = -{ - SLI_PREDEFINED_MODE_DX10_AUTOSELECT, - SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR2, - SLI_PREDEFINED_MODE_DX10_FORCE_SFR, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_SLI_RENDERING_MODE g_valuesSLI_RENDERING_MODE[SLI_RENDERING_MODE_NUM_VALUES] = -{ - SLI_RENDERING_MODE_AUTOSELECT, - SLI_RENDERING_MODE_FORCE_SINGLE, - SLI_RENDERING_MODE_FORCE_AFR, - SLI_RENDERING_MODE_FORCE_AFR2, - SLI_RENDERING_MODE_FORCE_SFR, - SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR, -}; - -EValues_VRPRERENDERLIMIT g_valuesVRPRERENDERLIMIT[VRPRERENDERLIMIT_NUM_VALUES] = -{ - VRPRERENDERLIMIT_MIN, - VRPRERENDERLIMIT_MAX, - VRPRERENDERLIMIT_APP_CONTROLLED, - VRPRERENDERLIMIT_DEFAULT, -}; - -EValues_VRRFEATUREINDICATOR g_valuesVRRFEATUREINDICATOR[VRRFEATUREINDICATOR_NUM_VALUES] = -{ - VRRFEATUREINDICATOR_DISABLED, - VRRFEATUREINDICATOR_ENABLED, -}; - -EValues_VRROVERLAYINDICATOR g_valuesVRROVERLAYINDICATOR[VRROVERLAYINDICATOR_NUM_VALUES] = -{ - VRROVERLAYINDICATOR_DISABLED, - VRROVERLAYINDICATOR_ENABLED, -}; - -EValues_VRRREQUESTSTATE g_valuesVRRREQUESTSTATE[VRRREQUESTSTATE_NUM_VALUES] = -{ - VRRREQUESTSTATE_DISABLED, - VRRREQUESTSTATE_FULLSCREEN_ONLY, - VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED, -}; - -EValues_VRR_APP_OVERRIDE g_valuesVRR_APP_OVERRIDE[VRR_APP_OVERRIDE_NUM_VALUES] = -{ - VRR_APP_OVERRIDE_ALLOW, - VRR_APP_OVERRIDE_FORCE_OFF, - VRR_APP_OVERRIDE_DISALLOW, - VRR_APP_OVERRIDE_ULMB, - VRR_APP_OVERRIDE_FIXED_REFRESH, -}; - -EValues_VRR_APP_OVERRIDE_REQUEST_STATE g_valuesVRR_APP_OVERRIDE_REQUEST_STATE[VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES] = -{ - VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW, - VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF, - VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW, - VRR_APP_OVERRIDE_REQUEST_STATE_ULMB, - VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH, -}; - -EValues_VRR_MODE g_valuesVRR_MODE[VRR_MODE_NUM_VALUES] = -{ - VRR_MODE_DISABLED, - VRR_MODE_FULLSCREEN_ONLY, - VRR_MODE_FULLSCREEN_AND_WINDOWED, -}; - -EValues_VSYNCSMOOTHAFR g_valuesVSYNCSMOOTHAFR[VSYNCSMOOTHAFR_NUM_VALUES] = -{ - VSYNCSMOOTHAFR_OFF, - VSYNCSMOOTHAFR_ON, -}; - -EValues_VSYNCVRRCONTROL g_valuesVSYNCVRRCONTROL[VSYNCVRRCONTROL_NUM_VALUES] = -{ - VSYNCVRRCONTROL_DISABLE, - VSYNCVRRCONTROL_ENABLE, - VSYNCVRRCONTROL_NOTSUPPORTED, -}; - -EValues_VSYNC_BEHAVIOR_FLAGS g_valuesVSYNC_BEHAVIOR_FLAGS[VSYNC_BEHAVIOR_FLAGS_NUM_VALUES] = -{ - VSYNC_BEHAVIOR_FLAGS_NONE, - VSYNC_BEHAVIOR_FLAGS_DEFAULT, - VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE, -}; - -EValues_WKS_API_STEREO_EYES_EXCHANGE g_valuesWKS_API_STEREO_EYES_EXCHANGE[WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES] = -{ - WKS_API_STEREO_EYES_EXCHANGE_OFF, - WKS_API_STEREO_EYES_EXCHANGE_ON, -}; - -EValues_WKS_API_STEREO_MODE g_valuesWKS_API_STEREO_MODE[WKS_API_STEREO_MODE_NUM_VALUES] = -{ - WKS_API_STEREO_MODE_SHUTTER_GLASSES, - WKS_API_STEREO_MODE_VERTICAL_INTERLACED, - WKS_API_STEREO_MODE_TWINVIEW, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1, - WKS_API_STEREO_MODE_COLOR_LINE, - WKS_API_STEREO_MODE_COLOR_INTERLEAVED, - WKS_API_STEREO_MODE_ANAGLYPH, - WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED, - WKS_API_STEREO_MODE_SIDE_FIELD, - WKS_API_STEREO_MODE_SUB_FIELD, - WKS_API_STEREO_MODE_CHECKERBOARD, - WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD, - WKS_API_STEREO_MODE_TRIDELITY_SL, - WKS_API_STEREO_MODE_TRIDELITY_MV, - WKS_API_STEREO_MODE_SEEFRONT, - WKS_API_STEREO_MODE_STEREO_MIRROR, - WKS_API_STEREO_MODE_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE, - WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL, - WKS_API_STEREO_MODE_DP_INBAND, - WKS_API_STEREO_MODE_USE_HW_DEFAULT, - WKS_API_STEREO_MODE_DEFAULT_GL, -}; - -EValues_WKS_MEMORY_ALLOCATION_POLICY g_valuesWKS_MEMORY_ALLOCATION_POLICY[WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES] = -{ - WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED, - WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION, - WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION, -}; - -EValues_WKS_STEREO_DONGLE_SUPPORT g_valuesWKS_STEREO_DONGLE_SUPPORT[WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES] = -{ - WKS_STEREO_DONGLE_SUPPORT_OFF, - WKS_STEREO_DONGLE_SUPPORT_DAC, - WKS_STEREO_DONGLE_SUPPORT_DLP, -}; - -EValues_WKS_STEREO_SUPPORT g_valuesWKS_STEREO_SUPPORT[WKS_STEREO_SUPPORT_NUM_VALUES] = -{ - WKS_STEREO_SUPPORT_OFF, - WKS_STEREO_SUPPORT_ON, -}; - -EValues_WKS_STEREO_SWAP_MODE g_valuesWKS_STEREO_SWAP_MODE[WKS_STEREO_SWAP_MODE_NUM_VALUES] = -{ - WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL, - WKS_STEREO_SWAP_MODE_PER_EYE, - WKS_STEREO_SWAP_MODE_PER_EYE_PAIR, - WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR, - WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP, -}; - -EValues_AO_MODE g_valuesAO_MODE[AO_MODE_NUM_VALUES] = -{ - AO_MODE_OFF, - AO_MODE_LOW, - AO_MODE_MEDIUM, - AO_MODE_HIGH, -}; - -EValues_AO_MODE_ACTIVE g_valuesAO_MODE_ACTIVE[AO_MODE_ACTIVE_NUM_VALUES] = -{ - AO_MODE_ACTIVE_DISABLED, - AO_MODE_ACTIVE_ENABLED, -}; - -EValues_AUTO_LODBIASADJUST g_valuesAUTO_LODBIASADJUST[AUTO_LODBIASADJUST_NUM_VALUES] = -{ - AUTO_LODBIASADJUST_OFF, - AUTO_LODBIASADJUST_ON, -}; - -EValues_EXPORT_PERF_COUNTERS_DX9_ONLY g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY[EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES] = -{ - EXPORT_PERF_COUNTERS_DX9_ONLY_OFF, - EXPORT_PERF_COUNTERS_DX9_ONLY_ON, -}; - -EValues_LODBIASADJUST g_valuesLODBIASADJUST[LODBIASADJUST_NUM_VALUES] = -{ - LODBIASADJUST_MIN, - LODBIASADJUST_MAX, -}; - -EValues_MAXWELL_B_SAMPLE_INTERLEAVE g_valuesMAXWELL_B_SAMPLE_INTERLEAVE[MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES] = -{ - MAXWELL_B_SAMPLE_INTERLEAVE_OFF, - MAXWELL_B_SAMPLE_INTERLEAVE_ON, -}; - -EValues_PRERENDERLIMIT g_valuesPRERENDERLIMIT[PRERENDERLIMIT_NUM_VALUES] = -{ - PRERENDERLIMIT_MIN, - PRERENDERLIMIT_MAX, - PRERENDERLIMIT_APP_CONTROLLED, -}; - -EValues_PS_SHADERDISKCACHE g_valuesPS_SHADERDISKCACHE[PS_SHADERDISKCACHE_NUM_VALUES] = -{ - PS_SHADERDISKCACHE_OFF, - PS_SHADERDISKCACHE_ON, -}; - -EValues_PS_SHADERDISKCACHE_MAX_SIZE g_valuesPS_SHADERDISKCACHE_MAX_SIZE[PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES] = -{ - PS_SHADERDISKCACHE_MAX_SIZE_MIN, - PS_SHADERDISKCACHE_MAX_SIZE_MAX, -}; - -EValues_PS_TEXFILTER_ANISO_OPTS2 g_valuesPS_TEXFILTER_ANISO_OPTS2[PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES] = -{ - PS_TEXFILTER_ANISO_OPTS2_OFF, - PS_TEXFILTER_ANISO_OPTS2_ON, -}; - -EValues_PS_TEXFILTER_BILINEAR_IN_ANISO g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO[PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES] = -{ - PS_TEXFILTER_BILINEAR_IN_ANISO_OFF, - PS_TEXFILTER_BILINEAR_IN_ANISO_ON, -}; - -EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE[PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES] = -{ - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON, -}; - -EValues_PS_TEXFILTER_NO_NEG_LODBIAS g_valuesPS_TEXFILTER_NO_NEG_LODBIAS[PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES] = -{ - PS_TEXFILTER_NO_NEG_LODBIAS_OFF, - PS_TEXFILTER_NO_NEG_LODBIAS_ON, -}; - -EValues_QUALITY_ENHANCEMENTS g_valuesQUALITY_ENHANCEMENTS[QUALITY_ENHANCEMENTS_NUM_VALUES] = -{ - QUALITY_ENHANCEMENTS_HIGHQUALITY, - QUALITY_ENHANCEMENTS_QUALITY, - QUALITY_ENHANCEMENTS_PERFORMANCE, - QUALITY_ENHANCEMENTS_HIGHPERFORMANCE, -}; - -EValues_QUALITY_ENHANCEMENT_SUBSTITUTION g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION[QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES] = -{ - QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION, - QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY, -}; - -EValues_REFRESH_RATE_OVERRIDE g_valuesREFRESH_RATE_OVERRIDE[REFRESH_RATE_OVERRIDE_NUM_VALUES] = -{ - REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED, - REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE, - REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK, -}; - -EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE[SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES] = -{ - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON, -}; - -EValues_SET_VAB_DATA g_valuesSET_VAB_DATA[SET_VAB_DATA_NUM_VALUES] = -{ - SET_VAB_DATA_ZERO, - SET_VAB_DATA_UINT_ONE, - SET_VAB_DATA_FLOAT_ONE, - SET_VAB_DATA_FLOAT_POS_INF, - SET_VAB_DATA_FLOAT_NAN, - SET_VAB_DATA_USE_API_DEFAULTS, -}; - -EValues_VSYNCMODE g_valuesVSYNCMODE[VSYNCMODE_NUM_VALUES] = -{ - VSYNCMODE_PASSIVE, - VSYNCMODE_FORCEOFF, - VSYNCMODE_FORCEON, - VSYNCMODE_FLIPINTERVAL2, - VSYNCMODE_FLIPINTERVAL3, - VSYNCMODE_FLIPINTERVAL4, - VSYNCMODE_VIRTUAL, -}; - -EValues_VSYNCTEARCONTROL g_valuesVSYNCTEARCONTROL[VSYNCTEARCONTROL_NUM_VALUES] = -{ - VSYNCTEARCONTROL_DISABLE, - VSYNCTEARCONTROL_ENABLE, -}; - - -SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] = -{ - {OGL_AA_LINE_GAMMA_ID, OGL_AA_LINE_GAMMA_STRING, 4, (NvU32 *)g_valuesOGL_AA_LINE_GAMMA, OGL_AA_LINE_GAMMA_DISABLED}, - {OGL_CPL_GDI_COMPATIBILITY_ID, OGL_CPL_GDI_COMPATIBILITY_STRING, 3, (NvU32 *)g_valuesOGL_CPL_GDI_COMPATIBILITY, OGL_CPL_GDI_COMPATIBILITY_AUTO}, - {OGL_CPL_PREFER_DXPRESENT_ID, OGL_CPL_PREFER_DXPRESENT_STRING, 3, (NvU32 *)g_valuesOGL_CPL_PREFER_DXPRESENT, OGL_CPL_PREFER_DXPRESENT_AUTO}, - {OGL_DEEP_COLOR_SCANOUT_ID, OGL_DEEP_COLOR_SCANOUT_STRING, 2, (NvU32 *)g_valuesOGL_DEEP_COLOR_SCANOUT, OGL_DEEP_COLOR_SCANOUT_ENABLE}, - {OGL_DEFAULT_SWAP_INTERVAL_ID, OGL_DEFAULT_SWAP_INTERVAL_STRING, 9, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL, OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE}, - {OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID, OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL, 0x00000000}, - {OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID, OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN, OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE}, - {OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID, OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING, 5, (NvU32 *)g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD, OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL}, - {OGL_EXTENSION_STRING_VERSION_ID, OGL_EXTENSION_STRING_VERSION_STRING, 0, NULL, 0x00000000}, - {OGL_FORCE_BLIT_ID, OGL_FORCE_BLIT_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_BLIT, OGL_FORCE_BLIT_OFF}, - {OGL_FORCE_STEREO_ID, OGL_FORCE_STEREO_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_STEREO, OGL_FORCE_STEREO_OFF}, - {OGL_MAX_FRAMES_ALLOWED_ID, OGL_MAX_FRAMES_ALLOWED_STRING, 0, NULL, 0x00000002}, - {OGL_OVERLAY_PIXEL_TYPE_ID, OGL_OVERLAY_PIXEL_TYPE_STRING, 4, (NvU32 *)g_valuesOGL_OVERLAY_PIXEL_TYPE, OGL_OVERLAY_PIXEL_TYPE_CI}, - {OGL_OVERLAY_SUPPORT_ID, OGL_OVERLAY_SUPPORT_STRING, 3, (NvU32 *)g_valuesOGL_OVERLAY_SUPPORT, OGL_OVERLAY_SUPPORT_OFF}, - {OGL_QUALITY_ENHANCEMENTS_ID, OGL_QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesOGL_QUALITY_ENHANCEMENTS, OGL_QUALITY_ENHANCEMENTS_QUAL}, - {OGL_SINGLE_BACKDEPTH_BUFFER_ID, OGL_SINGLE_BACKDEPTH_BUFFER_STRING, 3, (NvU32 *)g_valuesOGL_SINGLE_BACKDEPTH_BUFFER, OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE}, - {OGL_SLI_CFR_MODE_ID, OGL_SLI_CFR_MODE_STRING, 3, (NvU32 *)g_valuesOGL_SLI_CFR_MODE, OGL_SLI_CFR_MODE_DISABLE}, - {OGL_SLI_MULTICAST_ID, OGL_SLI_MULTICAST_STRING, 4, (NvU32 *)g_valuesOGL_SLI_MULTICAST, OGL_SLI_MULTICAST_DISABLE}, - {OGL_THREAD_CONTROL_ID, OGL_THREAD_CONTROL_STRING, 2, (NvU32 *)g_valuesOGL_THREAD_CONTROL, 0x00000000}, - {OGL_TMON_LEVEL_ID, OGL_TMON_LEVEL_STRING, 6, (NvU32 *)g_valuesOGL_TMON_LEVEL, OGL_TMON_LEVEL_MOST}, - {OGL_TRIPLE_BUFFER_ID, OGL_TRIPLE_BUFFER_STRING, 2, (NvU32 *)g_valuesOGL_TRIPLE_BUFFER, OGL_TRIPLE_BUFFER_DISABLED}, - {AA_BEHAVIOR_FLAGS_ID, AA_BEHAVIOR_FLAGS_STRING, 18, (NvU32 *)g_valuesAA_BEHAVIOR_FLAGS, AA_BEHAVIOR_FLAGS_DEFAULT}, - {AA_MODE_ALPHATOCOVERAGE_ID, AA_MODE_ALPHATOCOVERAGE_STRING, 4, (NvU32 *)g_valuesAA_MODE_ALPHATOCOVERAGE, 0x00000000}, - {AA_MODE_GAMMACORRECTION_ID, AA_MODE_GAMMACORRECTION_STRING, 8, (NvU32 *)g_valuesAA_MODE_GAMMACORRECTION, 0x00000000}, - {AA_MODE_METHOD_ID, AA_MODE_METHOD_STRING, 50, (NvU32 *)g_valuesAA_MODE_METHOD, AA_MODE_METHOD_NONE}, - {AA_MODE_REPLAY_ID, AA_MODE_REPLAY_STRING, 20, (NvU32 *)g_valuesAA_MODE_REPLAY, 0x00000000}, - {AA_MODE_SELECTOR_ID, AA_MODE_SELECTOR_STRING, 5, (NvU32 *)g_valuesAA_MODE_SELECTOR, AA_MODE_SELECTOR_APP_CONTROL}, - {AA_MODE_SELECTOR_SLIAA_ID, AA_MODE_SELECTOR_SLIAA_STRING, 2, (NvU32 *)g_valuesAA_MODE_SELECTOR_SLIAA, AA_MODE_SELECTOR_SLIAA_DISABLED}, - {ANISO_MODE_LEVEL_ID, ANISO_MODE_LEVEL_STRING, 5, (NvU32 *)g_valuesANISO_MODE_LEVEL, ANISO_MODE_LEVEL_DEFAULT}, - {ANISO_MODE_SELECTOR_ID, ANISO_MODE_SELECTOR_STRING, 6, (NvU32 *)g_valuesANISO_MODE_SELECTOR, ANISO_MODE_SELECTOR_DEFAULT}, - {ANSEL_ALLOW_ID, ANSEL_ALLOW_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOW, ANSEL_ALLOW_ALLOWED}, - {ANSEL_ALLOWLISTED_ID, ANSEL_ALLOWLISTED_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOWLISTED, ANSEL_ALLOWLISTED_DISALLOWED}, - {ANSEL_ENABLE_ID, ANSEL_ENABLE_STRING, 2, (NvU32 *)g_valuesANSEL_ENABLE, ANSEL_ENABLE_ON}, - {APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING, 6, (NvU32 *)g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED}, - {APPLICATION_STEAM_ID_ID, APPLICATION_STEAM_ID_STRING, 0, NULL, 0x00000000}, - {BATTERY_BOOST_APP_FPS_ID, BATTERY_BOOST_APP_FPS_STRING, 3, (NvU32 *)g_valuesBATTERY_BOOST_APP_FPS, BATTERY_BOOST_APP_FPS_NO_OVERRIDE}, - {CPL_HIDDEN_PROFILE_ID, CPL_HIDDEN_PROFILE_STRING, 2, (NvU32 *)g_valuesCPL_HIDDEN_PROFILE, CPL_HIDDEN_PROFILE_DISABLED}, - {EXPORT_PERF_COUNTERS_ID, EXPORT_PERF_COUNTERS_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS, EXPORT_PERF_COUNTERS_OFF}, - {EXTERNAL_QUIET_MODE_ID, EXTERNAL_QUIET_MODE_STRING, 2, (NvU32 *)g_valuesEXTERNAL_QUIET_MODE, EXTERNAL_QUIET_MODE_OFF}, - {FRL_FPS_ID, FRL_FPS_STRING, 3, (NvU32 *)g_valuesFRL_FPS, FRL_FPS_DISABLED}, - {FXAA_ALLOW_ID, FXAA_ALLOW_STRING, 2, (NvU32 *)g_valuesFXAA_ALLOW, FXAA_ALLOW_ALLOWED}, - {FXAA_ENABLE_ID, FXAA_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_ENABLE, FXAA_ENABLE_OFF}, - {FXAA_INDICATOR_ENABLE_ID, FXAA_INDICATOR_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_INDICATOR_ENABLE, FXAA_INDICATOR_ENABLE_OFF}, - {LATENCY_INDICATOR_AUTOALIGN_ID, LATENCY_INDICATOR_AUTOALIGN_STRING, 2, (NvU32 *)g_valuesLATENCY_INDICATOR_AUTOALIGN, LATENCY_INDICATOR_AUTOALIGN_ENABLED}, - {MCSFRSHOWSPLIT_ID, MCSFRSHOWSPLIT_STRING, 2, (NvU32 *)g_valuesMCSFRSHOWSPLIT, MCSFRSHOWSPLIT_DISABLED}, - {NV_QUALITY_UPSCALING_ID, NV_QUALITY_UPSCALING_STRING, 2, (NvU32 *)g_valuesNV_QUALITY_UPSCALING, NV_QUALITY_UPSCALING_OFF}, - {OPTIMUS_MAXAA_ID, OPTIMUS_MAXAA_STRING, 2, (NvU32 *)g_valuesOPTIMUS_MAXAA, 0x00000000}, - {PHYSXINDICATOR_ID, PHYSXINDICATOR_STRING, 2, (NvU32 *)g_valuesPHYSXINDICATOR, PHYSXINDICATOR_DISABLED}, - {PREFERRED_PSTATE_ID, PREFERRED_PSTATE_STRING, 8, (NvU32 *)g_valuesPREFERRED_PSTATE, PREFERRED_PSTATE_OPTIMAL_POWER}, - {PREVENT_UI_AF_OVERRIDE_ID, PREVENT_UI_AF_OVERRIDE_STRING, 2, (NvU32 *)g_valuesPREVENT_UI_AF_OVERRIDE, PREVENT_UI_AF_OVERRIDE_OFF}, - {SHIM_MAXRES_ID, SHIM_MAXRES_STRING, 0, NULL, 0x00000000}, - {SHIM_MCCOMPAT_ID, SHIM_MCCOMPAT_STRING, 8, (NvU32 *)g_valuesSHIM_MCCOMPAT, SHIM_MCCOMPAT_AUTO_SELECT}, - {SHIM_RENDERING_MODE_ID, SHIM_RENDERING_MODE_STRING, 8, (NvU32 *)g_valuesSHIM_RENDERING_MODE, SHIM_RENDERING_MODE_AUTO_SELECT}, - {SHIM_RENDERING_OPTIONS_ID, SHIM_RENDERING_OPTIONS_STRING, 28, (NvU32 *)g_valuesSHIM_RENDERING_OPTIONS, 0x00000000}, - {SLI_GPU_COUNT_ID, SLI_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_GPU_COUNT, SLI_GPU_COUNT_AUTOSELECT}, - {SLI_PREDEFINED_GPU_COUNT_ID, SLI_PREDEFINED_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT, SLI_PREDEFINED_GPU_COUNT_AUTOSELECT}, - {SLI_PREDEFINED_GPU_COUNT_DX10_ID, SLI_PREDEFINED_GPU_COUNT_DX10_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT_DX10, SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT}, - {SLI_PREDEFINED_MODE_ID, SLI_PREDEFINED_MODE_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE, SLI_PREDEFINED_MODE_AUTOSELECT}, - {SLI_PREDEFINED_MODE_DX10_ID, SLI_PREDEFINED_MODE_DX10_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE_DX10, SLI_PREDEFINED_MODE_DX10_AUTOSELECT}, - {SLI_RENDERING_MODE_ID, SLI_RENDERING_MODE_STRING, 6, (NvU32 *)g_valuesSLI_RENDERING_MODE, SLI_RENDERING_MODE_AUTOSELECT}, - {VRPRERENDERLIMIT_ID, VRPRERENDERLIMIT_STRING, 4, (NvU32 *)g_valuesVRPRERENDERLIMIT, VRPRERENDERLIMIT_DEFAULT}, - {VRRFEATUREINDICATOR_ID, VRRFEATUREINDICATOR_STRING, 2, (NvU32 *)g_valuesVRRFEATUREINDICATOR, VRRFEATUREINDICATOR_ENABLED}, - {VRROVERLAYINDICATOR_ID, VRROVERLAYINDICATOR_STRING, 2, (NvU32 *)g_valuesVRROVERLAYINDICATOR, VRROVERLAYINDICATOR_ENABLED}, - {VRRREQUESTSTATE_ID, VRRREQUESTSTATE_STRING, 3, (NvU32 *)g_valuesVRRREQUESTSTATE, VRRREQUESTSTATE_FULLSCREEN_ONLY}, - {VRR_APP_OVERRIDE_ID, VRR_APP_OVERRIDE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE, VRR_APP_OVERRIDE_ALLOW}, - {VRR_APP_OVERRIDE_REQUEST_STATE_ID, VRR_APP_OVERRIDE_REQUEST_STATE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE_REQUEST_STATE, VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW}, - {VRR_MODE_ID, VRR_MODE_STRING, 3, (NvU32 *)g_valuesVRR_MODE, VRR_MODE_FULLSCREEN_ONLY}, - {VSYNCSMOOTHAFR_ID, VSYNCSMOOTHAFR_STRING, 2, (NvU32 *)g_valuesVSYNCSMOOTHAFR, VSYNCSMOOTHAFR_OFF}, - {VSYNCVRRCONTROL_ID, VSYNCVRRCONTROL_STRING, 3, (NvU32 *)g_valuesVSYNCVRRCONTROL, VSYNCVRRCONTROL_ENABLE}, - {VSYNC_BEHAVIOR_FLAGS_ID, VSYNC_BEHAVIOR_FLAGS_STRING, 3, (NvU32 *)g_valuesVSYNC_BEHAVIOR_FLAGS, VSYNC_BEHAVIOR_FLAGS_DEFAULT}, - {WKS_API_STEREO_EYES_EXCHANGE_ID, WKS_API_STEREO_EYES_EXCHANGE_STRING, 2, (NvU32 *)g_valuesWKS_API_STEREO_EYES_EXCHANGE, WKS_API_STEREO_EYES_EXCHANGE_OFF}, - {WKS_API_STEREO_MODE_ID, WKS_API_STEREO_MODE_STRING, 25, (NvU32 *)g_valuesWKS_API_STEREO_MODE, WKS_API_STEREO_MODE_SHUTTER_GLASSES}, - {WKS_MEMORY_ALLOCATION_POLICY_ID, WKS_MEMORY_ALLOCATION_POLICY_STRING, 3, (NvU32 *)g_valuesWKS_MEMORY_ALLOCATION_POLICY, WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED}, - {WKS_STEREO_DONGLE_SUPPORT_ID, WKS_STEREO_DONGLE_SUPPORT_STRING, 3, (NvU32 *)g_valuesWKS_STEREO_DONGLE_SUPPORT, WKS_STEREO_DONGLE_SUPPORT_DAC}, - {WKS_STEREO_SUPPORT_ID, WKS_STEREO_SUPPORT_STRING, 2, (NvU32 *)g_valuesWKS_STEREO_SUPPORT, WKS_STEREO_SUPPORT_OFF}, - {WKS_STEREO_SWAP_MODE_ID, WKS_STEREO_SWAP_MODE_STRING, 5, (NvU32 *)g_valuesWKS_STEREO_SWAP_MODE, WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL}, - {AO_MODE_ID, AO_MODE_STRING, 4, (NvU32 *)g_valuesAO_MODE, AO_MODE_OFF}, - {AO_MODE_ACTIVE_ID, AO_MODE_ACTIVE_STRING, 2, (NvU32 *)g_valuesAO_MODE_ACTIVE, AO_MODE_ACTIVE_DISABLED}, - {AUTO_LODBIASADJUST_ID, AUTO_LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesAUTO_LODBIASADJUST, AUTO_LODBIASADJUST_ON}, - {EXPORT_PERF_COUNTERS_DX9_ONLY_ID, EXPORT_PERF_COUNTERS_DX9_ONLY_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY, EXPORT_PERF_COUNTERS_DX9_ONLY_OFF}, - {LODBIASADJUST_ID, LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesLODBIASADJUST, 0x00000000}, - {MAXWELL_B_SAMPLE_INTERLEAVE_ID, MAXWELL_B_SAMPLE_INTERLEAVE_STRING, 2, (NvU32 *)g_valuesMAXWELL_B_SAMPLE_INTERLEAVE, MAXWELL_B_SAMPLE_INTERLEAVE_OFF}, - {PRERENDERLIMIT_ID, PRERENDERLIMIT_STRING, 3, (NvU32 *)g_valuesPRERENDERLIMIT, PRERENDERLIMIT_APP_CONTROLLED}, - {PS_SHADERDISKCACHE_ID, PS_SHADERDISKCACHE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE, PS_SHADERDISKCACHE_ON}, - {PS_SHADERDISKCACHE_MAX_SIZE_ID, PS_SHADERDISKCACHE_MAX_SIZE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE_MAX_SIZE, 0x00000000}, - {PS_TEXFILTER_ANISO_OPTS2_ID, PS_TEXFILTER_ANISO_OPTS2_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_ANISO_OPTS2, PS_TEXFILTER_ANISO_OPTS2_OFF}, - {PS_TEXFILTER_BILINEAR_IN_ANISO_ID, PS_TEXFILTER_BILINEAR_IN_ANISO_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO, PS_TEXFILTER_BILINEAR_IN_ANISO_OFF}, - {PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF}, - {PS_TEXFILTER_NO_NEG_LODBIAS_ID, PS_TEXFILTER_NO_NEG_LODBIAS_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_NO_NEG_LODBIAS, PS_TEXFILTER_NO_NEG_LODBIAS_OFF}, - {QUALITY_ENHANCEMENTS_ID, QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesQUALITY_ENHANCEMENTS, QUALITY_ENHANCEMENTS_QUALITY}, - {QUALITY_ENHANCEMENT_SUBSTITUTION_ID, QUALITY_ENHANCEMENT_SUBSTITUTION_STRING, 2, (NvU32 *)g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION, QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION}, - {REFRESH_RATE_OVERRIDE_ID, REFRESH_RATE_OVERRIDE_STRING, 3, (NvU32 *)g_valuesREFRESH_RATE_OVERRIDE, REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED}, - {SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING, 2, (NvU32 *)g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF}, - {SET_VAB_DATA_ID, SET_VAB_DATA_STRING, 6, (NvU32 *)g_valuesSET_VAB_DATA, SET_VAB_DATA_USE_API_DEFAULTS}, - {VSYNCMODE_ID, VSYNCMODE_STRING, 7, (NvU32 *)g_valuesVSYNCMODE, VSYNCMODE_PASSIVE}, - {VSYNCTEARCONTROL_ID, VSYNCTEARCONTROL_STRING, 2, (NvU32 *)g_valuesVSYNCTEARCONTROL, VSYNCTEARCONTROL_DISABLE}, -}; - -SettingWSTRINGNameString mapSettingWSTRING[TOTAL_WSTRING_SETTING_NUM] = -{ - {OGL_IMPLICIT_GPU_AFFINITY_ID, OGL_IMPLICIT_GPU_AFFINITY_STRING, 1, (const wchar_t **)g_valuesOGL_IMPLICIT_GPU_AFFINITY, L"autoselect"}, - {CUDA_EXCLUDED_GPUS_ID, CUDA_EXCLUDED_GPUS_STRING, 1, (const wchar_t **)g_valuesCUDA_EXCLUDED_GPUS, L"none"}, - {D3DOGL_GPU_MAX_POWER_ID, D3DOGL_GPU_MAX_POWER_STRING, 1, (const wchar_t **)g_valuesD3DOGL_GPU_MAX_POWER, L"0"}, - {ICAFE_LOGO_CONFIG_ID, ICAFE_LOGO_CONFIG_STRING, 0, NULL, L""}, -}; - diff --git a/third-party/nvapi-opensource/NvApiDriverSettings.h b/third-party/nvapi-opensource/NvApiDriverSettings.h deleted file mode 100644 index bead3436975..00000000000 --- a/third-party/nvapi-opensource/NvApiDriverSettings.h +++ /dev/null @@ -1,1161 +0,0 @@ -/*****************************************************************************\ -|* *| -|* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. *| -|* *| -|* 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. *| -|* *| -|* *| -\*****************************************************************************/ - -#ifndef _NVAPI_DRIVER_SETTINGS_H_ -#define _NVAPI_DRIVER_SETTINGS_H_ - -#define OGL_AA_LINE_GAMMA_STRING L"Antialiasing - Line gamma" -#define OGL_CPL_GDI_COMPATIBILITY_STRING L"OpenGL GDI compatibility" -#define OGL_CPL_PREFER_DXPRESENT_STRING L"Vulkan/OpenGL present method" -#define OGL_DEEP_COLOR_SCANOUT_STRING L"Deep color for 3D applications" -#define OGL_DEFAULT_SWAP_INTERVAL_STRING L"OpenGL default swap interval" -#define OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING L"OpenGL default swap interval fraction" -#define OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING L"OpenGL default swap interval sign" -#define OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING L"Event Log Severity Threshold" -#define OGL_EXTENSION_STRING_VERSION_STRING L"Extension String version" -#define OGL_FORCE_BLIT_STRING L"Buffer-flipping mode" -#define OGL_FORCE_STEREO_STRING L"Force Stereo shuttering" -#define OGL_IMPLICIT_GPU_AFFINITY_STRING L"Preferred OpenGL GPU" -#define OGL_MAX_FRAMES_ALLOWED_STRING L"Maximum frames allowed" -#define OGL_OVERLAY_PIXEL_TYPE_STRING L"Exported Overlay pixel types" -#define OGL_OVERLAY_SUPPORT_STRING L"Enable overlay" -#define OGL_QUALITY_ENHANCEMENTS_STRING L"High level control of the rendering quality on OpenGL" -#define OGL_SINGLE_BACKDEPTH_BUFFER_STRING L"Unified back/depth buffer" -#define OGL_SLI_CFR_MODE_STRING L"Set CFR mode" -#define OGL_SLI_MULTICAST_STRING L"Enable NV_gpu_multicast extension" -#define OGL_THREAD_CONTROL_STRING L"Threaded optimization" -#define OGL_TMON_LEVEL_STRING L"Event Log Tmon Severity Threshold" -#define OGL_TRIPLE_BUFFER_STRING L"Triple buffering" -#define AA_BEHAVIOR_FLAGS_STRING L"Antialiasing - Behavior Flags" -#define AA_MODE_ALPHATOCOVERAGE_STRING L"Antialiasing - Transparency Multisampling" -#define AA_MODE_GAMMACORRECTION_STRING L"Antialiasing - Gamma correction" -#define AA_MODE_METHOD_STRING L"Antialiasing - Setting" -#define AA_MODE_REPLAY_STRING L"Antialiasing - Transparency Supersampling" -#define AA_MODE_SELECTOR_STRING L"Antialiasing - Mode" -#define AA_MODE_SELECTOR_SLIAA_STRING L"Antialiasing - SLI AA" -#define ANISO_MODE_LEVEL_STRING L"Anisotropic filtering setting" -#define ANISO_MODE_SELECTOR_STRING L"Anisotropic filtering mode" -#define ANSEL_ALLOW_STRING L"NVIDIA Predefined Ansel Usage" -#define ANSEL_ALLOWLISTED_STRING L"Ansel flags for enabled applications" -#define ANSEL_ENABLE_STRING L"Enable Ansel" -#define APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING L"Application Profile Notification Popup Timeout" -#define APPLICATION_STEAM_ID_STRING L"Steam Application ID" -#define BATTERY_BOOST_APP_FPS_STRING L"Battery Boost Application FPS" -#define CPL_HIDDEN_PROFILE_STRING L"Do not display this profile in the Control Panel" -#define CUDA_EXCLUDED_GPUS_STRING L"List of Universal GPU ids" -#define D3DOGL_GPU_MAX_POWER_STRING L"Maximum GPU Power" -#define EXPORT_PERF_COUNTERS_STRING L"Export Performance Counters" -#define EXTERNAL_QUIET_MODE_STRING L"External Quiet Mode (XQM)" -#define FRL_FPS_STRING L"Frame Rate Limiter" -#define FXAA_ALLOW_STRING L"NVIDIA Predefined FXAA Usage" -#define FXAA_ENABLE_STRING L"Enable FXAA" -#define FXAA_INDICATOR_ENABLE_STRING L"Enable FXAA Indicator" -#define LATENCY_INDICATOR_AUTOALIGN_STRING L"Autoalign flash indicator" -#define MCSFRSHOWSPLIT_STRING L"SLI indicator" -#define NV_QUALITY_UPSCALING_STRING L"NVIDIA Quality upscaling" -#define OPTIMUS_MAXAA_STRING L"Maximum AA samples allowed for a given application" -#define PHYSXINDICATOR_STRING L"Display the PhysX indicator" -#define PREFERRED_PSTATE_STRING L"Power management mode" -#define PREVENT_UI_AF_OVERRIDE_STRING L"No override of Anisotropic filtering" -#define SHIM_MAXRES_STRING L"Maximum resolution allowed for a given application" -#define SHIM_MCCOMPAT_STRING L"Optimus flags for enabled applications" -#define SHIM_RENDERING_MODE_STRING L"Enable application for Optimus" -#define SHIM_RENDERING_OPTIONS_STRING L"Shim Rendering Mode Options per application for Optimus" -#define SLI_GPU_COUNT_STRING L"Number of GPUs to use on SLI rendering mode" -#define SLI_PREDEFINED_GPU_COUNT_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode" -#define SLI_PREDEFINED_GPU_COUNT_DX10_STRING L"NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10" -#define SLI_PREDEFINED_MODE_STRING L"NVIDIA predefined SLI mode" -#define SLI_PREDEFINED_MODE_DX10_STRING L"NVIDIA predefined SLI mode on DirectX 10" -#define SLI_RENDERING_MODE_STRING L"SLI rendering mode" -#define VRPRERENDERLIMIT_STRING L"Virtual Reality pre-rendered frames" -#define VRRFEATUREINDICATOR_STRING L"Toggle the VRR global feature" -#define VRROVERLAYINDICATOR_STRING L"Display the VRR Overlay Indicator" -#define VRRREQUESTSTATE_STRING L"VRR requested state" -#define VRR_APP_OVERRIDE_STRING L"G-SYNC" -#define VRR_APP_OVERRIDE_REQUEST_STATE_STRING L"G-SYNC" -#define VRR_MODE_STRING L"Enable G-SYNC globally" -#define VSYNCSMOOTHAFR_STRING L"Flag to control smooth AFR behavior" -#define VSYNCVRRCONTROL_STRING L"Variable refresh Rate" -#define VSYNC_BEHAVIOR_FLAGS_STRING L"Vsync - Behavior Flags" -#define WKS_API_STEREO_EYES_EXCHANGE_STRING L"Stereo - Swap eyes" -#define WKS_API_STEREO_MODE_STRING L"Stereo - Display mode" -#define WKS_MEMORY_ALLOCATION_POLICY_STRING L"Memory Allocation Policy" -#define WKS_STEREO_DONGLE_SUPPORT_STRING L"Stereo - Dongle Support" -#define WKS_STEREO_SUPPORT_STRING L"Stereo - Enable" -#define WKS_STEREO_SWAP_MODE_STRING L"Stereo - swap mode" -#define AO_MODE_STRING L"Ambient Occlusion" -#define AO_MODE_ACTIVE_STRING L"NVIDIA Predefined Ambient Occlusion Usage" -#define AUTO_LODBIASADJUST_STRING L"Texture filtering - Driver Controlled LOD Bias" -#define EXPORT_PERF_COUNTERS_DX9_ONLY_STRING L"Export Performance Counters for DX9 only" -#define ICAFE_LOGO_CONFIG_STRING L"ICafe Settings" -#define LODBIASADJUST_STRING L"Texture filtering - LOD Bias" -#define MAXWELL_B_SAMPLE_INTERLEAVE_STRING L"Enable sample interleaving (MFAA)" -#define PRERENDERLIMIT_STRING L"Maximum pre-rendered frames" -#define PS_SHADERDISKCACHE_STRING L"Shader Cache" -#define PS_SHADERDISKCACHE_MAX_SIZE_STRING L"Shader disk cache maximum size" -#define PS_TEXFILTER_ANISO_OPTS2_STRING L"Texture filtering - Anisotropic sample optimization" -#define PS_TEXFILTER_BILINEAR_IN_ANISO_STRING L"Texture filtering - Anisotropic filter optimization" -#define PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING L"Texture filtering - Trilinear optimization" -#define PS_TEXFILTER_NO_NEG_LODBIAS_STRING L"Texture filtering - Negative LOD bias" -#define QUALITY_ENHANCEMENTS_STRING L"Texture filtering - Quality" -#define QUALITY_ENHANCEMENT_SUBSTITUTION_STRING L"Texture filtering - Quality Substitution" -#define REFRESH_RATE_OVERRIDE_STRING L"Preferred refresh rate" -#define SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING L"PowerThrottle" -#define SET_VAB_DATA_STRING L"VAB Default Data" -#define VSYNCMODE_STRING L"Vertical Sync" -#define VSYNCTEARCONTROL_STRING L"Vertical Sync Tear Control" - -enum ESetting { - OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, - OGL_CPL_GDI_COMPATIBILITY_ID = 0x2072C5A3, - OGL_CPL_PREFER_DXPRESENT_ID = 0x20D690F8, - OGL_DEEP_COLOR_SCANOUT_ID = 0x2097C2F6, - OGL_DEFAULT_SWAP_INTERVAL_ID = 0x206A6582, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID = 0x206C4581, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID = 0x20655CFA, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID = 0x209DF23E, - OGL_EXTENSION_STRING_VERSION_ID = 0x20FF7493, - OGL_FORCE_BLIT_ID = 0x201F619F, - OGL_FORCE_STEREO_ID = 0x204D9A0C, - OGL_IMPLICIT_GPU_AFFINITY_ID = 0x20D0F3E6, - OGL_MAX_FRAMES_ALLOWED_ID = 0x208E55E3, - OGL_OVERLAY_PIXEL_TYPE_ID = 0x209AE66F, - OGL_OVERLAY_SUPPORT_ID = 0x206C28C4, - OGL_QUALITY_ENHANCEMENTS_ID = 0x20797D6C, - OGL_SINGLE_BACKDEPTH_BUFFER_ID = 0x20A29055, - OGL_SLI_CFR_MODE_ID = 0x20343843, - OGL_SLI_MULTICAST_ID = 0x2092D3BE, - OGL_THREAD_CONTROL_ID = 0x20C1221E, - OGL_TMON_LEVEL_ID = 0x202888C1, - OGL_TRIPLE_BUFFER_ID = 0x20FDD1F9, - AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82, - AA_MODE_ALPHATOCOVERAGE_ID = 0x10FC2D9C, - AA_MODE_GAMMACORRECTION_ID = 0x107D639D, - AA_MODE_METHOD_ID = 0x10D773D2, - AA_MODE_REPLAY_ID = 0x10D48A85, - AA_MODE_SELECTOR_ID = 0x107EFC5B, - AA_MODE_SELECTOR_SLIAA_ID = 0x107AFC5B, - ANISO_MODE_LEVEL_ID = 0x101E61A9, - ANISO_MODE_SELECTOR_ID = 0x10D2BB16, - ANSEL_ALLOW_ID = 0x1035DB89, - ANSEL_ALLOWLISTED_ID = 0x1085DA8A, - ANSEL_ENABLE_ID = 0x1075D972, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6, - APPLICATION_STEAM_ID_ID = 0x107CDDBC, - BATTERY_BOOST_APP_FPS_ID = 0x10115C8C, - CPL_HIDDEN_PROFILE_ID = 0x106D5CFF, - CUDA_EXCLUDED_GPUS_ID = 0x10354FF8, - D3DOGL_GPU_MAX_POWER_ID = 0x10D1EF29, - EXPORT_PERF_COUNTERS_ID = 0x108F0841, - EXTERNAL_QUIET_MODE_ID = 0x10115C8D, - FRL_FPS_ID = 0x10835002, - FXAA_ALLOW_ID = 0x1034CB89, - FXAA_ENABLE_ID = 0x1074C972, - FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C, - LATENCY_INDICATOR_AUTOALIGN_ID = 0x1095F170, - MCSFRSHOWSPLIT_ID = 0x10287051, - NV_QUALITY_UPSCALING_ID = 0x10444444, - OPTIMUS_MAXAA_ID = 0x10F9DC83, - PHYSXINDICATOR_ID = 0x1094F16F, - PREFERRED_PSTATE_ID = 0x1057EB71, - PREVENT_UI_AF_OVERRIDE_ID = 0x103BCCB5, - SHIM_MAXRES_ID = 0x10F9DC82, - SHIM_MCCOMPAT_ID = 0x10F9DC80, - SHIM_RENDERING_MODE_ID = 0x10F9DC81, - SHIM_RENDERING_OPTIONS_ID = 0x10F9DC84, - SLI_GPU_COUNT_ID = 0x1033DCD1, - SLI_PREDEFINED_GPU_COUNT_ID = 0x1033DCD2, - SLI_PREDEFINED_GPU_COUNT_DX10_ID = 0x1033DCD3, - SLI_PREDEFINED_MODE_ID = 0x1033CEC1, - SLI_PREDEFINED_MODE_DX10_ID = 0x1033CEC2, - SLI_RENDERING_MODE_ID = 0x1033CED1, - VRPRERENDERLIMIT_ID = 0x10111133, - VRRFEATUREINDICATOR_ID = 0x1094F157, - VRROVERLAYINDICATOR_ID = 0x1095F16F, - VRRREQUESTSTATE_ID = 0x1094F1F7, - VRR_APP_OVERRIDE_ID = 0x10A879CF, - VRR_APP_OVERRIDE_REQUEST_STATE_ID = 0x10A879AC, - VRR_MODE_ID = 0x1194F158, - VSYNCSMOOTHAFR_ID = 0x101AE763, - VSYNCVRRCONTROL_ID = 0x10A879CE, - VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, - WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, - WKS_API_STEREO_MODE_ID = 0x11E91A61, - WKS_MEMORY_ALLOCATION_POLICY_ID = 0x11112233, - WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, - WKS_STEREO_SUPPORT_ID = 0x11AA9E99, - WKS_STEREO_SWAP_MODE_ID = 0x11333333, - AO_MODE_ID = 0x00667329, - AO_MODE_ACTIVE_ID = 0x00664339, - AUTO_LODBIASADJUST_ID = 0x00638E8F, - EXPORT_PERF_COUNTERS_DX9_ONLY_ID = 0x00B65E72, - ICAFE_LOGO_CONFIG_ID = 0x00DB1337, - LODBIASADJUST_ID = 0x00738E8F, - MAXWELL_B_SAMPLE_INTERLEAVE_ID = 0x0098C1AC, - PRERENDERLIMIT_ID = 0x007BA09E, - PS_SHADERDISKCACHE_ID = 0x00198FFF, - PS_SHADERDISKCACHE_MAX_SIZE_ID = 0x00AC8497, - PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, - PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID = 0x002ECAF2, - PS_TEXFILTER_NO_NEG_LODBIAS_ID = 0x0019BB68, - QUALITY_ENHANCEMENTS_ID = 0x00CE2691, - QUALITY_ENHANCEMENT_SUBSTITUTION_ID = 0x00CE2692, - REFRESH_RATE_OVERRIDE_ID = 0x0064B541, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID = 0x00AE785C, - SET_VAB_DATA_ID = 0x00AB8687, - VSYNCMODE_ID = 0x00A879CF, - VSYNCTEARCONTROL_ID = 0x005A375C, - TOTAL_DWORD_SETTING_NUM = 96, - TOTAL_WSTRING_SETTING_NUM = 4, - TOTAL_SETTING_NUM = 100, - INVALID_SETTING_ID = 0xFFFFFFFF -}; - -enum EValues_OGL_AA_LINE_GAMMA { - OGL_AA_LINE_GAMMA_DISABLED = 0x10, - OGL_AA_LINE_GAMMA_ENABLED = 0x23, - OGL_AA_LINE_GAMMA_MIN = 1, - OGL_AA_LINE_GAMMA_MAX = 100, - OGL_AA_LINE_GAMMA_NUM_VALUES = 4, - OGL_AA_LINE_GAMMA_DEFAULT = OGL_AA_LINE_GAMMA_DISABLED -}; - -enum EValues_OGL_CPL_GDI_COMPATIBILITY { - OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED = 0x00000000, - OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED = 0x00000001, - OGL_CPL_GDI_COMPATIBILITY_AUTO = 0x00000002, - OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES = 3, - OGL_CPL_GDI_COMPATIBILITY_DEFAULT = OGL_CPL_GDI_COMPATIBILITY_AUTO -}; - -enum EValues_OGL_CPL_PREFER_DXPRESENT { - OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED = 0x00000000, - OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED = 0x00000001, - OGL_CPL_PREFER_DXPRESENT_AUTO = 0x00000002, - OGL_CPL_PREFER_DXPRESENT_NUM_VALUES = 3, - OGL_CPL_PREFER_DXPRESENT_DEFAULT = OGL_CPL_PREFER_DXPRESENT_AUTO -}; - -enum EValues_OGL_DEEP_COLOR_SCANOUT { - OGL_DEEP_COLOR_SCANOUT_DISABLE = 0, - OGL_DEEP_COLOR_SCANOUT_ENABLE = 1, - OGL_DEEP_COLOR_SCANOUT_NUM_VALUES = 2, - OGL_DEEP_COLOR_SCANOUT_DEFAULT = OGL_DEEP_COLOR_SCANOUT_ENABLE -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL { - OGL_DEFAULT_SWAP_INTERVAL_TEAR = 0, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE = 1, - OGL_DEFAULT_SWAP_INTERVAL_VSYNC = 1, - OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK = 0x0000FFFF, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK = 0xF0000000, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF = 0xF0000000, - OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON = 0x10000000, - OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED = 0x00000000, - OGL_DEFAULT_SWAP_INTERVAL_DISABLE = 0xffffffff, - OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES = 9, - OGL_DEFAULT_SWAP_INTERVAL_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL { - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES = 0, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES = 100, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES = 2, - OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_DEFAULT = 0U -}; - -enum EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN { - OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE = 0, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE = 1, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES = 2, - OGL_DEFAULT_SWAP_INTERVAL_SIGN_DEFAULT = OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE -}; - -enum EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD { - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE = 0, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL = 1, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING = 2, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION = 3, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL = 4, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES = 5, - OGL_EVENT_LOG_SEVERITY_THRESHOLD_DEFAULT = OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL -}; - -enum EValues_OGL_FORCE_BLIT { - OGL_FORCE_BLIT_ON = 1, - OGL_FORCE_BLIT_OFF = 0, - OGL_FORCE_BLIT_NUM_VALUES = 2, - OGL_FORCE_BLIT_DEFAULT = OGL_FORCE_BLIT_OFF -}; - -enum EValues_OGL_FORCE_STEREO { - OGL_FORCE_STEREO_OFF = 0, - OGL_FORCE_STEREO_ON = 1, - OGL_FORCE_STEREO_NUM_VALUES = 2, - OGL_FORCE_STEREO_DEFAULT = OGL_FORCE_STEREO_OFF -}; - -#define OGL_IMPLICIT_GPU_AFFINITY_ENV_VAR L"OGL_DEFAULT_RENDERING_GPU" -#define OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT L"autoselect" -#define OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES 1 -#define OGL_IMPLICIT_GPU_AFFINITY_DEFAULT OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT - -enum EValues_OGL_OVERLAY_PIXEL_TYPE { - OGL_OVERLAY_PIXEL_TYPE_NONE = 0x0, - OGL_OVERLAY_PIXEL_TYPE_CI = 0x1, - OGL_OVERLAY_PIXEL_TYPE_RGBA = 0x2, - OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA = 0x3, - OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES = 4, - OGL_OVERLAY_PIXEL_TYPE_DEFAULT = OGL_OVERLAY_PIXEL_TYPE_CI -}; - -enum EValues_OGL_OVERLAY_SUPPORT { - OGL_OVERLAY_SUPPORT_OFF = 0, - OGL_OVERLAY_SUPPORT_ON = 1, - OGL_OVERLAY_SUPPORT_FORCE_SW = 2, - OGL_OVERLAY_SUPPORT_NUM_VALUES = 3, - OGL_OVERLAY_SUPPORT_DEFAULT = OGL_OVERLAY_SUPPORT_OFF -}; - -enum EValues_OGL_QUALITY_ENHANCEMENTS { - OGL_QUALITY_ENHANCEMENTS_HQUAL = 0xfffffff6, - OGL_QUALITY_ENHANCEMENTS_QUAL = 0, - OGL_QUALITY_ENHANCEMENTS_PERF = 10, - OGL_QUALITY_ENHANCEMENTS_HPERF = 20, - OGL_QUALITY_ENHANCEMENTS_NUM_VALUES = 4, - OGL_QUALITY_ENHANCEMENTS_DEFAULT = OGL_QUALITY_ENHANCEMENTS_QUAL -}; - -enum EValues_OGL_SINGLE_BACKDEPTH_BUFFER { - OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE = 0x0, - OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE = 0x1, - OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT = 0xffffffff, - OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES = 3, - OGL_SINGLE_BACKDEPTH_BUFFER_DEFAULT = OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE -}; - -enum EValues_OGL_SLI_CFR_MODE { - OGL_SLI_CFR_MODE_DISABLE = 0x00, - OGL_SLI_CFR_MODE_ENABLE = 0x01, - OGL_SLI_CFR_MODE_CLASSIC_SFR = 0x02, - OGL_SLI_CFR_MODE_NUM_VALUES = 3, - OGL_SLI_CFR_MODE_DEFAULT = OGL_SLI_CFR_MODE_DISABLE -}; - -enum EValues_OGL_SLI_MULTICAST { - OGL_SLI_MULTICAST_DISABLE = 0x00, - OGL_SLI_MULTICAST_ENABLE = 0x01, - OGL_SLI_MULTICAST_FORCE_DISABLE = 0x02, - OGL_SLI_MULTICAST_ALLOW_MOSAIC = 0x04, - OGL_SLI_MULTICAST_NUM_VALUES = 4, - OGL_SLI_MULTICAST_DEFAULT = OGL_SLI_MULTICAST_DISABLE -}; - -enum EValues_OGL_THREAD_CONTROL { - OGL_THREAD_CONTROL_ENABLE = 0x00000001, - OGL_THREAD_CONTROL_DISABLE = 0x00000002, - OGL_THREAD_CONTROL_NUM_VALUES = 2, - OGL_THREAD_CONTROL_DEFAULT = 0U -}; - -enum EValues_OGL_TMON_LEVEL { - OGL_TMON_LEVEL_DISABLE = 0, - OGL_TMON_LEVEL_CRITICAL = 1, - OGL_TMON_LEVEL_WARNING = 2, - OGL_TMON_LEVEL_INFORMATION = 3, - OGL_TMON_LEVEL_MOST = 4, - OGL_TMON_LEVEL_VERBOSE = 5, - OGL_TMON_LEVEL_NUM_VALUES = 6, - OGL_TMON_LEVEL_DEFAULT = OGL_TMON_LEVEL_MOST -}; - -enum EValues_OGL_TRIPLE_BUFFER { - OGL_TRIPLE_BUFFER_DISABLED = 0x00000000, - OGL_TRIPLE_BUFFER_ENABLED = 0x00000001, - OGL_TRIPLE_BUFFER_NUM_VALUES = 2, - OGL_TRIPLE_BUFFER_DEFAULT = OGL_TRIPLE_BUFFER_DISABLED -}; - -enum EValues_AA_BEHAVIOR_FLAGS { - AA_BEHAVIOR_FLAGS_NONE = 0x00000000, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED = 0x00000001, - AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE = 0x00000002, - AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE = 0x00000003, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED = 0x00000004, - AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE = 0x00000008, - AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE = 0x0000000c, - AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING = 0x00010000, - AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING = 0x00020000, - AA_BEHAVIOR_FLAGS_DISABLE_CPLAA = 0x00040000, - AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE = 0x00080000, - AA_BEHAVIOR_FLAGS_DISABLE_SLIAA = 0x00100000, - AA_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4 = 0xf0000000, - AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT = 28, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4 = 0x0f000000, - AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT = 24, - AA_BEHAVIOR_FLAGS_MASK = 0xff1f000f, - AA_BEHAVIOR_FLAGS_NUM_VALUES = 18, -}; - -enum EValues_AA_MODE_ALPHATOCOVERAGE { - AA_MODE_ALPHATOCOVERAGE_MODE_MASK = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_MODE_OFF = 0x00000000, - AA_MODE_ALPHATOCOVERAGE_MODE_ON = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_MODE_MAX = 0x00000004, - AA_MODE_ALPHATOCOVERAGE_NUM_VALUES = 4, - AA_MODE_ALPHATOCOVERAGE_DEFAULT = 0x00000000 -}; - -enum EValues_AA_MODE_GAMMACORRECTION { - AA_MODE_GAMMACORRECTION_MASK = 0x00000003, - AA_MODE_GAMMACORRECTION_OFF = 0x00000000, - AA_MODE_GAMMACORRECTION_ON_IF_FOS = 0x00000001, - AA_MODE_GAMMACORRECTION_ON_ALWAYS = 0x00000002, - AA_MODE_GAMMACORRECTION_MAX = 0x00000002, - AA_MODE_GAMMACORRECTION_DEFAULT = 0x00000000, - AA_MODE_GAMMACORRECTION_DEFAULT_TESLA = 0x00000002, - AA_MODE_GAMMACORRECTION_DEFAULT_FERMI = 0x00000002, - AA_MODE_GAMMACORRECTION_NUM_VALUES = 8, -}; - -enum EValues_AA_MODE_METHOD { - AA_MODE_METHOD_NONE = 0x0, - AA_MODE_METHOD_SUPERSAMPLE_2X_H = 0x1, - AA_MODE_METHOD_SUPERSAMPLE_2X_V = 0x2, - AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5 = 0x2, - AA_MODE_METHOD_FREE_0x03 = 0x3, - AA_MODE_METHOD_FREE_0x04 = 0x4, - AA_MODE_METHOD_SUPERSAMPLE_4X = 0x5, - AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS = 0x6, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN = 0x7, - AA_MODE_METHOD_FREE_0x08 = 0x8, - AA_MODE_METHOD_FREE_0x09 = 0x9, - AA_MODE_METHOD_SUPERSAMPLE_9X = 0xA, - AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS = 0xB, - AA_MODE_METHOD_SUPERSAMPLE_16X = 0xC, - AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS = 0xD, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL = 0xE, - AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX = 0xF, - AA_MODE_METHOD_MULTISAMPLE_4X = 0x10, - AA_MODE_METHOD_FREE_0x11 = 0x11, - AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN = 0x12, - AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP = 0x13, - AA_MODE_METHOD_FREE_0x14 = 0x14, - AA_MODE_METHOD_FREE_0x15 = 0x15, - AA_MODE_METHOD_MIXEDSAMPLE_6X = 0x16, - AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP = 0x17, - AA_MODE_METHOD_MIXEDSAMPLE_8X = 0x18, - AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP = 0x19, - AA_MODE_METHOD_MIXEDSAMPLE_16X = 0x1a, - AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA = 0x1b, - AA_MODE_METHOD_MULTISAMPLE_16X = 0x1c, - AA_MODE_METHOD_VCAA_32X_8v24 = 0x1d, - AA_MODE_METHOD_CORRUPTION_CHECK = 0x1e, - AA_MODE_METHOD_6X_CT = 0x1f, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA = 0x20, - AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA = 0x21, - AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA = 0x22, - AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA = 0x23, - AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA = 0x24, - AA_MODE_METHOD_MULTISAMPLE_8X = 0x25, - AA_MODE_METHOD_VCAA_8X_4v4 = 0x26, - AA_MODE_METHOD_VCAA_16X_4v12 = 0x27, - AA_MODE_METHOD_VCAA_16X_8v8 = 0x28, - AA_MODE_METHOD_MIXEDSAMPLE_32X = 0x29, - AA_MODE_METHOD_SUPERVCAA_64X_4v12 = 0x2a, - AA_MODE_METHOD_SUPERVCAA_64X_8v8 = 0x2b, - AA_MODE_METHOD_MIXEDSAMPLE_64X = 0x2c, - AA_MODE_METHOD_MIXEDSAMPLE_128X = 0x2d, - AA_MODE_METHOD_COUNT = 0x2e, - AA_MODE_METHOD_METHOD_MASK = 0x0000ffff, - AA_MODE_METHOD_METHOD_MAX = 0xf1c57815, - AA_MODE_METHOD_NUM_VALUES = 50, - AA_MODE_METHOD_DEFAULT = AA_MODE_METHOD_NONE -}; - -enum EValues_AA_MODE_REPLAY { - AA_MODE_REPLAY_SAMPLES_MASK = 0x00000070, - AA_MODE_REPLAY_SAMPLES_ONE = 0x00000000, - AA_MODE_REPLAY_SAMPLES_TWO = 0x00000010, - AA_MODE_REPLAY_SAMPLES_FOUR = 0x00000020, - AA_MODE_REPLAY_SAMPLES_EIGHT = 0x00000030, - AA_MODE_REPLAY_SAMPLES_MAX = 0x00000030, - AA_MODE_REPLAY_MODE_MASK = 0x0000000f, - AA_MODE_REPLAY_MODE_OFF = 0x00000000, - AA_MODE_REPLAY_MODE_ALPHA_TEST = 0x00000001, - AA_MODE_REPLAY_MODE_PIXEL_KILL = 0x00000002, - AA_MODE_REPLAY_MODE_DYN_BRANCH = 0x00000004, - AA_MODE_REPLAY_MODE_OPTIMAL = 0x00000004, - AA_MODE_REPLAY_MODE_ALL = 0x00000008, - AA_MODE_REPLAY_MODE_MAX = 0x0000000f, - AA_MODE_REPLAY_TRANSPARENCY = 0x00000023, - AA_MODE_REPLAY_DISALLOW_TRAA = 0x00000100, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT = 0x00000000, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA = 0x00000000, - AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI = 0x00000000, - AA_MODE_REPLAY_MASK = 0x0000017f, - AA_MODE_REPLAY_NUM_VALUES = 20, - AA_MODE_REPLAY_DEFAULT = 0x00000000 -}; - -enum EValues_AA_MODE_SELECTOR { - AA_MODE_SELECTOR_MASK = 0x00000003, - AA_MODE_SELECTOR_APP_CONTROL = 0x00000000, - AA_MODE_SELECTOR_OVERRIDE = 0x00000001, - AA_MODE_SELECTOR_ENHANCE = 0x00000002, - AA_MODE_SELECTOR_MAX = 0x00000002, - AA_MODE_SELECTOR_NUM_VALUES = 5, - AA_MODE_SELECTOR_DEFAULT = AA_MODE_SELECTOR_APP_CONTROL -}; - -enum EValues_AA_MODE_SELECTOR_SLIAA { - AA_MODE_SELECTOR_SLIAA_DISABLED = 0, - AA_MODE_SELECTOR_SLIAA_ENABLED = 1, - AA_MODE_SELECTOR_SLIAA_NUM_VALUES = 2, - AA_MODE_SELECTOR_SLIAA_DEFAULT = AA_MODE_SELECTOR_SLIAA_DISABLED -}; - -enum EValues_ANISO_MODE_LEVEL { - ANISO_MODE_LEVEL_MASK = 0x0000ffff, - ANISO_MODE_LEVEL_NONE_POINT = 0x00000000, - ANISO_MODE_LEVEL_NONE_LINEAR = 0x00000001, - ANISO_MODE_LEVEL_MAX = 0x00000010, - ANISO_MODE_LEVEL_DEFAULT = 0x00000001, - ANISO_MODE_LEVEL_NUM_VALUES = 5, -}; - -enum EValues_ANISO_MODE_SELECTOR { - ANISO_MODE_SELECTOR_MASK = 0x0000000f, - ANISO_MODE_SELECTOR_APP = 0x00000000, - ANISO_MODE_SELECTOR_USER = 0x00000001, - ANISO_MODE_SELECTOR_COND = 0x00000002, - ANISO_MODE_SELECTOR_MAX = 0x00000002, - ANISO_MODE_SELECTOR_DEFAULT = 0x00000000, - ANISO_MODE_SELECTOR_NUM_VALUES = 6, -}; - -enum EValues_ANSEL_ALLOW { - ANSEL_ALLOW_DISALLOWED = 0, - ANSEL_ALLOW_ALLOWED = 1, - ANSEL_ALLOW_NUM_VALUES = 2, - ANSEL_ALLOW_DEFAULT = ANSEL_ALLOW_ALLOWED -}; - -enum EValues_ANSEL_ALLOWLISTED { - ANSEL_ALLOWLISTED_DISALLOWED = 0, - ANSEL_ALLOWLISTED_ALLOWED = 1, - ANSEL_ALLOWLISTED_NUM_VALUES = 2, - ANSEL_ALLOWLISTED_DEFAULT = ANSEL_ALLOWLISTED_DISALLOWED -}; - -enum EValues_ANSEL_ENABLE { - ANSEL_ENABLE_OFF = 0, - ANSEL_ENABLE_ON = 1, - ANSEL_ENABLE_NUM_VALUES = 2, - ANSEL_ENABLE_DEFAULT = ANSEL_ENABLE_ON -}; - -enum EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT { - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED = 0, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS = 9, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS = 15, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS = 30, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE = 60, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES = 120, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES = 6, - APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DEFAULT = APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED -}; - -enum EValues_BATTERY_BOOST_APP_FPS { - BATTERY_BOOST_APP_FPS_MIN = 0x00000001, - BATTERY_BOOST_APP_FPS_MAX = 0x000003ff, - BATTERY_BOOST_APP_FPS_NO_OVERRIDE = 0x00000000, - BATTERY_BOOST_APP_FPS_NUM_VALUES = 3, - BATTERY_BOOST_APP_FPS_DEFAULT = BATTERY_BOOST_APP_FPS_NO_OVERRIDE -}; - -enum EValues_CPL_HIDDEN_PROFILE { - CPL_HIDDEN_PROFILE_DISABLED = 0, - CPL_HIDDEN_PROFILE_ENABLED = 1, - CPL_HIDDEN_PROFILE_NUM_VALUES = 2, - CPL_HIDDEN_PROFILE_DEFAULT = CPL_HIDDEN_PROFILE_DISABLED -}; - -#define CUDA_EXCLUDED_GPUS_NONE L"none" -#define CUDA_EXCLUDED_GPUS_NUM_VALUES 1 -#define CUDA_EXCLUDED_GPUS_DEFAULT CUDA_EXCLUDED_GPUS_NONE - -#define D3DOGL_GPU_MAX_POWER_DEFAULTPOWER L"0" -#define D3DOGL_GPU_MAX_POWER_NUM_VALUES 1 -#define D3DOGL_GPU_MAX_POWER_DEFAULT D3DOGL_GPU_MAX_POWER_DEFAULTPOWER - -enum EValues_EXPORT_PERF_COUNTERS { - EXPORT_PERF_COUNTERS_OFF = 0x00000000, - EXPORT_PERF_COUNTERS_ON = 0x00000001, - EXPORT_PERF_COUNTERS_NUM_VALUES = 2, - EXPORT_PERF_COUNTERS_DEFAULT = EXPORT_PERF_COUNTERS_OFF -}; - -enum EValues_EXTERNAL_QUIET_MODE { - EXTERNAL_QUIET_MODE_ON = 0x00000001, - EXTERNAL_QUIET_MODE_OFF = 0x00000000, - EXTERNAL_QUIET_MODE_NUM_VALUES = 2, - EXTERNAL_QUIET_MODE_DEFAULT = EXTERNAL_QUIET_MODE_OFF -}; - -enum EValues_FRL_FPS { - FRL_FPS_DISABLED = 0x00000000, - FRL_FPS_MIN = 0x00000000, - FRL_FPS_MAX = 0x000003ff, - FRL_FPS_NUM_VALUES = 3, - FRL_FPS_DEFAULT = FRL_FPS_DISABLED -}; - -enum EValues_FXAA_ALLOW { - FXAA_ALLOW_DISALLOWED = 0, - FXAA_ALLOW_ALLOWED = 1, - FXAA_ALLOW_NUM_VALUES = 2, - FXAA_ALLOW_DEFAULT = FXAA_ALLOW_ALLOWED -}; - -enum EValues_FXAA_ENABLE { - FXAA_ENABLE_OFF = 0, - FXAA_ENABLE_ON = 1, - FXAA_ENABLE_NUM_VALUES = 2, - FXAA_ENABLE_DEFAULT = FXAA_ENABLE_OFF -}; - -enum EValues_FXAA_INDICATOR_ENABLE { - FXAA_INDICATOR_ENABLE_OFF = 0, - FXAA_INDICATOR_ENABLE_ON = 1, - FXAA_INDICATOR_ENABLE_NUM_VALUES = 2, - FXAA_INDICATOR_ENABLE_DEFAULT = FXAA_INDICATOR_ENABLE_OFF -}; - -enum EValues_LATENCY_INDICATOR_AUTOALIGN { - LATENCY_INDICATOR_AUTOALIGN_DISABLED = 0x0, - LATENCY_INDICATOR_AUTOALIGN_ENABLED = 0x1, - LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES = 2, - LATENCY_INDICATOR_AUTOALIGN_DEFAULT = LATENCY_INDICATOR_AUTOALIGN_ENABLED -}; - -enum EValues_MCSFRSHOWSPLIT { - MCSFRSHOWSPLIT_DISABLED = 0x34534064, - MCSFRSHOWSPLIT_ENABLED = 0x24545582, - MCSFRSHOWSPLIT_NUM_VALUES = 2, - MCSFRSHOWSPLIT_DEFAULT = MCSFRSHOWSPLIT_DISABLED -}; - -enum EValues_NV_QUALITY_UPSCALING { - NV_QUALITY_UPSCALING_OFF = 0, - NV_QUALITY_UPSCALING_ON = 1, - NV_QUALITY_UPSCALING_NUM_VALUES = 2, - NV_QUALITY_UPSCALING_DEFAULT = NV_QUALITY_UPSCALING_OFF -}; - -enum EValues_OPTIMUS_MAXAA { - OPTIMUS_MAXAA_MIN = 0, - OPTIMUS_MAXAA_MAX = 16, - OPTIMUS_MAXAA_NUM_VALUES = 2, - OPTIMUS_MAXAA_DEFAULT = 0 -}; - -enum EValues_PHYSXINDICATOR { - PHYSXINDICATOR_DISABLED = 0x34534064, - PHYSXINDICATOR_ENABLED = 0x24545582, - PHYSXINDICATOR_NUM_VALUES = 2, - PHYSXINDICATOR_DEFAULT = PHYSXINDICATOR_DISABLED -}; - -enum EValues_PREFERRED_PSTATE { - PREFERRED_PSTATE_ADAPTIVE = 0x00000000, - PREFERRED_PSTATE_PREFER_MAX = 0x00000001, - PREFERRED_PSTATE_DRIVER_CONTROLLED = 0x00000002, - PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE = 0x00000003, - PREFERRED_PSTATE_PREFER_MIN = 0x00000004, - PREFERRED_PSTATE_OPTIMAL_POWER = 0x00000005, - PREFERRED_PSTATE_MIN = 0x00000000, - PREFERRED_PSTATE_MAX = 0x00000005, - PREFERRED_PSTATE_NUM_VALUES = 8, - PREFERRED_PSTATE_DEFAULT = PREFERRED_PSTATE_OPTIMAL_POWER -}; - -enum EValues_PREVENT_UI_AF_OVERRIDE { - PREVENT_UI_AF_OVERRIDE_OFF = 0, - PREVENT_UI_AF_OVERRIDE_ON = 1, - PREVENT_UI_AF_OVERRIDE_NUM_VALUES = 2, - PREVENT_UI_AF_OVERRIDE_DEFAULT = PREVENT_UI_AF_OVERRIDE_OFF -}; - -enum EValues_SHIM_MCCOMPAT { - SHIM_MCCOMPAT_INTEGRATED = 0x00000000U, - SHIM_MCCOMPAT_ENABLE = 0x00000001U, - SHIM_MCCOMPAT_USER_EDITABLE = 0x00000002U, - SHIM_MCCOMPAT_MASK = 0x00000003U, - SHIM_MCCOMPAT_VIDEO_MASK = 0x00000004U, - SHIM_MCCOMPAT_VARYING_BIT = 0x00000008U, - SHIM_MCCOMPAT_AUTO_SELECT = 0x00000010U, - SHIM_MCCOMPAT_OVERRIDE_BIT = 0x80000000U, - SHIM_MCCOMPAT_NUM_VALUES = 8, - SHIM_MCCOMPAT_DEFAULT = SHIM_MCCOMPAT_AUTO_SELECT -}; - -enum EValues_SHIM_RENDERING_MODE { - SHIM_RENDERING_MODE_INTEGRATED = 0x00000000U, - SHIM_RENDERING_MODE_ENABLE = 0x00000001U, - SHIM_RENDERING_MODE_USER_EDITABLE = 0x00000002U, - SHIM_RENDERING_MODE_MASK = 0x00000003U, - SHIM_RENDERING_MODE_VIDEO_MASK = 0x00000004U, - SHIM_RENDERING_MODE_VARYING_BIT = 0x00000008U, - SHIM_RENDERING_MODE_AUTO_SELECT = 0x00000010U, - SHIM_RENDERING_MODE_OVERRIDE_BIT = 0x80000000U, - SHIM_RENDERING_MODE_NUM_VALUES = 8, - SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT -}; - -enum EValues_SHIM_RENDERING_OPTIONS { - SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE = 0x00000000U, - SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT = 0x00000001U, - SHIM_RENDERING_OPTIONS_EHSHELL_DETECT = 0x00000002U, - SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT = 0x00000004U, - SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT = 0x00000008U, - SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES = 0x00000010U, - SHIM_RENDERING_OPTIONS_RESERVED1 = 0x00000020U, - SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT = 0x00000040U, - SHIM_RENDERING_OPTIONS_RESERVED2 = 0x00000080U, - SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE = 0x00000100U, - SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS = 0x00000200U, - SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS = 0x00000400U, - SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS = 0x00000800U, - SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT = 0x00001000U, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING = 0x00002000U, - SHIM_RENDERING_OPTIONS_DISABLE_CUDA = 0x00004000U, - SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO = 0x00008000U, - SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS = 0x00010000U, - SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT = 0x00020000U, - SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO = 0x00040000U, - SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID = 0x00080000U, - SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD = 0x00100000U, - SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT = 0x00200000U, - SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG = 0x00400000U, - SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP = 0x00800000U, - SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x01000000U, - SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH = 0x02000000U, - SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY = 0x04000000U, - SHIM_RENDERING_OPTIONS_NUM_VALUES = 28, - SHIM_RENDERING_OPTIONS_DEFAULT = 0x00000000U -}; - -enum EValues_SLI_GPU_COUNT { - SLI_GPU_COUNT_AUTOSELECT = 0x00000000, - SLI_GPU_COUNT_ONE = 0x00000001, - SLI_GPU_COUNT_TWO = 0x00000002, - SLI_GPU_COUNT_THREE = 0x00000003, - SLI_GPU_COUNT_FOUR = 0x00000004, - SLI_GPU_COUNT_NUM_VALUES = 5, - SLI_GPU_COUNT_DEFAULT = SLI_GPU_COUNT_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_GPU_COUNT { - SLI_PREDEFINED_GPU_COUNT_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_GPU_COUNT_ONE = 0x00000001, - SLI_PREDEFINED_GPU_COUNT_TWO = 0x00000002, - SLI_PREDEFINED_GPU_COUNT_THREE = 0x00000003, - SLI_PREDEFINED_GPU_COUNT_FOUR = 0x00000004, - SLI_PREDEFINED_GPU_COUNT_NUM_VALUES = 5, - SLI_PREDEFINED_GPU_COUNT_DEFAULT = SLI_PREDEFINED_GPU_COUNT_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_GPU_COUNT_DX10 { - SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_GPU_COUNT_DX10_ONE = 0x00000001, - SLI_PREDEFINED_GPU_COUNT_DX10_TWO = 0x00000002, - SLI_PREDEFINED_GPU_COUNT_DX10_THREE = 0x00000003, - SLI_PREDEFINED_GPU_COUNT_DX10_FOUR = 0x00000004, - SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES = 5, - SLI_PREDEFINED_GPU_COUNT_DX10_DEFAULT = SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_MODE { - SLI_PREDEFINED_MODE_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_MODE_FORCE_SINGLE = 0x00000001, - SLI_PREDEFINED_MODE_FORCE_AFR = 0x00000002, - SLI_PREDEFINED_MODE_FORCE_AFR2 = 0x00000003, - SLI_PREDEFINED_MODE_FORCE_SFR = 0x00000004, - SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_PREDEFINED_MODE_NUM_VALUES = 6, - SLI_PREDEFINED_MODE_DEFAULT = SLI_PREDEFINED_MODE_AUTOSELECT -}; - -enum EValues_SLI_PREDEFINED_MODE_DX10 { - SLI_PREDEFINED_MODE_DX10_AUTOSELECT = 0x00000000, - SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE = 0x00000001, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR = 0x00000002, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR2 = 0x00000003, - SLI_PREDEFINED_MODE_DX10_FORCE_SFR = 0x00000004, - SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_PREDEFINED_MODE_DX10_NUM_VALUES = 6, - SLI_PREDEFINED_MODE_DX10_DEFAULT = SLI_PREDEFINED_MODE_DX10_AUTOSELECT -}; - -enum EValues_SLI_RENDERING_MODE { - SLI_RENDERING_MODE_AUTOSELECT = 0x00000000, - SLI_RENDERING_MODE_FORCE_SINGLE = 0x00000001, - SLI_RENDERING_MODE_FORCE_AFR = 0x00000002, - SLI_RENDERING_MODE_FORCE_AFR2 = 0x00000003, - SLI_RENDERING_MODE_FORCE_SFR = 0x00000004, - SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR = 0x00000005, - SLI_RENDERING_MODE_NUM_VALUES = 6, - SLI_RENDERING_MODE_DEFAULT = SLI_RENDERING_MODE_AUTOSELECT -}; - -enum EValues_VRPRERENDERLIMIT { - VRPRERENDERLIMIT_MIN = 0x00, - VRPRERENDERLIMIT_MAX = 0xff, - VRPRERENDERLIMIT_APP_CONTROLLED = 0x00, - VRPRERENDERLIMIT_DEFAULT = 0x01, - VRPRERENDERLIMIT_NUM_VALUES = 4, -}; - -enum EValues_VRRFEATUREINDICATOR { - VRRFEATUREINDICATOR_DISABLED = 0x0, - VRRFEATUREINDICATOR_ENABLED = 0x1, - VRRFEATUREINDICATOR_NUM_VALUES = 2, - VRRFEATUREINDICATOR_DEFAULT = VRRFEATUREINDICATOR_ENABLED -}; - -enum EValues_VRROVERLAYINDICATOR { - VRROVERLAYINDICATOR_DISABLED = 0x0, - VRROVERLAYINDICATOR_ENABLED = 0x1, - VRROVERLAYINDICATOR_NUM_VALUES = 2, - VRROVERLAYINDICATOR_DEFAULT = VRROVERLAYINDICATOR_ENABLED -}; - -enum EValues_VRRREQUESTSTATE { - VRRREQUESTSTATE_DISABLED = 0x0, - VRRREQUESTSTATE_FULLSCREEN_ONLY = 0x1, - VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED = 0x2, - VRRREQUESTSTATE_NUM_VALUES = 3, - VRRREQUESTSTATE_DEFAULT = VRRREQUESTSTATE_FULLSCREEN_ONLY -}; - -enum EValues_VRR_APP_OVERRIDE { - VRR_APP_OVERRIDE_ALLOW = 0, - VRR_APP_OVERRIDE_FORCE_OFF = 1, - VRR_APP_OVERRIDE_DISALLOW = 2, - VRR_APP_OVERRIDE_ULMB = 3, - VRR_APP_OVERRIDE_FIXED_REFRESH = 4, - VRR_APP_OVERRIDE_NUM_VALUES = 5, - VRR_APP_OVERRIDE_DEFAULT = VRR_APP_OVERRIDE_ALLOW -}; - -enum EValues_VRR_APP_OVERRIDE_REQUEST_STATE { - VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW = 0, - VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF = 1, - VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW = 2, - VRR_APP_OVERRIDE_REQUEST_STATE_ULMB = 3, - VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH = 4, - VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES = 5, - VRR_APP_OVERRIDE_REQUEST_STATE_DEFAULT = VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW -}; - -enum EValues_VRR_MODE { - VRR_MODE_DISABLED = 0x0, - VRR_MODE_FULLSCREEN_ONLY = 0x1, - VRR_MODE_FULLSCREEN_AND_WINDOWED = 0x2, - VRR_MODE_NUM_VALUES = 3, - VRR_MODE_DEFAULT = VRR_MODE_FULLSCREEN_ONLY -}; - -enum EValues_VSYNCSMOOTHAFR { - VSYNCSMOOTHAFR_OFF = 0x00000000, - VSYNCSMOOTHAFR_ON = 0x00000001, - VSYNCSMOOTHAFR_NUM_VALUES = 2, - VSYNCSMOOTHAFR_DEFAULT = VSYNCSMOOTHAFR_OFF -}; - -enum EValues_VSYNCVRRCONTROL { - VSYNCVRRCONTROL_DISABLE = 0x00000000, - VSYNCVRRCONTROL_ENABLE = 0x00000001, - VSYNCVRRCONTROL_NOTSUPPORTED = 0x9f95128e, - VSYNCVRRCONTROL_NUM_VALUES = 3, - VSYNCVRRCONTROL_DEFAULT = VSYNCVRRCONTROL_ENABLE -}; - -enum EValues_VSYNC_BEHAVIOR_FLAGS { - VSYNC_BEHAVIOR_FLAGS_NONE = 0x00000000, - VSYNC_BEHAVIOR_FLAGS_DEFAULT = 0x00000000, - VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE = 0x00000001, - VSYNC_BEHAVIOR_FLAGS_NUM_VALUES = 3, -}; - -enum EValues_WKS_API_STEREO_EYES_EXCHANGE { - WKS_API_STEREO_EYES_EXCHANGE_OFF = 0, - WKS_API_STEREO_EYES_EXCHANGE_ON = 1, - WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES = 2, - WKS_API_STEREO_EYES_EXCHANGE_DEFAULT = WKS_API_STEREO_EYES_EXCHANGE_OFF -}; - -enum EValues_WKS_API_STEREO_MODE { - WKS_API_STEREO_MODE_SHUTTER_GLASSES = 0, - WKS_API_STEREO_MODE_VERTICAL_INTERLACED = 1, - WKS_API_STEREO_MODE_TWINVIEW = 2, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO = 3, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0 = 4, - WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1 = 5, - WKS_API_STEREO_MODE_COLOR_LINE = 6, - WKS_API_STEREO_MODE_COLOR_INTERLEAVED = 7, - WKS_API_STEREO_MODE_ANAGLYPH = 8, - WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED = 9, - WKS_API_STEREO_MODE_SIDE_FIELD = 10, - WKS_API_STEREO_MODE_SUB_FIELD = 11, - WKS_API_STEREO_MODE_CHECKERBOARD = 12, - WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD = 13, - WKS_API_STEREO_MODE_TRIDELITY_SL = 14, - WKS_API_STEREO_MODE_TRIDELITY_MV = 15, - WKS_API_STEREO_MODE_SEEFRONT = 16, - WKS_API_STEREO_MODE_STEREO_MIRROR = 17, - WKS_API_STEREO_MODE_FRAME_SEQUENTIAL = 18, - WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE = 19, - WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL = 20, - WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL = 21, - WKS_API_STEREO_MODE_DP_INBAND = 22, - WKS_API_STEREO_MODE_USE_HW_DEFAULT = 0xffffffff, - WKS_API_STEREO_MODE_DEFAULT_GL = 3, - WKS_API_STEREO_MODE_NUM_VALUES = 25, - WKS_API_STEREO_MODE_DEFAULT = WKS_API_STEREO_MODE_SHUTTER_GLASSES -}; - -enum EValues_WKS_MEMORY_ALLOCATION_POLICY { - WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED = 0x0, - WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION = 0x1, - WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION = 0x2, - WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES = 3, - WKS_MEMORY_ALLOCATION_POLICY_DEFAULT = WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED -}; - -enum EValues_WKS_STEREO_DONGLE_SUPPORT { - WKS_STEREO_DONGLE_SUPPORT_OFF = 0, - WKS_STEREO_DONGLE_SUPPORT_DAC = 1, - WKS_STEREO_DONGLE_SUPPORT_DLP = 2, - WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES = 3, - WKS_STEREO_DONGLE_SUPPORT_DEFAULT = WKS_STEREO_DONGLE_SUPPORT_DAC -}; - -enum EValues_WKS_STEREO_SUPPORT { - WKS_STEREO_SUPPORT_OFF = 0, - WKS_STEREO_SUPPORT_ON = 1, - WKS_STEREO_SUPPORT_NUM_VALUES = 2, - WKS_STEREO_SUPPORT_DEFAULT = WKS_STEREO_SUPPORT_OFF -}; - -enum EValues_WKS_STEREO_SWAP_MODE { - WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL = 0x0, - WKS_STEREO_SWAP_MODE_PER_EYE = 0x1, - WKS_STEREO_SWAP_MODE_PER_EYE_PAIR = 0x2, - WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR = 0x3, - WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP = 0x4, - WKS_STEREO_SWAP_MODE_NUM_VALUES = 5, - WKS_STEREO_SWAP_MODE_DEFAULT = WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL -}; - -enum EValues_AO_MODE { - AO_MODE_OFF = 0, - AO_MODE_LOW = 1, - AO_MODE_MEDIUM = 2, - AO_MODE_HIGH = 3, - AO_MODE_NUM_VALUES = 4, - AO_MODE_DEFAULT = AO_MODE_OFF -}; - -enum EValues_AO_MODE_ACTIVE { - AO_MODE_ACTIVE_DISABLED = 0, - AO_MODE_ACTIVE_ENABLED = 1, - AO_MODE_ACTIVE_NUM_VALUES = 2, - AO_MODE_ACTIVE_DEFAULT = AO_MODE_ACTIVE_DISABLED -}; - -enum EValues_AUTO_LODBIASADJUST { - AUTO_LODBIASADJUST_OFF = 0x00000000, - AUTO_LODBIASADJUST_ON = 0x00000001, - AUTO_LODBIASADJUST_NUM_VALUES = 2, - AUTO_LODBIASADJUST_DEFAULT = AUTO_LODBIASADJUST_ON -}; - -enum EValues_EXPORT_PERF_COUNTERS_DX9_ONLY { - EXPORT_PERF_COUNTERS_DX9_ONLY_OFF = 0x00000000, - EXPORT_PERF_COUNTERS_DX9_ONLY_ON = 0x00000001, - EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES = 2, - EXPORT_PERF_COUNTERS_DX9_ONLY_DEFAULT = EXPORT_PERF_COUNTERS_DX9_ONLY_OFF -}; - -enum EValues_LODBIASADJUST { - LODBIASADJUST_MIN = 0xffffff80, - LODBIASADJUST_MAX = 128, - LODBIASADJUST_NUM_VALUES = 2, - LODBIASADJUST_DEFAULT = 0 -}; - -enum EValues_MAXWELL_B_SAMPLE_INTERLEAVE { - MAXWELL_B_SAMPLE_INTERLEAVE_OFF = 0, - MAXWELL_B_SAMPLE_INTERLEAVE_ON = 1, - MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES = 2, - MAXWELL_B_SAMPLE_INTERLEAVE_DEFAULT = MAXWELL_B_SAMPLE_INTERLEAVE_OFF -}; - -enum EValues_PRERENDERLIMIT { - PRERENDERLIMIT_MIN = 0x00, - PRERENDERLIMIT_MAX = 0xff, - PRERENDERLIMIT_APP_CONTROLLED = 0x00, - PRERENDERLIMIT_NUM_VALUES = 3, - PRERENDERLIMIT_DEFAULT = PRERENDERLIMIT_APP_CONTROLLED -}; - -enum EValues_PS_SHADERDISKCACHE { - PS_SHADERDISKCACHE_OFF = 0x00000000, - PS_SHADERDISKCACHE_ON = 0x00000001, - PS_SHADERDISKCACHE_NUM_VALUES = 2, - PS_SHADERDISKCACHE_DEFAULT = PS_SHADERDISKCACHE_ON -}; - -enum EValues_PS_SHADERDISKCACHE_MAX_SIZE { - PS_SHADERDISKCACHE_MAX_SIZE_MIN = 0x0, - PS_SHADERDISKCACHE_MAX_SIZE_MAX = 0xffffffff, - PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES = 2, - PS_SHADERDISKCACHE_MAX_SIZE_DEFAULT = 0x1000 -}; - -enum EValues_PS_TEXFILTER_ANISO_OPTS2 { - PS_TEXFILTER_ANISO_OPTS2_OFF = 0x00000000, - PS_TEXFILTER_ANISO_OPTS2_ON = 0x00000001, - PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES = 2, - PS_TEXFILTER_ANISO_OPTS2_DEFAULT = PS_TEXFILTER_ANISO_OPTS2_OFF -}; - -enum EValues_PS_TEXFILTER_BILINEAR_IN_ANISO { - PS_TEXFILTER_BILINEAR_IN_ANISO_OFF = 0x00000000, - PS_TEXFILTER_BILINEAR_IN_ANISO_ON = 0x00000001, - PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES = 2, - PS_TEXFILTER_BILINEAR_IN_ANISO_DEFAULT = PS_TEXFILTER_BILINEAR_IN_ANISO_OFF -}; - -enum EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE { - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF = 0x00000000, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON = 0x00000001, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES = 2, - PS_TEXFILTER_DISABLE_TRILIN_SLOPE_DEFAULT = PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF -}; - -enum EValues_PS_TEXFILTER_NO_NEG_LODBIAS { - PS_TEXFILTER_NO_NEG_LODBIAS_OFF = 0x00000000, - PS_TEXFILTER_NO_NEG_LODBIAS_ON = 0x00000001, - PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES = 2, - PS_TEXFILTER_NO_NEG_LODBIAS_DEFAULT = PS_TEXFILTER_NO_NEG_LODBIAS_OFF -}; - -enum EValues_QUALITY_ENHANCEMENTS { - QUALITY_ENHANCEMENTS_HIGHQUALITY = 0xfffffff6, - QUALITY_ENHANCEMENTS_QUALITY = 0x00000000, - QUALITY_ENHANCEMENTS_PERFORMANCE = 0x0000000a, - QUALITY_ENHANCEMENTS_HIGHPERFORMANCE = 0x00000014, - QUALITY_ENHANCEMENTS_NUM_VALUES = 4, - QUALITY_ENHANCEMENTS_DEFAULT = QUALITY_ENHANCEMENTS_QUALITY -}; - -enum EValues_QUALITY_ENHANCEMENT_SUBSTITUTION { - QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION = 0x00000000, - QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY = 0x00000001, - QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES = 2, - QUALITY_ENHANCEMENT_SUBSTITUTION_DEFAULT = QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION -}; - -enum EValues_REFRESH_RATE_OVERRIDE { - REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED = 0x00000000, - REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE = 0x00000001, - REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK = 0x00000FF0, - REFRESH_RATE_OVERRIDE_NUM_VALUES = 3, - REFRESH_RATE_OVERRIDE_DEFAULT = REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED -}; - -enum EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE { - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF = 0x00000000, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON = 0x00000001, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES = 2, - SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_DEFAULT = SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF -}; - -enum EValues_SET_VAB_DATA { - SET_VAB_DATA_ZERO = 0x00000000, - SET_VAB_DATA_UINT_ONE = 0x00000001, - SET_VAB_DATA_FLOAT_ONE = 0x3f800000, - SET_VAB_DATA_FLOAT_POS_INF = 0x7f800000, - SET_VAB_DATA_FLOAT_NAN = 0x7fc00000, - SET_VAB_DATA_USE_API_DEFAULTS = 0xffffffff, - SET_VAB_DATA_NUM_VALUES = 6, - SET_VAB_DATA_DEFAULT = SET_VAB_DATA_USE_API_DEFAULTS -}; - -enum EValues_VSYNCMODE { - VSYNCMODE_PASSIVE = 0x60925292, - VSYNCMODE_FORCEOFF = 0x08416747, - VSYNCMODE_FORCEON = 0x47814940, - VSYNCMODE_FLIPINTERVAL2 = 0x32610244, - VSYNCMODE_FLIPINTERVAL3 = 0x71271021, - VSYNCMODE_FLIPINTERVAL4 = 0x13245256, - VSYNCMODE_VIRTUAL = 0x18888888, - VSYNCMODE_NUM_VALUES = 7, - VSYNCMODE_DEFAULT = VSYNCMODE_PASSIVE -}; - -enum EValues_VSYNCTEARCONTROL { - VSYNCTEARCONTROL_DISABLE = 0x96861077, - VSYNCTEARCONTROL_ENABLE = 0x99941284, - VSYNCTEARCONTROL_NUM_VALUES = 2, - VSYNCTEARCONTROL_DEFAULT = VSYNCTEARCONTROL_DISABLE -}; - - - -typedef struct _SettingDWORDNameString { - NvU32 settingId; - const wchar_t * settingNameString; - NvU32 numSettingValues; - NvU32 *settingValues; - NvU32 defaultValue; -} SettingDWORDNameString; - -typedef struct _SettingWSTRINGNameString { - NvU32 settingId; - const wchar_t * settingNameString; - NvU32 numSettingValues; - const wchar_t **settingValues; - const wchar_t * defaultValue; -} SettingWSTRINGNameString; - - -#endif // _NVAPI_DRIVER_SETTINGS_H_ - diff --git a/third-party/nvapi-opensource/nvapi.h b/third-party/nvapi-opensource/nvapi.h deleted file mode 100644 index 5b68aeb39a0..00000000000 --- a/third-party/nvapi-opensource/nvapi.h +++ /dev/null @@ -1,25148 +0,0 @@ -/*****************************************************************************\ -|* *| -|* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. *| -|* *| -|* 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. *| -|* *| -|* *| -\*****************************************************************************/ -/////////////////////////////////////////////////////////////////////////////// -// -// Date: Feb 27, 2023 -// File: nvapi.h -// -// NvAPI provides an interface to NVIDIA devices. This file contains the -// interface constants, structure definitions and function prototypes. -// -// Target Profile: Open-Source -// Target Platform: windows -// -/////////////////////////////////////////////////////////////////////////////// -#ifndef _NVAPI_H -#define _NVAPI_H - -#pragma pack(push,8) // Make sure we have consistent structure packings - -#ifdef __cplusplus -extern "C" { -#endif -// ==================================================== -// Universal NvAPI Definitions -// ==================================================== -#ifndef _WIN32 -#define __cdecl -#endif - -// ==================================================== -// SAL related support -// ==================================================== - -#ifndef __ecount - #define __nvapi_undef__ecount - #define __ecount(size) -#endif -#ifndef __bcount - #define __nvapi_undef__bcount - #define __bcount(size) -#endif -#ifndef __in - #define __nvapi_undef__in - #define __in -#endif -#ifndef __in_ecount - #define __nvapi_undef__in_ecount - #define __in_ecount(size) -#endif -#ifndef __in_bcount - #define __nvapi_undef__in_bcount - #define __in_bcount(size) -#endif -#ifndef __in_z - #define __nvapi_undef__in_z - #define __in_z -#endif -#ifndef __in_ecount_z - #define __nvapi_undef__in_ecount_z - #define __in_ecount_z(size) -#endif -#ifndef __in_bcount_z - #define __nvapi_undef__in_bcount_z - #define __in_bcount_z(size) -#endif -#ifndef __in_nz - #define __nvapi_undef__in_nz - #define __in_nz -#endif -#ifndef __in_ecount_nz - #define __nvapi_undef__in_ecount_nz - #define __in_ecount_nz(size) -#endif -#ifndef __in_bcount_nz - #define __nvapi_undef__in_bcount_nz - #define __in_bcount_nz(size) -#endif -#ifndef __out - #define __nvapi_undef__out - #define __out -#endif -#ifndef __out_ecount - #define __nvapi_undef__out_ecount - #define __out_ecount(size) -#endif -#ifndef __out_bcount - #define __nvapi_undef__out_bcount - #define __out_bcount(size) -#endif -#ifndef __out_ecount_part - #define __nvapi_undef__out_ecount_part - #define __out_ecount_part(size,length) -#endif -#ifndef __out_bcount_part - #define __nvapi_undef__out_bcount_part - #define __out_bcount_part(size,length) -#endif -#ifndef __out_ecount_full - #define __nvapi_undef__out_ecount_full - #define __out_ecount_full(size) -#endif -#ifndef __out_bcount_full - #define __nvapi_undef__out_bcount_full - #define __out_bcount_full(size) -#endif -#ifndef __out_z - #define __nvapi_undef__out_z - #define __out_z -#endif -#ifndef __out_z_opt - #define __nvapi_undef__out_z_opt - #define __out_z_opt -#endif -#ifndef __out_ecount_z - #define __nvapi_undef__out_ecount_z - #define __out_ecount_z(size) -#endif -#ifndef __out_bcount_z - #define __nvapi_undef__out_bcount_z - #define __out_bcount_z(size) -#endif -#ifndef __out_ecount_part_z - #define __nvapi_undef__out_ecount_part_z - #define __out_ecount_part_z(size,length) -#endif -#ifndef __out_bcount_part_z - #define __nvapi_undef__out_bcount_part_z - #define __out_bcount_part_z(size,length) -#endif -#ifndef __out_ecount_full_z - #define __nvapi_undef__out_ecount_full_z - #define __out_ecount_full_z(size) -#endif -#ifndef __out_bcount_full_z - #define __nvapi_undef__out_bcount_full_z - #define __out_bcount_full_z(size) -#endif -#ifndef __out_nz - #define __nvapi_undef__out_nz - #define __out_nz -#endif -#ifndef __out_nz_opt - #define __nvapi_undef__out_nz_opt - #define __out_nz_opt -#endif -#ifndef __out_ecount_nz - #define __nvapi_undef__out_ecount_nz - #define __out_ecount_nz(size) -#endif -#ifndef __out_bcount_nz - #define __nvapi_undef__out_bcount_nz - #define __out_bcount_nz(size) -#endif -#ifndef __inout - #define __nvapi_undef__inout - #define __inout -#endif -#ifndef __inout_ecount - #define __nvapi_undef__inout_ecount - #define __inout_ecount(size) -#endif -#ifndef __inout_bcount - #define __nvapi_undef__inout_bcount - #define __inout_bcount(size) -#endif -#ifndef __inout_ecount_part - #define __nvapi_undef__inout_ecount_part - #define __inout_ecount_part(size,length) -#endif -#ifndef __inout_bcount_part - #define __nvapi_undef__inout_bcount_part - #define __inout_bcount_part(size,length) -#endif -#ifndef __inout_ecount_full - #define __nvapi_undef__inout_ecount_full - #define __inout_ecount_full(size) -#endif -#ifndef __inout_bcount_full - #define __nvapi_undef__inout_bcount_full - #define __inout_bcount_full(size) -#endif -#ifndef __inout_z - #define __nvapi_undef__inout_z - #define __inout_z -#endif -#ifndef __inout_ecount_z - #define __nvapi_undef__inout_ecount_z - #define __inout_ecount_z(size) -#endif -#ifndef __inout_bcount_z - #define __nvapi_undef__inout_bcount_z - #define __inout_bcount_z(size) -#endif -#ifndef __inout_nz - #define __nvapi_undef__inout_nz - #define __inout_nz -#endif -#ifndef __inout_ecount_nz - #define __nvapi_undef__inout_ecount_nz - #define __inout_ecount_nz(size) -#endif -#ifndef __inout_bcount_nz - #define __nvapi_undef__inout_bcount_nz - #define __inout_bcount_nz(size) -#endif -#ifndef __ecount_opt - #define __nvapi_undef__ecount_opt - #define __ecount_opt(size) -#endif -#ifndef __bcount_opt - #define __nvapi_undef__bcount_opt - #define __bcount_opt(size) -#endif -#ifndef __in_opt - #define __nvapi_undef__in_opt - #define __in_opt -#endif -#ifndef __in_ecount_opt - #define __nvapi_undef__in_ecount_opt - #define __in_ecount_opt(size) -#endif -#ifndef __in_bcount_opt - #define __nvapi_undef__in_bcount_opt - #define __in_bcount_opt(size) -#endif -#ifndef __in_z_opt - #define __nvapi_undef__in_z_opt - #define __in_z_opt -#endif -#ifndef __in_ecount_z_opt - #define __nvapi_undef__in_ecount_z_opt - #define __in_ecount_z_opt(size) -#endif -#ifndef __in_bcount_z_opt - #define __nvapi_undef__in_bcount_z_opt - #define __in_bcount_z_opt(size) -#endif -#ifndef __in_nz_opt - #define __nvapi_undef__in_nz_opt - #define __in_nz_opt -#endif -#ifndef __in_ecount_nz_opt - #define __nvapi_undef__in_ecount_nz_opt - #define __in_ecount_nz_opt(size) -#endif -#ifndef __in_bcount_nz_opt - #define __nvapi_undef__in_bcount_nz_opt - #define __in_bcount_nz_opt(size) -#endif -#ifndef __out_opt - #define __nvapi_undef__out_opt - #define __out_opt -#endif -#ifndef __out_ecount_opt - #define __nvapi_undef__out_ecount_opt - #define __out_ecount_opt(size) -#endif -#ifndef __out_bcount_opt - #define __nvapi_undef__out_bcount_opt - #define __out_bcount_opt(size) -#endif -#ifndef __out_ecount_part_opt - #define __nvapi_undef__out_ecount_part_opt - #define __out_ecount_part_opt(size,length) -#endif -#ifndef __out_bcount_part_opt - #define __nvapi_undef__out_bcount_part_opt - #define __out_bcount_part_opt(size,length) -#endif -#ifndef __out_ecount_full_opt - #define __nvapi_undef__out_ecount_full_opt - #define __out_ecount_full_opt(size) -#endif -#ifndef __out_bcount_full_opt - #define __nvapi_undef__out_bcount_full_opt - #define __out_bcount_full_opt(size) -#endif -#ifndef __out_ecount_z_opt - #define __nvapi_undef__out_ecount_z_opt - #define __out_ecount_z_opt(size) -#endif -#ifndef __out_bcount_z_opt - #define __nvapi_undef__out_bcount_z_opt - #define __out_bcount_z_opt(size) -#endif -#ifndef __out_ecount_part_z_opt - #define __nvapi_undef__out_ecount_part_z_opt - #define __out_ecount_part_z_opt(size,length) -#endif -#ifndef __out_bcount_part_z_opt - #define __nvapi_undef__out_bcount_part_z_opt - #define __out_bcount_part_z_opt(size,length) -#endif -#ifndef __out_ecount_full_z_opt - #define __nvapi_undef__out_ecount_full_z_opt - #define __out_ecount_full_z_opt(size) -#endif -#ifndef __out_bcount_full_z_opt - #define __nvapi_undef__out_bcount_full_z_opt - #define __out_bcount_full_z_opt(size) -#endif -#ifndef __out_ecount_nz_opt - #define __nvapi_undef__out_ecount_nz_opt - #define __out_ecount_nz_opt(size) -#endif -#ifndef __out_bcount_nz_opt - #define __nvapi_undef__out_bcount_nz_opt - #define __out_bcount_nz_opt(size) -#endif -#ifndef __inout_opt - #define __nvapi_undef__inout_opt - #define __inout_opt -#endif -#ifndef __inout_ecount_opt - #define __nvapi_undef__inout_ecount_opt - #define __inout_ecount_opt(size) -#endif -#ifndef __inout_bcount_opt - #define __nvapi_undef__inout_bcount_opt - #define __inout_bcount_opt(size) -#endif -#ifndef __inout_ecount_part_opt - #define __nvapi_undef__inout_ecount_part_opt - #define __inout_ecount_part_opt(size,length) -#endif -#ifndef __inout_bcount_part_opt - #define __nvapi_undef__inout_bcount_part_opt - #define __inout_bcount_part_opt(size,length) -#endif -#ifndef __inout_ecount_full_opt - #define __nvapi_undef__inout_ecount_full_opt - #define __inout_ecount_full_opt(size) -#endif -#ifndef __inout_bcount_full_opt - #define __nvapi_undef__inout_bcount_full_opt - #define __inout_bcount_full_opt(size) -#endif -#ifndef __inout_z_opt - #define __nvapi_undef__inout_z_opt - #define __inout_z_opt -#endif -#ifndef __inout_ecount_z_opt - #define __nvapi_undef__inout_ecount_z_opt - #define __inout_ecount_z_opt(size) -#endif -#ifndef __inout_ecount_z_opt - #define __nvapi_undef__inout_ecount_z_opt - #define __inout_ecount_z_opt(size) -#endif -#ifndef __inout_bcount_z_opt - #define __nvapi_undef__inout_bcount_z_opt - #define __inout_bcount_z_opt(size) -#endif -#ifndef __inout_nz_opt - #define __nvapi_undef__inout_nz_opt - #define __inout_nz_opt -#endif -#ifndef __inout_ecount_nz_opt - #define __nvapi_undef__inout_ecount_nz_opt - #define __inout_ecount_nz_opt(size) -#endif -#ifndef __inout_bcount_nz_opt - #define __nvapi_undef__inout_bcount_nz_opt - #define __inout_bcount_nz_opt(size) -#endif -#ifndef __deref_ecount - #define __nvapi_undef__deref_ecount - #define __deref_ecount(size) -#endif -#ifndef __deref_bcount - #define __nvapi_undef__deref_bcount - #define __deref_bcount(size) -#endif -#ifndef __deref_out - #define __nvapi_undef__deref_out - #define __deref_out -#endif -#ifndef __deref_out_ecount - #define __nvapi_undef__deref_out_ecount - #define __deref_out_ecount(size) -#endif -#ifndef __deref_out_bcount - #define __nvapi_undef__deref_out_bcount - #define __deref_out_bcount(size) -#endif -#ifndef __deref_out_ecount_part - #define __nvapi_undef__deref_out_ecount_part - #define __deref_out_ecount_part(size,length) -#endif -#ifndef __deref_out_bcount_part - #define __nvapi_undef__deref_out_bcount_part - #define __deref_out_bcount_part(size,length) -#endif -#ifndef __deref_out_ecount_full - #define __nvapi_undef__deref_out_ecount_full - #define __deref_out_ecount_full(size) -#endif -#ifndef __deref_out_bcount_full - #define __nvapi_undef__deref_out_bcount_full - #define __deref_out_bcount_full(size) -#endif -#ifndef __deref_out_z - #define __nvapi_undef__deref_out_z - #define __deref_out_z -#endif -#ifndef __deref_out_ecount_z - #define __nvapi_undef__deref_out_ecount_z - #define __deref_out_ecount_z(size) -#endif -#ifndef __deref_out_bcount_z - #define __nvapi_undef__deref_out_bcount_z - #define __deref_out_bcount_z(size) -#endif -#ifndef __deref_out_nz - #define __nvapi_undef__deref_out_nz - #define __deref_out_nz -#endif -#ifndef __deref_out_ecount_nz - #define __nvapi_undef__deref_out_ecount_nz - #define __deref_out_ecount_nz(size) -#endif -#ifndef __deref_out_bcount_nz - #define __nvapi_undef__deref_out_bcount_nz - #define __deref_out_bcount_nz(size) -#endif -#ifndef __deref_inout - #define __nvapi_undef__deref_inout - #define __deref_inout -#endif -#ifndef __deref_inout_z - #define __nvapi_undef__deref_inout_z - #define __deref_inout_z -#endif -#ifndef __deref_inout_ecount - #define __nvapi_undef__deref_inout_ecount - #define __deref_inout_ecount(size) -#endif -#ifndef __deref_inout_bcount - #define __nvapi_undef__deref_inout_bcount - #define __deref_inout_bcount(size) -#endif -#ifndef __deref_inout_ecount_part - #define __nvapi_undef__deref_inout_ecount_part - #define __deref_inout_ecount_part(size,length) -#endif -#ifndef __deref_inout_bcount_part - #define __nvapi_undef__deref_inout_bcount_part - #define __deref_inout_bcount_part(size,length) -#endif -#ifndef __deref_inout_ecount_full - #define __nvapi_undef__deref_inout_ecount_full - #define __deref_inout_ecount_full(size) -#endif -#ifndef __deref_inout_bcount_full - #define __nvapi_undef__deref_inout_bcount_full - #define __deref_inout_bcount_full(size) -#endif -#ifndef __deref_inout_z - #define __nvapi_undef__deref_inout_z - #define __deref_inout_z -#endif -#ifndef __deref_inout_ecount_z - #define __nvapi_undef__deref_inout_ecount_z - #define __deref_inout_ecount_z(size) -#endif -#ifndef __deref_inout_bcount_z - #define __nvapi_undef__deref_inout_bcount_z - #define __deref_inout_bcount_z(size) -#endif -#ifndef __deref_inout_nz - #define __nvapi_undef__deref_inout_nz - #define __deref_inout_nz -#endif -#ifndef __deref_inout_ecount_nz - #define __nvapi_undef__deref_inout_ecount_nz - #define __deref_inout_ecount_nz(size) -#endif -#ifndef __deref_inout_bcount_nz - #define __nvapi_undef__deref_inout_bcount_nz - #define __deref_inout_bcount_nz(size) -#endif -#ifndef __deref_ecount_opt - #define __nvapi_undef__deref_ecount_opt - #define __deref_ecount_opt(size) -#endif -#ifndef __deref_bcount_opt - #define __nvapi_undef__deref_bcount_opt - #define __deref_bcount_opt(size) -#endif -#ifndef __deref_out_opt - #define __nvapi_undef__deref_out_opt - #define __deref_out_opt -#endif -#ifndef __deref_out_ecount_opt - #define __nvapi_undef__deref_out_ecount_opt - #define __deref_out_ecount_opt(size) -#endif -#ifndef __deref_out_bcount_opt - #define __nvapi_undef__deref_out_bcount_opt - #define __deref_out_bcount_opt(size) -#endif -#ifndef __deref_out_ecount_part_opt - #define __nvapi_undef__deref_out_ecount_part_opt - #define __deref_out_ecount_part_opt(size,length) -#endif -#ifndef __deref_out_bcount_part_opt - #define __nvapi_undef__deref_out_bcount_part_opt - #define __deref_out_bcount_part_opt(size,length) -#endif -#ifndef __deref_out_ecount_full_opt - #define __nvapi_undef__deref_out_ecount_full_opt - #define __deref_out_ecount_full_opt(size) -#endif -#ifndef __deref_out_bcount_full_opt - #define __nvapi_undef__deref_out_bcount_full_opt - #define __deref_out_bcount_full_opt(size) -#endif -#ifndef __deref_out_z_opt - #define __nvapi_undef__deref_out_z_opt - #define __deref_out_z_opt -#endif -#ifndef __deref_out_ecount_z_opt - #define __nvapi_undef__deref_out_ecount_z_opt - #define __deref_out_ecount_z_opt(size) -#endif -#ifndef __deref_out_bcount_z_opt - #define __nvapi_undef__deref_out_bcount_z_opt - #define __deref_out_bcount_z_opt(size) -#endif -#ifndef __deref_out_nz_opt - #define __nvapi_undef__deref_out_nz_opt - #define __deref_out_nz_opt -#endif -#ifndef __deref_out_ecount_nz_opt - #define __nvapi_undef__deref_out_ecount_nz_opt - #define __deref_out_ecount_nz_opt(size) -#endif -#ifndef __deref_out_bcount_nz_opt - #define __nvapi_undef__deref_out_bcount_nz_opt - #define __deref_out_bcount_nz_opt(size) -#endif -#ifndef __deref_inout_opt - #define __nvapi_undef__deref_inout_opt - #define __deref_inout_opt -#endif -#ifndef __deref_inout_ecount_opt - #define __nvapi_undef__deref_inout_ecount_opt - #define __deref_inout_ecount_opt(size) -#endif -#ifndef __deref_inout_bcount_opt - #define __nvapi_undef__deref_inout_bcount_opt - #define __deref_inout_bcount_opt(size) -#endif -#ifndef __deref_inout_ecount_part_opt - #define __nvapi_undef__deref_inout_ecount_part_opt - #define __deref_inout_ecount_part_opt(size,length) -#endif -#ifndef __deref_inout_bcount_part_opt - #define __nvapi_undef__deref_inout_bcount_part_opt - #define __deref_inout_bcount_part_opt(size,length) -#endif -#ifndef __deref_inout_ecount_full_opt - #define __nvapi_undef__deref_inout_ecount_full_opt - #define __deref_inout_ecount_full_opt(size) -#endif -#ifndef __deref_inout_bcount_full_opt - #define __nvapi_undef__deref_inout_bcount_full_opt - #define __deref_inout_bcount_full_opt(size) -#endif -#ifndef __deref_inout_z_opt - #define __nvapi_undef__deref_inout_z_opt - #define __deref_inout_z_opt -#endif -#ifndef __deref_inout_ecount_z_opt - #define __nvapi_undef__deref_inout_ecount_z_opt - #define __deref_inout_ecount_z_opt(size) -#endif -#ifndef __deref_inout_bcount_z_opt - #define __nvapi_undef__deref_inout_bcount_z_opt - #define __deref_inout_bcount_z_opt(size) -#endif -#ifndef __deref_inout_nz_opt - #define __nvapi_undef__deref_inout_nz_opt - #define __deref_inout_nz_opt -#endif -#ifndef __deref_inout_ecount_nz_opt - #define __nvapi_undef__deref_inout_ecount_nz_opt - #define __deref_inout_ecount_nz_opt(size) -#endif -#ifndef __deref_inout_bcount_nz_opt - #define __nvapi_undef__deref_inout_bcount_nz_opt - #define __deref_inout_bcount_nz_opt(size) -#endif -#ifndef __deref_opt_ecount - #define __nvapi_undef__deref_opt_ecount - #define __deref_opt_ecount(size) -#endif -#ifndef __deref_opt_bcount - #define __nvapi_undef__deref_opt_bcount - #define __deref_opt_bcount(size) -#endif -#ifndef __deref_opt_out - #define __nvapi_undef__deref_opt_out - #define __deref_opt_out -#endif -#ifndef __deref_opt_out_z - #define __nvapi_undef__deref_opt_out_z - #define __deref_opt_out_z -#endif -#ifndef __deref_opt_out_ecount - #define __nvapi_undef__deref_opt_out_ecount - #define __deref_opt_out_ecount(size) -#endif -#ifndef __deref_opt_out_bcount - #define __nvapi_undef__deref_opt_out_bcount - #define __deref_opt_out_bcount(size) -#endif -#ifndef __deref_opt_out_ecount_part - #define __nvapi_undef__deref_opt_out_ecount_part - #define __deref_opt_out_ecount_part(size,length) -#endif -#ifndef __deref_opt_out_bcount_part - #define __nvapi_undef__deref_opt_out_bcount_part - #define __deref_opt_out_bcount_part(size,length) -#endif -#ifndef __deref_opt_out_ecount_full - #define __nvapi_undef__deref_opt_out_ecount_full - #define __deref_opt_out_ecount_full(size) -#endif -#ifndef __deref_opt_out_bcount_full - #define __nvapi_undef__deref_opt_out_bcount_full - #define __deref_opt_out_bcount_full(size) -#endif -#ifndef __deref_opt_inout - #define __nvapi_undef__deref_opt_inout - #define __deref_opt_inout -#endif -#ifndef __deref_opt_inout_ecount - #define __nvapi_undef__deref_opt_inout_ecount - #define __deref_opt_inout_ecount(size) -#endif -#ifndef __deref_opt_inout_bcount - #define __nvapi_undef__deref_opt_inout_bcount - #define __deref_opt_inout_bcount(size) -#endif -#ifndef __deref_opt_inout_ecount_part - #define __nvapi_undef__deref_opt_inout_ecount_part - #define __deref_opt_inout_ecount_part(size,length) -#endif -#ifndef __deref_opt_inout_bcount_part - #define __nvapi_undef__deref_opt_inout_bcount_part - #define __deref_opt_inout_bcount_part(size,length) -#endif -#ifndef __deref_opt_inout_ecount_full - #define __nvapi_undef__deref_opt_inout_ecount_full - #define __deref_opt_inout_ecount_full(size) -#endif -#ifndef __deref_opt_inout_bcount_full - #define __nvapi_undef__deref_opt_inout_bcount_full - #define __deref_opt_inout_bcount_full(size) -#endif -#ifndef __deref_opt_inout_z - #define __nvapi_undef__deref_opt_inout_z - #define __deref_opt_inout_z -#endif -#ifndef __deref_opt_inout_ecount_z - #define __nvapi_undef__deref_opt_inout_ecount_z - #define __deref_opt_inout_ecount_z(size) -#endif -#ifndef __deref_opt_inout_bcount_z - #define __nvapi_undef__deref_opt_inout_bcount_z - #define __deref_opt_inout_bcount_z(size) -#endif -#ifndef __deref_opt_inout_nz - #define __nvapi_undef__deref_opt_inout_nz - #define __deref_opt_inout_nz -#endif -#ifndef __deref_opt_inout_ecount_nz - #define __nvapi_undef__deref_opt_inout_ecount_nz - #define __deref_opt_inout_ecount_nz(size) -#endif -#ifndef __deref_opt_inout_bcount_nz - #define __nvapi_undef__deref_opt_inout_bcount_nz - #define __deref_opt_inout_bcount_nz(size) -#endif -#ifndef __deref_opt_ecount_opt - #define __nvapi_undef__deref_opt_ecount_opt - #define __deref_opt_ecount_opt(size) -#endif -#ifndef __deref_opt_bcount_opt - #define __nvapi_undef__deref_opt_bcount_opt - #define __deref_opt_bcount_opt(size) -#endif -#ifndef __deref_opt_out_opt - #define __nvapi_undef__deref_opt_out_opt - #define __deref_opt_out_opt -#endif -#ifndef __deref_opt_out_ecount_opt - #define __nvapi_undef__deref_opt_out_ecount_opt - #define __deref_opt_out_ecount_opt(size) -#endif -#ifndef __deref_opt_out_bcount_opt - #define __nvapi_undef__deref_opt_out_bcount_opt - #define __deref_opt_out_bcount_opt(size) -#endif -#ifndef __deref_opt_out_ecount_part_opt - #define __nvapi_undef__deref_opt_out_ecount_part_opt - #define __deref_opt_out_ecount_part_opt(size,length) -#endif -#ifndef __deref_opt_out_bcount_part_opt - #define __nvapi_undef__deref_opt_out_bcount_part_opt - #define __deref_opt_out_bcount_part_opt(size,length) -#endif -#ifndef __deref_opt_out_ecount_full_opt - #define __nvapi_undef__deref_opt_out_ecount_full_opt - #define __deref_opt_out_ecount_full_opt(size) -#endif -#ifndef __deref_opt_out_bcount_full_opt - #define __nvapi_undef__deref_opt_out_bcount_full_opt - #define __deref_opt_out_bcount_full_opt(size) -#endif -#ifndef __deref_opt_out_z_opt - #define __nvapi_undef__deref_opt_out_z_opt - #define __deref_opt_out_z_opt -#endif -#ifndef __deref_opt_out_ecount_z_opt - #define __nvapi_undef__deref_opt_out_ecount_z_opt - #define __deref_opt_out_ecount_z_opt(size) -#endif -#ifndef __deref_opt_out_bcount_z_opt - #define __nvapi_undef__deref_opt_out_bcount_z_opt - #define __deref_opt_out_bcount_z_opt(size) -#endif -#ifndef __deref_opt_out_nz_opt - #define __nvapi_undef__deref_opt_out_nz_opt - #define __deref_opt_out_nz_opt -#endif -#ifndef __deref_opt_out_ecount_nz_opt - #define __nvapi_undef__deref_opt_out_ecount_nz_opt - #define __deref_opt_out_ecount_nz_opt(size) -#endif -#ifndef __deref_opt_out_bcount_nz_opt - #define __nvapi_undef__deref_opt_out_bcount_nz_opt - #define __deref_opt_out_bcount_nz_opt(size) -#endif -#ifndef __deref_opt_inout_opt - #define __nvapi_undef__deref_opt_inout_opt - #define __deref_opt_inout_opt -#endif -#ifndef __deref_opt_inout_ecount_opt - #define __nvapi_undef__deref_opt_inout_ecount_opt - #define __deref_opt_inout_ecount_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_opt - #define __nvapi_undef__deref_opt_inout_bcount_opt - #define __deref_opt_inout_bcount_opt(size) -#endif -#ifndef __deref_opt_inout_ecount_part_opt - #define __nvapi_undef__deref_opt_inout_ecount_part_opt - #define __deref_opt_inout_ecount_part_opt(size,length) -#endif -#ifndef __deref_opt_inout_bcount_part_opt - #define __nvapi_undef__deref_opt_inout_bcount_part_opt - #define __deref_opt_inout_bcount_part_opt(size,length) -#endif -#ifndef __deref_opt_inout_ecount_full_opt - #define __nvapi_undef__deref_opt_inout_ecount_full_opt - #define __deref_opt_inout_ecount_full_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_full_opt - #define __nvapi_undef__deref_opt_inout_bcount_full_opt - #define __deref_opt_inout_bcount_full_opt(size) -#endif -#ifndef __deref_opt_inout_z_opt - #define __nvapi_undef__deref_opt_inout_z_opt - #define __deref_opt_inout_z_opt -#endif -#ifndef __deref_opt_inout_ecount_z_opt - #define __nvapi_undef__deref_opt_inout_ecount_z_opt - #define __deref_opt_inout_ecount_z_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_z_opt - #define __nvapi_undef__deref_opt_inout_bcount_z_opt - #define __deref_opt_inout_bcount_z_opt(size) -#endif -#ifndef __deref_opt_inout_nz_opt - #define __nvapi_undef__deref_opt_inout_nz_opt - #define __deref_opt_inout_nz_opt -#endif -#ifndef __deref_opt_inout_ecount_nz_opt - #define __nvapi_undef__deref_opt_inout_ecount_nz_opt - #define __deref_opt_inout_ecount_nz_opt(size) -#endif -#ifndef __deref_opt_inout_bcount_nz_opt - #define __nvapi_undef__deref_opt_inout_bcount_nz_opt - #define __deref_opt_inout_bcount_nz_opt(size) -#endif -#ifndef __success - #define __nvapi_success - #define __success(epxr) -#endif -#ifndef _Ret_notnull_ - #define __nvapi__Ret_notnull_ - #define _Ret_notnull_ -#endif -#ifndef _Post_writable_byte_size_ - #define __nvapi__Post_writable_byte_size_ - #define _Post_writable_byte_size_(n) -#endif -#ifndef _Outptr_ - #define __nvapi_Outptr_ - #define _Outptr_ -#endif - - -#define NVAPI_INTERFACE extern __success(return == NVAPI_OK) NvAPI_Status __cdecl - -#if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) && (_MSC_VER > 1399) && !defined(NVAPI_INTERNAL) && !defined(NVAPI_DEPRECATED_OLD) -#ifndef __nvapi_deprecated_function -#define __nvapi_deprecated_function(message) __declspec(deprecated(message)) -#endif -#ifndef __nvapi_deprecated_datatype -#define __nvapi_deprecated_datatype(FirstRelease) __declspec(deprecated("Do not use this data type - it is deprecated in release " #FirstRelease ".")) -#endif -#else -#ifndef __nvapi_deprecated_function -#define __nvapi_deprecated_function(message) -#endif -#ifndef __nvapi_deprecated_datatype -#define __nvapi_deprecated_datatype(FirstRelease) -#endif -#endif - - -/* 64-bit types for compilers that support them, plus some obsolete variants */ -#if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64) -typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */ -typedef long long NvS64; /* -9223372036854775808 to 9223372036854775807 */ -#else -typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */ -typedef __int64 NvS64; /* -9223372036854775808 to 9223372036854775807 */ -#endif - -// mac os 32-bit still needs this -#if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__) -typedef signed long NvS32; /* -2147483648 to 2147483647 */ -#else -typedef signed int NvS32; /* -2147483648 to 2147483647 */ -#endif - -#ifndef __unix -// mac os 32-bit still needs this -#if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \ - (!defined(macintosh) && defined(__NVAPI_RESERVED0__)) ) -typedef unsigned int NvU32; /* 0 to 4294967295 */ -#else -typedef unsigned long NvU32; /* 0 to 4294967295 */ -#endif -#else -typedef unsigned int NvU32; /* 0 to 4294967295 */ -#endif - -typedef unsigned long temp_NvU32; /* 0 to 4294967295 */ -typedef signed short NvS16; -typedef unsigned short NvU16; -typedef unsigned char NvU8; -typedef signed char NvS8; -typedef float NvF32; -typedef double NvF64; - -/*! - * Macro to convert NvU32 to NvF32. - */ -#define NvU32TONvF32(_pData) *(NvF32 *)(_pData) -/*! - * Macro to convert NvF32 to NvU32. - */ -#define NvF32TONvU32(_pData) *(NvU32 *)(_pData) - -/* Boolean type */ -typedef NvU8 NvBool; -#define NV_TRUE ((NvBool)(0 == 0)) -#define NV_FALSE ((NvBool)(0 != 0)) - -typedef struct _NV_RECT -{ - NvU32 left; - NvU32 top; - NvU32 right; - NvU32 bottom; -} NV_RECT; - - -#define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name - -//! \addtogroup nvapihandles -//! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI -//! These are meant to be opaque types. Do not assume they correspond to indices, HDCs, -//! display indexes or anything else. -//! -//! Most handles remain valid until a display re-configuration (display mode set) or GPU -//! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED -//! is received by an app, it should discard all handles, and re-enumerate them. -//! @{ -NV_DECLARE_HANDLE(NvLogicalGpuHandle); //!< One or more physical GPUs acting in concert (SLI) -NV_DECLARE_HANDLE(NvPhysicalGpuHandle); //!< A single physical GPU -NV_DECLARE_HANDLE(NvDisplayHandle); //!< Display Device driven by NVIDIA GPU(s) (an attached display) -NV_DECLARE_HANDLE(NvMonitorHandle); //!< Monitor handle -NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); //!< Unattached Display Device driven by NVIDIA GPU(s) -NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); //!< A handle to a Visual Computing Device -NV_DECLARE_HANDLE(NvEventHandle); //!< A handle to an event registration instance - - -NV_DECLARE_HANDLE(NvHICHandle); //!< A handle to a Host Interface Card -NV_DECLARE_HANDLE(NvGSyncDeviceHandle); //!< A handle to a Sync device -NV_DECLARE_HANDLE(NvVioHandle); //!< A handle to an SDI device -NV_DECLARE_HANDLE(NvTransitionHandle); //!< A handle to address a single transition request -NV_DECLARE_HANDLE(NvAudioHandle); //!< NVIDIA HD Audio Device -NV_DECLARE_HANDLE(Nv3DVPContextHandle); //!< A handle for a 3D Vision Pro (3DVP) context -NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); //!< A handle for a 3DVP RF transceiver -NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); //!< A handle for a pair of 3DVP RF shutter glasses -NV_DECLARE_HANDLE(NvPcfClientHandle); //!< A handle for NVPCF clients - -typedef void* StereoHandle; //!< A stereo handle, that corresponds to the device interface - -NV_DECLARE_HANDLE(NvSourceHandle); //!< Unique source handle on the system -NV_DECLARE_HANDLE(NvTargetHandle); //!< Unique target handle on the system -NV_DECLARE_HANDLE(NVDX_SwapChainHandle); //!< DirectX SwapChain objects -static const NVDX_SwapChainHandle NVDX_SWAPCHAIN_NONE = 0; -NV_DECLARE_HANDLE(NvPresentBarrierClientHandle); //!< PresentBarrier client object -//! @} - -//! \ingroup nvapihandles -//! @{ -#define NVAPI_DEFAULT_HANDLE 0 -#define NV_BIT(x) (1 << (x)) -//! @} - - - -//! \addtogroup nvapitypes -//! @{ -#define NVAPI_GENERIC_STRING_MAX 4096 -#define NVAPI_LONG_STRING_MAX 256 -#define NVAPI_SHORT_STRING_MAX 64 - -typedef struct -{ - NvS32 sX; - NvS32 sY; - NvS32 sWidth; - NvS32 sHeight; -} NvSBox; - -#ifndef NvGUID_Defined -#define NvGUID_Defined - -typedef struct -{ - NvU32 data1; - NvU16 data2; - NvU16 data3; - NvU8 data4[8]; -} NvGUID, NvLUID; - - -#endif //#ifndef NvGUID_Defined -#define NVAPI_MAX_PHYSICAL_GPUS 64 - - -#define NVAPI_MAX_PHYSICAL_BRIDGES 100 -#define NVAPI_PHYSICAL_GPUS 32 -#define NVAPI_MAX_LOGICAL_GPUS 64 -#define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256 -#define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256 -#define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS -#define NVAPI_MAX_GPU_PER_TOPOLOGY 8 -#define NVAPI_MAX_DISPLAY_HEADS 2 -#define NVAPI_ADVANCED_DISPLAY_HEADS 4 -#define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS -#define NVAPI_MAX_ACPI_IDS 16 -#define NVAPI_MAX_VIEW_MODES 8 - - -#define NVAPI_SYSTEM_MAX_HWBCS 128 -#define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff - -#define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS -#define NV_MAX_HEADS 4 //!< Maximum heads, each with NVAPI_DESKTOP_RES resolution -#define NVAPI_MAX_HEADS_PER_GPU 32 -#define NV_MAX_VID_STREAMS 4 //!< Maximum number of input video streams, each with a #NVAPI_VIDEO_SRC_INFO -#define NV_MAX_VID_STREAMS_EX 20 //!< Increasing MAX no. of input video streams, each with a #NVAPI_VIDEO_SRC_INFO -#define NV_MAX_VID_PROFILES 4 //!< Maximum number of output video profiles supported - -#define NVAPI_MAX_AUDIO_DEVICES 16 - - -typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX]; -typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX]; -typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX]; -typedef NvU16 NvAPI_UnicodeShortString[NVAPI_SHORT_STRING_MAX]; -//! @} - - -// ========================================================================================= -//! NvAPI Version Definition \n -//! Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro. \n -//! Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1) -//! \ingroup nvapitypes -// ========================================================================================= -#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16)) - -//! \ingroup nvapitypes -#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16) - -//! \ingroup nvapitypes -#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff) - - -// ==================================================== -//! NvAPI Status Values -//! All NvAPI functions return one of these codes. -//! \ingroup nvapistatus -// ==================================================== - - -typedef enum _NvAPI_Status -{ - NVAPI_OK = 0, //!< Success. Request is completed. - NVAPI_ERROR = -1, //!< Generic error - NVAPI_LIBRARY_NOT_FOUND = -2, //!< NVAPI support library cannot be loaded. - NVAPI_NO_IMPLEMENTATION = -3, //!< not implemented in current driver installation - NVAPI_API_NOT_INITIALIZED = -4, //!< NvAPI_Initialize has not been called (successfully) - NVAPI_INVALID_ARGUMENT = -5, //!< The argument/parameter value is not valid or NULL. - NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, //!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found. - NVAPI_END_ENUMERATION = -7, //!< No more items to enumerate - NVAPI_INVALID_HANDLE = -8, //!< Invalid handle - NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, //!< An argument's structure version is not supported - NVAPI_HANDLE_INVALIDATED = -10, //!< The handle is no longer valid (likely due to GPU or display re-configuration) - NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, //!< No NVIDIA OpenGL context is current (but needs to be) - NVAPI_INVALID_POINTER = -14, //!< An invalid pointer, usually NULL, was passed as a parameter - NVAPI_NO_GL_EXPERT = -12, //!< OpenGL Expert is not supported by the current drivers - NVAPI_INSTRUMENTATION_DISABLED = -13, //!< OpenGL Expert is supported, but driver instrumentation is currently disabled - NVAPI_NO_GL_NSIGHT = -15, //!< OpenGL does not support Nsight - - NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, //!< Expected a logical GPU handle for one or more parameters - NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, //!< Expected a physical GPU handle for one or more parameters - NVAPI_EXPECTED_DISPLAY_HANDLE = -102, //!< Expected an NV display handle for one or more parameters - NVAPI_INVALID_COMBINATION = -103, //!< The combination of parameters is not valid. - NVAPI_NOT_SUPPORTED = -104, //!< Requested feature is not supported in the selected GPU - NVAPI_PORTID_NOT_FOUND = -105, //!< No port ID was found for the I2C transaction - NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, //!< Expected an unattached display handle as one of the input parameters. - NVAPI_INVALID_PERF_LEVEL = -107, //!< Invalid perf level - NVAPI_DEVICE_BUSY = -108, //!< Device is busy; request not fulfilled - NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, //!< NV persist file is not found - NVAPI_PERSIST_DATA_NOT_FOUND = -110, //!< NV persist data is not found - NVAPI_EXPECTED_TV_DISPLAY = -111, //!< Expected a TV output display - NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, //!< Expected a TV output on the D Connector - HDTV_EIAJ4120. - NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, //!< SLI is not active on this device. - NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, //!< Setup of SLI rendering mode is not possible right now. - NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, //!< Expected a digital flat panel. - NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, //!< Argument exceeds the expected size. - NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, //!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active. - NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, //!< Testing of clocks is not supported. - NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, //!< The specified underscan config is from an unknown source (e.g. INF) - NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, //!< Timeout while reconfiguring GPUs - NVAPI_DATA_NOT_FOUND = -121, //!< Requested data was not found - NVAPI_EXPECTED_ANALOG_DISPLAY = -122, //!< Expected an analog display - NVAPI_NO_VIDLINK = -123, //!< No SLI video bridge is present - NVAPI_REQUIRES_REBOOT = -124, //!< NVAPI requires a reboot for the settings to take effect - NVAPI_INVALID_HYBRID_MODE = -125, //!< The function is not supported with the current Hybrid mode. - NVAPI_MIXED_TARGET_TYPES = -126, //!< The target types are not all the same - NVAPI_SYSWOW64_NOT_SUPPORTED = -127, //!< The function is not supported from 32-bit on a 64-bit system. - NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology. - NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //!< Prompt the user to close all non-migratable applications. - NVAPI_OUT_OF_MEMORY = -130, //!< Could not allocate sufficient memory to complete the call. - NVAPI_WAS_STILL_DRAWING = -131, //!< The previous operation that is transferring information to or from this surface is incomplete. - NVAPI_FILE_NOT_FOUND = -132, //!< The file was not found. - NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, //!< There are too many unique instances of a particular type of state object. - NVAPI_INVALID_CALL = -134, //!< The method call is invalid. For example, a method's parameter may not be a valid pointer. - NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, //!< d3d10_1.dll cannot be loaded. - NVAPI_FUNCTION_NOT_FOUND = -136, //!< Couldn't find the function in the loaded DLL. - NVAPI_INVALID_USER_PRIVILEGE = -137, //!< The application will require Administrator privileges to access this API. - //!< The application can be elevated to a higher permission level by selecting "Run as Administrator". - NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, //!< The handle corresponds to GDIPrimary. - NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, //!< Setting Physx GPU requires that the GPU is compute-capable. - NVAPI_STEREO_NOT_INITIALIZED = -140, //!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed. - NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, //!< Access to stereo-related registry keys or values has failed. - NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, //!< The given registry profile type is not supported. - NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, //!< The given registry value is not supported. - NVAPI_STEREO_NOT_ENABLED = -144, //!< Stereo is not enabled and the function needed it to execute completely. - NVAPI_STEREO_NOT_TURNED_ON = -145, //!< Stereo is not turned on and the function needed it to execute completely. - NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, //!< Invalid device interface. - NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, //!< Separation percentage or JPEG image capture quality is out of [0-100] range. - NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, //!< The given frustum adjust mode is not supported. - NVAPI_TOPO_NOT_POSSIBLE = -149, //!< The mosaic topology is not possible given the current state of the hardware. - NVAPI_MODE_CHANGE_FAILED = -150, //!< An attempt to do a display resolution mode change has failed. - NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, //!< d3d11.dll/d3d11_beta.dll cannot be loaded. - NVAPI_INVALID_ADDRESS = -152, //!< Address is outside of valid range. - NVAPI_STRING_TOO_SMALL = -153, //!< The pre-allocated string is too small to hold the result. - NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, //!< The input does not match any of the available devices. - NVAPI_DRIVER_RUNNING = -155, //!< Driver is running. - NVAPI_DRIVER_NOTRUNNING = -156, //!< Driver is not running. - NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, //!< A driver reload is required to apply these settings. - NVAPI_SET_NOT_ALLOWED = -158, //!< Intended setting is not allowed. - NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, //!< Information can't be returned due to "advanced display topology". - NVAPI_SETTING_NOT_FOUND = -160, //!< Setting is not found. - NVAPI_SETTING_SIZE_TOO_LARGE = -161, //!< Setting size is too large. - NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, //!< There are too many settings for a profile. - NVAPI_PROFILE_NOT_FOUND = -163, //!< Profile is not found. - NVAPI_PROFILE_NAME_IN_USE = -164, //!< Profile name is duplicated. - NVAPI_PROFILE_NAME_EMPTY = -165, //!< Profile name is empty. - NVAPI_EXECUTABLE_NOT_FOUND = -166, //!< Application not found in the Profile. - NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, //!< Application already exists in the other profile. - NVAPI_DATATYPE_MISMATCH = -168, //!< Data Type mismatch - NVAPI_PROFILE_REMOVED = -169, //!< The profile passed as parameter has been removed and is no longer valid. - NVAPI_UNREGISTERED_RESOURCE = -170, //!< An unregistered resource was passed as a parameter. - NVAPI_ID_OUT_OF_RANGE = -171, //!< The DisplayId corresponds to a display which is not within the normal outputId range. - NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, //!< Display topology is not valid so the driver cannot do a mode set on this configuration. - NVAPI_DPMST_CHANGED = -173, //!< Display Port Multi-Stream topology has been changed. - NVAPI_INSUFFICIENT_BUFFER = -174, //!< Input buffer is insufficient to hold the contents. - NVAPI_ACCESS_DENIED = -175, //!< No access to the caller. - NVAPI_MOSAIC_NOT_ACTIVE = -176, //!< The requested action cannot be performed without Mosaic being enabled. - NVAPI_SHARE_RESOURCE_RELOCATED = -177, //!< The surface is relocated away from video memory. - NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, //!< The user should disable DWM before calling NvAPI. - NVAPI_D3D_DEVICE_LOST = -179, //!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device. - NVAPI_INVALID_CONFIGURATION = -180, //!< The requested action cannot be performed in the current state. - NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, //!< Call failed as stereo handshake not completed. - NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, //!< The path provided was too short to determine the correct NVDRS_APPLICATION - NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, //!< Default stereo profile is not currently defined - NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, //!< Default stereo profile does not exist - NVAPI_CLUSTER_ALREADY_EXISTS = -185, //!< A cluster is already defined with the given configuration. - NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, //!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology - NVAPI_INVALID_DISPLAY_ID = -187, //!< The input display id is not valid or the monitor associated to it does not support the current operation - NVAPI_STREAM_IS_OUT_OF_SYNC = -188, //!< While playing secure audio stream, stream goes out of sync - NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, //!< Older audio driver version than required - NVAPI_VALUE_ALREADY_SET = -190, //!< Value already set, setting again not allowed. - NVAPI_TIMEOUT = -191, //!< Requested operation timed out - NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, //!< The requested workstation feature set has incomplete driver internal allocation resources - NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, //!< Call failed because InitActivation was not called. - NVAPI_SYNC_NOT_ACTIVE = -194, //!< The requested action cannot be performed without Sync being enabled. - NVAPI_SYNC_MASTER_NOT_FOUND = -195, //!< The requested action cannot be performed without Sync Master being enabled. - NVAPI_INVALID_SYNC_TOPOLOGY = -196, //!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer. - NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, //!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value. - NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, //!< The encrypted public key verification has failed. - NVAPI_FIRMWARE_OUT_OF_DATE = -199, //!< The device's firmware is out of date. - NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED = -200, //!< The device's firmware is not supported. - NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED = -201, //!< The caller is not authorized to modify the License. - NVAPI_D3D_DEVICE_NOT_REGISTERED = -202, //!< The user tried to use a deferred context without registering the device first - NVAPI_RESOURCE_NOT_ACQUIRED = -203, //!< Head or SourceId was not reserved for the VR Display before doing the Modeset or the dedicated display. - NVAPI_TIMING_NOT_SUPPORTED = -204, //!< Provided timing is not supported. - NVAPI_HDCP_ENCRYPTION_FAILED = -205, //!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable. - NVAPI_PCLK_LIMITATION_FAILED = -206, //!< Provided mode is over sink device pclk limitation. - NVAPI_NO_CONNECTOR_FOUND = -207, //!< No connector on GPU found. - NVAPI_HDCP_DISABLED = -208, //!< When a non-HDCP capable HMD is connected, we would inform user by this code. - NVAPI_API_IN_USE = -209, //!< Atleast an API is still being called - NVAPI_NVIDIA_DISPLAY_NOT_FOUND = -210, //!< No display found on Nvidia GPU(s). - NVAPI_PRIV_SEC_VIOLATION = -211, //!< Priv security violation, improper access to a secured register. - NVAPI_INCORRECT_VENDOR = -212, //!< NVAPI cannot be called by this vendor - NVAPI_DISPLAY_IN_USE = -213, //!< DirectMode Display is already in use - NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD = -214, //!< The Config is having Non-NVidia GPU with Non-HDCP HMD connected - NVAPI_MAX_DISPLAY_LIMIT_REACHED = -215, //!< GPU's Max Display Limit has Reached - NVAPI_INVALID_DIRECT_MODE_DISPLAY = -216, //!< DirectMode not Enabled on the Display - NVAPI_GPU_IN_DEBUG_MODE = -217, //!< GPU is in debug mode, OC is NOT allowed. - NVAPI_D3D_CONTEXT_NOT_FOUND = -218, //!< No NvAPI context was found for this D3D object - NVAPI_STEREO_VERSION_MISMATCH = -219, //!< there is version mismatch between stereo driver and dx driver - NVAPI_GPU_NOT_POWERED = -220, //!< GPU is not powered and so the request cannot be completed. - NVAPI_ERROR_DRIVER_RELOAD_IN_PROGRESS = -221, //!< The display driver update in progress. - NVAPI_WAIT_FOR_HW_RESOURCE = -222, //!< Wait for HW resources allocation - NVAPI_REQUIRE_FURTHER_HDCP_ACTION = -223, //!< operation requires further HDCP action - NVAPI_DISPLAY_MUX_TRANSITION_FAILED = -224, //!< Dynamic Mux transition failure - NVAPI_INVALID_DSC_VERSION = -225, //!< Invalid DSC version - NVAPI_INVALID_DSC_SLICECOUNT = -226, //!< Invalid DSC slice count - NVAPI_INVALID_DSC_OUTPUT_BPP = -227, //!< Invalid DSC output BPP - NVAPI_FAILED_TO_LOAD_FROM_DRIVER_STORE = -228, //!< There was an error while loading nvapi.dll from the driver store. - NVAPI_NO_VULKAN = -229, //!< OpenGL does not export Vulkan fake extensions - NVAPI_REQUEST_PENDING = -230, //!< A request for NvTOPPs telemetry CData has already been made and is pending a response. - NVAPI_RESOURCE_IN_USE = -231, //!< Operation cannot be performed because the resource is in use. - NVAPI_INVALID_IMAGE = -232, //!< Device kernel image is invalid - NVAPI_INVALID_PTX = -233, //!< PTX JIT compilation failed - NVAPI_NVLINK_UNCORRECTABLE = -234, //!< Uncorrectable NVLink error was detected during the execution - NVAPI_JIT_COMPILER_NOT_FOUND = -235, //!< PTX JIT compiler library was not found. - NVAPI_INVALID_SOURCE = -236, //!< Device kernel source is invalid. - NVAPI_ILLEGAL_INSTRUCTION = -237, //!< While executing a kernel, the device encountered an illegal instruction. - NVAPI_INVALID_PC = -238, //!< While executing a kernel, the device program counter wrapped its address space - NVAPI_LAUNCH_FAILED = -239, //!< An exception occurred on the device while executing a kernel - NVAPI_NOT_PERMITTED = -240, //!< Attempted operation is not permitted. - NVAPI_CALLBACK_ALREADY_REGISTERED = -241, //!< The callback function has already been registered. - NVAPI_CALLBACK_NOT_FOUND = -242, //!< The callback function is not found or not registered. -} NvAPI_Status; - - -//! @} - - -//! \ingroup nvapistatus -#define NVAPI_API_NOT_INTIALIZED NVAPI_API_NOT_INITIALIZED //!< Fix typo in error code - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Initialize -// -//! This function initializes the NvAPI library (if not already initialized) but always increments the ref-counter. -//! This must be called before calling other NvAPI_ functions. -//! Note: It is now mandatory to call NvAPI_Initialize before calling any other NvAPI. -//! NvAPI_Unload should be called to unload the NVAPI Library. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_LIBRARY_NOT_FOUND Failed to load the NVAPI support library -//! \sa nvapistatus -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Initialize(); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Unload -// -//! DESCRIPTION: Decrements the ref-counter and when it reaches ZERO, unloads NVAPI library. -//! This must be called in pairs with NvAPI_Initialize. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! If the client wants unload functionality, it is recommended to always call NvAPI_Initialize and NvAPI_Unload in pairs. -//! -//! Unloading NvAPI library is not supported when the library is in a resource locked state. -//! Some functions in the NvAPI library initiates an operation or allocates certain resources -//! and there are corresponding functions available, to complete the operation or free the -//! allocated resources. All such function pairs are designed to prevent unloading NvAPI library. -//! -//! For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with -//! NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources, -//! before calling NvAPI_Unload again. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_API_IN_USE Atleast an API is still being called hence cannot unload requested driver. -//! -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Unload(); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetErrorMessage -// -//! This function converts an NvAPI error code into a null terminated string. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param nr The error code to convert -//! \param szDesc The string corresponding to the error code -//! -//! \return NULL terminated string (always, never NULL) -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr,NvAPI_ShortString szDesc); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetInterfaceVersionString -// -//! This function returns a string describing the version of the NvAPI library. -//! The contents of the string are human readable. Do not assume a fixed -//! format. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param szDesc User readable string giving NvAPI version information -//! -//! \return See \ref nvapistatus for the list of possible return values. -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetInterfaceVersionStringEx -// -//! This function returns a string describing the version of the NvAPI library. -//! The contents of the string are human readable. Do not assume a fixed format. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 450 -//! -//! \param szDesc User readable string giving NvAPI version information -//! -//! \return See \ref nvapistatus for the list of possible return values. -//! \ingroup nvapifunctions -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetInterfaceVersionStringEx(NvAPI_ShortString szDesc); - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// All display port related data types definition starts -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// This category is intentionally added before the #ifdef. The #endif should also be in the same scope - -#ifndef DISPLAYPORT_STRUCTS_DEFINED -#define DISPLAYPORT_STRUCTS_DEFINED - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_LINK_RATE -{ - NV_DP_1_62GBPS = 6, - NV_DP_2_70GBPS = 0xA, - NV_DP_5_40GBPS = 0x14, - NV_DP_8_10GBPS = 0x1E, -// Recommended Intermidiate Link Transfer Rates - NV_EDP_2_16GBPS = 8, - NV_EDP_2_43GBPS = 9, - NV_EDP_3_24GBPS = 0xC, - NV_EDP_4_32GBPS = 0x10 -} NV_DP_LINK_RATE; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_LANE_COUNT -{ - NV_DP_1_LANE = 1, - NV_DP_2_LANE = 2, - NV_DP_4_LANE = 4, -} NV_DP_LANE_COUNT; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_COLOR_FORMAT -{ - NV_DP_COLOR_FORMAT_RGB = 0, - NV_DP_COLOR_FORMAT_YCbCr422, - NV_DP_COLOR_FORMAT_YCbCr444, -} NV_DP_COLOR_FORMAT; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_COLORIMETRY -{ - NV_DP_COLORIMETRY_RGB = 0, - NV_DP_COLORIMETRY_YCbCr_ITU601, - NV_DP_COLORIMETRY_YCbCr_ITU709, -} NV_DP_COLORIMETRY; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_DYNAMIC_RANGE -{ - NV_DP_DYNAMIC_RANGE_VESA = 0, - NV_DP_DYNAMIC_RANGE_CEA, -} NV_DP_DYNAMIC_RANGE; - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PORT_INFO. -typedef enum _NV_DP_BPC -{ - NV_DP_BPC_DEFAULT = 0, - NV_DP_BPC_6, - NV_DP_BPC_8, - NV_DP_BPC_10, - NV_DP_BPC_12, - NV_DP_BPC_16, -} NV_DP_BPC; - - -#endif //#ifndef DISPLAYPORT_STRUCTS_DEFINED - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// All display port related data types definitions end -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetEDID -// -//! \fn NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID) -//! This function returns the EDID data for the specified GPU handle and connection bit mask. -//! displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set -//! \retval NVAPI_OK *pEDID contains valid data. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_DATA_NOT_FOUND The requested display does not contain an EDID. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! @{ - -#define NV_EDID_V1_DATA_SIZE 256 - -#define NV_EDID_DATA_SIZE NV_EDID_V1_DATA_SIZE - -typedef struct -{ - NvU32 version; //structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; -} NV_EDID_V1; - -//! Used in NvAPI_GPU_GetEDID() -typedef struct -{ - NvU32 version; //!< Structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; - NvU32 sizeofEDID; -} NV_EDID_V2; - -//! Used in NvAPI_GPU_GetEDID() -typedef struct -{ - NvU32 version; //!< Structure version - NvU8 EDID_Data[NV_EDID_DATA_SIZE]; - NvU32 sizeofEDID; - NvU32 edidId; //!< ID which always returned in a monotonically increasing counter. - //!< Across a split-EDID read we need to verify that all calls returned the same edidId. - //!< This counter is incremented if we get the updated EDID. - NvU32 offset; //!< Which 256-byte page of the EDID we want to read. Start at 0. - //!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE, - //!< call back again with offset+256 until we have read the entire buffer -} NV_EDID_V3; - -typedef NV_EDID_V3 NV_EDID; - -#define NV_EDID_VER1 MAKE_NVAPI_VERSION(NV_EDID_V1,1) -#define NV_EDID_VER2 MAKE_NVAPI_VERSION(NV_EDID_V2,2) -#define NV_EDID_VER3 MAKE_NVAPI_VERSION(NV_EDID_V3,3) -#define NV_EDID_VER NV_EDID_VER3 - -//! @} - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID); - -//! \ingroup gpu -//! Used in NV_GPU_CONNECTOR_DATA -typedef enum _NV_GPU_CONNECTOR_TYPE -{ - NVAPI_GPU_CONNECTOR_VGA_15_PIN = 0x00000000, - NVAPI_GPU_CONNECTOR_TV_COMPOSITE = 0x00000010, - NVAPI_GPU_CONNECTOR_TV_SVIDEO = 0x00000011, - NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = 0x00000013, - NVAPI_GPU_CONNECTOR_TV_SCART = 0x00000014, - NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = 0x00000016, - NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = 0x00000017, - NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = 0x00000018, - NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = 0x00000019, - NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = 0x0000001A, - NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = 0x00000020, - NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = 0x00000021, - NVAPI_GPU_CONNECTOR_DVI_I = 0x00000030, - NVAPI_GPU_CONNECTOR_DVI_D = 0x00000031, - NVAPI_GPU_CONNECTOR_ADC = 0x00000032, - NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = 0x00000038, - NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = 0x00000039, - NVAPI_GPU_CONNECTOR_SPWG = 0x00000040, - NVAPI_GPU_CONNECTOR_OEM = 0x00000041, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = 0x00000046, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = 0x00000047, - NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT = 0x00000048, - NVAPI_GPU_CONNECTOR_HDMI_A = 0x00000061, - NVAPI_GPU_CONNECTOR_HDMI_C_MINI = 0x00000063, - NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1 = 0x00000064, - NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2 = 0x00000065, - NVAPI_GPU_CONNECTOR_VIRTUAL_WFD = 0x00000070, //!< Deprecated. - NVAPI_GPU_CONNECTOR_USB_C = 0x00000071, - NVAPI_GPU_CONNECTOR_UNKNOWN = 0xFFFFFFFF, -} NV_GPU_CONNECTOR_TYPE; - -//////////////////////////////////////////////////////////////////////////////// -// -// NvAPI_TVOutput Information -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup tvapi -//! Used in NV_DISPLAY_TV_OUTPUT_INFO -typedef enum _NV_DISPLAY_TV_FORMAT -{ - NV_DISPLAY_TV_FORMAT_NONE = 0, - NV_DISPLAY_TV_FORMAT_SD_NTSCM = 0x00000001, - NV_DISPLAY_TV_FORMAT_SD_NTSCJ = 0x00000002, - NV_DISPLAY_TV_FORMAT_SD_PALM = 0x00000004, - NV_DISPLAY_TV_FORMAT_SD_PALBDGH = 0x00000008, - NV_DISPLAY_TV_FORMAT_SD_PALN = 0x00000010, - NV_DISPLAY_TV_FORMAT_SD_PALNC = 0x00000020, - NV_DISPLAY_TV_FORMAT_SD_576i = 0x00000100, - NV_DISPLAY_TV_FORMAT_SD_480i = 0x00000200, - NV_DISPLAY_TV_FORMAT_ED_480p = 0x00000400, - NV_DISPLAY_TV_FORMAT_ED_576p = 0x00000800, - NV_DISPLAY_TV_FORMAT_HD_720p = 0x00001000, - NV_DISPLAY_TV_FORMAT_HD_1080i = 0x00002000, - NV_DISPLAY_TV_FORMAT_HD_1080p = 0x00004000, - NV_DISPLAY_TV_FORMAT_HD_720p50 = 0x00008000, - NV_DISPLAY_TV_FORMAT_HD_1080p24 = 0x00010000, - NV_DISPLAY_TV_FORMAT_HD_1080i50 = 0x00020000, - NV_DISPLAY_TV_FORMAT_HD_1080p50 = 0x00040000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30 = 0x00080000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp30, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25 = 0x00100000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp25, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24 = 0x00200000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp24, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE = 0x00400000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_3840 = 0x00800000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_3840 = 0x00900000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_4096 = 0x00A00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_4096 = 0x00B00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_4096 = 0x00C00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_4096 = 0x00D00000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_4096 = 0x00E00000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp24_7680 = 0x01000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp25_7680 = 0x02000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp30_7680 = 0x04000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp48_7680 = 0x08000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp50_7680 = 0x09000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp60_7680 = 0x0A000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp100_7680 = 0x0B000000, - NV_DISPLAY_TV_FORMAT_UHD_8Kp120_7680 = 0x0C000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_3840 = 0x0D000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_4096 = 0x0E000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_4096 = 0x0F000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_3840 = 0x10000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_4096 = 0x11000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_3840 = 0x12000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp100_5120 = 0x13000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp120_5120 = 0x14000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp24_5120 = 0x15000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp25_5120 = 0x16000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp30_5120 = 0x17000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp48_5120 = 0x18000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp50_5120 = 0x19000000, - NV_DISPLAY_TV_FORMAT_UHD_4Kp60_5120 = 0x20000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp24_10240 = 0x21000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp25_10240 = 0x22000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp30_10240 = 0x23000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp48_10240 = 0x24000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp50_10240 = 0x25000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp60_10240 = 0x26000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp100_10240 = 0x27000000, - NV_DISPLAY_TV_FORMAT_UHD_10Kp120_10240 = 0x28000000, - - - NV_DISPLAY_TV_FORMAT_SD_OTHER = 0x30000000, - NV_DISPLAY_TV_FORMAT_ED_OTHER = 0x40000000, - NV_DISPLAY_TV_FORMAT_HD_OTHER = 0x50000000, - - NV_DISPLAY_TV_FORMAT_ANY = 0x80000000, - -} NV_DISPLAY_TV_FORMAT; - - -//! \ingroup dispcontrol -//! @{ -#define NVAPI_MAX_VIEW_TARGET 2 -#define NVAPI_ADVANCED_MAX_VIEW_TARGET 4 - -#ifndef _NV_TARGET_VIEW_MODE_ -#define _NV_TARGET_VIEW_MODE_ - -//! Used in NvAPI_SetView(). -typedef enum _NV_TARGET_VIEW_MODE -{ - NV_VIEW_MODE_STANDARD = 0, - NV_VIEW_MODE_CLONE = 1, - NV_VIEW_MODE_HSPAN = 2, - NV_VIEW_MODE_VSPAN = 3, - NV_VIEW_MODE_DUALVIEW = 4, - NV_VIEW_MODE_MULTIVIEW = 5, -} NV_TARGET_VIEW_MODE; -#endif - -//! @} - -// Following definitions are used in NvAPI_SetViewEx. - -//! Scaling modes - used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -typedef enum _NV_SCALING -{ - NV_SCALING_DEFAULT = 0, //!< No change - - // New Scaling Declarations - NV_SCALING_GPU_SCALING_TO_CLOSEST = 1, //!< Balanced - Full Screen - NV_SCALING_GPU_SCALING_TO_NATIVE = 2, //!< Force GPU - Full Screen - NV_SCALING_GPU_SCANOUT_TO_NATIVE = 3, //!< Force GPU - Centered\No Scaling - NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE = 5, //!< Force GPU - Aspect Ratio - NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6, //!< Balanced - Aspect Ratio - NV_SCALING_GPU_SCANOUT_TO_CLOSEST = 7, //!< Balanced - Centered\No Scaling - NV_SCALING_GPU_INTEGER_ASPECT_SCALING = 8, //!< Force GPU - Integer Scaling - - // Legacy Declarations - NV_SCALING_MONITOR_SCALING = NV_SCALING_GPU_SCALING_TO_CLOSEST, - NV_SCALING_ADAPTER_SCALING = NV_SCALING_GPU_SCALING_TO_NATIVE, - NV_SCALING_CENTERED = NV_SCALING_GPU_SCANOUT_TO_NATIVE, - NV_SCALING_ASPECT_SCALING = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE, - - NV_SCALING_CUSTOMIZED = 255 //!< For future use -} NV_SCALING; - -//! Rotate modes- used in NvAPI_SetViewEx(). - -//! \ingroup dispcontrol -typedef enum _NV_ROTATE -{ - NV_ROTATE_0 = 0, - NV_ROTATE_90 = 1, - NV_ROTATE_180 = 2, - NV_ROTATE_270 = 3, - NV_ROTATE_IGNORED = 4, -} NV_ROTATE; - -//! Color formats- used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -#define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) | \ - ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24 )) - - - -//! Color formats- used in NvAPI_SetViewEx(). -//! \ingroup dispcontrol -typedef enum _NV_FORMAT -{ - NV_FORMAT_UNKNOWN = 0, //!< unknown. Driver will choose one as following value. - NV_FORMAT_P8 = 41, //!< for 8bpp mode - NV_FORMAT_R5G6B5 = 23, //!< for 16bpp mode - NV_FORMAT_A8R8G8B8 = 21, //!< for 32bpp mode - NV_FORMAT_A16B16G16R16F = 113, //!< for 64bpp(floating point) mode. - -} NV_FORMAT; - -// TV standard - -typedef struct -{ - float x; //!< x-coordinate of the viewport top-left point - float y; //!< y-coordinate of the viewport top-left point - float w; //!< Width of the viewport - float h; //!< Height of the viewport -} NV_VIEWPORTF; - - - -//! \ingroup dispcontrol -//! The timing override is not supported yet; must be set to _AUTO. \n - - -typedef enum _NV_TIMING_OVERRIDE -{ - NV_TIMING_OVERRIDE_CURRENT = 0, //!< get the current timing - NV_TIMING_OVERRIDE_AUTO, //!< the timing the driver will use based the current policy - NV_TIMING_OVERRIDE_EDID, //!< EDID timing - NV_TIMING_OVERRIDE_DMT, //!< VESA DMT timing - NV_TIMING_OVERRIDE_DMT_RB, //!< VESA DMT timing with reduced blanking - NV_TIMING_OVERRIDE_CVT, //!< VESA CVT timing - NV_TIMING_OVERRIDE_CVT_RB, //!< VESA CVT timing with reduced blanking - NV_TIMING_OVERRIDE_GTF, //!< VESA GTF timing - NV_TIMING_OVERRIDE_EIA861, //!< EIA 861x pre-defined timing - NV_TIMING_OVERRIDE_ANALOG_TV, //!< analog SD/HDTV timing - NV_TIMING_OVERRIDE_CUST, //!< NV custom timings - NV_TIMING_OVERRIDE_NV_PREDEFINED, //!< NV pre-defined timing (basically the PsF timings) - NV_TIMING_OVERRIDE_NV_PSF = NV_TIMING_OVERRIDE_NV_PREDEFINED, - NV_TIMING_OVERRIDE_NV_ASPR, - NV_TIMING_OVERRIDE_SDI, //!< Override for SDI timing - - NV_TIMING_OVRRIDE_MAX, -}NV_TIMING_OVERRIDE; - - -#ifndef NV_TIMING_STRUCTS_DEFINED -#define NV_TIMING_STRUCTS_DEFINED - -//*********************** -// The Timing Structure -//*********************** -// -//! \ingroup dispcontrol -//! NVIDIA-specific timing extras \n -//! Used in NV_TIMING. -typedef struct tagNV_TIMINGEXT -{ - NvU32 flag; //!< Reserved for NVIDIA hardware-based enhancement, such as double-scan. - NvU16 rr; //!< Logical refresh rate to present - NvU32 rrx1k; //!< Physical vertical refresh rate in 0.001Hz - NvU32 aspect; //!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect - NvU16 rep; //!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,.. - NvU32 status; //!< Timing standard - NvU8 name[40]; //!< Timing name -}NV_TIMINGEXT; - - - -//! \ingroup dispcontrol -//!The very basic timing structure based on the VESA standard: -//! \code -//! |<----------------------------htotal--------------------------->| -//! ---------"active" video-------->|<-------blanking------>|<----- -//! |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->| -//! --------- -+-------------------------+ | | | | | -//! A A | | | | | | | -//! : : | | | | | | | -//! : : | | | | | | | -//! :vertical| addressable video | | | | | | -//! : visible| | | | | | | -//! : : | | | | | | | -//! : : | | | | | | | -//! vertical V | | | | | | | -//! total --+-------------------------+ | | | | | -//! : vb border | | | | | -//! : -----------------------------------+ | | | | -//! : vfp front porch | | | | -//! : -------------------------------------------+ | | | -//! : vsw sync width | | | -//! : ---------------------------------------------------+ | | -//! : vbp back porch | | -//! : -----------------------------------------------------------+ | -//! V vb border | -//! ---------------------------------------------------------------------------+ -//! \endcode -typedef struct _NV_TIMING -{ - // VESA scan out timing parameters: - NvU16 HVisible; //!< horizontal visible - NvU16 HBorder; //!< horizontal border - NvU16 HFrontPorch; //!< horizontal front porch - NvU16 HSyncWidth; //!< horizontal sync width - NvU16 HTotal; //!< horizontal total - NvU8 HSyncPol; //!< horizontal sync polarity: 1-negative, 0-positive - - NvU16 VVisible; //!< vertical visible - NvU16 VBorder; //!< vertical border - NvU16 VFrontPorch; //!< vertical front porch - NvU16 VSyncWidth; //!< vertical sync width - NvU16 VTotal; //!< vertical total - NvU8 VSyncPol; //!< vertical sync polarity: 1-negative, 0-positive - - NvU16 interlaced; //!< 1-interlaced, 0-progressive - NvU32 pclk; //!< pixel clock in 10 kHz - - //other timing related extras - NV_TIMINGEXT etc; -}NV_TIMING; -#endif //NV_TIMING_STRUCTS_DEFINED - - -//! \addtogroup dispcontrol -//! Timing-related constants -//! @{ -#define NV_TIMING_H_SYNC_POSITIVE 0 -#define NV_TIMING_H_SYNC_NEGATIVE 1 -#define NV_TIMING_H_SYNC_DEFAULT NV_TIMING_H_SYNC_NEGATIVE -// -#define NV_TIMING_V_SYNC_POSITIVE 0 -#define NV_TIMING_V_SYNC_NEGATIVE 1 -#define NV_TIMING_V_SYNC_DEFAULT NV_TIMING_V_SYNC_POSITIVE -// -#define NV_TIMING_PROGRESSIVE 0 -#define NV_TIMING_INTERLACED 1 -#define NV_TIMING_INTERLACED_EXTRA_VBLANK_ON_FIELD2 1 -#define NV_TIMING_INTERLACED_NO_EXTRA_VBLANK_ON_FIELD2 2 -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetView -// -//! \fn NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView) -//! This function lets the caller modify the target display arrangement of the selected source display handle in any nView mode. -//! It can also modify or extend the source display in Dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 90 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pTargetInfo Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] targetCount Count of target devices specified in pTargetInfo. -//! \param [in] targetView Target view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -//! Used in NvAPI_SetView() and NvAPI_GetView() -typedef struct -{ - NvU32 version; //!< (IN) structure version - NvU32 count; //!< (IN) target count - struct - { - NvU32 deviceMask; //!< (IN/OUT) Device mask - NvU32 sourceId; //!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU. - NvU32 bPrimary:1; //!< (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary. - //!< NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view. - NvU32 bInterlaced:1; //!< (IN/OUT) Indicates if the timing being used on this monitor is interlaced. - NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary. - NvU32 bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetView(). Turns off optimization & forces OS to set supplied mode. - } target[NVAPI_MAX_VIEW_TARGET]; -} NV_VIEW_TARGET_INFO; - -//! \ingroup dispcontrol -#define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2) - -//! \ingroup dispcontrol -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.") -NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetViewEx -// -//! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView) -//! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes. -//! It also allows to modify or extend the source display in dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] pathCount Count of paths specified in pPathInfo. -//! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -#define NVAPI_MAX_DISPLAY_PATH NVAPI_MAX_VIEW_TARGET - -//! \ingroup dispcontrol -#define NVAPI_ADVANCED_MAX_DISPLAY_PATH NVAPI_ADVANCED_MAX_VIEW_TARGET - - - -//! \ingroup dispcontrol -//! Used in NV_DISPLAY_PATH_INFO. -typedef struct -{ - NvU32 deviceMask; //!< (IN) Device mask - NvU32 sourceId; //!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?) - NvU32 bPrimary:1; //!< (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary. - //!< NvAPI_SetViewEx() automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view. - NV_GPU_CONNECTOR_TYPE connector; //!< (IN) Specify connector type. For TV only. - - // source mode information - NvU32 width; //!< (IN) Width of the mode - NvU32 height; //!< (IN) Height of the mode - NvU32 depth; //!< (IN) Depth of the mode - NV_FORMAT colorFormat; //!< Color format if it needs to be specified. Not used now. - - //rotation setting of the mode - NV_ROTATE rotation; //!< (IN) Rotation setting. - - // the scaling mode - NV_SCALING scaling; //!< (IN) Scaling setting - - // Timing info - NvU32 refreshRate; //!< (IN) Refresh rate of the mode - NvU32 interlaced:1; //!< (IN) Interlaced mode flag - - NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE - - // Windows desktop position - NvU32 posx; //!< (IN/OUT) X-offset of this display on the Windows desktop - NvU32 posy; //!< (IN/OUT) Y-offset of this display on the Windows desktop - NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary. - - NvU32 bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetViewEx(). Turns off optimization & forces OS to set supplied mode. - NvU32 bFocusDisplay:1;//!< (IN) If set, this display path should have the focus after the GPU topology change - NvU32 gpuId:24; //!< (IN) the physical display/target Gpu id which is the owner of the scan out (for SLI multimon, display from the slave Gpu) - -} NV_DISPLAY_PATH; - -//! \ingroup dispcontrol -//! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx(). -typedef struct -{ - NvU32 version; //!< (IN) Structure version - NvU32 count; //!< (IN) Path count - NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH]; -} NV_DISPLAY_PATH_INFO_V3; - -//! \ingroup dispcontrol -//! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx(). -typedef struct -{ - NvU32 version; //!< (IN) Structure version - NvU32 count; //!< (IN) Path count - NV_DISPLAY_PATH path[NVAPI_ADVANCED_MAX_DISPLAY_PATH]; -} NV_DISPLAY_PATH_INFO; - -//! \addtogroup dispcontrol -//! Macro for constructing the version fields of NV_DISPLAY_PATH_INFO -//! @{ -#define NV_DISPLAY_PATH_INFO_VER NV_DISPLAY_PATH_INFO_VER4 -#define NV_DISPLAY_PATH_INFO_VER4 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,4) -#define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,3) -#define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2) -#define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,1) -//! @} -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetViewEx -// -//! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView) -//! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes. -//! It also allows to modify or extend the source display in dualview mode. -//! \note Maps the selected source to the associated target Ids. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view. -//! The first device entry in the array is the physical primary. -//! The device entry with the lowest source id is the desktop primary. -//! \param [in] pathCount Count of paths specified in pPathInfo. -//! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.") -NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView); - - - -/////////////////////////////////////////////////////////////////////////////// -// SetDisplayConfig/GetDisplayConfig -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol - -typedef struct _NV_POSITION -{ - NvS32 x; - NvS32 y; -} NV_POSITION; - -//! \ingroup dispcontrol -typedef struct _NV_RESOLUTION -{ - NvU32 width; - NvU32 height; - NvU32 colorDepth; -} NV_RESOLUTION; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 -{ - NvU32 version; - - // Rotation and Scaling - NV_ROTATE rotation; //!< (IN) rotation setting. - NV_SCALING scaling; //!< (IN) scaling setting. - - // Refresh Rate - NvU32 refreshRate1K; //!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored - //!< This is the value which driver reports to the OS. - // Flags - NvU32 interlaced:1; //!< (IN) Interlaced mode flag, ignored if refreshRate == 0 - NvU32 primary:1; //!< (IN) Declares primary display in clone configuration. This is *NOT* GDI Primary. - //!< Only one target can be primary per source. If no primary is specified, the first - //!< target will automatically be primary. -#ifdef NV_PAN_AND_SCAN_DEFINED - NvU32 isPanAndScanTarget:1; //!< Whether on this target Pan and Scan is enabled or has to be enabled. Valid only - //!< when the target is part of clone topology. -#else - NvU32 reservedBit1:1; -#endif - NvU32 disableVirtualModeSupport:1; - NvU32 isPreferredUnscaledTarget:1; - NvU32 reserved:27; - // TV format information - NV_GPU_CONNECTOR_TYPE connector; //!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE - NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE - //!< In case of NvAPI_DISP_GetDisplayConfig(), this field will indicate the currently applied TV format; - //!< if no TV format is applied, this field will have NV_DISPLAY_TV_FORMAT_NONE value. - //!< In case of NvAPI_DISP_SetDisplayConfig(), this field should only be set in case of TVs; - //!< for other displays this field will be ignored and resolution & refresh rate specified in input will be used to apply the TV format. - - // Backend (raster) timing standard - NV_TIMING_OVERRIDE timingOverride; //!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT - NV_TIMING timing; //!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST - //!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may - //!< tweak this value for HDTV, stereo, etc., before reporting it to the OS. -} NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1; - -//! \ingroup dispcontrol -typedef NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO; - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1,1) - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1 -{ - NvU32 displayId; //!< Display ID - NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display. -} NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 -{ - NvU32 displayId; //!< Display ID - NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required - NvU32 targetId; //!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored. -} NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2; - - -//! \ingroup dispcontrol -//! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO -typedef NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 NV_DISPLAYCONFIG_PATH_TARGET_INFO; - - -//! \ingroup dispcontrol -typedef enum _NV_DISPLAYCONFIG_SPANNING_ORIENTATION -{ - NV_DISPLAYCONFIG_SPAN_NONE = 0, - NV_DISPLAYCONFIG_SPAN_HORIZONTAL = 1, - NV_DISPLAYCONFIG_SPAN_VERTICAL = 2, -} NV_DISPLAYCONFIG_SPANNING_ORIENTATION; - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 -{ - NV_RESOLUTION resolution; - NV_FORMAT colorFormat; //!< Ignored at present, must be NV_FORMAT_UNKNOWN (0) - NV_POSITION position; //!< Is all positions are 0 or invalid, displays will be automatically - //!< positioned from left to right with GDI Primary at 0,0, and all - //!< other displays in the order of the path array. - NV_DISPLAYCONFIG_SPANNING_ORIENTATION spanningOrientation; //!< Spanning is only supported on XP - NvU32 bGDIPrimary : 1; - NvU32 bSLIFocus : 1; - NvU32 reserved : 30; //!< Must be 0 -} NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1; - - - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V1 -{ - NvU32 version; - NvU32 reserved_sourceId; //!< This field is reserved. There is ongoing debate if we need this field. - //!< Identifies sourceIds used by Windows. If all sourceIds are 0, - //!< these will be computed automatically. - NvU32 targetInfoCount; //!< Number of elements in targetInfo array - NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1* targetInfo; - NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important -} NV_DISPLAYCONFIG_PATH_INFO_V1; - -//! \ingroup dispcontrol -//! This define is temporary and must be removed once DVS failure is fixed. -#define _NV_DISPLAYCONFIG_PATH_INFO_V2 _NV_DISPLAYCONFIG_PATH_INFO - -//! \ingroup dispcontrol -typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V2 -{ - NvU32 version; - union { - NvU32 sourceId; //!< Identifies sourceId used by Windows CCD. This can be optionally set. - NvU32 reserved_sourceId; //!< Only for compatibility - }; - - NvU32 targetInfoCount; //!< Number of elements in targetInfo array - NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2* targetInfo; - NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important - NvU32 IsNonNVIDIAAdapter : 1; //!< True for non-NVIDIA adapter. - NvU32 reserved : 31; //!< Must be 0 - void *pOSAdapterID; //!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID - //!< type, type casted to void *. -} NV_DISPLAYCONFIG_PATH_INFO_V2; - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V1,1) - -//! \ingroup dispcontrol -#define NV_DISPLAYCONFIG_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2,2) - -#ifndef NV_DISPLAYCONFIG_PATH_INFO_VER - -typedef NV_DISPLAYCONFIG_PATH_INFO_V2 NV_DISPLAYCONFIG_PATH_INFO; - -#define NV_DISPLAYCONFIG_PATH_INFO_VER NV_DISPLAYCONFIG_PATH_INFO_VER2 - -typedef NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 NV_DISPLAYCONFIG_SOURCE_MODE_INFO; - -#endif - - -//! \ingroup dispcontrol -typedef enum _NV_DISPLAYCONFIG_FLAGS -{ - NV_DISPLAYCONFIG_VALIDATE_ONLY = 0x00000001, - NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE = 0x00000002, - NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED = 0x00000004, //!< Driver reload is permitted if necessary - NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION = 0x00000008, //!< Refresh OS mode list. - NV_FORCE_COMMIT_VIDPN = 0x00000010, //!< Tell OS to avoid optimizing CommitVidPn call during a modeset -} NV_DISPLAYCONFIG_FLAGS; - - -#define NVAPI_UNICODE_STRING_MAX 2048 -#define NVAPI_BINARY_DATA_MAX 4096 - -typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX]; -typedef const NvU16 *NvAPI_LPCWSTR; - -// Common - - - -//! \ingroup gpuclock -//! @{ -#define NVAPI_MAX_GPU_CLOCKS 32 -#define NVAPI_MAX_GPU_PUBLIC_CLOCKS 32 -#define NVAPI_MAX_GPU_PERF_CLOCKS 32 -#define NVAPI_MAX_GPU_PERF_VOLTAGES 16 -#define NVAPI_MAX_GPU_PERF_PSTATES 16 -//! @} - -//! \ingroup gpuclock -typedef enum _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID -{ - NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE = 0, - NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED = NVAPI_MAX_GPU_PERF_VOLTAGES, -} NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID; - -//! \ingroup gpuclock -typedef enum _NV_GPU_PUBLIC_CLOCK_ID -{ - NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS = 0, - NVAPI_GPU_PUBLIC_CLOCK_MEMORY = 4, - NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR = 7, - NVAPI_GPU_PUBLIC_CLOCK_VIDEO = 8, - NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED = NVAPI_MAX_GPU_PUBLIC_CLOCKS, -} NV_GPU_PUBLIC_CLOCK_ID; - - -//! \addtogroup gpupstate -//! @{ - -typedef enum _NV_GPU_PERF_PSTATE_ID -{ - NVAPI_GPU_PERF_PSTATE_P0 = 0, - NVAPI_GPU_PERF_PSTATE_P1, - NVAPI_GPU_PERF_PSTATE_P2, - NVAPI_GPU_PERF_PSTATE_P3, - NVAPI_GPU_PERF_PSTATE_P4, - NVAPI_GPU_PERF_PSTATE_P5, - NVAPI_GPU_PERF_PSTATE_P6, - NVAPI_GPU_PERF_PSTATE_P7, - NVAPI_GPU_PERF_PSTATE_P8, - NVAPI_GPU_PERF_PSTATE_P9, - NVAPI_GPU_PERF_PSTATE_P10, - NVAPI_GPU_PERF_PSTATE_P11, - NVAPI_GPU_PERF_PSTATE_P12, - NVAPI_GPU_PERF_PSTATE_P13, - NVAPI_GPU_PERF_PSTATE_P14, - NVAPI_GPU_PERF_PSTATE_P15, - NVAPI_GPU_PERF_PSTATE_UNDEFINED = NVAPI_MAX_GPU_PERF_PSTATES, - NVAPI_GPU_PERF_PSTATE_ALL, - -} NV_GPU_PERF_PSTATE_ID; - -//! @} - - - -//! \addtogroup gpupstate -//! @{ - -#define NVAPI_MAX_GPU_PSTATE20_PSTATES 16 -#define NVAPI_MAX_GPU_PSTATE20_CLOCKS 8 -#define NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES 4 - -//! Used to identify clock type -typedef enum -{ - //! Clock domains that use single frequency value within given pstate - NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE = 0, - - //! Clock domains that allow range of frequency values within given pstate - NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE, -} NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID; - -//! Used to describe both voltage and frequency deltas -typedef struct -{ - //! Value of parameter delta (in respective units [kHz, uV]) - NvS32 value; - - struct - { - //! Min value allowed for parameter delta (in respective units [kHz, uV]) - NvS32 min; - - //! Max value allowed for parameter delta (in respective units [kHz, uV]) - NvS32 max; - } valueRange; -} NV_GPU_PERF_PSTATES20_PARAM_DELTA; - -//! Used to describe single clock entry -typedef struct -{ - //! ID of the clock domain - NV_GPU_PUBLIC_CLOCK_ID domainId; - - //! Clock type ID - NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID typeId; - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Current frequency delta from nominal settings in (kHz) - NV_GPU_PERF_PSTATES20_PARAM_DELTA freqDelta_kHz; - - //! Clock domain type dependant information - union - { - struct - { - //! Clock frequency within given pstate in (kHz) - NvU32 freq_kHz; - } single; - - struct - { - //! Min clock frequency within given pstate in (kHz) - NvU32 minFreq_kHz; - - //! Max clock frequency within given pstate in (kHz) - NvU32 maxFreq_kHz; - - //! Voltage domain ID and value range in (uV) required for this clock - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; - NvU32 minVoltage_uV; - NvU32 maxVoltage_uV; - } range; - } data; -} NV_GPU_PSTATE20_CLOCK_ENTRY_V1; - -//! Used to describe single base voltage entry -typedef struct -{ - //! ID of the voltage domain - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Current base voltage settings in [uV] - NvU32 volt_uV; - - NV_GPU_PERF_PSTATES20_PARAM_DELTA voltDelta_uV; // Current base voltage delta from nominal settings in [uV] -} NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1; - -//! Used in NvAPI_GPU_GetPstates20() interface call. - -typedef struct -{ - //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER) - NvU32 version; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Number of populated pstates - NvU32 numPstates; - - //! Number of populated clocks (per pstate) - NvU32 numClocks; - - //! Number of populated base voltages (per pstate) - NvU32 numBaseVoltages; - - //! Performance state (P-State) settings - //! Valid index range is 0 to numPstates-1 - struct - { - //! ID of the P-State - NV_GPU_PERF_PSTATE_ID pstateId; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Array of clock entries - //! Valid index range is 0 to numClocks-1 - NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS]; - - //! Array of baseVoltage entries - //! Valid index range is 0 to numBaseVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES]; -} NV_GPU_PERF_PSTATES20_INFO_V1; - -//! Used in NvAPI_GPU_GetPstates20() interface call. - -typedef struct _NV_GPU_PERF_PSTATES20_INFO_V2 -{ - //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER) - NvU32 version; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Number of populated pstates - NvU32 numPstates; - - //! Number of populated clocks (per pstate) - NvU32 numClocks; - - //! Number of populated base voltages (per pstate) - NvU32 numBaseVoltages; - - //! Performance state (P-State) settings - //! Valid index range is 0 to numPstates-1 - struct - { - //! ID of the P-State - NV_GPU_PERF_PSTATE_ID pstateId; - - NvU32 bIsEditable:1; - - //! These bits are reserved for future use (must be always 0) - NvU32 reserved:31; - - //! Array of clock entries - //! Valid index range is 0 to numClocks-1 - NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS]; - - //! Array of baseVoltage entries - //! Valid index range is 0 to numBaseVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES]; - - //! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality - //! Valid index range is 0 to numVoltages-1 - struct - { - //! Number of populated voltages - NvU32 numVoltages; - - //! Array of voltage entries - //! Valid index range is 0 to numVoltages-1 - NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 voltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES]; - } ov; -} NV_GPU_PERF_PSTATES20_INFO_V2; - -typedef NV_GPU_PERF_PSTATES20_INFO_V2 NV_GPU_PERF_PSTATES20_INFO; - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V1 -#define NV_GPU_PERF_PSTATES20_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V1,1) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2 -#define NV_GPU_PERF_PSTATES20_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,2) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2 -#define NV_GPU_PERF_PSTATES20_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,3) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO -#define NV_GPU_PERF_PSTATES20_INFO_VER NV_GPU_PERF_PSTATES20_INFO_VER3 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetDisplayDriverVersion -//! \fn NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion) -//! This function returns a struct that describes aspects of the display driver -//! build. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] hNvDisplay NVIDIA display handle. -//! \param [out] pVersion Pointer to NV_DISPLAY_DRIVER_VERSION struc -//! -//! \retval NVAPI_ERROR -//! \retval NVAPI_OK -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup driverapi -//! Used in NvAPI_GetDisplayDriverVersion() -typedef struct -{ - NvU32 version; // Structure version - NvU32 drvVersion; - NvU32 bldChangeListNum; - NvAPI_ShortString szBuildBranchString; - NvAPI_ShortString szAdapterString; -} NV_DISPLAY_DRIVER_VERSION; - -//! \ingroup driverapi -#define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1) - - -//! \ingroup driverapi -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.") -NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion -// -//! DESCRIPTION: This API returns display driver version and driver-branch string. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] pDriverVersion Contains the driver version after successful return. -//! \param [out] szBuildBranchString Contains the driver-branch string after successful return. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString); - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - -} NV_DISPLAY_DRIVER_MEMORY_INFO_V1; - - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces. - -} NV_DISPLAY_DRIVER_MEMORY_INFO_V2; - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfo(). -typedef struct -{ - NvU32 version; //!< Version info - NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer. - NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces. - NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time. - NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations. - NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces. - NvU32 dedicatedVideoMemoryEvictionsSize; //!< Size(in kb) of the total size of memory released as a result of the evictions. - NvU32 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU - //!< video memory to make room for other allocations. -} NV_DISPLAY_DRIVER_MEMORY_INFO_V3; - -//! \ingroup driverapi -typedef NV_DISPLAY_DRIVER_MEMORY_INFO_V3 NV_DISPLAY_DRIVER_MEMORY_INFO; - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V1 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V1,1) - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V2 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V2,2) - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V3 -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3,3) - -//! \ingroup driverapi -#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetMemoryInfo -// -//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU. -//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_DISPLAY_DRIVER_MEMORY_INFO). -//! -//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 177 -//! -//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted. -//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_DISPLAY_DRIVER_MEMORY_INFO. -//! -//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_DISPLAY_DRIVER_MEMORY_INFO structure version mismatch. -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.") -NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_DISPLAY_DRIVER_MEMORY_INFO *pMemoryInfo); - - -//! \ingroup driverapi -//! Used in NvAPI_GPU_GetMemoryInfoEx(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU64 dedicatedVideoMemory; //!< Size(in bytes) of the physical framebuffer. - NvU64 availableDedicatedVideoMemory; //!< Size(in bytes) of the available physical framebuffer for allocating video memory surfaces. - NvU64 systemVideoMemory; //!< Size(in bytes) of system memory the driver allocates at load time. - NvU64 sharedSystemMemory; //!< Size(in bytes) of shared system memory that driver is allowed to commit for surfaces across all allocations. - NvU64 curAvailableDedicatedVideoMemory; //!< Size(in bytes) of the current available physical framebuffer for allocating video memory surfaces. - NvU64 dedicatedVideoMemoryEvictionsSize; //!< Size(in bytes) of the total size of memory released as a result of the evictions. - NvU64 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU - //!< video memory to make room for other allocations. - NvU64 dedicatedVideoMemoryPromotionsSize; //!< Size(in bytes) of the total size of memory allocated as a result of the promotions. - NvU64 dedicatedVideoMemoryPromotionCount; //!< Indicates the number of promotion events that caused an allocation to be promoted to dedicated video memory -} NV_GPU_MEMORY_INFO_EX_V1; - -//! \ingroup driverapi -typedef NV_GPU_MEMORY_INFO_EX_V1 NV_GPU_MEMORY_INFO_EX; - -//! \ingroup driverapi -//! Macro for constructing the version field of NV_GPU_MEMORY_INFO_EX_V1 -#define NV_GPU_MEMORY_INFO_EX_VER_1 MAKE_NVAPI_VERSION(NV_GPU_MEMORY_INFO_EX_V1,1) - -//! \ingroup driverapi -#define NV_GPU_MEMORY_INFO_EX_VER NV_GPU_MEMORY_INFO_EX_VER_1 - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetMemoryInfoEx -// -//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU. -//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_GPU_MEMORY_INFO_EX). -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 520 -//! -//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted. -//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_GPU_MEMORY_INFO_EX. -//! -//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_GPU_MEMORY_INFO_EX structure version mismatch. -//! -//! \ingroup driverapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_MEMORY_INFO_EX *pMemoryInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get] -// -//! \name NvAPI_OGL_ExpertModeSet[Get] Functions -//@{ -//! This function configures OpenGL Expert Mode, an API usage feedback and -//! advice reporting mechanism. The effects of this call are -//! applied only to the current context, and are reset to the -//! defaults when the context is destroyed. -//! -//! \note This feature is valid at runtime only when GLExpert -//! functionality has been built into the OpenGL driver -//! installed on the system. All Windows Vista OpenGL -//! drivers provided by NVIDIA have this instrumentation -//! included by default. Windows XP, however, requires a -//! special display driver available with the NVIDIA -//! PerfSDK found at developer.nvidia.com. -//! -//! \note These functions are valid only for the current OpenGL -//! context. Calling these functions prior to creating a -//! context and calling MakeCurrent with it will result -//! in errors and undefined behavior. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param expertDetailMask Mask made up of NVAPI_OGLEXPERT_DETAIL bits, -//! this parameter specifies the detail level in -//! the feedback stream. -//! -//! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits, -//! this parameter specifies the areas of -//! functional interest. -//! -//! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits, -//! this parameter specifies the feedback output -//! location. -//! -//! \param expertCallback Used in conjunction with OUTPUT_TO_CALLBACK, -//! this is a simple callback function the user -//! may use to obtain the feedback stream. The -//! function will be called once per fully -//! qualified feedback stream extry. -//! -//! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU found -//! \retval NVAPI_OPENGL_CONTEXT_NOT_CURRENT No NVIDIA OpenGL context -//! which supports GLExpert -//! has been made current -//! \retval NVAPI_ERROR OpenGL driver failed to load properly -//! \retval NVAPI_OK Success -// -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup oglapi -//! @{ -#define NVAPI_OGLEXPERT_DETAIL_NONE 0x00000000 -#define NVAPI_OGLEXPERT_DETAIL_ERROR 0x00000001 -#define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK 0x00000002 -#define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO 0x00000004 -#define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO 0x00000008 -#define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING 0x00000010 -#define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING 0x00000020 -#define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING 0x00000040 -#define NVAPI_OGLEXPERT_DETAIL_ALL 0xFFFFFFFF - -#define NVAPI_OGLEXPERT_REPORT_NONE 0x00000000 -#define NVAPI_OGLEXPERT_REPORT_ERROR 0x00000001 -#define NVAPI_OGLEXPERT_REPORT_SWFALLBACK 0x00000002 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX 0x00000004 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY 0x00000008 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB 0x00000010 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER 0x00000020 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT 0x00000040 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP 0x00000080 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL 0x00000200 -#define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE 0x00000400 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT 0x00000800 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE 0x00001000 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM 0x00002000 -#define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO 0x00004000 -#define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI 0x00008000 -#define NVAPI_OGLEXPERT_REPORT_ALL 0xFFFFFFFF - - -#define NVAPI_OGLEXPERT_OUTPUT_TO_NONE 0x00000000 -#define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE 0x00000001 -#define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER 0x00000004 -#define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK 0x00000008 -#define NVAPI_OGLEXPERT_OUTPUT_TO_ALL 0xFFFFFFFF - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK -// -//! DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple -//! callback function the user may use to obtain the feedback -//! stream. The function will be called once per fully qualified -//! feedback stream entry. -//! -//! \param categoryId Contains the bit from the NVAPI_OGLEXPERT_REPORT -//! mask that corresponds to the current message -//! \param messageId Unique ID for the current message -//! \param detailLevel Contains the bit from the NVAPI_OGLEXPERT_DETAIL -//! mask that corresponds to the current message -//! \param objectId Unique ID of the object that corresponds to the -//! current message -//! \param messageStr Text string from the current message -//! -//! \ingroup oglapi -/////////////////////////////////////////////////////////////////////////////// -typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr); - - - -//! \ingroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel, - NvU32 expertReportMask, - NvU32 expertOutputMask, - NVAPI_OGLEXPERT_CALLBACK expertCallback); - -//! \addtogroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel, - NvU32 *pExpertReportMask, - NvU32 *pExpertOutputMask, - NVAPI_OGLEXPERT_CALLBACK *pExpertCallback); - -//@} -/////////////////////////////////////////////////////////////////////////////// -// -//! \name NvAPI_OGL_ExpertModeDefaultsSet[Get] Functions -//! -//@{ -//! This function configures OpenGL Expert Mode global defaults. These settings -//! apply to any OpenGL application which starts up after these -//! values are applied (i.e. these settings *do not* apply to -//! currently running applications). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param expertDetailLevel Value which specifies the detail level in -//! the feedback stream. This is a mask made up -//! of NVAPI_OGLEXPERT_LEVEL bits. -//! -//! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits, -//! this parameter specifies the areas of -//! functional interest. -//! -//! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits, -//! this parameter specifies the feedback output -//! location. Note that using OUTPUT_TO_CALLBACK -//! here is meaningless and has no effect, but -//! using it will not cause an error. -//! -//! \return ::NVAPI_ERROR or ::NVAPI_OK -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel, - NvU32 expertReportMask, - NvU32 expertOutputMask); - -//! \addtogroup oglapi -//! SUPPORTED OS: Windows 7 and higher -//! -NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel, - NvU32 *pExpertReportMask, - NvU32 *pExpertOutputMask); -//@} - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumPhysicalGPUs -// -//! This function returns an array of physical GPU handles. -//! Each handle represents a physical GPU present in the system. -//! That GPU may be part of an SLI configuration, or may not be visible to the OS directly. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! \note In drivers older than 105.00, all physical GPU handles get invalidated on a -//! modeset. So the calling applications need to renum the handles after every modeset.\n -//! With drivers 105.00 and up, all physical GPU handles are constant. -//! Physical GPU handles are constant as long as the GPUs are not physically moved and -//! the SBIOS VGA order is unchanged. -//! -//! For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs() -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \par Introduced in -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumTCCPhysicalGPUs -// -//! This function returns an array of physical GPU handles that are in TCC Mode. -//! Each handle represents a physical GPU present in the system in TCC Mode. -//! That GPU may not be visible to the OS directly. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! NOTE: Handles enumerated by this API are only valid for NvAPIs that are tagged as TCC_SUPPORTED -//! If handle is passed to any other API, it will fail with NVAPI_INVALID_HANDLE -//! -//! For WDDM GPU handles please use NvAPI_EnumPhysicalGPUs() -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! \param [out] nvGPUHandle Physical GPU array that will contain all TCC Physical GPUs -//! \param [out] pGpuCount count represent the number of valid entries in nvGPUHandle -//! -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumTCCPhysicalGPUs( NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumLogicalGPUs -// -//! This function returns an array of logical GPU handles. -//! -//! Each handle represents one or more GPUs acting in concert as a single graphics device. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with logical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! \note All logical GPUs handles get invalidated on a GPU topology change, so the calling -//! application is required to renum the logical GPU handles to get latest physical handle -//! mapping after every GPU topology change activated by a call to NvAPI_SetGpuTopologies(). -//! -//! To detect if SLI rendering is enabled, use NvAPI_D3D_GetCurrentSLIState(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay -// -//! This function returns an array of physical GPU handles associated with the specified display. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array nvGPUHandle will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! If the display corresponds to more than one physical GPU, the first GPU returned -//! is the one with the attached active output. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay -// -//! This function returns a physical GPU handle associated with the specified unattached display. -//! The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL. -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay -// -//! This function returns the logical GPU handle associated with the specified display. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! hNvDisp can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; pLogicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU -// -//! This function returns the logical GPU handle associated with specified physical GPU handle. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGPU is not valid; pLogicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU -// -//! This function returns the physical GPU handles associated with the specified logical GPU handle. -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! The array hPhysicalGPU will be filled with physical GPU handle values. The returned -//! gpuCount determines how many entries in the array are valid. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hLogicalGPU is not valid; hPhysicalGPU is NULL -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_LOGICAL_GPU_HANDLE hLogicalGPU was not a logical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU,NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetPhysicalGPUFromGPUID -// -//! Do not use this function for new software development. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT gpuId is zero or pPhysicalGPU is NULL -//! \retval NVAPI_OK Handle was returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromGPUID(NvU32 gpuId, NvPhysicalGpuHandle *pPhysicalGPU); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetGPUIDfromPhysicalGPU -// -//! Do not use this function for new software development. -// -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL or invalid. Re-enumerate the GPU handles. -//! \retval NVAPI_OK Handle was returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetGPUIDfromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pGpuId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetShaderSubPipeCount -// -//! DESCRIPTION: This function retrieves the number of Shader SubPipes on the GPU -//! On newer architectures, this corresponds to the number of SM units -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT: pCount is NULL -//! \retval NVAPI_OK: *pCount is set -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetShaderSubPipeCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetGpuCoreCount -// -//! DESCRIPTION: Retrieves the total number of cores defined for a GPU. -//! Returns 0 on architectures that don't define GPU cores. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \retval ::NVAPI_INVALID_ARGUMENT pCount is NULL -//! \retval ::NVAPI_OK *pCount is set -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \retval ::NVAPI_NOT_SUPPORTED API call is not supported on current architecture -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllOutputs -// -//! This function returns set of all GPU-output identifiers as a bitmask. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pOutputsMask); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs -// -//! This function is the same as NvAPI_GPU_GetAllOutputs() but returns only the set of GPU output -//! identifiers that are connected to display devices. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs -// -//! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputs() but returns only the set of GPU-output -//! identifiers that can be selected in an SLI configuration. -//! NOTE: This function matches NvAPI_GPU_GetConnectedOutputs() -//! - On systems which are not SLI capable. -//! - If the queried GPU is not part of a valid SLI group. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - - - -//! \ingroup gpu -typedef enum -{ - NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0, - NV_MONITOR_CONN_TYPE_VGA, - NV_MONITOR_CONN_TYPE_COMPONENT, - NV_MONITOR_CONN_TYPE_SVIDEO, - NV_MONITOR_CONN_TYPE_HDMI, - NV_MONITOR_CONN_TYPE_DVI, - NV_MONITOR_CONN_TYPE_LVDS, - NV_MONITOR_CONN_TYPE_DP, - NV_MONITOR_CONN_TYPE_COMPOSITE, - NV_MONITOR_CONN_TYPE_UNKNOWN = -1 -} NV_MONITOR_CONN_TYPE; - - -//! \addtogroup gpu -//! @{ -#define NV_GPU_CONNECTED_IDS_FLAG_UNCACHED NV_BIT(0) //!< Get uncached connected devices -#define NV_GPU_CONNECTED_IDS_FLAG_SLI NV_BIT(1) //!< Get devices such that those can be selected in an SLI configuration -#define NV_GPU_CONNECTED_IDS_FLAG_LIDSTATE NV_BIT(2) //!< Get devices such that to reflect the Lid State -#define NV_GPU_CONNECTED_IDS_FLAG_FAKE NV_BIT(3) //!< Get devices that includes the fake connected monitors -#define NV_GPU_CONNECTED_IDS_FLAG_EXCLUDE_MST NV_BIT(4) //!< Excludes devices that are part of the multi stream topology. - -//! @} - -//! \ingroup gpu -typedef struct _NV_GPU_DISPLAYIDS -{ - NvU32 version; - NV_MONITOR_CONN_TYPE connectorType; //!< out: vga, tv, dvi, hdmi and dp. This is reserved for future use and clients should not rely on this information. Instead get the - //!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx - NvU32 displayId; //!< this is a unique identifier for each device - - NvU32 isDynamic : 1; //!< if bit is set then this display is part of MST topology and it's a dynamic - NvU32 isMultiStreamRootNode : 1; //!< if bit is set then this displayID belongs to a multi stream enabled connector(root node). Note that when multi stream is enabled and - //!< a single multi stream capable monitor is connected to it, the monitor will share the display id with the RootNode. - //!< When there is more than one monitor connected in a multi stream topology, then the root node will have a separate displayId. - NvU32 isActive : 1; //!< if bit is set then this display is being actively driven - NvU32 isCluster : 1; //!< if bit is set then this display is the representative display - NvU32 isOSVisible : 1; //!< if bit is set, then this display is reported to the OS - NvU32 isWFD : 1; //!< Deprecated. Will always return 0. - NvU32 isConnected : 1; //!< if bit is set, then this display is connected - - NvU32 reservedInternal : 10; //!< Do not use - NvU32 isPhysicallyConnected : 1; //!< if bit is set, then this display is a phycially connected display; Valid only when isConnected bit is set - NvU32 reserved : 14; //!< must be zero -} NV_GPU_DISPLAYIDS; - -//! \ingroup gpu -//! Macro for constructing the version field of ::_NV_GPU_DISPLAYIDS -#define NV_GPU_DISPLAYIDS_VER1 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,1) -#define NV_GPU_DISPLAYIDS_VER2 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,3) - -#define NV_GPU_DISPLAYIDS_VER NV_GPU_DISPLAYIDS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedDisplayIds -// -//! -//! DESCRIPTION: Due to space limitation NvAPI_GPU_GetConnectedOutputs can return maximum 32 devices, but -//! this is no longer true for DPMST. NvAPI_GPU_GetConnectedDisplayIds will return all -//! the connected display devices in the form of displayIds for the associated hPhysicalGpu. -//! This function can accept set of flags to request cached, uncached, sli and lid to get the connected devices. -//! Default value for flags will be cached . -//! -//! HOW TO USE: 1) for each PhysicalGpu, make a call to get the number of connected displayId's -//! using NvAPI_GPU_GetConnectedDisplayIds by passing the pDisplayIds as NULL -//! On call success: -//! -//! 2) If pDisplayIdCount is greater than 0, allocate memory based on pDisplayIdCount. Then make a call NvAPI_GPU_GetConnectedDisplayIds to populate DisplayIds. -//! However, if pDisplayIdCount is 0, do not make this call. -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] hPhysicalGpu - GPU selection -//! \param [in] flags - One or more defines from NV_GPU_CONNECTED_IDS_FLAG_* as valid flags. -//! \param [in,out] pDisplayIds - Pointer to an NV_GPU_DISPLAYIDS struct, each entry represents a one displayID and its attributes -//! \param [in] pDisplayIdCount - Number of displayId's. -//! -//! \retval NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pDisplayIds or pDisplayIdCount is NULL -//! \retval NVAPI_OK: *pDisplayIds contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetConnectedDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount, __in NvU32 flags); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllDisplayIds -// -//! DESCRIPTION: This API returns display IDs for all possible outputs on the GPU. -//! For DPMST connector, it will return display IDs for all the video sinks in the topology. \n -//! HOW TO USE: 1. The first call should be made to get the all display ID count. To get the display ID count, send in \n -//! a) hPhysicalGpu - a valid GPU handle(enumerated using NvAPI_EnumPhysicalGPUs()) as input, \n -//! b) pDisplayIds - NULL, as we just want to get the display ID count. \n -//! c) pDisplayIdCount - a valid pointer to NvU32, whose value is set to ZERO. \n -//! If all parameters are correct and this call is successful, this call will return the display ID's count. \n -//! 2. To get the display ID array, make the second call to NvAPI_GPU_GetAllDisplayIds() with \n -//! a) hPhysicalGpu - should be same value which was sent in first call, \n -//! b) pDisplayIds - pointer to the display ID array allocated by caller based on display ID count, \n -//! eg. malloc(sizeof(NV_GPU_DISPLAYIDS) * pDisplayIdCount). \n -//! c) pDisplayIdCount - a valid pointer to NvU32. This indicates for how many display IDs \n -//! the memory is allocated(pDisplayIds) by the caller. \n -//! If all parameters are correct and this call is successful, this call will return the display ID array and actual -//! display ID count (which was obtained in the first call to NvAPI_GPU_GetAllDisplayIds). If the input display ID count is -//! less than the actual display ID count, it will overwrite the input and give the pDisplayIdCount as actual count and the -//! API will return NVAPI_INSUFFICIENT_BUFFER. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu GPU selection. -//! \param [in,out] DisplayIds Pointer to an array of NV_GPU_DISPLAYIDS structures, each entry represents one displayID -//! and its attributes. -//! \param [in,out] pDisplayIdCount As input, this parameter indicates the number of display's id's for which caller has -//! allocated the memory. As output, it will return the actual number of display IDs. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INSUFFICIENT_BUFFER When the input buffer(pDisplayIds) is less than the actual number of display IDs, this API -//! will return NVAPI_INSUFFICIENT_BUFFER. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetAllDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState -// -//! This function is similar to NvAPI_GPU_GetConnectedOutputs(), and returns the connected display identifiers that are connected -//! as an output mask but unlike NvAPI_GPU_GetConnectedOutputs() this API "always" reflects the Lid State in the output mask. -//! Thus if you expect the LID close state to be available in the connection mask use this API. -//! - If LID is closed then this API will remove the LID panel from the connected display identifiers. -//! - If LID is open then this API will reflect the LID panel in the connected display identifiers. -//! -//! \note This API should be used on notebook systems and on systems where the LID state is required in the connection -//! output mask. On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs(). -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState -// -//! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputsWithLidState() but returns only the set -//! of GPU-output identifiers that can be selected in an SLI configuration. With SLI disabled, -//! this function matches NvAPI_GPU_GetConnectedOutputsWithLidState(). -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 170 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.") -NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetSystemType -// -//! \fn NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType) -//! This function identifies whether the GPU is a notebook GPU or a desktop GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL -//! \retval NVAPI_OK *pSystemType contains the GPU system type -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetSystemType() -typedef enum -{ - NV_SYSTEM_TYPE_UNKNOWN = 0, - NV_SYSTEM_TYPE_LAPTOP = 1, - NV_SYSTEM_TYPE_DESKTOP = 2, - -} NV_SYSTEM_TYPE; - - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetActiveOutputs -// -//! This function is the same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU output -//! identifiers that are actively driving display devices. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL. -//! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_SetEDID -// -//! Thus function sets the EDID data for the specified GPU handle and connection bit mask. -//! User can either send (Gpu handle & output id) or only display Id in variable displayOutputId parameter & hPhysicalGpu parameter can be default handle (0). -//! \note The EDID will be cached across the boot session and will be enumerated to the OS in this call. -//! To remove the EDID set sizeofEDID to zero. -//! OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically. -//! -//! This feature will NOT be supported on the following boards: -//! - GeForce -//! - Quadro VX -//! - Tesla -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 100 -//! -//! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set -//! \retval NVAPI_OK *pEDID data was applied to the requested displayOutputId. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_NOT_SUPPORTED For the above mentioned GPUs -//! \retval NVAPI_INVALID_USER_PRIVILEGE The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetOutputType -// -//! \fn NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType) -//! This function returns the output type. User can either specify both 'physical GPU handle and outputId (exactly 1 bit set - see \ref handles)' or -//! a valid displayId in the outputId parameter. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \Version Earliest supported ForceWare version: 82.61 -//! -//! \retval NVAPI_INVALID_ARGUMENT outputId, pOutputType is NULL; or if outputId parameter is not displayId and either it has > 1 bit set or hPhysicalGpu is NULL. -//! \retval NVAPI_OK *pOutputType contains a NvGpuOutputType value -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -//! used in NvAPI_GPU_GetOutputType() -typedef enum _NV_GPU_OUTPUT_TYPE -{ - NVAPI_GPU_OUTPUT_UNKNOWN = 0, - NVAPI_GPU_OUTPUT_CRT = 1, //!< CRT display device - NVAPI_GPU_OUTPUT_DFP = 2, //!< Digital Flat Panel display device - NVAPI_GPU_OUTPUT_TV = 3, //!< TV display device -} NV_GPU_OUTPUT_TYPE; - - - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination -// -//! This function determines if a set of GPU outputs can be active -//! simultaneously. While a GPU may have outputs, typically they cannot -//! all be active at the same time due to internal resource sharing. -//! -//! Given a physical GPU handle and a mask of candidate outputs, this call -//! will return NVAPI_OK if all of the specified outputs can be driven -//! simultaneously. It will return NVAPI_INVALID_COMBINATION if they cannot. -//! -//! Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \retval NVAPI_OK Combination of outputs in outputsMask are valid (can be active simultaneously). -//! \retval NVAPI_INVALID_COMBINATION Combination of outputs in outputsMask are NOT valid. -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or outputsMask does not have at least 2 bits set. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetFullName -// -//! This function retrieves the full GPU name as an ASCII string - for example, "Quadro FX 1400". -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers -// -//! This function returns the PCI identifiers associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \param DeviceId The internal PCI device identifier for the GPU. -//! \param SubSystemId The internal PCI subsystem identifier for the GPU. -//! \param RevisionId The internal PCI device-specific revision identifier for the GPU. -//! \param ExtDeviceId The external PCI device identifier for the GPU. -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or an argument is NULL -//! \retval NVAPI_OK Arguments are populated with PCI identifiers -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pDeviceId,NvU32 *pSubSystemId,NvU32 *pRevisionId,NvU32 *pExtDeviceId); - - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetGPUType(). -typedef enum _NV_GPU_TYPE -{ - NV_SYSTEM_TYPE_GPU_UNKNOWN = 0, - NV_SYSTEM_TYPE_IGPU = 1, //!< Integrated GPU - NV_SYSTEM_TYPE_DGPU = 2, //!< Discrete GPU -} NV_GPU_TYPE; - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetGPUType -// -//! DESCRIPTION: This function returns the GPU type (integrated or discrete). -//! See ::NV_GPU_TYPE. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 173 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu -//! \retval NVAPI_OK *pGpuType contains the GPU type -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetGPUType(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_TYPE *pGpuType); - - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetBusType() -typedef enum _NV_GPU_BUS_TYPE -{ - NVAPI_GPU_BUS_TYPE_UNDEFINED = 0, - NVAPI_GPU_BUS_TYPE_PCI = 1, - NVAPI_GPU_BUS_TYPE_AGP = 2, - NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3, - NVAPI_GPU_BUS_TYPE_FPCI = 4, - NVAPI_GPU_BUS_TYPE_AXI = 5, -} NV_GPU_BUS_TYPE; -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusType -// -//! This function returns the type of bus associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusType is NULL. -//! \retval NVAPI_OK *pBusType contains bus identifier. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS_TYPE *pBusType); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusId -// -//! DESCRIPTION: Returns the ID of the bus associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 167 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusId is NULL. -//! \retval NVAPI_OK *pBusId contains the bus ID. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBusSlotId -// -//! DESCRIPTION: Returns the ID of the bus slot associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 167 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusSlotId is NULL. -//! \retval NVAPI_OK *pBusSlotId contains the bus slot ID. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetIRQ -// -//! This function returns the interrupt number associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pIRQ is NULL. -//! \retval NVAPI_OK *pIRQ contains interrupt number. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosRevision -// -//! This function returns the revision of the video BIOS associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL. -//! \retval NVAPI_OK *pBiosRevision contains revision number. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision -// -//! This function returns the OEM revision of the video BIOS associated with this GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL -//! \retval NVAPI_OK *pBiosRevision contains revision number -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString -// -//! This function returns the full video BIOS version string in the form of xx.xx.xx.xx.yy where -//! - xx numbers come from NvAPI_GPU_GetVbiosRevision() and -//! - yy comes from NvAPI_GPU_GetVbiosOEMRevision(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL. -//! \retval NVAPI_OK szBiosRevision contains version string. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu,NvAPI_ShortString szBiosRevision); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAGPAperture -// -//! This function returns the AGP aperture in megabytes. -//! -//! \deprecated Do not use this function - it is deprecated in release 455. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_NOT_SUPPORTED -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.") -NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate -// -//! This function returns the current AGP Rate (0 = AGP not present, 1 = 1x, 2 = 2x, etc.). -//! -//! \deprecated Do not use this function - it is deprecated in release 455. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_NOT_SUPPORTED -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.") -NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pRate); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth -// -//! This function returns the number of PCIE lanes being used for the PCIE interface -//! downstream from the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pWidth is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pWidth); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize -// -//! This function returns the physical size of framebuffer in KB. This does NOT include any -//! system RAM that may be dedicated for use by the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pSize is NULL -//! \retval NVAPI_OK Call successful -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize -// -//! This function returns the virtual size of framebuffer in KB. This includes the physical RAM plus any -//! system RAM that has been dedicated for use by the GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 90 -//! -//! \retval NVAPI_INVALID_ARGUMENT pSize is NULL. -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle. -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetQuadroStatus -// -//! This function retrieves the Quadro status for the GPU (1 if Quadro, 0 if GeForce) -//! -//! This API is deprecated and it is recommended to instead query -//! NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ support from the API -//! NvAPI_GPU_QueryWorkstationFeatureSupport. -//! \deprecated Do not use this function - it is deprecated in release 460. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 460.") -NVAPI_INTERFACE NvAPI_GPU_GetQuadroStatus(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pStatus); - - -//! \ingroup gpu -typedef struct _NV_BOARD_INFO -{ - NvU32 version; //!< structure version - NvU8 BoardNum[16]; //!< Board Serial Number - -}NV_BOARD_INFO_V1; - -#define NV_BOARD_INFO_VER1 MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1,1) -#ifndef NV_BOARD_INFO_VER -//! \ingroup gpu -typedef NV_BOARD_INFO_V1 NV_BOARD_INFO; -//! \ingroup gpu -//! \ingroup gpu -#define NV_BOARD_INFO_VER NV_BOARD_INFO_VER1 -#endif - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetBoardInfo -// -//! DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM. -//! -//! \param [in] hPhysicalGpu Physical GPU Handle. -//! \param [in,out] NV_BOARD_INFO Board Information. -//! -//! TCC_SUPPORTED -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE handle passed is not a physical GPU handle -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval ::NVAPI_INVALID_POINTER pBoardInfo is NULL -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of the INFO struct is not supported -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetRamBusWidth -// -//! This function returns the width of the GPU's RAM memory bus. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 100 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetRamBusWidth(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusWidth); - - - -//! Used in NvAPI_GPU_GetArchInfo() -typedef struct -{ - NvU32 version; - - NvU32 architecture; - NvU32 implementation; - NvU32 revision; - -} NV_GPU_ARCH_INFO_V1; - -//! NV_GPU_ARCH_INFO() values to identify Architecture level for the GPU. -typedef enum _NV_GPU_ARCHITECTURE_ID -{ - - NV_GPU_ARCHITECTURE_T2X = 0xE0000020, - NV_GPU_ARCHITECTURE_T3X = 0xE0000030, - NV_GPU_ARCHITECTURE_T4X = 0xE0000040, - NV_GPU_ARCHITECTURE_T12X = 0xE0000040, - NV_GPU_ARCHITECTURE_NV40 = 0x00000040, - NV_GPU_ARCHITECTURE_NV50 = 0x00000050, - NV_GPU_ARCHITECTURE_G78 = 0x00000060, - NV_GPU_ARCHITECTURE_G80 = 0x00000080, - NV_GPU_ARCHITECTURE_G90 = 0x00000090, - NV_GPU_ARCHITECTURE_GT200 = 0x000000A0, - NV_GPU_ARCHITECTURE_GF100 = 0x000000C0, - NV_GPU_ARCHITECTURE_GF110 = 0x000000D0, - NV_GPU_ARCHITECTURE_GK100 = 0x000000E0, - NV_GPU_ARCHITECTURE_GK110 = 0x000000F0, - NV_GPU_ARCHITECTURE_GK200 = 0x00000100, - NV_GPU_ARCHITECTURE_GM000 = 0x00000110, - NV_GPU_ARCHITECTURE_GM200 = 0x00000120, - NV_GPU_ARCHITECTURE_GP100 = 0x00000130, - NV_GPU_ARCHITECTURE_GV100 = 0x00000140, - NV_GPU_ARCHITECTURE_GV110 = 0x00000150, - NV_GPU_ARCHITECTURE_TU100 = 0x00000160, - NV_GPU_ARCHITECTURE_GA100 = 0x00000170, - NV_GPU_ARCHITECTURE_AD100 = 0x00000190, - -}NV_GPU_ARCHITECTURE_ID; - -//! NV_GPU_ARCH_INFO() values to identify GPU Architecture Implementation. -typedef enum _NV_GPU_ARCH_IMPLEMENTATION_ID -{ - - NV_GPU_ARCH_IMPLEMENTATION_T20 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_T30 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_T35 = 0x00000005, - - NV_GPU_ARCH_IMPLEMENTATION_T40 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_T124 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_NV40 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_NV41 = 0x00000001, - NV_GPU_ARCH_IMPLEMENTATION_NV42 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_NV43 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_NV44 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_NV44A = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_NV46 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_NV47 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_NV49 = 0x00000009, - NV_GPU_ARCH_IMPLEMENTATION_NV4B = 0x0000000B, - NV_GPU_ARCH_IMPLEMENTATION_NV4C = 0x0000000C, - NV_GPU_ARCH_IMPLEMENTATION_NV4E = 0x0000000E, - - NV_GPU_ARCH_IMPLEMENTATION_NV50 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_NV63 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_NV67 = 0x00000007, - - NV_GPU_ARCH_IMPLEMENTATION_G84 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_G86 = 0x00000006, - - NV_GPU_ARCH_IMPLEMENTATION_G92 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_G94 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_G96 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_G98 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GT200 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GT212 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GT214 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GT215 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_GT216 = 0x00000005, - NV_GPU_ARCH_IMPLEMENTATION_GT218 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_MCP77 = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_GT21C = 0x0000000B, - NV_GPU_ARCH_IMPLEMENTATION_MCP79 = 0x0000000C, - NV_GPU_ARCH_IMPLEMENTATION_GT21A = 0x0000000D, - NV_GPU_ARCH_IMPLEMENTATION_MCP89 = 0x0000000F, - - NV_GPU_ARCH_IMPLEMENTATION_GF100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GF104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GF106 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_GF108 = 0x00000001, - - NV_GPU_ARCH_IMPLEMENTATION_GF110 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GF116 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GF117 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GF118 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_GF119 = 0x00000009, - - NV_GPU_ARCH_IMPLEMENTATION_GK104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GK106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GK107 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GK20A = 0x0000000A, - NV_GPU_ARCH_IMPLEMENTATION_GK110 = 0x00000000, - - NV_GPU_ARCH_IMPLEMENTATION_GK208 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GM204 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GM206 = 0x00000006, - - NV_GPU_ARCH_IMPLEMENTATION_GP100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GP000 = 0x00000001, - NV_GPU_ARCH_IMPLEMENTATION_GP102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GP104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_GP106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_GP107 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_GP108 = 0x00000008, - - NV_GPU_ARCH_IMPLEMENTATION_GV100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GV10B = 0x0000000B, - - NV_GPU_ARCH_IMPLEMENTATION_TU100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_TU102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_TU104 = 0x00000004, - NV_GPU_ARCH_IMPLEMENTATION_TU106 = 0x00000006, - NV_GPU_ARCH_IMPLEMENTATION_TU116 = 0x00000008, - NV_GPU_ARCH_IMPLEMENTATION_TU117 = 0x00000007, - NV_GPU_ARCH_IMPLEMENTATION_TU000 = 0x00000001, - - NV_GPU_ARCH_IMPLEMENTATION_GA100 = 0x00000000, - NV_GPU_ARCH_IMPLEMENTATION_GA102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_GA104 = 0x00000004, - - NV_GPU_ARCH_IMPLEMENTATION_AD102 = 0x00000002, - NV_GPU_ARCH_IMPLEMENTATION_AD103 = 0x00000003, - NV_GPU_ARCH_IMPLEMENTATION_AD104 = 0x00000004, - -}NV_GPU_ARCH_IMPLEMENTATION_ID; - -typedef enum _NV_GPU_CHIP_REVISION -{ - NV_GPU_CHIP_REV_EMULATION_QT = 0x00000000, //!< QT chip - NV_GPU_CHIP_REV_EMULATION_FPGA = 0x00000001, //!< FPGA implementation of the chipset - NV_GPU_CHIP_REV_A01 = 0x00000011, //!< First silicon chipset revision - NV_GPU_CHIP_REV_A02 = 0x00000012, //!< Second Silicon chipset revision - NV_GPU_CHIP_REV_A03 = 0x00000013, //!< Third Silicon chipset revision - NV_GPU_CHIP_REV_UNKNOWN = 0xffffffff, //!< Unknown chip revision -}NV_GPU_CHIP_REVISION; - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetArchInfo() -typedef struct -{ - NvU32 version; - - union - { - NvU32 architecture; //!< architecture and architecture_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_ARCHITECTURE_ID architecture_id; //!< specifies the architecture level for the GPU. - }; - union - { - NvU32 implementation; //!< implementation and implementation_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_ARCH_IMPLEMENTATION_ID implementation_id; //!< specifies the implementation of the architecture for the GPU. - }; - union - { - NvU32 revision; //!< revision and revision_id are the same. The former is NvU32 while the latter is an enum made for readability. - NV_GPU_CHIP_REVISION revision_id; //!< specifies the architecture revision of the GPU. - }; - -} NV_GPU_ARCH_INFO_V2; - -//! \ingroup gpu -typedef NV_GPU_ARCH_INFO_V2 NV_GPU_ARCH_INFO; - -//! \ingroup gpu -#define NV_GPU_ARCH_INFO_VER_1 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V1,1) -#define NV_GPU_ARCH_INFO_VER_2 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V2,2) -#define NV_GPU_ARCH_INFO_VER NV_GPU_ARCH_INFO_VER_2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetArchInfo -// -//! \fn NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo) -//! This function retrieves the architecture, implementation and chip revision for the specified GPU . -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! \since Release: 85 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo); - - - -/////////////////////////////////////////////////////////////////////////////////// -// I2C API -// Provides ability to read or write data using I2C protocol. -// These APIs allow I2C access only to DDC monitors - - -//! \ingroup i2capi -//! @{ -#define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER 4096 -#define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS 4 -#define NVAPI_DISPLAY_DEVICE_MASK_MAX 24 -#define NVAPI_I2C_SPEED_DEPRECATED 0xFFFF - -typedef enum -{ - NVAPI_I2C_SPEED_DEFAULT, //!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting. - NVAPI_I2C_SPEED_3KHZ, - NVAPI_I2C_SPEED_10KHZ, - NVAPI_I2C_SPEED_33KHZ, - NVAPI_I2C_SPEED_100KHZ, - NVAPI_I2C_SPEED_200KHZ, - NVAPI_I2C_SPEED_400KHZ, -} NV_I2C_SPEED; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed). -} NV_I2C_INFO_V1; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED. - NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED). -} NV_I2C_INFO_V2; - -//! Used in NvAPI_I2CRead() and NvAPI_I2CWrite() -typedef struct -{ - NvU32 version; //!< The structure version. - NvU32 displayMask; //!< The Display Mask of the concerned display. - NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port - //!< (FALSE) of the concerned display. - NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For - //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored - //!< here as 0xA0. This matches the position within the byte sent by the master, as - //!< the last bit is reserved to specify the read or write direction. - NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register - //!< address should be sent. - NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this - //!< field must be 0. - NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command). - NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written. - NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED. - NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED). - NvU8 portId; //!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set) - //!< Optional for pre-Kepler - NvU32 bIsPortIdSet; //!< set this flag on if and only if portid value is set -} NV_I2C_INFO_V3; - -typedef NV_I2C_INFO_V3 NV_I2C_INFO; - -#define NV_I2C_INFO_VER3 MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3) -#define NV_I2C_INFO_VER2 MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2) -#define NV_I2C_INFO_VER1 MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1) - -#define NV_I2C_INFO_VER NV_I2C_INFO_VER3 -//! @} - -/***********************************************************************************/ - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_I2CRead -// -//! This function reads the data buffer from the I2C port. -//! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1. -//! -//! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case, -//! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned. -//! -//! If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in -//! the combined format described in the I2C specification. The register address will be written, followed by -//! reading into the data buffer. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [out] NV_I2C_INFO *pI2cInfo The I2C data input structure -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported. -//! \retval NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements -//! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum -//! -//! \ingroup i2capi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_I2CWrite -// -//! This function writes the data buffer to the I2C port. -//! -//! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1. -//! -//! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case, -//! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned. -//! -//! If a register address is specified (i.e. regAddrSize is positive), then the register address will be written -//! and the data buffer will immediately follow without a restart. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [in] pI2cInfo The I2C data input structure -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported. -//! \retval NVAPI_INVALID_ARGUMENT Argument does not meet specified requirements -//! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE Argument exceeds the maximum -//! -//! \ingroup i2capi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_WorkstationFeatureSetup -// -//! \fn NvAPI_GPU_WorkstationFeatureSetup(NvPhysicalGpuHandle hPhysicalGpu, NvU32 featureEnableMask, NvU32 featureDisableMask) -//! DESCRIPTION: This API configures the driver for a set of workstation features. -//! The driver can allocate the memory resources accordingly. -//! -//! SUPPORTED OS: Windows 7 -//! -//! -//! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved -//! using NvAPI_EnumPhysicalGPUs. A value of NULL is permitted and applies the same operation -//! to all GPU handles enumerated by NvAPI_EnumPhysicalGPUs. -//! \param [in] featureEnableMask Mask of features the caller requests to enable for use -//! \param [in] featureDisableMask Mask of features the caller requests to disable -//! -//! As a general rule, features in the enable and disable masks are expected to be disjoint, although the disable -//! mask has precedence and a feature flagged in both masks will be disabled. -//! -//! \retval ::NVAPI_OK configuration request succeeded -//! \retval ::NVAPI_ERROR configuration request failed -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle. -//! \retval ::NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE requested feature set does not have all resources allocated for completeness. -//! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to -//! keep compatibility with apps written against Win7. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef enum -{ - NVAPI_GPU_WORKSTATION_FEATURE_MASK_SWAPGROUP = 0x00000001, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_STEREO = 0x00000010, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_WARPING = 0x00000100, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_PIXINTENSITY = 0x00000200, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_GRAYSCALE = 0x00000400, - NVAPI_GPU_WORKSTATION_FEATURE_MASK_BPC10 = 0x00001000 -} NVAPI_GPU_WORKSTATION_FEATURE_MASK; - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureSetup(__in NvPhysicalGpuHandle hPhysicalGpu, __in NvU32 featureEnableMask, __in NvU32 featureDisableMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_WorkstationFeatureQuery -// -//! DESCRIPTION: This API queries the current set of workstation features. -//! -//! SUPPORTED OS: Windows 7 -//! -//! -//! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved -//! using NvAPI_EnumPhysicalGPUs. -//! \param [out] pConfiguredFeatureMask Mask of features requested for use by client drivers -//! \param [out] pConsistentFeatureMask Mask of features that have all resources allocated for completeness. -//! -//! \retval ::NVAPI_OK configuration request succeeded -//! \retval ::NVAPI_ERROR configuration request failed -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle. -//! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to -//! keep compatibility with apps written against Win7. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhysicalGpu, __out_opt NvU32 *pConfiguredFeatureMask, __out_opt NvU32 *pConsistentFeatureMask); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus -// -//! \fn NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus) -//! DESCRIPTION: This function returns a GPU's HDCP support status. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 175 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION -// -//////////////////////////////////////////////////////////////////////////////// - - -//! \addtogroup gpu -//! @{ - - -//! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_FUSE_STATE -{ - NV_GPU_HDCP_FUSE_STATE_UNKNOWN = 0, - NV_GPU_HDCP_FUSE_STATE_DISABLED = 1, - NV_GPU_HDCP_FUSE_STATE_ENABLED = 2, -} NV_GPU_HDCP_FUSE_STATE; - - -//! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_KEY_SOURCE -{ - NV_GPU_HDCP_KEY_SOURCE_UNKNOWN = 0, - NV_GPU_HDCP_KEY_SOURCE_NONE = 1, - NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2, - NV_GPU_HDCP_KEY_SOURCE_SBIOS = 3, - NV_GPU_HDCP_KEY_SOURCE_I2C_ROM = 4, - NV_GPU_HDCP_KEY_SOURCE_FUSES = 5, -} NV_GPU_HDCP_KEY_SOURCE; - - -//! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS -typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE -{ - NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0, - NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT = 1, - NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2, -} NV_GPU_HDCP_KEY_SOURCE_STATE; - - -//! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus() -typedef struct -{ - NvU32 version; //! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS - NV_GPU_HDCP_FUSE_STATE hdcpFuseState; //! GPU's HDCP fuse state - NV_GPU_HDCP_KEY_SOURCE hdcpKeySource; //! GPU's HDCP key source - NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState; //! GPU's HDCP key source state -} NV_GPU_GET_HDCP_SUPPORT_STATUS; - - -//! Macro for constructing the version for structure NV_GPU_GET_HDCP_SUPPORT_STATUS -#define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS,1) - - -//! @} - - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus); - - - - -//! \ingroup gpucuda -//! @{ - -//! defgroup nvcomp_gpu_top NVIDIA Compute GPU Topology Flags -//! @{ - -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE NV_BIT(0) //!< This is Read only GPU flag - Physics capable GPU. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE NV_BIT(1) //!< This is Read/Write GPU flag - Indicates GPU is already enabled for physics. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_DEDICATED NV_BIT(2) //!< This is Read only GPU flag - Physics enabled GPU which is *dedicated* for physics indicates - //!< this compute capable GPU was automatically made usable for Physx on CUDA. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED NV_BIT(3) //!< This is Read only GPU flag - Physics GPU which is recommended by the driver. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE NV_BIT(4) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE NV_BIT(16) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_DISABLED NV_BIT(17) //!< This is Read only GPU flag. -#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE NV_BIT(21) //!< This is Read only GPU flag - PhysX is able to use this GPU (PhysX is installed, etc) - -//! @} - -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 gpuCount; //!< Total number of compute-capable GPUs - - struct - { - NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle - NvU32 flags; //!< One or more flags from \ref nvcomp_gpu_top - - } computeGpus[NVAPI_MAX_GPU_PER_TOPOLOGY]; //!< Array of compute-capable physical GPUs. - -} NV_COMPUTE_GPU_TOPOLOGY_V1; - - -typedef struct _NV_COMPUTE_GPU -{ - NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle - NvU32 flags; //!< One or more flags from \ref nvcomp_gpu_top - -} NV_COMPUTE_GPU; - -typedef struct _NV_COMPUTE_GPU_TOPOLOGY_V2 -{ - NvU32 version; //!< Structure version - NvU32 gpuCount; //!< Size of array - NV_COMPUTE_GPU *computeGpus; //!< Array of compute-capable physical GPUs (allocate memory of size of Physical gpuCount of system). - -} NV_COMPUTE_GPU_TOPOLOGY_V2; - -//! Macro for constructing the version field of NV_COMPUTE_GPU_TOPOLOGY -#define NV_COMPUTE_GPU_TOPOLOGY_VER1 MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V1,1) - -#define NV_COMPUTE_GPU_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V2,2) -typedef NV_COMPUTE_GPU_TOPOLOGY_V2 NV_COMPUTE_GPU_TOPOLOGY; - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_CudaEnumComputeCapableGpus -// -//! DESCRIPTION: This API enumerates one or more compute-capable GPUs. -//! Note that this API is deprecated and should no longer be used for new software development. -//! \deprecated Do not use this function - it is deprecated in release 319. -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in,out] pComputeTopo Pointer to the structure NV_COMPUTE_GPU_TOPOLOGY. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! The gpuCount indicates if one or more compute-capable GPUs are found. -//! gpuCount >= 1 means atleast one compute-capable GPU is found. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported, initialize to NV_COMPUTE_GPU_TOPOLOGY_VER. -//! \retval ::NVAPI_ERROR Enumeration of the GPUs failed. Make sure at least one NVIDIA GPU exists in the system. -//! -//! \ingroup gpucuda -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 319.") -NVAPI_INTERFACE NvAPI_GPU_CudaEnumComputeCapableGpus(__inout NV_COMPUTE_GPU_TOPOLOGY *pComputeTopo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetTachReading -// -//! DESCRIPTION: This API retrieves the fan speed tachometer reading for the specified physical GPU. -//! -//! HOW TO USE: -//! - NvU32 Value = 0; -//! - ret = NvAPI_GPU_GetTachReading(hPhysicalGpu, &Value); -//! - On call success: -//! - Value contains the tachometer reading -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGpu GPU selection. -//! \param [out] pValue Pointer to a variable to get the tachometer reading -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_NOT_SUPPORTED - functionality not supported -//! \retval ::NVAPI_API_NOT_INTIALIZED - nvapi not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - invalid argument passed -//! \retval ::NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide) -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle -//! -//! \ingroup gpucooler -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue); - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCStatusInfo -// -//! \fn NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_STATUS_INFO *pECCStatusInfo); -//! DESCRIPTION: This function returns ECC memory status information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for which ECC -//! status information is to be retrieved. -//! \param [out] pECCStatusInfo A pointer to an ECC status structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup gpuecc -//! Used in NV_GPU_ECC_STATUS_INFO. -typedef enum _NV_ECC_CONFIGURATION -{ - NV_ECC_CONFIGURATION_NOT_SUPPORTED = 0, - NV_ECC_CONFIGURATION_DEFERRED, //!< Changes require a POST to take effect - NV_ECC_CONFIGURATION_IMMEDIATE, //!< Changes can optionally be made to take effect immediately -} NV_ECC_CONFIGURATION; - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCStatusInfo(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 isSupported : 1; //!< ECC memory feature support - NV_ECC_CONFIGURATION configurationOptions; //!< Supported ECC memory feature configuration options - NvU32 isEnabled : 1; //!< Active ECC memory setting -} NV_GPU_ECC_STATUS_INFO; - -//! \ingroup gpuecc -//! Macro for constructing the version field of NV_GPU_ECC_STATUS_INFO -#define NV_GPU_ECC_STATUS_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_STATUS_INFO,1) - -//! \ingroup gpuecc -NVAPI_INTERFACE NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_STATUS_INFO *pECCStatusInfo); - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCErrorInfo()/ -typedef struct -{ - NvU32 version; //!< Structure version - struct - { - NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last boot - NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last boot - } current; - struct - { - NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last counter reset - NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last counter reset - } aggregate; -} NV_GPU_ECC_ERROR_INFO; - -//! \ingroup gpuecc -//! Macro for constructing the version field of NV_GPU_ECC_ERROR_INFO -#define NV_GPU_ECC_ERROR_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_ERROR_INFO,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCErrorInfo -// -//! \fn NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_ERROR_INFO *pECCErrorInfo); -//! -//! DESCRIPTION: This function returns ECC memory error information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC error information is to be -//! retrieved. -//! \param [out] pECCErrorInfo A pointer to an ECC error structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_ARGUMENT incorrect param value -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION structure version is not supported, initialize to NV_GPU_ECC_ERROR_INFO_VER. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup gpuecc - -NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_ERROR_INFO *pECCErrorInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_ResetECCErrorInfo -// -//! DESCRIPTION: This function resets ECC memory error counters. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \requires Administrator privileges since release 430.39 -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC error information is to be -//! cleared. -//! \param [in] bResetCurrent Reset the current ECC error counters. -//! \param [in] bResetAggregate Reset the aggregate ECC error counters. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gpuecc -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bResetCurrent, - NvU8 bResetAggregate); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetECCConfigurationInfo -// -//! \fn NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu, -//! NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo); -//! DESCRIPTION: This function returns ECC memory configuration information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which ECC configuration information -//! is to be retrieved. -//! \param [out] pECCConfigurationInfo A pointer to an ECC -//! configuration structure. -//! -//! \retval ::NVAPI_OK The request was completed successfully. -//! \retval ::NVAPI_ERROR An unknown error occurred. -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle. -//! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid. -//! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid. -//! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided. -//! \retval ::NVAPI_NOT_SUPPORTED The request is not supported. -//! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpuecc -//! Used in NvAPI_GPU_GetECCConfigurationInfo(). -typedef struct -{ - NvU32 version; //! Structure version - NvU32 isEnabled : 1; //! Current ECC configuration stored in non-volatile memory - NvU32 isEnabledByDefault : 1; //! Factory default ECC configuration (static) -} NV_GPU_ECC_CONFIGURATION_INFO; - -//! \ingroup gpuecc -//! Macro for consstructing the verion field of NV_GPU_ECC_CONFIGURATION_INFO -#define NV_GPU_ECC_CONFIGURATION_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_CONFIGURATION_INFO,1) - -//! \ingroup gpuecc -NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu, - NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_SetECCConfiguration -// -//! DESCRIPTION: This function updates the ECC memory configuration setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \requires Administrator privileges since release 430.39 -//! -//! \param [in] hPhysicalGpu A handle identifying the physical GPU for -//! which to update the ECC configuration -//! setting. -//! \param [in] bEnable The new ECC configuration setting. -//! \param [in] bEnableImmediately Request that the new setting take effect immediately. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_CONFIGURATION - Possibly SLI is enabled. Disable SLI and retry. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! -//! \ingroup gpuecc -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetECCConfiguration(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bEnable, - NvU8 bEnableImmediately); - - - -// The following enum is providing definitions for events signaled by a Quadro Sync (QSYNC) device. -// QSYNC event broadcast is supported for Windows 10 and later OS. -typedef enum -{ - NV_QSYNC_EVENT_NONE = 0, - NV_QSYNC_EVENT_SYNC_LOSS = 1, // Frame Lock sync loss event - NV_QSYNC_EVENT_SYNC_GAIN = 2, // Frame Lock sync gain event - NV_QSYNC_EVENT_HOUSESYNC_GAIN = 3, // House cable gain(plug in) event - NV_QSYNC_EVENT_HOUSESYNC_LOSS = 4, // House cable loss(plug out) event - NV_QSYNC_EVENT_RJ45_GAIN = 5, // RJ45 cable gain(plug in) event - NV_QSYNC_EVENT_RJ45_LOSS = 6, // RJ45 cable loss(plug out) event -} NV_QSYNC_EVENT; - -typedef struct -{ - NV_QSYNC_EVENT qsyncEvent; // One of the value of the enum NV_QSYNC_EVENT - NvU32 reserved[7]; // Reserved for future use. Do not use this. -} NV_QSYNC_EVENT_DATA; - -//! Callback for QSYNC event -typedef void(__cdecl *NVAPI_CALLBACK_QSYNCEVENT)(NV_QSYNC_EVENT_DATA qyncEventData, void *callbackParam); - - -//! Enum for Event IDs -typedef enum -{ - NV_EVENT_TYPE_NONE = 0, - NV_EVENT_TYPE_QSYNC = 6, -} NV_EVENT_TYPE; - -//! Core NV_EVENT_REGISTER_CALLBACK structure declaration -typedef struct -{ - NvU32 version; //!< version field to ensure minimum version compatibility - NV_EVENT_TYPE eventId; //!< ID of the event being sent - void *callbackParam; //!< This value will be passed back to the callback function when an event occurs - union - { - NVAPI_CALLBACK_QSYNCEVENT nvQSYNCEventCallback; //!< Callback function pointer for QSYNC events - }nvCallBackFunc; - -} NV_EVENT_REGISTER_CALLBACK, *PNV_EVENT_REGISTER_CALLBACK; - -//! Macro for constructing the version field of ::NV_EVENT_REGISTER_CALLBACK -#define NV_EVENT_REGISTER_CALLBACK_VERSION MAKE_NVAPI_VERSION(NV_EVENT_REGISTER_CALLBACK,1) - - -//! \ingroup gpu -typedef enum _NV_GPU_WORKSTATION_FEATURE_TYPE -{ - NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY = 1, //!< NVIDIA RTX VR Ready - NV_GPU_WORKSTATION_FEATURE_TYPE_QUADRO_VR_READY = NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY, //!< DEPRECATED name - do not use - NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ = 2, -} NV_GPU_WORKSTATION_FEATURE_TYPE; - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_QueryWorkstationFeatureSupport -// -//! \fn NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature) -//! \code -//! DESCRIPTION: Indicates whether a queried workstation feature is supported by the requested GPU. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 440 -//! -//! DESCRIPTION: This API, when called with a valid physical gpu handle as Input, lets caller know whether the given workstation feature is supported by this GPU. -//! -//! PARAMETERS: physicalGpu(IN) : The handle of the GPU for the which caller wants to get the support information. -//! gpuWorkstationFeature(IN ) : The feature for the GPU in question. One of the values from enum NV_GPU_WORKSTATION_FEATURE_TYPE. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status listed below -//! -//! \retval ::NVAPI_OK the queried workstation feature is supported on the given GPU. -//! \retval ::NVAPI_NO_IMPLEMENTATION the current driver doesn't support this interface. -//! \retval ::NVAPI_INVALID_HANDLE the incoming physicalGpu handle is invalid. -//! \retval ::NVAPI_NOT_SUPPORTED the requested gpuWorkstationFeature is not supported in the selected GPU. -//! \retval ::NVAPI_SETTING_NOT_FOUND the requested gpuWorkstationFeature is unknown to the current driver version. -//! -//! \endcode -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature); - - - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - NvU32 width; //!< width of the input texture - NvU32 height; //!< height of the input texture - float* blendingTexture; //!< array of floating values building an intensity RGB texture -} NV_SCANOUT_INTENSITY_DATA_V1; - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - NvU32 width; //!< width of the input texture - NvU32 height; //!< height of the input texture - float* blendingTexture; //!< array of floating values building an intensity RGB texture - float* offsetTexture; //!< array of floating values building an offset texture - NvU32 offsetTexChannels; //!< number of channels per pixel in the offset texture -} NV_SCANOUT_INTENSITY_DATA_V2; - -typedef NV_SCANOUT_INTENSITY_DATA_V2 NV_SCANOUT_INTENSITY_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_INTENSITY_DATA_VER1 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V1, 1) -#define NV_SCANOUT_INTENSITY_DATA_VER2 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V2, 2) -#define NV_SCANOUT_INTENSITY_DATA_VER NV_SCANOUT_INTENSITY_DATA_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutIntensity -// -//! DESCRIPTION: This API enables and sets up per-pixel intensity feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to apply the intensity control. -//! \param [in] scanoutIntensityData the intensity texture info. -//! \param [out] pbSticky(OUT) indicates whether the settings will be kept over a reboot. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_SetScanoutIntensity(NvU32 displayId, NV_SCANOUT_INTENSITY_DATA* scanoutIntensityData, int *pbSticky); - - -//! \ingroup gpu -typedef struct _NV_SCANOUT_INTENSITY_STATE_DATA -{ - NvU32 version; //!< version of this structure - NvU32 bEnabled; //!< intensity is enabled or not -} NV_SCANOUT_INTENSITY_STATE_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_INTENSITY_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_STATE_DATA, 1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutIntensityState -// -//! DESCRIPTION: This API queries current state of the intensity feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] scanoutIntensityStateData intensity state data. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutIntensityState(__in NvU32 displayId, __inout NV_SCANOUT_INTENSITY_STATE_DATA* scanoutIntensityStateData); - - -//! \ingroup gpu -typedef enum -{ - NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ = 0, - NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ = 1, -} NV_GPU_WARPING_VERTICE_FORMAT; - -//! \ingroup gpu -typedef struct -{ - NvU32 version; //!< version of this structure - float* vertices; //!< width of the input texture - NV_GPU_WARPING_VERTICE_FORMAT vertexFormat; //!< format of the input vertices - int numVertices; //!< number of the input vertices - NvSBox* textureRect; //!< rectangle in desktop coordinates describing the source area for the warping -} NV_SCANOUT_WARPING_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_WARPING_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_DATA, 1) - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutWarping -// -//! DESCRIPTION: This API enables and sets up the warping feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control -//! \param [in] scanoutWarpingData The warping data info -//! \param [out] pbSticky Indicates whether the settings will be kept over a reboot. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_WARPING_DATA structure version mismatch. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_GPU_SetScanoutWarping(NvU32 displayId, NV_SCANOUT_WARPING_DATA* scanoutWarpingData, int* piMaxNumVertices, int* pbSticky); - - -//! \ingroup gpu -typedef struct _NV_SCANOUT_WARPING_STATE_DATA -{ - NvU32 version; //!< version of this structure - NvU32 bEnabled; //!< warping is enabled or not -} NV_SCANOUT_WARPING_STATE_DATA; - -//! \ingroup gpu -#define NV_SCANOUT_WARPING_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_STATE_DATA, 1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutWarpingState -// -//! DESCRIPTION: This API queries current state of the warping feature on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] scanoutWarpingStateData warping state data. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutWarpingState(__in NvU32 displayId, __inout NV_SCANOUT_WARPING_STATE_DATA* scanoutWarpingStateData); - -typedef enum -{ - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_WARPING_RESAMPLING_METHOD = 0 -} NV_GPU_SCANOUT_COMPOSITION_PARAMETER; - -//! This enum defines a collection of possible scanout composition values that can be used to configure -//! possible scanout composition settings. (Currently the only parameter defined is the WARPING_RESAMPLING_METHOD). -typedef enum -{ - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SET_TO_DEFAULT = 0, // Set parameter to default value. - // WARPING_RESAMPLING_METHOD section: - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BILINEAR = 0x100, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_TRIANGULAR = 0x101, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BELL_SHAPED = 0x102, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BSPLINE = 0x103, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_TRIANGULAR = 0x104, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BELL_SHAPED = 0x105, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BSPLINE = 0x106 -} NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_SetScanoutCompositionParameter -// -//! DESCRIPTION: This API sets various parameters that configure the scanout composition feature on the specified display. -//! (currently there is only one configurable parameter defined: WARPING_RESAMPLING_METHOD, -//! but this function is designed to support the addition of parameters as needed.) -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control -//! \param [in] parameter The scanout composition parameter to be set -//! \param [in] parameterValue The data to be set for the specified parameter -//! \param [in] pContainer Additional container for data associated with the specified parameter -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_GPU_SetScanoutCompositionParameter(NvU32 displayId, NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter, - NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE parameterValue, float *pContainer); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutCompositionParameter -// -//! DESCRIPTION: This API queries current state of one of the various scanout composition parameters on the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in] parameter scanout composition parameter to by queried. -//! \param [out] parameterData scanout composition parameter data. -//! \param [out] pContainer Additional container for returning data associated with the specified parameter -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutCompositionParameter(__in NvU32 displayId, __in NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter, - __out NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE *parameterData, __out float *pContainer); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutConfiguration -// -//! DESCRIPTION: This API queries the desktop and scanout portion of the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] desktopRect desktop area of the display in desktop coordinates. -//! \param [in,out] scanoutRect scanout area of the display relative to desktopRect. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs. -//! \retval ::NVAPI_OK Feature enabled. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfiguration(NvU32 displayId, NvSBox* desktopRect, NvSBox* scanoutRect); - - - -//! \ingroup gpu -//! Used in NvAPI_GPU_GetScanoutConfigurationEx(). -typedef struct _NV_SCANOUT_INFORMATION -{ - NvU32 version; //!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER. - - NvSBox sourceDesktopRect; //!< Operating system display device rect in desktop coordinates displayId is scanning out from. - NvSBox sourceViewportRect; //!< Area inside the sourceDesktopRect which is scanned out to the display. - NvSBox targetViewportRect; //!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to. - NvU32 targetDisplayWidth; //!< Horizontal size of the active resolution scanned out to the display. - NvU32 targetDisplayHeight; //!< Vertical size of the active resolution scanned out to the display. - NvU32 cloneImportance; //!< If targets are cloned views of the sourceDesktopRect the cloned targets have an importance assigned (0:primary,1 secondary,...). - NV_ROTATE sourceToTargetRotation; //!< Rotation performed between the sourceViewportRect and the targetViewportRect. -} NV_SCANOUT_INFORMATION; - -#define NV_SCANOUT_INFORMATION_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INFORMATION,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GPU_GetScanoutConfigurationEx -// -//! DESCRIPTION: This API queries the desktop and scanout portion of the specified display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 331 -//! -//! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration. -//! \param [in,out] pScanoutInformation desktop area to displayId mapping information. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfigurationEx(__in NvU32 displayId, __inout NV_SCANOUT_INFORMATION *pScanoutInformation); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAdapterIdFromPhysicalGpu -// -//! DESCRIPTION: This API returns the OS-AdapterID from physicalGpu Handle. OS-AdapterID -//! is the Adapter ID that is used by Win7 CCD APIs. -//! This API is deprecated. Please use NvAPI_GPU_GetLogicalGpuInfo to get the OS-AdapterID. -//! NvAPI_GetLogicalGPUFromPhysicalGPU can be used to get the logical GPU handle associated with specified physical GPU handle. -//! -//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetLogicalGpuInfo. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu PhysicalGpu Handle -//! \param [out] pOSAdapterId Returns OS-AdapterId, it is typed as void * to -//! avoid dependency with windows.h. User must type cast it to LUID. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT pOSAdapterId is NULL; hPhysicalGpu is invalid -//! \retval ::NVAPI_OK *pOSAdapterId contains valid data. -//! \retval ::NVAPI_NOT_SUPPORTED This API is not supported on the system. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetLogicalGpuInfo.") -NVAPI_INTERFACE NvAPI_GPU_GetAdapterIdFromPhysicalGpu(NvPhysicalGpuHandle hPhysicalGpu, void *pOSAdapterId); - - - - -//! \ingroup gpu -typedef enum _NV_VIRTUALIZATION_MODE -{ - NV_VIRTUALIZATION_MODE_NONE = 0, //!< Represents Bare Metal GPU - NV_VIRTUALIZATION_MODE_NMOS = 1, //!< Represents GPU-Passthrough - NV_VIRTUALIZATION_MODE_VGX = 2, //!< Represents vGPU inside virtual machine - NV_VIRTUALIZATION_MODE_HOST_VGPU = 3 //!< Represents VGX hypervisor in vGPU mode -} NV_VIRTUALIZATION_MODE; - -//! \ingroup gpu -typedef struct _NV_GPU_VIRTUALIZATION_INFO -{ - NvU32 version; //!< Structure version - - NV_VIRTUALIZATION_MODE virtualizationMode; //!< one of NV_VIRTUALIZATION_MODE. - NvU32 reserved; //!< reserved for future use. Should be set to ZERO. -} NV_GPU_VIRTUALIZATION_INFO_V1; - -//! \ingroup gpu -typedef NV_GPU_VIRTUALIZATION_INFO_V1 NV_GPU_VIRTUALIZATION_INFO; - -//! \ingroup gpu -#define NV_GPU_VIRTUALIZATION_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_VIRTUALIZATION_INFO_V1,1) - -//! \ingroup gpu -#define NV_GPU_VIRTUALIZATION_INFO_VER NV_GPU_VIRTUALIZATION_INFO_VER1 - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_GetVirtualizationInfo -//! -//! DESCRIPTION: This API returns virtualization information of the GPU -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 367 -//! -//! \param [in,out] pVirtualizationInfo Pointer to NV_GPU_VIRTUALIZATION_INFO structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVirtualizationInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VIRTUALIZATION_INFO *pVirtualizationInfo); - - -//! \ingroup gpu -typedef struct _NV_LOGICAL_GPU_DATA_V1 -{ - NvU32 version; //!< [in] Structure version. - void *pOSAdapterId; //!< [out] Returns OS-AdapterId. User must send memory buffer of size atleast equal to the size of LUID structure before calling the NVAPI. - NvU32 physicalGpuCount; //!< [out] Number of physical GPU handles associated with the specified logical GPU handle. - - NvPhysicalGpuHandle physicalGpuHandles[NVAPI_MAX_PHYSICAL_GPUS]; //!< [out] This array will be filled with physical GPU handles associated with the given logical GPU handle. - //!< The array index refers to the Physical Gpu Index (Idx). - //!< Idx value is the same as D3D11 MultiGPUDevice GPU index, D3D12 node index, OpenGL GL_NV_gpu_multicast GPU index. - //!< When converted to a bit mask (1 << Idx), it matches: - //!< 1. Vulkan deviceNodeMask in VkPhysicalDeviceIDProperties - //!< 2. CUDA deviceNodeMask returned by cuDeviceGetLuid - NvU32 reserved[8]; //!< Reserved for future use. Should be set to ZERO. -} NV_LOGICAL_GPU_DATA_V1; - -//! \ingroup gpu -typedef NV_LOGICAL_GPU_DATA_V1 NV_LOGICAL_GPU_DATA; -#define NV_LOGICAL_GPU_DATA_VER1 MAKE_NVAPI_VERSION(NV_LOGICAL_GPU_DATA_V1,1) -#define NV_LOGICAL_GPU_DATA_VER NV_LOGICAL_GPU_DATA_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetLogicalGpuInfo -// -//! This function is used to query Logical GPU information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 421 -//! -//! \param [in] hLogicalGpu logical GPU Handle. -//! \param [in,out] pLogicalGpuData Pointer to NV_LOGICAL_GPU_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetLogicalGpuInfo(__in NvLogicalGpuHandle hLogicalGpu, __inout NV_LOGICAL_GPU_DATA *pLogicalGpuData); - - -//! \ingroup gridlicense -//! @{ - -//! Maximum number of supported Feature License -#define NV_LICENSE_MAX_COUNT 3 - -//! Signature length for GRID License -#define NV_LICENSE_SIGNATURE_SIZE (128) - -//! Length for Grid License -#define NV_LICENSE_INFO_MAX_LENGTH (128) - -//! License string -typedef char NvAPI_LicenseString[NV_LICENSE_INFO_MAX_LENGTH]; - -//! Used in NV_LICENSE_FEATURE_DETAILS -typedef enum _NV_LICENSE_FEATURE_TYPE -{ - NV_LICENSE_FEATURE_UNKNOWN = 0, - NV_LICENSE_FEATURE_VGPU = 1, - NV_LICENSE_FEATURE_NVIDIA_RTX = 2, - NV_LICENSE_FEATURE_QUADRO = NV_LICENSE_FEATURE_NVIDIA_RTX, //!< DEPRECATED name - do not use - NV_LICENSE_FEATURE_GAMING = 3, - NV_LICENSE_FEATURE_COMPUTE = 4, -} NV_LICENSE_FEATURE_TYPE; - -//! Used in NV_LICENSE_FEATURE_DETAILS -//! -//!< The 'status' variable holds any one of the following license expiry status codes : -//!< 0 - Expiry information not available -//!< 1 - Invalid expiry or error fetching expiry -//!< 2 - Valid expiry -//!< 3 - Expiry not applicable -//!< 4 - Permanent expiry -typedef struct _NV_LICENSE_EXPIRY_DETAILS -{ - NvU32 year; //!< Year value of license expiry - NvU16 month; //!< Month value of license expiry - NvU16 day; //!< Day value of license expiry - NvU16 hour; //!< Hour value of license expiry - NvU16 min; //!< Minutes value of license expiry - NvU16 sec; //!< Seconds value of license expiry - - NvU8 status; //!< License expiry status -}NV_LICENSE_EXPIRY_DETAILS; - -//! Used in NV_LICENSABLE_FEATURES -typedef struct _NV_LICENSE_FEATURE_DETAILS_V1 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isEnabled : 1; //!< The current state of the licensed feature, true=enabled, false=disabled. - NvU32 reserved : 31; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated -}NV_LICENSE_FEATURE_DETAILS_V1; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V2 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of the licensed feature, true=enabled, false=disabled. - NvU32 reserved : 31; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. -}NV_LICENSE_FEATURE_DETAILS_V2; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V3 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of license, true=licensed, false=unlicensed. - NvU32 isFeatureEnabled : 1; //!< The current state of feature, true=enabled, false=disabled. - NvU32 reserved : 30; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. -}NV_LICENSE_FEATURE_DETAILS_V3; - -typedef struct _NV_LICENSE_FEATURE_DETAILS_V4 -{ - NvU32 version; //!< Unused. - NvU32 isEnabled : 1; //!< The current state of license, true=licensed, false=unlicensed. - NvU32 isFeatureEnabled : 1; //!< The current state of feature, true=enabled, false=disabled. - NvU32 reserved : 30; //!< Reserved - NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature. - NvAPI_LicenseString licenseInfo; //!< Deprecated - NvAPI_LicenseString productName; //!< Nvidia Grid licensable product name. - NV_LICENSE_EXPIRY_DETAILS licenseExpiry; //!< License expiry information. -}NV_LICENSE_FEATURE_DETAILS_V4; - -typedef NV_LICENSE_FEATURE_DETAILS_V1 NV_LICENSE_FEATURE_DETAILS; - -#define NV_LICENSE_FEATURE_DETAILS_VER1 MAKE_NVAPI_VERSION(NV_LICENSE_FEATURE_DETAILS_V1, 1) -#define NV_LICENSE_FEATURE_DETAILS_VER NV_LICENSE_FEATURE_DETAILS_VER1 - -//! Licensable features -typedef struct _NV_LICENSABLE_FEATURES_V1 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V1 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V1; - -typedef struct _NV_LICENSABLE_FEATURES_V2 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V2 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V2; - -typedef struct _NV_LICENSABLE_FEATURES_V3 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V3 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V3; - -typedef struct _NV_LICENSABLE_FEATURES_V4 -{ - NvU32 version; //!< IN - Structure version. - NvU32 isLicenseSupported : 1; //!< True if Software Licensing is supported. - NvU32 reserved : 31; //!< Reserved - NvU32 licensableFeatureCount; //!< The number of licensable features. - NvU8 signature[NV_LICENSE_SIGNATURE_SIZE]; //!< Dynamic signature required for Authentication of the components, - //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE - NV_LICENSE_FEATURE_DETAILS_V4 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features -}NV_LICENSABLE_FEATURES_V4; - -typedef NV_LICENSABLE_FEATURES_V4 NV_LICENSABLE_FEATURES; - -#define NV_LICENSABLE_FEATURES_VER1 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V1, 1) -#define NV_LICENSABLE_FEATURES_VER2 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V2, 2) -#define NV_LICENSABLE_FEATURES_VER3 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V3, 3) -#define NV_LICENSABLE_FEATURES_VER4 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V4, 4) -#define NV_LICENSABLE_FEATURES_VER NV_LICENSABLE_FEATURES_VER4 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetLicensableFeatures -// -//! DESCRIPTION: This function call identifies whether licenses are supported on this system and if -//! they are supported, returns the details of the features that can be licensed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGpu GPU selection -//! \param [in,out] pLicensableFeatures Licensable features information. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup gridlicense -///////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetLicensableFeatures(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_LICENSABLE_FEATURES *pLicensableFeatures); - - - -typedef struct _NV_GPU_VR_READY_V1 -{ - NvU32 version; //!< Structure Version. - NvU32 isVRReady : 1; //!< Is the requested GPU VR ready. - NvU32 reserved : 31; -} NV_GPU_VR_READY_V1; - -#define NV_GPU_VR_READY_VER1 MAKE_NVAPI_VERSION(NV_GPU_VR_READY_V1, 1) -#define NV_GPU_VR_READY_VER NV_GPU_VR_READY_VER1 -typedef NV_GPU_VR_READY_V1 NV_GPU_VR_READY; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetVRReadyData -// -//! DESCRIPTION: This API will return NVIDIA GPU VR Ready state. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 465 -//! -//! \param [in,out] pGpuVrReadyData - This structure will be filled with required information. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetVRReadyData(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VR_READY *pGpuVrReadyData); - -//! Used in NvAPI_GPU_GetPerfDecreaseInfo. -//! Bit masks for knowing the exact reason for performance decrease -typedef enum _NVAPI_GPU_PERF_DECREASE -{ - NV_GPU_PERF_DECREASE_NONE = 0, //!< No Slowdown detected - NV_GPU_PERF_DECREASE_REASON_THERMAL_PROTECTION = 0x00000001, //!< Thermal slowdown/shutdown/POR thermal protection - NV_GPU_PERF_DECREASE_REASON_POWER_CONTROL = 0x00000002, //!< Power capping / pstate cap - NV_GPU_PERF_DECREASE_REASON_AC_BATT = 0x00000004, //!< AC->BATT event - NV_GPU_PERF_DECREASE_REASON_API_TRIGGERED = 0x00000008, //!< API triggered slowdown - NV_GPU_PERF_DECREASE_REASON_INSUFFICIENT_POWER = 0x00000010, //!< Power connector missing - NV_GPU_PERF_DECREASE_REASON_UNKNOWN = 0x80000000, //!< Unknown reason -} NVAPI_GPU_PERF_DECREASE; - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPerfDecreaseInfo -// -//! DESCRIPTION: This function retrieves - in NvU32 variable - reasons for the current performance decrease. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] hPhysicalGPU (IN) - GPU for which performance decrease is to be evaluated. -//! \param [out] pPerfDecrInfo (OUT) - Pointer to a NvU32 variable containing performance decrease info -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup gpuPerf -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPerfDecreaseInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NvU32 *pPerfDecrInfo); - - -//! \ingroup gpupstate -//! Used in NvAPI_GPU_GetPstatesInfoEx() -typedef struct -{ - NvU32 version; - NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not - //!< - bit 1 indicates if dynamic Pstate is capable or not - //!< - bit 2 indicates if dynamic Pstate is enable or not - //!< - all other bits must be set to 0 - NvU32 numPstates; //!< The number of available p-states - NvU32 numClocks; //!< The number of clock domains supported by each P-State - struct - { - NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state. - NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2 - //!< - bit 1 indicates if the Pstate is overclocked or not - //!< - bit 2 indicates if the Pstate is overclockable or not - //!< - all other bits must be set to 0 - struct - { - NV_GPU_PUBLIC_CLOCK_ID domainId; //!< ID of the clock domain - NvU32 flags; //!< Reserved. Must be set to 0 - NvU32 freq; //!< Clock frequency in kHz - - } clocks[NVAPI_MAX_GPU_PERF_CLOCKS]; - } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; - -} NV_GPU_PERF_PSTATES_INFO_V1; - - -//! \ingroup gpupstate -typedef struct -{ - NvU32 version; - NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not - //!< - bit 1 indicates if dynamic Pstate is capable or not - //!< - bit 2 indicates if dynamic Pstate is enable or not - //!< - all other bits must be set to 0 - NvU32 numPstates; //!< The number of available p-states - NvU32 numClocks; //!< The number of clock domains supported by each P-State - NvU32 numVoltages; - struct - { - NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state. - NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2 - //!< - bit 1 indicates if the Pstate is overclocked or not - //!< - bit 2 indicates if the Pstate is overclockable or not - //!< - all other bits must be set to 0 - struct - { - NV_GPU_PUBLIC_CLOCK_ID domainId; - NvU32 flags; //!< bit 0 indicates if this clock is overclockable - //!< all other bits must be set to 0 - NvU32 freq; - - } clocks[NVAPI_MAX_GPU_PERF_CLOCKS]; - struct - { - NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; //!< ID of the voltage domain, containing flags and mvolt info - NvU32 flags; //!< Reserved for future use. Must be set to 0 - NvU32 mvolt; //!< Voltage in mV - - } voltages[NVAPI_MAX_GPU_PERF_VOLTAGES]; - - } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; //!< Valid index range is 0 to numVoltages-1 - -} NV_GPU_PERF_PSTATES_INFO_V2; - -//! \ingroup gpupstate -typedef NV_GPU_PERF_PSTATES_INFO_V2 NV_GPU_PERF_PSTATES_INFO; - - -//! \ingroup gpupstate -//! @{ - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V1 -#define NV_GPU_PERF_PSTATES_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V1,1) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2 -#define NV_GPU_PERF_PSTATES_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,2) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2 -#define NV_GPU_PERF_PSTATES_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,3) - -//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO -#define NV_GPU_PERF_PSTATES_INFO_VER NV_GPU_PERF_PSTATES_INFO_VER3 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPstatesInfoEx -// -//! DESCRIPTION: This API retrieves all performance states (P-States) information. This is the same as -//! NvAPI_GPU_GetPstatesInfo(), but supports an input flag for various options. -//! -//! P-States are GPU active/executing performance capability and power consumption states. -//! -//! P-States ranges from P0 to P15, with P0 being the highest performance/power state, and -//! P15 being the lowest performance/power state. Each P-State, if available, maps to a -//! performance level. Not all P-States are available on a given system. The definitions -//! of each P-State are currently as follows: \n -//! - P0/P1 - Maximum 3D performance -//! - P2/P3 - Balanced 3D performance-power -//! - P8 - Basic HD video playback -//! - P10 - DVD playback -//! - P12 - Minimum idle power consumption -//! -//! \deprecated Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [out] pPerfPstatesInfo P-States information retrieved, as detailed below: \n -//! - flags is reserved for future use. -//! - numPstates is the number of available P-States -//! - numClocks is the number of clock domains supported by each P-State -//! - pstates has valid index range from 0 to numPstates - 1 -//! - pstates[i].pstateId is the ID of the P-State, -//! containing the following info: -//! - pstates[i].flags containing the following info: -//! - bit 0 indicates if the PCIE limit is GEN1 or GEN2 -//! - bit 1 indicates if the Pstate is overclocked or not -//! - bit 2 indicates if the Pstate is overclockable or not -//! - pstates[i].clocks has valid index range from 0 to numClocks -1 -//! - pstates[i].clocks[j].domainId is the public ID of the clock domain, -//! containing the following info: -//! - pstates[i].clocks[j].flags containing the following info: -//! bit 0 indicates if the clock domain is overclockable or not -//! - pstates[i].clocks[j].freq is the clock frequency in kHz -//! - pstates[i].voltages has a valid index range from 0 to numVoltages - 1 -//! - pstates[i].voltages[j].domainId is the ID of the voltage domain, -//! containing the following info: -//! - pstates[i].voltages[j].flags is reserved for future use. -//! - pstates[i].voltages[j].mvolt is the voltage in mV -//! inputFlags(IN) - This can be used to select various options: -//! - if bit 0 is set, pPerfPstatesInfo would contain the default settings -//! instead of the current, possibily overclocked settings. -//! - if bit 1 is set, pPerfPstatesInfo would contain the maximum clock -//! frequencies instead of the nominal frequencies. -//! - if bit 2 is set, pPerfPstatesInfo would contain the minimum clock -//! frequencies instead of the nominal frequencies. -//! - all other bits must be set to 0. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! \retval ::NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide) -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the NV_GPU_PERF_PSTATES struct is not supported -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.") -NVAPI_INTERFACE NvAPI_GPU_GetPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATES_INFO *pPerfPstatesInfo, NvU32 inputFlags); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetPstates20 -// -//! DESCRIPTION: This API retrieves all performance states (P-States) 2.0 information. -//! -//! P-States are GPU active/executing performance capability states. -//! They range from P0 to P15, with P0 being the highest performance state, -//! and P15 being the lowest performance state. Each P-State, if available, -//! maps to a performance level. Not all P-States are available on a given system. -//! The definition of each P-States are currently as follow: -//! - P0/P1 - Maximum 3D performance -//! - P2/P3 - Balanced 3D performance-power -//! - P8 - Basic HD video playback -//! - P10 - DVD playback -//! - P12 - Minimum idle power consumption -//! -//! TCC_SUPPORTED -//! -//! \since Release: 295 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGPU GPU selection -//! \param [out] pPstatesInfo P-States information retrieved, as documented in declaration above -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetPstates20(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_PERF_PSTATES20_INFO *pPstatesInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetCurrentPstate -// -//! DESCRIPTION: This function retrieves the current performance state (P-State). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! TCC_SUPPORTED -//! -//! \param [in] hPhysicalGPU GPU selection -//! \param [out] pCurrentPstate The ID of the current P-State of the GPU - see \ref NV_GPU_PERF_PSTATES. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_NOT_SUPPORTED P-States is not supported on this setup. -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetCurrentPstate(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATE_ID *pCurrentPstate); - - - - -//! \ingroup gpupstate -#define NVAPI_MAX_GPU_UTILIZATIONS 8 - - - -//! \ingroup gpupstate -//! Used in NvAPI_GPU_GetDynamicPstatesInfoEx(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 flags; //!< bit 0 indicates if the dynamic Pstate is enabled or not - struct - { - NvU32 bIsPresent:1; //!< Set if this utilization domain is present on this GPU - NvU32 percentage; //!< Percentage of time where the domain is considered busy in the last 1 second interval - } utilization[NVAPI_MAX_GPU_UTILIZATIONS]; -} NV_GPU_DYNAMIC_PSTATES_INFO_EX; - -//! \ingroup gpupstate -//! Macro for constructing the version field of NV_GPU_DYNAMIC_PSTATES_INFO_EX -#define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx -// -//! DESCRIPTION: This API retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU. -//! Each domain's info is indexed in the array. For example: -//! - pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain. \p -//! There are currently 4 domains for which GPU utilization and dynamic P-State thresholds can be retrieved: -//! graphic engine (GPU), frame buffer (FB), video engine (VID), and bus interface (BUS). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! TCC_SUPPORTED -//! \since Release: 185 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT pDynamicPstatesInfo is NULL -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported -//! -//! \ingroup gpupstate -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx); -/////////////////////////////////////////////////////////////////////////////////// -// Thermal API -// Provides ability to get temperature levels from the various thermal sensors associated with the GPU - -//! \ingroup gputhermal -#define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3 - -//! \ingroup gputhermal -//! Used in NV_GPU_THERMAL_SETTINGS -typedef enum -{ - NVAPI_THERMAL_TARGET_NONE = 0, - NVAPI_THERMAL_TARGET_GPU = 1, //!< GPU core temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_MEMORY = 2, //!< GPU memory temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4, //!< GPU power supply temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_BOARD = 8, //!< GPU board ambient temperature requires NvPhysicalGpuHandle - NVAPI_THERMAL_TARGET_VCD_BOARD = 9, //!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle - NVAPI_THERMAL_TARGET_VCD_INLET = 10, //!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle - NVAPI_THERMAL_TARGET_VCD_OUTLET = 11, //!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle - - NVAPI_THERMAL_TARGET_ALL = 15, - NVAPI_THERMAL_TARGET_UNKNOWN = -1, -} NV_THERMAL_TARGET; - -//! \ingroup gputhermal -//! Used in NV_GPU_THERMAL_SETTINGS -typedef enum -{ - NVAPI_THERMAL_CONTROLLER_NONE = 0, - NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL, - NVAPI_THERMAL_CONTROLLER_ADM1032, - NVAPI_THERMAL_CONTROLLER_MAX6649, - NVAPI_THERMAL_CONTROLLER_MAX1617, - NVAPI_THERMAL_CONTROLLER_LM99, - NVAPI_THERMAL_CONTROLLER_LM89, - NVAPI_THERMAL_CONTROLLER_LM64, - NVAPI_THERMAL_CONTROLLER_ADT7473, - NVAPI_THERMAL_CONTROLLER_SBMAX6649, - NVAPI_THERMAL_CONTROLLER_VBIOSEVT, - NVAPI_THERMAL_CONTROLLER_OS, - NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1, -} NV_THERMAL_CONTROLLER; - -//! \ingroup gputhermal -//! Used in NvAPI_GPU_GetThermalSettings() -typedef struct -{ - NvU32 version; //!< structure version - NvU32 count; //!< number of associated thermal sensors - struct - { - NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649... - NvU32 defaultMinTemp; //!< The min default temperature value of the thermal sensor in degree Celsius - NvU32 defaultMaxTemp; //!< The max default temperature value of the thermal sensor in degree Celsius - NvU32 currentTemp; //!< The current temperature value of the thermal sensor in degree Celsius - NV_THERMAL_TARGET target; //!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc. - } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU]; - -} NV_GPU_THERMAL_SETTINGS_V1; - -//! \ingroup gputhermal -typedef struct -{ - NvU32 version; //!< structure version - NvU32 count; //!< number of associated thermal sensors - struct - { - NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649... - NvS32 defaultMinTemp; //!< Minimum default temperature value of the thermal sensor in degree Celsius - NvS32 defaultMaxTemp; //!< Maximum default temperature value of the thermal sensor in degree Celsius - NvS32 currentTemp; //!< Current temperature value of the thermal sensor in degree Celsius - NV_THERMAL_TARGET target; //!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc - } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU]; - -} NV_GPU_THERMAL_SETTINGS_V2; - -//! \ingroup gputhermal -typedef NV_GPU_THERMAL_SETTINGS_V2 NV_GPU_THERMAL_SETTINGS; - -//! \ingroup gputhermal -//! @{ - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V1 -#define NV_GPU_THERMAL_SETTINGS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1,1) - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V2 -#define NV_GPU_THERMAL_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2,2) - -//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS -#define NV_GPU_THERMAL_SETTINGS_VER NV_GPU_THERMAL_SETTINGS_VER_2 -//! @} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetThermalSettings -// -//! This function retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU. -//! Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1. -//! -//! - To retrieve specific thermal sensor info, set the sensorIndex to the required thermal sensor index. -//! - To retrieve info for all sensors, set sensorIndex to NVAPI_THERMAL_TARGET_ALL. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 85 -//! -//! \param [in] hPhysicalGPU GPU selection. -//! \param [in] sensorIndex Explicit thermal sensor index selection. -//! \param [out] pThermalSettings Array of thermal settings. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred. -//! \retval NVAPI_INVALID_ARGUMENT pThermalInfo is NULL. -//! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide). -//! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported. -//! \ingroup gputhermal -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings); - - - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 reserved; //!< These bits are reserved for future use. - struct - { - NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU - NvU32 reserved:31; //!< These bits are reserved for future use. - NvU32 frequency; //!< Clock frequency (kHz) - }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS]; -} NV_GPU_CLOCK_FREQUENCIES_V1; - -#ifndef NV_GPU_MAX_CLOCK_FREQUENCIES - #define NV_GPU_MAX_CLOCK_FREQUENCIES 3 -#endif - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef enum -{ - NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ = 0, - NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK = 1, - NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK = 2, - NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM = NV_GPU_MAX_CLOCK_FREQUENCIES -} NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE; - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 ClockType:4; //!< One of NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE. Used to specify the type of clock to be returned. - NvU32 reserved:20; //!< These bits are reserved for future use. Must be set to 0. - NvU32 reserved1:8; //!< These bits are reserved. - struct - { - NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU - NvU32 reserved:31; //!< These bits are reserved for future use. - NvU32 frequency; //!< Clock frequency (kHz) - }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS]; -} NV_GPU_CLOCK_FREQUENCIES_V2; - -//! \ingroup gpuclock -//! Used in NvAPI_GPU_GetAllClockFrequencies() -typedef NV_GPU_CLOCK_FREQUENCIES_V2 NV_GPU_CLOCK_FREQUENCIES; - -//! \addtogroup gpuclock -//! @{ -#define NV_GPU_CLOCK_FREQUENCIES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V1,1) -#define NV_GPU_CLOCK_FREQUENCIES_VER_2 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,2) -#define NV_GPU_CLOCK_FREQUENCIES_VER_3 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,3) -#define NV_GPU_CLOCK_FREQUENCIES_VER NV_GPU_CLOCK_FREQUENCIES_VER_3 -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_GetAllClockFrequencies -// -//! This function retrieves the NV_GPU_CLOCK_FREQUENCIES structure for the specified physical GPU. -//! -//! For each clock domain: -//! - bIsPresent is set for each domain that is present on the GPU -//! - frequency is the domain's clock freq in kHz -//! -//! Each domain's info is indexed in the array. For example: -//! clkFreqs.domain[NVAPI_GPU_PUBLIC_CLOCK_MEMORY] holds the info for the MEMORY domain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 295 -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval NVAPI_INVALID_ARGUMENT pClkFreqs is NULL. -//! \ingroup gpuclock -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGPU, __inout NV_GPU_CLOCK_FREQUENCIES *pClkFreqs); - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_QueryIlluminationSupport -//! -//! \fn NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo) -//! DESCRIPTION: This function reports if the specified illumination attribute is supported. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with this call to determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be querried -//! \param [out] pSupported A boolean indicating if the attribute is supported. -//! -//! \return See \ref nvapistatus for the list of possible return values. -// -////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef enum _NV_GPU_ILLUMINATION_ATTRIB -{ - NV_GPU_IA_LOGO_BRIGHTNESS = 0, - NV_GPU_IA_SLI_BRIGHTNESS = 1, -} NV_GPU_ILLUMINATION_ATTRIB; - -//! \ingroup gpu -typedef struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - - // OUT - NvU32 bSupported; //!< A boolean indicating if the attribute is supported. - -} NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM; -//! \ingroup gpu -#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_GetIllumination -//! -//! \fn NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo) -//! DESCRIPTION: This function reports value of the specified illumination attribute. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to -//! determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be querried -//! \param [out] Value A DWORD containing the current value for the specified attribute. -//! This is specified as a percentage of the full range of the attribute -//! (0-100; 0 = off, 100 = full brightness) -//! -//! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are: -//! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver. -//! NVAPI_NOT_SUPPORTED: The specified attribute is not supported on the specified GPU -// -////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef struct _NV_GPU_GET_ILLUMINATION_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< Note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - - // OUT - NvU32 Value; //!< A DWORD that will contain the current value of the specified attribute. - //! This is specified as a percentage of the full range of the attribute - //! (0-100; 0 = off, 100 = full brightness) - -} NV_GPU_GET_ILLUMINATION_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_GET_ILLUMINATION_PARM_V1 NV_GPU_GET_ILLUMINATION_PARM; -//! \ingroup gpu -#define NV_GPU_GET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_GET_ILLUMINATION_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_GET_ILLUMINATION_PARM_VER NV_GPU_GET_ILLUMINATION_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_SetIllumination -//! -//! \fn NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo) -//! DESCRIPTION: This function sets the value of the specified illumination attribute. -//! -//! \note Only a single GPU can manage an given attribute on a given HW element, -//! regardless of how many are attatched. I.E. only one GPU will be used to control -//! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached. -//! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to -//! determine which GPU is managing the attribute. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 300.05 -//! -//! \param [in] hPhysicalGpu Physical GPU handle -//! \param Attribute An enumeration value specifying the Illumination attribute to be set -//! \param Value The new value for the specified attribute. -//! This should be specified as a percentage of the full range of the attribute -//! (0-100; 0 = off, 100 = full brightness) -//! If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned. -//! -//! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are: -//! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver, or the specified value is out of range. -//! NVAPI_NOT_SUPPORTED The specified attribute is not supported on the specified GPU. -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup gpu -typedef struct _NV_GPU_SET_ILLUMINATION_PARM_V1 { - - // IN - NvU32 version; //!< Version of this structure - NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute. - //!< Note that this is the GPU that is managing the attribute. - //!< Only a single GPU can manage an given attribute on a given HW element, - //!< regardless of how many are attatched. - //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge, - //!< regardless of how many are physicaly attached. - //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute. - NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried. - //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB. - NvU32 Value; //!< A DWORD containing the new value for the specified attribute. - //!< This should be specified as a percentage of the full range of the attribute - //!< (0-100; 0 = off, 100 = full brightness) - //!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned. - - // OUT - -} NV_GPU_SET_ILLUMINATION_PARM_V1; - -//! \ingroup gpu -typedef NV_GPU_SET_ILLUMINATION_PARM_V1 NV_GPU_SET_ILLUMINATION_PARM; -//! \ingroup gpu -#define NV_GPU_SET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_SET_ILLUMINATION_PARM_V1,1) -//! \ingroup gpu -#define NV_GPU_SET_ILLUMINATION_PARM_VER NV_GPU_SET_ILLUMINATION_PARM_VER_1 - -//! \ingroup gpu -NVAPI_INTERFACE NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo); - - - -/*! - * Enumeration of control modes that can be applied to Illumination Zones. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB = 0, // deprecated - NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB, // deprecated - - NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL = 0, - NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR, - - // Strictly add new control modes above this. - NV_GPU_CLIENT_ILLUM_CTRL_MODE_INVALID = 0xFF, -} NV_GPU_CLIENT_ILLUM_CTRL_MODE; - -/*! - * Enumeration of locations where an Illumination Zone might be present. - * Encoding used - - * 1:0 - Number specifier (0) - * 4:2 - Location (TOP) - * 7:5 - Type (GPU/SLI) - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_TOP_0 = 0x00, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_FRONT_0 = 0x08, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_BACK_0 = 0x0C, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_SLI_TOP_0 = 0x20, - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_INVALID = 0xFFFFFFFF, -} NV_GPU_CLIENT_ILLUM_ZONE_LOCATION; - -/*! - * Enumeration of ILLUM_DEVICEs. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_INVALID = 0, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_MCUV10, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_RGBW_V10, - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_SINGLE_COLOR_V10, -} NV_GPU_CLIENT_ILLUM_DEVICE_TYPE; - -/*! - * Enumeration of ILLUM_ZONEs. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_INVALID = 0, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGBW, - NV_GPU_CLIENT_ILLUM_ZONE_TYPE_SINGLE_COLOR, -} NV_GPU_CLIENT_ILLUM_ZONE_TYPE; - -/*! - * Number of color points for the piecewise linear control mode. - */ -#define NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS 2 - -/*! - * Enumeration of Cycle types for piecewise linear control mode. - */ -typedef enum -{ - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_HALF_HALT = 0, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_HALT, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_REPEAT, - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_INVALID = 0xFF, -} NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX 32 - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illumination device type MCUV10. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 -{ - /*! - * I2C Device Index: Pointing to the illumination device in I2C Devices Table. - */ - NvU8 i2cDevIdx; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illum device type GPIO_PWM_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW -{ - /*! - * Red drive GPIO pin. - */ - NvU8 gpioPinRed; - - /*! - * Green drive GPIO pin. - */ - NvU8 gpioPinGreen; - - /*! - * Blue drive GPIO pin. - */ - NvU8 gpioPinBlue; - - /*! - * White drive GPIO pin. - */ - NvU8 gpioPinWhite; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW; -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 - * Describes the static information of illum device type GPIO_PWM_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR -{ - /*! - * Single Color GPIO pin. - */ - NvU8 gpioPinSingleColor; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR; - -/*! - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 -{ - /*! - * Type of the illumination device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type; - - /*! - * Supported control modes for this illumination device. - */ - NvU32 ctrlModeMask; - - /*! - * Union of illumination device info data. Interpreted as per - * @ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1::type - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 mcuv10; - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW gpioPwmRgbwv10; - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR gpioPwmSingleColorv10; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1; - -/*! - */ -typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination devices present. - */ - NvU32 numIllumDevices; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - /*! - */ - NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX]; -} NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetInfo -//! -//! DESCRIPTION: This API returns static information about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumDevicesInfo Pointer to structure containing static -//! information about illumination devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS *pIllumDevicesInfo); - - -/*! - * Structure representing the data required for synchronization. - */ -typedef struct -{ - /*! - * Boolean representing the need for synchronization. - */ - NvBool bSync; - - /*! - * Time stamp value required for synchronization. - */ - NvU64 timeStampms; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1; - -/*! - * Structure representing the device control parameters of each ILLUM_DEVICE. - */ -typedef struct -{ - /*! - * Type of the illum device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type; - - /*! - * Structure containing the synchronization data for the illumination device. - */ - NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1 syncData; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1; - -typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL; - -/*! - * Structure representing the control parameters of ILLUM_DEVICE-s. - */ -typedef struct -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination devices present. - */ - NvU32 numIllumDevices; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - /*! - */ - NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX]; -} NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetControl -//! -//! DESCRIPTION: This API gets control parameters about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [inout] pIllumDevicesControl Pointer to structure containing control -//! information about illum devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl); - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesSetControl -//! -//! DESCRIPTION: This API sets control parameters about illumination devices on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [inout] pClientIllumDevicesControl Pointer to structure containing control -//! information about illum devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl); - - -#define NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX 32 - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 - * Describes the static information of illum zone type RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 - * Describes the static information of illum zone type SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR -{ - NvU8 rsvd; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE type; - - /*! - * Index pointing to an Illumination Device that controls this zone. - */ - NvU8 illumDeviceIdx; - - /*! - * Provider index for representing logical to physical zone mapping. - */ - NvU8 provIdx; - - /*! - * Location of the zone on the board. - */ - NV_GPU_CLIENT_ILLUM_ZONE_LOCATION zoneLocation; - - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB rgb; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW rgbw; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR singleColor; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 -{ - /*! - * Version of structure. Must always be first member. - */ - NvU32 version; - - /*! - * Number of illumination zones present. - */ - NvU32 numIllumZones; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX]; -} NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetInfo -//! -//! DESCRIPTION: This API returns static information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesInfo Pointer to structure containing static -//! information about illumination devices. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS *pIllumZonesInfo); - - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS -{ - /*! - * Red compenent of color applied to the zone. - */ - NvU8 colorR; - - /*! - * Green compenent of color applied to the zone. - */ - NvU8 colorG; - - /*! - * Blue compenent of color applied to the zone. - */ - NvU8 colorB; - - /*! - * Brightness perecentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR -{ - /*! - * Type of cycle effect to apply. - */ - NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE cycleType; - - /*! - * Number of times to repeat function within group period. - */ - NvU8 grpCount; - - /*! - * Time in ms to transition from color A to color B. - */ - NvU16 riseTimems; - - /*! - * Time in ms to transition from color B to color A. - */ - NvU16 fallTimems; - - /*! - * Time in ms to remain at color A before color A to color B transition. - */ - NvU16 ATimems; - - /*! - * Time in ms to remain at color B before color B to color A transition. - */ - NvU16 BTimems; - - /*! - * Time in ms to remain idle before next group of repeated function cycles. - */ - NvU16 grpIdleTimems; - - /*! - * Time in ms to offset the cycle relative to other zones. - */ - NvU16 phaseOffsetms; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illumination zone of type - * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB -{ - /*! - * Union of illumination zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB manualRGB; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB piecewiseLinearRGB; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS -{ - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED - * Data required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED manualColorFixed; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED piecewiseLinearColorFixed; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED; - -/*! - * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW - * Parameters required to represent control mode of type - * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS -{ - /*! - * Red component of color applied to the zone. - */ - NvU8 colorR; - - /*! - * Green component of color applied to the zone. - */ - NvU8 colorG; - - /*! - * Blue component of color applied to the zone. - */ - NvU8 colorB; - - /*! - * White component of color applied to the zone. - */ - NvU8 colorW; - - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_ILLUM_ZONE_TYPE_RGBW. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_RGBW. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW manualRGBW; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW piecewiseLinearRGBW; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS -{ - /*! - * Brightness percentage value of the zone. - */ - NvU8 brightnessPct; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR - * Data required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR -{ - /*! - * Parameters required to represent control mode of type - * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR. - */ - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR; - -/*! - * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1 - * Describes the control data for illum zone of type - * \ref NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR. - */ -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR -{ - /*! - * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR. - * Interpreted as per ctrlMode. - */ - union - { - // - // Need to be careful when add/expanding types in this union. If any type - // exceeds sizeof(rsvd) then rsvd has failed its purpose. - // - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR manualSingleColor; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR piecewiseLinearSingleColor; - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - } data; - - /*! - * Reserved for future. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 -{ - NV_GPU_CLIENT_ILLUM_ZONE_TYPE type; - NV_GPU_CLIENT_ILLUM_CTRL_MODE ctrlMode; - union - { - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB rgb; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED colorFixed; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW rgbw; - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR singleColor; - NvU8 rsvd[64]; - } data; - NvU8 rsvd[64]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1; - -typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 -{ - NvU32 version; - - /*! - * Bit field specifying the set of values to retrieve or set - * - default (NV_TRUE) - * - currently active (NV_FALSE). - */ - NvU32 bDefault : 1; - NvU32 rsvdField : 31; - - /*! - * Number of illumination zones present. - */ - NvU32 numIllumZonesControl; - - /*! - * Reserved bytes for possible future extension of this struct. - */ - NvU8 rsvd[64]; - - NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX]; -} NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1; - -#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1, 1) -#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 -typedef NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS; - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetControl -//! -//! DESCRIPTION: Accessor for control information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesControl Pointer to structure containing control -//! information about illumination zones. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl); - -/////////////////////////////////////////////////////////////////////////////// -//! -//! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesSetControl -//! -//! DESCRIPTION: Mutator for control information about illumination zones on the -//! given GPU. -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! TCC_SUPPORTED -//! -//! \since Release: 400 -//! \param [in] hPhysicalGpu The physical GPU handle -//! \param [out] pIllumZonesControl Pointer to structure containing control -//! information about illumination zones. -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Event_RegisterCallback -// -//! DESCRIPTION: This API registers the process for events. This API should be called for each eventcallback. -//! The handle returned to the client will be common across all eventCallbacks. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] eventCallback Pointer to NV_EVENT_REGISTER_CALLBACK structure to call -//! on new events -//! \param [out] phClient Handle to client for use with -//! unregister function -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Event_RegisterCallback(PNV_EVENT_REGISTER_CALLBACK eventCallback, - NvEventHandle* phClient); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Event_UnregisterCallback -// -//! DESCRIPTION: This API unregister an event handle. -//! This API should be called only once per process(irrespective of the number of callbacks registered). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hClient Handle associated with this listeners -//! event queue. Same as returned from -//! NvAPI_Event_RegisterCallback(). -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Event_UnregisterCallback(NvEventHandle hClient); -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle -// -//! This function returns the handle of the NVIDIA display specified by the enum -//! index (thisEnum). The client should keep enumerating until it -//! returns error. -//! -//! Note: Display handles can get invalidated on a modeset, so the calling applications need to -//! renum the handles after every modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] thisEnum The index of the NVIDIA display. -//! \param [out] pNvDispHandle Pointer to the NVIDIA display handle. -//! -//! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big -//! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system -//! \retval NVAPI_END_ENUMERATION No more display device to enumerate -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle); - - - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle -// -//! This function returns the handle of the NVIDIA unattached display specified by the enum -//! index (thisEnum). The client should keep enumerating until it -//! returns error. -//! Note: Display handles can get invalidated on a modeset, so the calling applications need to -//! renum the handles after every modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \param [in] thisEnum The index of the NVIDIA display. -//! \param [out] pNvUnAttachedDispHandle Pointer to the NVIDIA display handle of the unattached display. -//! -//! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big -//! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system -//! \retval NVAPI_END_ENUMERATION No more display device to enumerate. -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay -// -//! This function converts the unattached display handle to an active attached display handle. -//! -//! At least one GPU must be present in the system and running an NVIDIA display driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pNvDisplay is NULL. -//! \retval NVAPI_OK One or more handles were returned -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayHandle -// -//! This function returns the handle of the NVIDIA display that is associated -//! with the given display "name" (such as "\\.\DISPLAY1"). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle -// -//! DESCRIPTION: This function returns the handle of an unattached NVIDIA display that is -//! associated with the given display name (such as "\\DISPLAY1"). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \retval ::NVAPI_INVALID_ARGUMENT Either argument is NULL. -//! \retval ::NVAPI_OK *pNvUnAttachedDispHandle is now valid. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name. -//! -//! \ingroup disphandle -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayName -// -//! For a given NVIDIA display handle, this function returns a string (such as "\\.\DISPLAY1") to identify the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName -// -//! This function returns the display name given, for example, "\\DISPLAY1", using the unattached NVIDIA display handle -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL -//! \retval NVAPI_OK *pNvDispHandle is now valid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnableHWCursor -// -//! This function enables hardware cursor support -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DisableHWCursor -// -//! This function disables hardware cursor support -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetVBlankCounter -// -//! This function gets the V-blank counter -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 80 -//! -//! \return NVAPI_ERROR or NVAPI_OK -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SetRefreshRateOverride -// -//! This function overrides the refresh rate on the given display/outputsMask. -//! The new refresh rate can be applied right away in this API call or deferred to be applied with the -//! next OS modeset. The override is good for only one modeset (regardless whether it's deferred or immediate). -//! -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 80 -//! -//! \param [in] hNvDisplay The NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle -//! enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] outputsMask A set of bits that identify all target outputs which are associated with the NVIDIA -//! display handle to apply the refresh rate override. When SLI is enabled, the -//! outputsMask only applies to the GPU that is driving the display output. -//! \param [in] refreshRate The override value. "0.0" means cancel the override. -//! \param [in] bSetDeferred -//! - "0": Apply the refresh rate override immediately in this API call.\p -//! - "1": Apply refresh rate at the next OS modeset. -//! -//! \retval NVAPI_INVALID_ARGUMENT hNvDisplay or outputsMask is invalid -//! \retval NVAPI_OK The refresh rate override is correct set -//! \retval NVAPI_ERROR The operation failed -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId -// -//! This function gets the active outputId associated with the display handle. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 90 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] outputId The active display output ID associated with the selected display handle hNvDisplay. -//! The outputid will have only one bit set. In the case of Clone or Span mode, this will indicate the -//! display outputId of the primary display that the GPU is driving. See \ref handles. -//! -//! \retval NVAPI_OK Call successful. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found. -//! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId); - - -//! \ingroup dispcontrol -//! Used in NvAPI_GetDisplayPortInfo(). -typedef struct _NV_DISPLAY_PORT_INFO_V1 -{ - NvU32 version; //!< Structure version - NvU32 dpcd_ver; //!< DPCD version of the monitor - NV_DP_LINK_RATE maxLinkRate; //!< Maximum supported link rate - NV_DP_LANE_COUNT maxLaneCount; //!< Maximum supported lane count - NV_DP_LINK_RATE curLinkRate; //!< Current link rate - NV_DP_LANE_COUNT curLaneCount; //!< Current lane count - NV_DP_COLOR_FORMAT colorFormat; //!< Current color format - NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range - NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space - NV_DP_BPC bpc; //!< Current bit-per-component - NvU32 isDp : 1; //!< If the monitor is driven by a DisplayPort - NvU32 isInternalDp : 1; //!< If the monitor is driven by an NV Dp transmitter - NvU32 isColorCtrlSupported : 1; //!< If the color format change is supported - NvU32 is6BPCSupported : 1; //!< If 6 bpc is supported - NvU32 is8BPCSupported : 1; //!< If 8 bpc is supported - NvU32 is10BPCSupported : 1; //!< If 10 bpc is supported - NvU32 is12BPCSupported : 1; //!< If 12 bpc is supported - NvU32 is16BPCSupported : 1; //!< If 16 bpc is supported - NvU32 isYCrCb420Supported : 1; //!< If YCrCb420 is supported - NvU32 isYCrCb422Supported : 1; //!< If YCrCb422 is supported - NvU32 isYCrCb444Supported : 1; //!< If YCrCb444 is supported - NvU32 isRgb444SupportedOnCurrentMode : 1; //!< If Rgb444 is supported on the current mode - NvU32 isYCbCr444SupportedOnCurrentMode : 1; //!< If YCbCr444 is supported on the current mode - NvU32 isYCbCr422SupportedOnCurrentMode : 1; //!< If YCbCr422 is supported on the current mode - NvU32 isYCbCr420SupportedOnCurrentMode : 1; //!< If YCbCr420 is supported on the current mode - NvU32 is6BPCSupportedOnCurrentMode : 1; // if 6 bpc is supported On Current Mode - NvU32 is8BPCSupportedOnCurrentMode : 1; // if 8 bpc is supported On Current Mode - NvU32 is10BPCSupportedOnCurrentMode : 1; // if 10 bpc is supported On Current Mode - NvU32 is12BPCSupportedOnCurrentMode : 1; // if 12 bpc is supported On Current Mode - NvU32 is16BPCSupportedOnCurrentMode : 1; // if 16 bpc is supported On Current Mode - NvU32 isMonxvYCC601Capable : 1; // if xvYCC 601 extended colorimetry is supported - NvU32 isMonxvYCC709Capable : 1; // if xvYCC 709 extended colorimetry is supported - NvU32 isMonsYCC601Capable : 1; // if sYCC601 extended colorimetry is supported - NvU32 isMonAdobeYCC601Capable : 1; // if AdobeYCC601 extended colorimetry is supported - NvU32 isMonAdobeRGBCapable : 1; // if AdobeRGB extended colorimetry is supported - NvU32 isMonBT2020RGBCapable : 1; // if BT2020 RGB extended colorimetry is supported - NvU32 isMonBT2020YCCCapable : 1; // if BT2020 Y'CbCr extended colorimetry is supported - NvU32 isMonBT2020cYCCCapable : 1; // if BT2020 cYCbCr (constant luminance) extended colorimetry is supported - - NvU32 reserved : 4; //!< reserved - } NV_DISPLAY_PORT_INFO_V1; - - typedef NV_DISPLAY_PORT_INFO_V1 NV_DISPLAY_PORT_INFO; - -//! Macro for constructing the version field of NV_DISPLAY_PORT_INFO. -#define NV_DISPLAY_PORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1) -#define NV_DISPLAY_PORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,2) -#define NV_DISPLAY_PORT_INFO_VER NV_DISPLAY_PORT_INFO_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetDisplayPortInfo -// -//! \fn NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo) -//! DESCRIPTION: This function returns the current DisplayPort-related information on the specified device (monitor). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! This parameter is ignored when the outputId is a NvAPI displayId. -//! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed, -//! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from -//! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles. -//! \param [out] pInfo The DisplayPort information -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -// -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SetDisplayPort -// -//! \fn NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg) -//! DESCRIPTION: This function sets up DisplayPort-related configurations. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hNvDisplay NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in] outputId This display output ID, when it's "0" it means the default outputId generated from the return of -//! NvAPI_GetAssociatedDisplayOutputId(). See \ref handles. -//! \param [in] pCfg The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dispcontrol -//! DisplayPort configuration settings - used in NvAPI_SetDisplayPort(). -typedef struct -{ - NvU32 version; //!< Structure version - 2 is the latest - NV_DP_LINK_RATE linkRate; //!< Link rate - NV_DP_LANE_COUNT laneCount; //!< Lane count - NV_DP_COLOR_FORMAT colorFormat; //!< Color format to set - NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range - NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space - NV_DP_BPC bpc; //!< Bit-per-component - NvU32 isHPD : 1; //!< If the control panel is making this call due to HPD - NvU32 isSetDeferred : 1; //!< Requires an OS modeset to finalize the setup if set - NvU32 isChromaLpfOff : 1; //!< Force the chroma low_pass_filter to be off - NvU32 isDitherOff : 1; //!< Force to turn off dither - NvU32 testLinkTrain : 1; //!< If testing mode, skip validation - NvU32 testColorChange : 1; //!< If testing mode, skip validation - -} NV_DISPLAY_PORT_CONFIG; - -//! \addtogroup dispcontrol -//! @{ -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2) -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1) -//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG -#define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2) -//! @} - - -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg); - - - - -//! \ingroup dispcontrol -//! Used in NvAPI_GetHDMISupportInfo(). -typedef struct _NV_HDMI_SUPPORT_INFO_V1 -{ - NvU32 version; //!< Structure version - - NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI - NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan - NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio - NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported - NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported - NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC 601 is supported - NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC 709 is supported - NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID) - NvU32 reserved : 24; //!< Reserved. - - NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension - } NV_HDMI_SUPPORT_INFO_V1; - -typedef struct _NV_HDMI_SUPPORT_INFO_V2 -{ - NvU32 version; //!< Structure version - - NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI - NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan - NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio - NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported - NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported - NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC extended colorimetry 601 is supported - NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC extended colorimetry 709 is supported - NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID) - NvU32 isMonsYCC601Capable : 1; //!< if sYCC601 extended colorimetry is supported - NvU32 isMonAdobeYCC601Capable : 1; //!< if AdobeYCC601 extended colorimetry is supported - NvU32 isMonAdobeRGBCapable : 1; //!< if AdobeRGB extended colorimetry is supported - NvU32 reserved : 21; //!< Reserved. - - NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension - } NV_HDMI_SUPPORT_INFO_V2; - -#define NV_HDMI_SUPPORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V1, 1) -#define NV_HDMI_SUPPORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V2, 2) - - - -#ifndef NV_HDMI_SUPPORT_INFO_VER - -typedef NV_HDMI_SUPPORT_INFO_V2 NV_HDMI_SUPPORT_INFO; -#define NV_HDMI_SUPPORT_INFO_VER NV_HDMI_SUPPORT_INFO_VER2 - -#endif - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetHDMISupportInfo -// -//! \fn NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo) -//! This API returns the current infoframe data on the specified device(monitor). -//! -//! \since Release: 95 -//! -//! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle(). -//! This parameter is ignored when the outputId is a NvAPI displayId. -//! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed, -//! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from -//! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles. -//! \param [out] pInfo The monitor and GPU's HDMI support info -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo); - - -//! \ingroup dispcontrol - -typedef enum -{ - NV_INFOFRAME_CMD_GET_DEFAULT = 0, //!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM. - NV_INFOFRAME_CMD_RESET, //!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set. - NV_INFOFRAME_CMD_GET, //!< Get the current infoframe state. - NV_INFOFRAME_CMD_SET, //!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist. - NV_INFOFRAME_CMD_GET_OVERRIDE, //!< Get the override infoframe state, non-override fields will be set to value = AUTO, overridden fields will have the current override values. - NV_INFOFRAME_CMD_SET_OVERRIDE, //!< Set the override infoframe state, non-override fields will be set to value = AUTO, other values indicate override; persist across modeset/reboot - NV_INFOFRAME_CMD_GET_PROPERTY, //!< get properties associated with infoframe (each of the infoframe type will have properties) - NV_INFOFRAME_CMD_SET_PROPERTY, //!< set properties associated with infoframe -} NV_INFOFRAME_CMD; - - -typedef enum -{ - NV_INFOFRAME_PROPERTY_MODE_AUTO = 0, //!< Driver determines whether to send infoframes. - NV_INFOFRAME_PROPERTY_MODE_ENABLE, //!< Driver always sends infoframe. - NV_INFOFRAME_PROPERTY_MODE_DISABLE, //!< Driver never sends infoframe. - NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE, //!< Driver only sends infoframe when client requests it via infoframe escape call. -} NV_INFOFRAME_PROPERTY_MODE; - - -//! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist. -typedef enum -{ - NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0, - NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE, -} NV_INFOFRAME_PROPERTY_BLACKLIST; - -typedef struct -{ - NvU32 mode : 4; - NvU32 blackList : 2; - NvU32 reserved : 10; - NvU32 version : 8; - NvU32 length : 8; -} NV_INFOFRAME_PROPERTY; - -//! Byte1 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT, - NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE, - NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_F17; - -//! Byte2 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO = 31, -} NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE, - NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY, - NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY; - -//! Byte 3 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH, - NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED, - NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07, - NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT, - NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AVI_ITC; - -//! Byte 4 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15, - NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME, - NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03, - NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION; - -//! Adding an Auto bit to each field -typedef struct -{ - NvU32 vic : 8; - NvU32 pixelRepeat : 5; - NvU32 colorSpace : 3; - NvU32 colorimetry : 3; - NvU32 extendedColorimetry : 4; - NvU32 rgbQuantizationRange : 3; - NvU32 yccQuantizationRange : 3; - NvU32 itContent : 2; - NvU32 contentTypes : 3; - NvU32 scanInfo : 3; - NvU32 activeFormatInfoPresent : 2; - NvU32 activeFormatAspectRatio : 5; - NvU32 picAspectRatio : 3; - NvU32 nonuniformScaling : 3; - NvU32 barInfo : 3; - NvU32 top_bar : 17; - NvU32 bottom_bar : 17; - NvU32 left_bar : 17; - NvU32 right_bar : 17; - NvU32 Future17 : 2; - NvU32 Future47 : 2; -} NV_INFOFRAME_VIDEO; - -//! Byte 1 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE; - -//! Byte 2 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ, - NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO = 15 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY; - - - -//! Byte 3 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO = 63 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE; - - -//! Byte 4 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL =0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL, - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL = 0X31, - // all other values should default to auto - NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO = 0x1FF -} NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION; - -//! Byte 5 related -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO = 7 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL; - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB, - NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES; - - -typedef enum -{ - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED = 0, - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED, - NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO = 3 -} NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX; - -typedef struct -{ - NvU32 codingType : 5; - NvU32 codingExtensionType : 6; - NvU32 sampleSize : 3; - NvU32 sampleRate : 4; - NvU32 channelCount : 4; - NvU32 speakerPlacement : 9; - NvU32 downmixInhibit : 2; - NvU32 lfePlaybackLevel : 3; - NvU32 levelShift : 5; - NvU32 Future12 : 2; - NvU32 Future2x : 4; - NvU32 Future3x : 4; - NvU32 Future52 : 2; - NvU32 Future6 : 9; - NvU32 Future7 : 9; - NvU32 Future8 : 9; - NvU32 Future9 : 9; - NvU32 Future10 : 9; -} NV_INFOFRAME_AUDIO; - -typedef struct -{ - NvU32 version; //!< version of this structure - NvU16 size; //!< size of this structure - NvU8 cmd; //!< The actions to perform from NV_INFOFRAME_CMD - NvU8 type; //!< type of infoframe - - union - { - NV_INFOFRAME_PROPERTY property; //!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe. - NV_INFOFRAME_AUDIO audio; - NV_INFOFRAME_VIDEO video; - } infoframe; -} NV_INFOFRAME_DATA; - -//! Macro for constructing the version field of ::NV_INFOFRAME_DATA -#define NV_INFOFRAME_DATA_VER MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_InfoFrameControl -// -//! DESCRIPTION: This API controls the InfoFrame values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pInfoframeData Contains data corresponding to InfoFrame -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(__in NvU32 displayId, __inout NV_INFOFRAME_DATA *pInfoframeData); - - - - - - -//! \ingroup dispcontrol -//! @{ -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_ColorControl -// -//! \fn NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData) -//! DESCRIPTION: This API controls the Color values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pColorData Contains data corresponding to color information -//! -//! \return RETURN STATUS: -//! ::NVAPI_OK, -//! ::NVAPI_ERROR, -//! ::NVAPI_INVALID_ARGUMENT -// -/////////////////////////////////////////////////////////////////////////////// - -typedef enum -{ - NV_COLOR_CMD_GET = 1, - NV_COLOR_CMD_SET, - NV_COLOR_CMD_IS_SUPPORTED_COLOR, - NV_COLOR_CMD_GET_DEFAULT -} NV_COLOR_CMD; - -//! See Table 14 of CEA-861E. Not all of this is supported by the GPU. -typedef enum -{ - NV_COLOR_FORMAT_RGB = 0, - NV_COLOR_FORMAT_YUV422, - NV_COLOR_FORMAT_YUV444, - NV_COLOR_FORMAT_YUV420, - - NV_COLOR_FORMAT_DEFAULT = 0xFE, - NV_COLOR_FORMAT_AUTO = 0xFF -} NV_COLOR_FORMAT; - - - -typedef enum -{ - NV_COLOR_COLORIMETRY_RGB = 0, - NV_COLOR_COLORIMETRY_YCC601, - NV_COLOR_COLORIMETRY_YCC709, - NV_COLOR_COLORIMETRY_XVYCC601, - NV_COLOR_COLORIMETRY_XVYCC709, - NV_COLOR_COLORIMETRY_SYCC601, - NV_COLOR_COLORIMETRY_ADOBEYCC601, - NV_COLOR_COLORIMETRY_ADOBERGB, - NV_COLOR_COLORIMETRY_BT2020RGB, - NV_COLOR_COLORIMETRY_BT2020YCC, - NV_COLOR_COLORIMETRY_BT2020cYCC, - - NV_COLOR_COLORIMETRY_DEFAULT = 0xFE, - NV_COLOR_COLORIMETRY_AUTO = 0xFF -} NV_COLOR_COLORIMETRY; - -typedef enum _NV_DYNAMIC_RANGE -{ - NV_DYNAMIC_RANGE_VESA = 0x0, - NV_DYNAMIC_RANGE_CEA = 0x1, - - NV_DYNAMIC_RANGE_AUTO = 0xFF -} NV_DYNAMIC_RANGE; - -typedef enum _NV_BPC -{ - NV_BPC_DEFAULT = 0, - NV_BPC_6 = 1, - NV_BPC_8 = 2, - NV_BPC_10 = 3, - NV_BPC_12 = 4, - NV_BPC_16 = 5, -} NV_BPC; - -typedef enum _NV_COLOR_SELECTION_POLICY -{ - NV_COLOR_SELECTION_POLICY_USER = 0, //!< app/nvcpl make decision to select the desire color format - NV_COLOR_SELECTION_POLICY_BEST_QUALITY = 1, //!< driver/ OS make decision to select the best color format - NV_COLOR_SELECTION_POLICY_DEFAULT = NV_COLOR_SELECTION_POLICY_BEST_QUALITY, - NV_COLOR_SELECTION_POLICY_UNKNOWN = 0xFF, -} NV_COLOR_SELECTION_POLICY; - -typedef enum _NV_DESKTOP_COLOR_DEPTH -{ - NV_DESKTOP_COLOR_DEPTH_DEFAULT = 0x0, // set if the current setting should be kept - NV_DESKTOP_COLOR_DEPTH_8BPC = 0x1, //8 bit int per color component (8 bit int alpha) - NV_DESKTOP_COLOR_DEPTH_10BPC = 0x2, //10 bit int per color component (2 bit int alpha) - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT = 0x3, //16 bit float per color component (16 bit float alpha) - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_WCG = 0x4, //16 bit float per color component (16 bit float alpha) wide color gamut - NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR = 0x5, //16 bit float per color component (16 bit float alpha) HDR - NV_DESKTOP_COLOR_DEPTH_MAX_VALUE = NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR, // must be set to highest enum value -} NV_DESKTOP_COLOR_DEPTH; - -typedef struct _NV_COLOR_DATA_V1 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - } data; -} NV_COLOR_DATA_V1; - -typedef struct _NV_COLOR_DATA_V2 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - } data; -} NV_COLOR_DATA_V2; - -typedef struct _NV_COLOR_DATA_V3 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - } data; -} NV_COLOR_DATA_V3; - -typedef struct _NV_COLOR_DATA_V4 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy - } data; -} NV_COLOR_DATA_V4; - -typedef struct _NV_COLOR_DATA_V5 -{ - NvU32 version; //!< Version of this structure - NvU16 size; //!< Size of this structure - NvU8 cmd; - struct - { - NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values. - NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values. - NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values. - NV_BPC bpc; //!< One of NV_BPC enum values. - NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy - NV_DESKTOP_COLOR_DEPTH depth; //!< One of NV_DESKTOP_COLOR_DEPTH enum values. - } data; -} NV_COLOR_DATA_V5; - -typedef NV_COLOR_DATA_V5 NV_COLOR_DATA; - -#define NV_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V1, 1) -#define NV_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V2, 2) -#define NV_COLOR_DATA_VER3 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V3, 3) -#define NV_COLOR_DATA_VER4 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V4, 4) -#define NV_COLOR_DATA_VER5 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V5, 5) -#define NV_COLOR_DATA_VER NV_COLOR_DATA_VER5 - -NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData); - -//! @} - - -typedef enum -{ - NV_STATIC_METADATA_TYPE_1 = 0 //!< Tells the type of structure used to define the Static Metadata Descriptor block. -}NV_STATIC_METADATA_DESCRIPTOR_ID; - -typedef struct _NV_HDR_CAPABILITIES_V1 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 reserved :27; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - }display_data; -} NV_HDR_CAPABILITIES_V1; - -typedef struct _NV_HDR_CAPABILITIES_V2 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isDolbyVisionSupported :1; //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported; - NvU32 reserved :26; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - }display_data; - - struct - { - NvU32 VSVDB_version : 3; //!< Version of Vendor Data block,Version 0: 25 bytes Version 1: 14 bytes - NvU32 dm_version : 8; //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM - NvU32 supports_2160p60hz : 1; //!< If set sink is capable of 4kx2k @ 60hz - NvU32 supports_YUV422_12bit : 1; //!< If set, sink is capable of YUV422-12 bit - NvU32 supports_global_dimming : 1; //!< Indicates if sink supports global dimming - NvU32 colorimetry : 1; //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise - NvU32 supports_backlight_control : 2; //!< This is set when sink is using lowlatency interface and can control its backlight. - NvU32 backlt_min_luma : 2; //!< It is the level for Backlt min luminance value. - NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink. - NvU32 supports_10b_12b_444 : 2; //!< It is set when interface supported is low latency, it tells whether it supports 10 bit or 12 bit RGB 4:4:4 or YCbCr 4:4:4 or both. - NvU32 reserved : 9; //!< Should be set to zero - //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode - NvU16 target_min_luminance; //!< Represents min luminance level of Sink - NvU16 target_max_luminance; //!< Represents max luminance level of sink - NvU16 cc_red_x; //!< Red primary chromaticity coordinate x - NvU16 cc_red_y; //!< Red primary chromaticity coordinate y - NvU16 cc_green_x; //!< Green primary chromaticity coordinate x - NvU16 cc_green_y; //!< Green primary chromaticity coordinate Y - NvU16 cc_blue_x; //!< Blue primary chromaticity coordinate x - NvU16 cc_blue_y; //!< Blue primary chromaticity coordinate y - NvU16 cc_white_x; //!< White primary chromaticity coordinate x - NvU16 cc_white_y; //!< White primary chromaticity coordinate y - }dv_static_metadata; - -} NV_HDR_CAPABILITIES_V2; - -typedef struct _NV_HDR_CAPABILITIES_V3 -{ - NvU32 version; //!< Version of this structure - - NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported; - NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID. - //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters; - NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported; - NvU32 isDolbyVisionSupported :1; //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported; - NvU32 isHdr10PlusSupported :1; //!< HDR10+ (Sink Side Tonemapping) is supported - NvU32 isHdr10PlusGamingSupported :1; //!< HDR10+ Gaming, a.k.a HDR10+ Source Side Tonemapping (SSTM), is supported - NvU32 reserved :24; - - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2) - NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - }display_data; - - struct - { - NvU32 VSVDB_version : 3; //!< Version of Vendor Data block,Version 0: 25 bytes Version 1: 14 bytes - NvU32 dm_version : 8; //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM - NvU32 supports_2160p60hz : 1; //!< If set sink is capable of 4kx2k @ 60hz - NvU32 supports_YUV422_12bit : 1; //!< If set, sink is capable of YUV422-12 bit - NvU32 supports_global_dimming : 1; //!< Indicates if sink supports global dimming - NvU32 colorimetry : 1; //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise - NvU32 supports_backlight_control : 2; //!< This is set when sink is using lowlatency interface and can control its backlight. - NvU32 backlt_min_luma : 2; //!< It is the level for Backlt min luminance value (reserved = 0x3 in latest DV spec). - NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink. - NvU32 supports_10b_12b_444 : 2; //!< It is set when interface supported is low latency, it tells whether it supports 10 bit or 12 bit RGB 4:4:4 or YCbCr 4:4:4 or both. - NvU32 parity : 1; //!< resolution and frame-rate relationships between Dolby Vision and other video processing - NvU32 reserved : 8; //!< Should be set to zero - - //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode - NvU16 target_min_luminance; //!< Represents min luminance level of Sink - NvU16 target_max_luminance; //!< Represents max luminance level of sink - NvU16 cc_red_x; //!< Red primary chromaticity coordinate x - NvU16 cc_red_y; //!< Red primary chromaticity coordinate y - NvU16 cc_green_x; //!< Green primary chromaticity coordinate x - NvU16 cc_green_y; //!< Green primary chromaticity coordinate Y - NvU16 cc_blue_x; //!< Blue primary chromaticity coordinate x - NvU16 cc_blue_y; //!< Blue primary chromaticity coordinate y - NvU16 cc_white_x; //!< White primary chromaticity coordinate x - NvU16 cc_white_y; //!< White primary chromaticity coordinate y - }dv_static_metadata; - - struct - { - NvU16 application_version : 2; //!< Application version of HDR10+ Vendor Specific Video Data Block - NvU16 full_frame_peak_luminance_index : 2; //!< Full frame peak luminance index - NvU16 peak_luminance_index : 4; //!< Peak luminance index - NvU16 reserved : 8; - }hdr10plus_vsvdb; - -} NV_HDR_CAPABILITIES_V3; - -#define NV_HDR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V1, 1) -#define NV_HDR_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V2, 2) -#define NV_HDR_CAPABILITIES_VER3 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V3, 3) -#define NV_HDR_CAPABILITIES_VER NV_HDR_CAPABILITIES_VER3 -typedef NV_HDR_CAPABILITIES_V3 NV_HDR_CAPABILITIES; - -//! \ingroup dispcontrol -//! @{ -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetHdrCapabilities -// -//! \fn NvAPI_Disp_GetHdrCapabilities(NvU32 displayId, NV_HDR_CAPABILITIES *pHdrCapabilities) -//! DESCRIPTION: This API gets High Dynamic Range (HDR) capabilities of the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pHdrCapabilities display's HDR capabilities -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetHdrCapabilities(__in NvU32 displayId, __inout NV_HDR_CAPABILITIES *pHdrCapabilities); - -//! @} - - -typedef enum -{ - NV_HDR_CMD_GET = 0, //!< Get current HDR output configuration - NV_HDR_CMD_SET = 1 //!< Set HDR output configuration -} NV_HDR_CMD; - -typedef enum -{ - // Official production-ready HDR modes - NV_HDR_MODE_OFF = 0, //!< Turn off HDR - NV_HDR_MODE_UHDA = 2, //!< Source: CCCS [a.k.a FP16 scRGB, linear, sRGB primaries, [-65504,0, 65504] range, RGB(1,1,1) = 80nits] Output : UHDA HDR [a.k.a HDR10, RGB/YCC 10/12bpc ST2084(PQ) EOTF RGB(1,1,1) = 10000 nits, Rec2020 color primaries, ST2086 static HDR metadata]. This is the only supported production HDR mode. - - // Experimental - NV_HDR_MODE_UHDA_PASSTHROUGH = 5, //!< Experimental mode only, not for production! Source: HDR10 RGB 10bpc Output: HDR10 RGB 10 bpc - signal UHDA HDR mode (PQ + Rec2020) to the sink but send source pixel values unmodified (no PQ or Rec2020 conversions) - assumes source is already in HDR10 format. - NV_HDR_MODE_DOLBY_VISION = 7, //!< Experimental mode only, not for production! Source: RGB8 Dolby Vision encoded (12 bpc YCbCr422 packed into RGB8) Output: Dolby Vision encoded : Application is to encoded frames in DV format and embed DV dynamic metadata as described in Dolby Vision specification. - - // Unsupported/obsolete HDR modes - NV_HDR_MODE_EDR = 3, //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : EDR (Extended Dynamic Range) - HDR content is tonemapped and gamut mapped to output on regular SDR display set to max luminance ( ~300 nits ). - NV_HDR_MODE_SDR = 4, //!< Do not use! Internal test mode only, to be removed. Source: any Output: SDR (Standard Dynamic Range), we continuously send SDR EOTF InfoFrame signaling, HDMI compliance testing. - NV_HDR_MODE_UHDA_NB = 6, //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : notebook HDR - NV_HDR_MODE_UHDBD = 2 //!< Do not use! Obsolete, to be removed. NV_HDR_MODE_UHDBD == NV_HDR_MODE_UHDA, reflects obsolete pre-UHDA naming convention. - -} NV_HDR_MODE; - -typedef struct _NV_HDR_COLOR_DATA_V1 -{ - NvU32 version; //!< Version of this structure - NV_HDR_CMD cmd; //!< Command get/set - NV_HDR_MODE hdrMode; //!< HDR mode - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - } mastering_display_data; -} NV_HDR_COLOR_DATA_V1; - -typedef struct _NV_HDR_COLOR_DATA_V2 -{ - NvU32 version; //!< Version of this structure - NV_HDR_CMD cmd; //!< Command get/set - NV_HDR_MODE hdrMode; //!< HDR mode - NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1) - - struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086 - { - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2) - } mastering_display_data; - - NV_COLOR_FORMAT hdrColorFormat; //!< Optional, One of NV_COLOR_FORMAT enum values, if set it will apply requested color format for HDR session - NV_DYNAMIC_RANGE hdrDynamicRange; //!< Optional, One of NV_DYNAMIC_RANGE enum values, if set it will apply requested dynamic range for HDR session - NV_BPC hdrBpc; //!< Optional, One of NV_BPC enum values, if set it will apply requested color depth - //!< Dolby Vision mode: DV supports specific combinations of colorformat, dynamic range and bpc. Please refer Dolby Vision specification. - //!< If invalid or no combination is passed driver will force default combination of RGB format + full range + 8bpc. - //!< HDR mode: These fields are ignored in hdr mode -} NV_HDR_COLOR_DATA_V2; - -#define NV_HDR_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V1, 1) -#define NV_HDR_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V2, 2) - -#ifndef NV_HDR_COLOR_DATA_VER -#define NV_HDR_COLOR_DATA_VER NV_HDR_COLOR_DATA_VER2 -typedef NV_HDR_COLOR_DATA_V2 NV_HDR_COLOR_DATA; -#endif - -//! \ingroup dispcontrol -//! @{ - /////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_HdrColorControl -// -//! \fn NvAPI_Disp_HdrColorControl(NvU32 displayId, NV_HDR_COLOR_DATA *pHdrColorData) -//! DESCRIPTION: This API configures High Dynamic Range (HDR) and Extended Dynamic Range (EDR) output. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in,out] pHdrColorData HDR configuration data -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_HdrColorControl(__in NvU32 displayId, __inout NV_HDR_COLOR_DATA *pHdrColorData); - -typedef enum _NV_COLORSPACE_TYPE -{ - NV_COLORSPACE_sRGB = 0, //!< sRGB IEC 61966-2-1:1999 == DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 - NV_COLORSPACE_xRGB = 1, //!< FP16 linear with sRGB color primaries == DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 - NV_COLORSPACE_REC2100 = 12, //!< ITU-R Rec BT.2100 (HDR10) == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 -} NV_COLORSPACE_TYPE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetSourceColorSpace -// -//! \fn NvAPI_Disp_SetSourceColorSpace(__in NvU32 displayId, __in NV_SOURCE_COLORSPACE colorSpace) -//! DESCRIPTION: This API sets colorspace of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [in] colorSpaceType Source colorspace type -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetSourceColorSpace(__in NvU32 displayId, __in NV_COLORSPACE_TYPE colorSpaceType); - -#define NV_SOURCE_PID_CURRENT 0 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetSourceColorSpace -// -//! \fn NvAPI_Disp_GetSourceColorSpace(__in NvU32 displayId, __inout NV_SOURCE_COLORSPACE* pColorSpace) -//! DESCRIPTION: This API gets colorspace of the source identified by the process id. -//! Set sourcePID = NV_SOURCE_PID_CURRENT to use the process id of the caller. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pColorSpaceType Source colorspace type -//! \param [in] sourcePID Source process id (PID) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetSourceColorSpace(__in NvU32 displayId, __inout NV_COLORSPACE_TYPE* pColorSpaceType, NvU64 sourcePID); - -typedef struct _NV_HDR_METADATA_V1 -{ - NvU32 version; //!< Version of this structure - - NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0]) - - NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0000-0xFFFF] = [0.0 - 6.55350] cd/m^2, in units of 0.0001 cd/m^2) - - NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) - NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0000-0xFFFF] = [0.0 - 65535.0] cd/m^2, in units of 1 cd/m^2) -} NV_HDR_METADATA_V1; - -#define NV_HDR_METADATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_METADATA_V1, 1) -#define NV_HDR_METADATA_VER NV_HDR_METADATA_VER1 -typedef NV_HDR_METADATA_V1 NV_HDR_METADATA; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetSourceHdrMetadata -// -//! \fn NvAPI_Disp_SetSourceHdrMetadata(__in NvU32 displayId, __in NV_HDR_METADATA* pMetadata) -//! DESCRIPTION: This API sets HDR metadata of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [in] pMetadata HDR metadata -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetSourceHdrMetadata(__in NvU32 displayId, __in NV_HDR_METADATA* pMetadata); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetSourceHdrMetadata -// -//! \fn NvAPI_NvAPI_Disp_GetSourceHdrMetadata(__in NvU32 displayId, __inout NV_HDR_METADATA* pMetadata) -//! DESCRIPTION: This API gets HDR metadata of the source identified by the process id of the caller -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pMetadata HDR metadata -//! \param [in] sourcePID Source process id (PID) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetSourceHdrMetadata(__in NvU32 displayId, __inout NV_HDR_METADATA* pMetadata, NvU64 sourcePID); - -typedef enum _NV_DISPLAY_OUTPUT_MODE -{ - NV_DISPLAY_OUTPUT_MODE_SDR = 0, - NV_DISPLAY_OUTPUT_MODE_HDR10 = 1, - NV_DISPLAY_OUTPUT_MODE_HDR10PLUS_GAMING = 2 -} NV_DISPLAY_OUTPUT_MODE; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetOutputMode -// -//! \fn NvAPI_Disp_SetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode) -//! DESCRIPTION: This API sets display output mode and returns the display output mode used by the OS before the API call. -//! Only one application at a time can override OS display output mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [in, out] pDisplayMode New/original display output mode -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_RESOURCE_IN_USE the output mode can't be changed as it is already overriden by another application. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetOutputMode -// -//! \fn NvAPI_Disp_GetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode) -//! DESCRIPTION: This API gets display output mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [out] pDisplayMode Current display output mode -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetOutputMode(__in NvU32 displayId, __inout NV_DISPLAY_OUTPUT_MODE* pDisplayMode); - -typedef enum _NV_HDR_TONEMAPPING_METHOD -{ - NV_HDR_TONEMAPPING_APP = 0, - NV_HDR_TONEMAPPING_GPU = 1 -} NV_HDR_TONEMAPPING_METHOD; - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_SetHdrToneMapping -// -//! \fn NvAPI_Disp_SetHdrToneMapping(__in NvU32 displayId, __in NV_HDR_TONEMAPPING_METHOD hdrTonemapping) -//! DESCRIPTION: This API sets HDR tonemapping method for the display -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId Display identifier -//! \param [in] hdrTonemapping HDR tonemapping method -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_SetHdrToneMapping(__in NvU32 displayId, __in NV_HDR_TONEMAPPING_METHOD hdrTonemapping); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_Disp_GetHdrToneMapping -// -//! \fn NvAPI_Disp_GetHdrToneMapping(__in NvU32 displayId, __inout NV_HDR_TONEMAPPING_METHOD* pHdrTonemapping) -//! DESCRIPTION: This API gets HDR tonemapping method for the display. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [in] displayId display identifier -//! \param [out] pHdrTonemapping HDR tonemapping method -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetHdrToneMapping(__in NvU32 displayId, __inout NV_HDR_TONEMAPPING_METHOD* pHdrTonemapping); -//! @} - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_GetTiming(). -typedef struct -{ - NvU32 isInterlaced : 4; //!< To retrieve interlaced/progressive timing - NvU32 reserved0 : 12; - union - { - NvU32 tvFormat : 8; //!< The actual analog HD/SDTV format. Used when the timing type is - //! NV_TIMING_OVERRIDE_ANALOG_TV and width==height==rr==0. - NvU32 ceaId : 8; //!< The EIA/CEA 861B/D predefined short timing descriptor ID. - //! Used when the timing type is NV_TIMING_OVERRIDE_EIA861 - //! and width==height==rr==0. - NvU32 nvPsfId : 8; //!< The NV predefined PsF format Id. - //! Used when the timing type is NV_TIMING_OVERRIDE_NV_PREDEFINED. - }; - NvU32 scaling : 8; //!< Define preferred scaling -}NV_TIMING_FLAG; - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_GetTiming(). -typedef struct _NV_TIMING_INPUT -{ - NvU32 version; //!< (IN) structure version - - NvU32 width; //!< Visible horizontal size - NvU32 height; //!< Visible vertical size - float rr; //!< Timing refresh rate - - NV_TIMING_FLAG flag; //!< Flag containing additional info for timing calculation. - - NV_TIMING_OVERRIDE type; //!< Timing type(formula) to use for calculating the timing -}NV_TIMING_INPUT; - -#define NV_TIMING_INPUT_VER MAKE_NVAPI_VERSION(NV_TIMING_INPUT,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetTiming -// -//! DESCRIPTION: This function calculates the timing from the visible width/height/refresh-rate and timing type info. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] displayId Display ID of the display. -//! \param [in] timingInput Inputs used for calculating the timing. -//! \param [out] pTiming Pointer to the NV_TIMING structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetTiming( __in NvU32 displayId,__in NV_TIMING_INPUT *timingInput, __out NV_TIMING *pTiming); - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetMonitorCapabilities -// -//! \fn NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities) -//! DESCRIPTION: This API returns the Monitor capabilities -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [out] pMonitorCapabilities The monitor support info -//! -//! \return ::NVAPI_OK, -//! ::NVAPI_ERROR, -//! ::NVAPI_INVALID_ARGUMENT -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dispcontrol -//! @{ - - -//! HDMI-related and extended CAPs -typedef enum -{ - // hdmi related caps - NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000, - NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001, - // backend caps - NV_MONITOR_CAPS_TYPE_GENERIC = 0x1002, -} NV_MONITOR_CAPS_TYPE; - - - -typedef struct _NV_MONITOR_CAPS_VCDB -{ - NvU8 quantizationRangeYcc : 1; - NvU8 quantizationRangeRgb : 1; - NvU8 scanInfoPreferredVideoFormat : 2; - NvU8 scanInfoITVideoFormats : 2; - NvU8 scanInfoCEVideoFormats : 2; -} NV_MONITOR_CAPS_VCDB; - - -//! See NvAPI_DISP_GetMonitorCapabilities(). -typedef struct _NV_MONITOR_CAPS_VSDB -{ - // byte 1 - NvU8 sourcePhysicalAddressB : 4; //!< Byte 1 - NvU8 sourcePhysicalAddressA : 4; //!< Byte 1 - // byte 2 - NvU8 sourcePhysicalAddressD : 4; //!< Byte 2 - NvU8 sourcePhysicalAddressC : 4; //!< Byte 2 - // byte 3 - NvU8 supportDualDviOperation : 1; //!< Byte 3 - NvU8 reserved6 : 2; //!< Byte 3 - NvU8 supportDeepColorYCbCr444 : 1; //!< Byte 3 - NvU8 supportDeepColor30bits : 1; //!< Byte 3 - NvU8 supportDeepColor36bits : 1; //!< Byte 3 - NvU8 supportDeepColor48bits : 1; //!< Byte 3 - NvU8 supportAI : 1; //!< Byte 3 - // byte 4 - NvU8 maxTmdsClock; //!< Bye 4 - // byte 5 - NvU8 cnc0SupportGraphicsTextContent : 1; //!< Byte 5 - NvU8 cnc1SupportPhotoContent : 1; //!< Byte 5 - NvU8 cnc2SupportCinemaContent : 1; //!< Byte 5 - NvU8 cnc3SupportGameContent : 1; //!< Byte 5 - NvU8 reserved8 : 1; //!< Byte 5 - NvU8 hasVicEntries : 1; //!< Byte 5 - NvU8 hasInterlacedLatencyField : 1; //!< Byte 5 - NvU8 hasLatencyField : 1; //!< Byte 5 - // byte 6 - NvU8 videoLatency; //!< Byte 6 - // byte 7 - NvU8 audioLatency; //!< Byte 7 - // byte 8 - NvU8 interlacedVideoLatency; //!< Byte 8 - // byte 9 - NvU8 interlacedAudioLatency; //!< Byte 9 - // byte 10 - NvU8 reserved13 : 7; //!< Byte 10 - NvU8 has3dEntries : 1; //!< Byte 10 - // byte 11 - NvU8 hdmi3dLength : 5; //!< Byte 11 - NvU8 hdmiVicLength : 3; //!< Byte 11 - // Remaining bytes - NvU8 hdmi_vic[7]; //!< Keeping maximum length for 3 bits - NvU8 hdmi_3d[31]; //!< Keeping maximum length for 5 bits -} NV_MONITOR_CAPS_VSDB; - -typedef struct _NV_MONITOR_CAPS_GENERIC -{ - NvU8 supportVRR : 1; //!< monitor supports variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 supportULMB : 1; //!< monitor supports ULMB with variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 isTrueGsync : 1; //!< whether the monitor is actually GSYNC or adaptive sync monitor : 0 for adaptive sync. - NvU8 isRLACapable : 1; //!< whether monitor supports RLA - NvU8 currentlyCapableOfVRR : 1; //!< monitor currently supports VRR on applied display settings. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only. - NvU8 reserved : 3; -} NV_MONITOR_CAPS_GENERIC; - -//! See NvAPI_DISP_GetMonitorCapabilities(). -typedef struct _NV_MONITOR_CAPABILITIES_V1 -{ - NvU32 version; - NvU16 size; - NvU32 infoType; - NvU32 connectorType; //!< Out: VGA, TV, DVI, HDMI, DP - NvU8 bIsValidInfo : 1; //!< Boolean : Returns invalid if requested info is not present such as VCDB not present - union { - NV_MONITOR_CAPS_VSDB vsdb; - NV_MONITOR_CAPS_VCDB vcdb; - NV_MONITOR_CAPS_GENERIC caps; - } data; -} NV_MONITOR_CAPABILITIES_V1; - -typedef NV_MONITOR_CAPABILITIES_V1 NV_MONITOR_CAPABILITIES; - -//! Macro for constructing the version field of ::NV_MONITOR_CAPABILITIES_V1 -#define NV_MONITOR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES_V1,1) -#define NV_MONITOR_CAPABILITIES_VER NV_MONITOR_CAPABILITIES_VER1 - -//! @} - -//! SUPPORTED OS: Windows 7 and higher -//! -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(__in NvU32 displayId, __inout NV_MONITOR_CAPABILITIES *pMonitorCapabilities); - -//! \ingroup dispcontrol -typedef struct _NV_MONITOR_COLOR_DATA -{ - NvU32 version; -// We are only supporting DP monitors for now. We need to extend this to HDMI panels as well - NV_DP_COLOR_FORMAT colorFormat; //!< One of the supported color formats - NV_DP_BPC backendBitDepths; //!< One of the supported bit depths -} NV_MONITOR_COLOR_CAPS_V1; - -typedef NV_MONITOR_COLOR_CAPS_V1 NV_MONITOR_COLOR_CAPS; - -//! \ingroup dispcontrol -#define NV_MONITOR_COLOR_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_COLOR_CAPS_V1,1) -#define NV_MONITOR_COLOR_CAPS_VER NV_MONITOR_COLOR_CAPS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetMonitorColorCapabilities -// -//! DESCRIPTION: This API returns all the color formats and bit depth values supported by a given DP monitor. -//! -//! USAGE: Sequence of calls which caller should make to get the information. -//! 1. First call NvAPI_DISP_GetMonitorColorCapabilities() with pMonitorColorCapabilities as NULL to get the count. -//! 2. Allocate memory for color caps(NV_MONITOR_COLOR_CAPS) array. -//! 3. Call NvAPI_DISP_GetMonitorColorCapabilities() again with the pointer to the memory allocated to get all the -//! color capabilities. -//! -//! Note : -//! 1. pColorCapsCount should never be NULL, else the API will fail with NVAPI_INVALID_ARGUMENT. -//! 2. *pColorCapsCount returned from the API will always be the actual count in any/every call. -//! 3. Memory size to be allocated should be (*pColorCapsCount * sizeof(NV_MONITOR_COLOR_CAPS)). -//! 4. If the memory allocated is less than what is required to return all the timings, this API will return the -//! amount of information which can fit in user provided buffer and API will return NVAPI_INSUFFICIENT_BUFFER. -//! 5. If the caller specifies a greater value for *pColorCapsCount in second call to NvAPI_DISP_GetMonitorColorCapabilities() -//! than what was returned from first call, the API will return only the actual number of elements in the color -//! capabilities array and the extra buffer will remain unused. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Monitor Identifier -//! \param [in, out] pMonitorColorCapabilities The monitor color capabilities information -//! \param [in, out] pColorCapsCount - During input, the number of elements allocated for the pMonitorColorCapabilities pointer -//! - During output, the actual number of color data elements the monitor supports -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INSUFFICIENT_BUFFER The input buffer size is not sufficient to hold the total contents. In this case -//! *pColorCapsCount will hold the required amount of elements. -//! \retval NVAPI_INVALID_DISPLAY_ID The input monitor is either not connected or is not a DP panel. -//! -//! \ingroup dispcontrol -//! -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetMonitorColorCapabilities(__in NvU32 displayId, __inout_ecount_part_opt(*pColorCapsCount, *pColorCapsCount) NV_MONITOR_COLOR_CAPS *pMonitorColorCapabilities, __inout NvU32 *pColorCapsCount); - -//! \ingroup dispcontrol -//! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay(). -typedef struct -{ - NvU32 version; - - // the source mode information - NvU32 width; //!< Source surface(source mode) width - NvU32 height; //!< Source surface(source mode) height - NvU32 depth; //!< Source surface color depth."0" means all 8/16/32bpp - NV_FORMAT colorFormat; //!< Color format (optional) - - NV_VIEWPORTF srcPartition; //!< For multimon support, should be set to (0,0,1.0,1.0) for now. - - float xRatio; //!< Horizontal scaling ratio - float yRatio; //!< Vertical scaling ratio - - NV_TIMING timing; //!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc. - NvU32 hwModeSetOnly : 1; //!< If set, it means a hardware modeset without OS update - -}NV_CUSTOM_DISPLAY; - -//! \ingroup dispcontrol -//! Used in NV_CUSTOM_DISPLAY. -#define NV_CUSTOM_DISPLAY_VER MAKE_NVAPI_VERSION(NV_CUSTOM_DISPLAY,1) - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_EnumCustomDisplay -// -//! DESCRIPTION: This API enumerates the custom timing specified by the enum index. -//! The client should keep enumerating until it returns NVAPI_END_ENUMERATION. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] displayId Dispaly ID of the display. -//! \param [in] index Enum index -//! \param [inout] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_EnumCustomDisplay( __in NvU32 displayId, __in NvU32 index, __inout NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_TryCustomDisplay -// -//! DESCRIPTION: This API is used to set up a custom display without saving the configuration on multiple displays. -//! -//! \note -//! All the members of srcPartition, present in NV_CUSTOM_DISPLAY structure, should have their range in (0.0,1.0). -//! In clone mode the timings can applied to both the target monitors but only one target at a time. \n -//! For the secondary target the applied timings works under the following conditions: -//! - If the secondary monitor EDID supports the selected timing, OR -//! - If the selected custom timings can be scaled by the secondary monitor for the selected source resolution on the primary, OR -//! - If the selected custom timings matches the existing source resolution on the primary. -//! Setting up a custom display on non-active but connected monitors is supported only for Win7 and above. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of the target display Dispaly IDs - See \ref handles. -//! \param [in] count Total number of the incoming Display IDs and corresponding NV_CUSTOM_DISPLAY structure. This is for the multi-head support. -//! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure array. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_TryCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in_ecount(count) NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_DeleteCustomDisplay -// -//! DESCRIPTION: This function deletes the custom display configuration, specified from the registry for all the displays whose display IDs are passed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved. -//! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support. -//! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_DeleteCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NV_CUSTOM_DISPLAY *pCustDisp); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SaveCustomDisplay -// -//! DESCRIPTION: This function saves the current hardware display configuration on the specified Display IDs as a custom display configuration. -//! This function should be called right after NvAPI_DISP_TryCustomDisplay() to save the custom display from the current -//! hardware context. This function will not do anything if the custom display configuration is not tested on the hardware. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved. -//! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support. -//! \param [in] isThisOutputIdOnly If set, the saved custom display will only be applied on the monitor with the same outputId (see \ref handles). -//! \param [in] isThisMonitorIdOnly If set, the saved custom display will only be applied on the monitor with the same EDID ID or -//! the same TV connector in case of analog TV. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SaveCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NvU32 isThisOutputIdOnly, __in NvU32 isThisMonitorIdOnly); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_RevertCustomDisplayTrial -// -//! DESCRIPTION: This API is used to restore the display configuration, that was changed by calling NvAPI_DISP_TryCustomDisplay(). This function -//! must be called only after a custom display configuration is tested on the hardware, using NvAPI_DISP_TryCustomDisplay(), -//! otherwise no action is taken. On Vista, NvAPI_DISP_RevertCustomDisplayTrial should be called with an active display that -//! was affected during the NvAPI_DISP_TryCustomDisplay() call, per GPU. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! -//! \param [in] pDisplayIds Pointer to display Id, of an active display. -//! \param [in] count Total number of incoming Display IDs. For future use only. Currently it is expected to be passed as 1. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_RevertCustomDisplayTrial( __in_ecount(count) NvU32* pDisplayIds, __in NvU32 count); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetView -// -//! This API lets caller retrieve the target display arrangement for selected source display handle. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW. -//! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] pTargets User allocated storage to retrieve an array of NV_VIEW_TARGET_INFO. Can be NULL to retrieve -//! the targetCount. -//! \param [in,out] targetMaskCount Count of target device mask specified in pTargetMask. -//! \param [out] targetView Target view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.") -NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView); - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetViewEx -// -//! DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle. -//! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW. -//! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs. -//! -//! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 165 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [in,out] pPathInfo Count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount. -//! \param [in,out] pPathCount Number of elements in array pPathInfo->path. -//! \param [out] pTargetViewMode Display view selected from NV_TARGET_VIEW_MODE. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -__nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.") -NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_GetSupportedViews -// -//! This API lets caller enumerate all the supported NVIDIA display views - nView and Dualview modes. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 85 -//! -//! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from -//! NvAPI_EnumNVidiaDisplayHandle(). -//! \param [out] pTargetViews Array of supported views. Can be NULL to retrieve the pViewCount first. -//! \param [in,out] pViewCount Count of supported views. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Miscellaneous error occurred -//! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount); - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetDisplayIdByDisplayName -// -//! DESCRIPTION: This API retrieves the Display Id of a given display by -//! display name. The display must be active to retrieve the -//! displayId. In the case of clone mode or Surround gaming, -//! the primary or top-left display will be returned. -//! -//! \param [in] displayName Name of display (Eg: "\\DISPLAY1" to -//! retrieve the displayId for. -//! \param [out] displayId Display ID of the requested display. -//! -//! retval ::NVAPI_OK: Capabilties have been returned. -//! retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetDisplayIdByDisplayName(const char *displayName, NvU32* displayId); - - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetGDIPrimaryDisplayId -// -//! DESCRIPTION: This API returns the Display ID of the GDI Primary. -//! -//! \param [out] displayId Display ID of the GDI Primary display. -//! -//! \retval ::NVAPI_OK: Capabilties have been returned. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND: GDI Primary not on an NVIDIA GPU. -//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetGDIPrimaryDisplayId(NvU32* displayId); - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetDisplayConfig -// -//! DESCRIPTION: This API lets caller retrieve the current global display -//! configuration. -//! USAGE: The caller might have to call this three times to fetch all the required configuration details as follows: -//! First Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set to NULL to fetch pathInfoCount. -//! Second Pass: Allocate memory for pathInfo with respect to the number of pathInfoCount(from First Pass) to fetch -//! targetInfoCount. If sourceModeInfo is needed allocate memory or it can be initialized to NULL. -//! Third Pass(Optional, only required if target information is required): Allocate memory for targetInfo with respect -//! to number of targetInfoCount(from Second Pass). -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in,out] pathInfoCount Number of elements in pathInfo array, returns number of valid topologies, this cannot be null. -//! \param [in,out] pathInfo Array of path information -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with -//! specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_ARGUMENT - Invalid input parameter. Following can be the reason for this return value: -//! -# pathInfoCount is NULL. -//! -# *pathInfoCount is 0 and pathInfo is not NULL. -//! -# *pathInfoCount is not 0 and pathInfo is NULL. -//! \retval NVAPI_DEVICE_BUSY - ModeSet has not yet completed. Please wait and call it again. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetDisplayConfig(__inout NvU32 *pathInfoCount, __out_ecount_full_opt(*pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo); - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SetDisplayConfig -// -// -//! DESCRIPTION: This API lets caller apply a global display configuration -//! across multiple GPUs. -//! -//! If all sourceIds are zero, then NvAPI will pick up sourceId's based on the following criteria : -//! - If user provides sourceModeInfo then we are trying to assign 0th sourceId always to GDIPrimary. -//! This is needed since active windows always moves along with 0th sourceId. -//! - For rest of the paths, we are incrementally assigning the sourceId per adapter basis. -//! - If user doesn't provide sourceModeInfo then NVAPI just picks up some default sourceId's in incremental order. -//! Note : NVAPI will not intelligently choose the sourceIDs for any configs that does not need a modeset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pathInfoCount Number of supplied elements in pathInfo -//! \param [in] pathInfo Array of path information -//! \param [in] flags A bitwise OR of supported flags from NV_DISPLAYCONFIG_FLAGS. -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SetDisplayConfig(__in NvU32 pathInfoCount, __in_ecount(pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO* pathInfo, __in NvU32 flags); - - - -typedef struct _NV_GET_ADAPTIVE_SYNC_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 maxFrameInterval; //!< [out] maximum frame interval in micro seconds as set previously using NvAPI_DISP_SetAdaptiveSyncData function. - //!< If default values from EDID are used, this parameter returns 0. - NvU32 bDisableAdaptiveSync : 1; //!< [out] Indicates if adaptive sync is disabled on the display. - NvU32 bDisableFrameSplitting : 1; //!< [out] Indicates if frame splitting is disabled on the display. - NvU32 reserved : 30; //!< reserved for future use. - NvU32 lastFlipRefreshCount; //!< [out] Number of times the last flip was shown on the screen - NvU64 lastFlipTimeStamp; //!< [out] Timestamp for the lastest flip on the screen - NvU32 reservedEx[4]; //!< reserved for future use. -} NV_GET_ADAPTIVE_SYNC_DATA_V1; - -#define NV_GET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_GET_ADAPTIVE_SYNC_DATA_V1,1) -#define NV_GET_ADAPTIVE_SYNC_DATA_VER NV_GET_ADAPTIVE_SYNC_DATA_VER1 - -typedef NV_GET_ADAPTIVE_SYNC_DATA_V1 NV_GET_ADAPTIVE_SYNC_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData) -//! \code -//! DESCRIPTION: This function is used to get data for the Adaptive Sync Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 415 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pAdaptiveSyncData - A pointer to NV_GET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData); - -typedef struct _NV_SET_ADAPTIVE_SYNC_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 maxFrameInterval; //!< [in] maximum frame interval in micro seconds. - //!< If maxFrameInterval is send as 0, default values from EDID will be used. - NvU32 bDisableAdaptiveSync : 1; //!< [in] Indicates if adaptive sync is disabled on the display. - NvU32 bDisableFrameSplitting : 1; //!< [in] Indicates if Frame Splitting should be disabled. - NvU32 reserved : 30; //!< reserved for future use. - NvU32 reservedEx[7]; //!< reserved for future use. -} NV_SET_ADAPTIVE_SYNC_DATA_V1; - -#define NV_SET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_SET_ADAPTIVE_SYNC_DATA_V1,1) -#define NV_SET_ADAPTIVE_SYNC_DATA_VER NV_SET_ADAPTIVE_SYNC_DATA_VER1 - -typedef NV_SET_ADAPTIVE_SYNC_DATA_V1 NV_SET_ADAPTIVE_SYNC_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData) -//! \code -//! DESCRIPTION: This function is used to set data for Adaptive Sync Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 415 -//! -//! \param [in] displayId - display id of the display -//! \param [in] pAdaptiveSyncData - A pointer to NV_SET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be set on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData); - - -typedef struct _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 frameIntervalUs; //!< [out] frame interval in micro seconds if Virtual RR is currently applied - NvU32 reservedEx[8]; //!< reserved for future use. -} NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1; - -#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1,1) -#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1 - -typedef NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_GET_VIRTUAL_REFRESH_RATE_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData) -//! \code -//! DESCRIPTION: This function is used to get Virtual Refresh Rate data for a VRR Capable Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 510 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pVirtualRefreshRateData - A pointer to NV_GET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData); - -typedef struct _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 -{ - NvU32 version ; //!< [in] structure version - NvU32 frameIntervalUs; //!< [in] frame interval in micro seconds if Virtual RR is currently applied - NvU32 reservedEx[8]; //!< reserved for future use. -} NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1; - -#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1,1) -#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1 - -typedef NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_SET_VIRTUAL_REFRESH_RATE_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -//! \fn NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData) -//! \code -//! DESCRIPTION: This function is used to set Virtual Refresh Rate data for a VRR Capable Display. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 510 -//! -//! \param [in] displayId - display id of the display -//! \param [inout] pVirtualRefreshRateData - A pointer to NV_SET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -/////////////////////////////////////////////////////////////////////////////// -//! \ingroup dispcontrol -NVAPI_INTERFACE NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData); - -//! \ingroup dispcontrol -typedef struct -{ - NvU32 version; //!< [in] Structure version - NvU32 displayId; //!< [in] Monitor Identifier to be set - NvU32 reserved; //!< Reserved for future use without adding versioning -} NV_SET_PREFERRED_STEREO_DISPLAY_V1; - -//! \ingroup dispcontrol -typedef NV_SET_PREFERRED_STEREO_DISPLAY_V1 NV_SET_PREFERRED_STEREO_DISPLAY; - -//! \ingroup dispcontrol -#define NV_SET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_SET_PREFERRED_STEREO_DISPLAY_V1,1) - -//! \ingroup dispcontrol -#define NV_SET_PREFERRED_STEREO_DISPLAY_VER NV_SET_PREFERRED_STEREO_DISPLAY_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_SetPreferredStereoDisplay -// -//! DESCRIPTION: Specifies a display output that drives the 3pin DIN output signal -//! in a workstation stereo system environment. -//! If display output is specified as a displayId of 0, the preferred -//! stereo display target is reset to the driver default selection. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 470 -//! -//! \param [in] pPreferredStereoDisplay Pointer to a NV_SET_PREFERRED_STEREO_DISPLAY structure -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API. -//! The application can be elevated to a higher permission level by selecting "Run as Administrator". -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_SetPreferredStereoDisplay(__in NV_SET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay); - -//! \ingroup dispcontrol -typedef struct -{ - NvU32 version; //!< [in] Structure version - NvU32 displayId; //!< [out] The queried stereo display - NvU32 reserved; //!< Reserved for future use without adding versioning -} NV_GET_PREFERRED_STEREO_DISPLAY_V1; - -//! \ingroup dispcontrol -typedef NV_GET_PREFERRED_STEREO_DISPLAY_V1 NV_GET_PREFERRED_STEREO_DISPLAY; - -//! \ingroup dispcontrol -#define NV_GET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_GET_PREFERRED_STEREO_DISPLAY_V1,1) - -//! \ingroup dispcontrol -#define NV_GET_PREFERRED_STEREO_DISPLAY_VER NV_GET_PREFERRED_STEREO_DISPLAY_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_DISP_GetPreferredStereoDisplay -// -//! DESCRIPTION: Queries the displayId of the display output driving the 3pin -//! DIN stereo signal, if any. -//! SUPPORTED OS: Windows 10 and higher -//! -//! \since Release: 470 -//! -//! \param [inout] pPreferredStereoDisplay Pointer to a NV_GET_PREFERRED_STEREO_DISPLAY structure -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_ERROR miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameter. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument (probably NULL). -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetPreferredStereoDisplay(__inout NV_GET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay); - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) - -typedef struct _NV_MANAGED_DEDICATED_DISPLAY_INFO -{ - NvU32 version; //!< [in] Version of this structure. - NvU32 displayId; //!< [out] DisplayId. - NvU32 isAcquired : 1; //!< [out] If bit is set, this display has been acquired by another process through NvAPI_DISP_AcquireDedicatedDisplay(). - NvU32 isMosaic : 1; //!< [out] If bit is set, this display represents a Mosaic grid. - NvU32 reserved : 30; //!< [out] Reserved for future use without adding versioning. -} NV_MANAGED_DEDICATED_DISPLAY_INFO_V1; - -#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1 MAKE_NVAPI_VERSION(NV_MANAGED_DEDICATED_DISPLAY_INFO_V1,1) -#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1 - -typedef NV_MANAGED_DEDICATED_DISPLAY_INFO_V1 NV_MANAGED_DEDICATED_DISPLAY_INFO; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_GetNvManagedDedicatedDisplays -// -//! DESCRIPTION: This API returns the count of dedicated displays managed by -//! the Nvidia driver, and specific driver info of each display. -//! This API does not return VR displays. -//! -//! HOW TO USE: 1) First make a call NvAPI_DISP_GetNvManagedDedicatedDisplays to get the number of dedicated displays managed by the Nvidia driver -//! by passing pDedicatedDisplays as NULL. -//! On call success: -//! 2) Allocate memory based on pDisplayCount, then call NvAPI_DISP_GetNvManagedDedicatedDisplays to populate pDedicatedDisplays. -//! -//! \since Release: 495 -//! -//! \param [in/out] pDedicatedDisplayCount The count of dedicated displays managed by the Nvidia driver. -//! \param [in/out] pDedicatedDisplays Pointer to an array of NV_MANAGED_DEDICATED_DISPLAY_INFO data structure. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API is not implemented in current driver. -//! \retval ::NVAPI_OUT_OF_MEMORY Could not allocate sufficient memory to complete the call. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not initialized. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of NV_MANAGED_DEDICATED_DISPLAY_INFO structure is invalid. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_GetNvManagedDedicatedDisplays(__inout NvU32* pDedicatedDisplayCount, __inout NV_MANAGED_DEDICATED_DISPLAY_INFO* pDedicatedDisplays); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_AcquireDedicatedDisplay -// -//! DESCRIPTION: This API requests exclusive access to the specified dedicated -//! display managed by the Nvidia driver. If the call succeeds, a handle -//! is returned which could be opened as a DisplaySource. -//! The call fails if the display is not managed by the Nvidia driver. -//! The call fails if the display has already been acquired by another process. -//! -//! \since Release: 495 -//! -//! \param [in] displayId Display ID of the dedicated display to be acquired. -//! \param [in/out] pDisplaySourceHandle Pointer to memory that receives the shared handle to a DisplaySource. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API not implemented. -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_INVALID_DISPLAY_ID An invalid displayId was passed as an argument. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver. -//! \retval ::NVAPI_RESOURCE_IN_USE The display has already been acquired by another process. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_AcquireDedicatedDisplay(__in NvU32 displayId, __inout NvU64* pDisplaySourceHandle); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DISP_ReleaseDedicatedDisplay -// -//! DESCRIPTION: This API releases the exclusive ownership of a specific dedicated -//! display previously acquired by the process. -//! -//! \since Release: 495 -//! -//! \param [in] displayId Display ID of the dedicated display to be released. -//! -//! \retval ::NVAPI_OK The call succeeded. -//! \retval ::NVAPI_ERROR The call failed. -//! \retval ::NVAPI_NO_IMPLEMENTATION The API not implemented. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver. -//! \retval ::NVAPI_DDISPLAY_NOT_ACQUIRED The display is not acquired by the process. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DISP_ReleaseDedicatedDisplay(__in NvU32 displayId); -#endif // defined(__cplusplus) - - -#if defined (_WINNT_) - -//! \ingroup dispcontrol - -typedef struct _NV_DISPLAY_ID_INFO_DATA_V1 -{ - NvU32 version; //!< [in] Structure version - LUID adapterId; //!< [out] Locally unique ID (LUID) of the display adapter on which the given display is present. - NvU32 targetId; //!< [out] The target identifier of the given display. This is also called AdapterRelativeId. - NvU32 reserved[4]; //!< Reserved for future use. -} NV_DISPLAY_ID_INFO_DATA_V1; - -#define NV_DISPLAY_ID_INFO_DATA_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_ID_INFO_DATA_V1,1) -#define NV_DISPLAY_ID_INFO_DATA_VER NV_DISPLAY_ID_INFO_DATA_VER1 - -typedef NV_DISPLAY_ID_INFO_DATA_V1 NV_DISPLAY_ID_INFO_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetDisplayIdInfo -// -//! DESCRIPTION: This API returns information related to the given displayId. -//! It returns adapterId and targetId (AdapterRelativeId) corresponding to the given displayId. -//! If the displayId is part of a display grid (Mosaic/Surround), then every displayId that is part of the same display grid -//! outputs the same (adapterId, targetId) pair, and no other displayId outputs this pair. -//! Otherwise, the (adapterId, targetId) pair is unique to this displayId. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 530 -//! -//! \param [in] displayId DisplayId of the display. -//! \param [inout] pDisplayIdInfoData Pointer to the NV_DISPLAY_ID_INFO_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetDisplayIdInfo(__in NvU32 displayId, __inout NV_DISPLAY_ID_INFO_DATA* pDisplayIdInfoData); - -#endif - - -//! \ingroup dispcontrol - -#if defined (_WINNT_) - -typedef struct _NV_TARGET_INFO_DATA_V1 -{ - NvU32 version; //!< [in] Structure version - LUID adapterId; //!< [in] Locally unique ID (LUID) of the display adapter on which the target is present. - NvU32 targetId; //!< [in] The target identifier. This is also called AdapterRelativeId. - NvU32 displayId[NVAPI_MAX_DISPLAYS]; //!< [out] An array of displayIds corresponding to the input adapterId and targetId. - //!< If the input (targetId, adapterId) pair is a display grid (Mosaic/Surround), - //!< then the output contains the displayId of every display that is part of the display grid. - //!< Otherwise, it contains exactly one displayId. - //!< These displayId values are unique to this (targetId, adapterId) pair. - NvU32 displayIdCount; //!< [out] The number of displays returned in displayId array. - NvU32 reserved[4]; //!< Reserved for future use. -} NV_TARGET_INFO_DATA_V1; - -#define NV_TARGET_INFO_DATA_VER1 MAKE_NVAPI_VERSION(NV_TARGET_INFO_DATA_V1,1) -#define NV_TARGET_INFO_DATA_VER NV_TARGET_INFO_DATA_VER1 - -typedef NV_TARGET_INFO_DATA_V1 NV_TARGET_INFO_DATA; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetDisplayIdsFromTarget -// -//! DESCRIPTION: This API returns displayId(s) corresponding to the given target. -//! If the input (targetId, adapterId) pair is a display grid (Mosaic/Surround), then the output contains the displayId of every display -//! that is part of the display grid. Otherwise, it contains exactly one displayId. -//! These displayId values are unique to this (targetId, adapterId) pair. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 530 -//! -//! \param [inout] pTargetInfoData Pointer to the NV_TARGET_INFO_DATA structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetDisplayIdsFromTarget(__inout NV_TARGET_INFO_DATA* pTargetInfoData); - - -//! \ingroup dispcontrol - -typedef struct _NV_GET_VRR_INFO_V1 -{ - NvU32 version; //!< [in] Structure version - NvU32 bIsVRREnabled : 1; //!< [out] Set if VRR Mode is currently enabled on given display. - NvU32 reserved :31; //!< Reserved for future use. - NvU32 reservedEx[4]; //!< Reserved for future use -} NV_GET_VRR_INFO_V1; - -#define NV_GET_VRR_INFO_VER1 MAKE_NVAPI_VERSION(NV_GET_VRR_INFO_V1,1) -#define NV_GET_VRR_INFO_VER NV_GET_VRR_INFO_VER1 - -typedef NV_GET_VRR_INFO_V1 NV_GET_VRR_INFO; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Disp_GetVRRInfo -// -//! DESCRIPTION: This API returns Variable Refresh Rate(VRR) information for the given display ID. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 525 -//! -//! \param [inout] pVrrInfo Pointer to the NV_GET_VRR_INFO structure. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dispcontrol -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Disp_GetVRRInfo(__in NvU32 displayId, __inout NV_GET_VRR_INFO *pVrrInfo); - - -#endif - - -//////////////////////////////////////////////////////////////////////////////////////// -// -// MOSAIC allows a multi display target output scanout on a single source. -// -// SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap -// -//+-------------------------++-------------------------++-------------------------++-------------------------+ -//| || || || | -//| || || || | -//| || || || | -//| DVI1 || DVI2 || DVI3 || DVI4 | -//| || || || | -//| || || || | -//| || || || | -//| || || || | -//+-------------------------++-------------------------++-------------------------++-------------------------+ - - -//! \addtogroup mosaicapi -//! @{ - -#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8 -#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8 -#define NV_MOSAIC_MAX_DISPLAYS (64) -// -// These bits are used to describe the validity of a topo. -// -#define NV_MOSAIC_TOPO_VALIDITY_VALID 0x00000000 //!< The topology is valid -#define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU 0x00000001 //!< Not enough SLI GPUs were found to fill the entire - //! topology. hPhysicalGPU will be 0 for these. -#define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY 0x00000002 //!< Not enough displays were found to fill the entire - //! topology. displayOutputId will be 0 for these. -#define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004 //!< The topoogy is only possible with displays of the same - //! NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make - //! sure they are all CRTs, or all DFPs. - - -// -//! This structure defines the topology details. -typedef struct -{ - NvU32 version; //!< Version of this structure - NvLogicalGpuHandle hLogicalGPU; //!< Logical GPU for this topology - NvU32 validityMask; //!< 0 means topology is valid with the current hardware. - //! If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*. - NvU32 rowCount; //!< Number of displays in a row - NvU32 colCount; //!< Number of displays in a column - - struct - { - NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology (0 if GPU missing) - NvU32 displayOutputId; //!< Connected display target (0 if no display connected) - NvS32 overlapX; //!< Pixels of overlap on left of target: (+overlap, -gap) - NvS32 overlapY; //!< Pixels of overlap on top of target: (+overlap, -gap) - - } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS]; - -} NV_MOSAIC_TOPO_DETAILS; - -//! Macro for constructing te vesion field of NV_MOSAIC_TOPO_DETAILS -#define NVAPI_MOSAIC_TOPO_DETAILS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS,1) - - -// -//! These values refer to the different types of Mosaic topologies that are possible. When -//! getting the supported Mosaic topologies, you can specify one of these types to narrow down -//! the returned list to only those that match the given type. -typedef enum -{ - NV_MOSAIC_TOPO_TYPE_ALL, //!< All mosaic topologies - NV_MOSAIC_TOPO_TYPE_BASIC, //!< Basic Mosaic topologies - NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO, //!< Passive Stereo topologies - NV_MOSAIC_TOPO_TYPE_SCALED_CLONE, //!< Not supported at this time - NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE, //!< Not supported at this time - NV_MOSAIC_TOPO_TYPE_MAX, //!< Always leave this at end of the enum -} NV_MOSAIC_TOPO_TYPE; - - -// -//! This is a complete list of supported Mosaic topologies. -//! -//! Using a "Basic" topology combines multiple monitors to create a single desktop. -//! -//! Using a "Passive" topology combines multiples monitors to create a passive stereo desktop. -//! In passive stereo, two identical topologies combine - one topology is used for the right eye and the other identical //! topology (targeting different displays) is used for the left eye. \n -//! NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums. If this -//! enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO -//! please update the corresponding value in nvEscDef.h -typedef enum -{ - NV_MOSAIC_TOPO_NONE, - - // 'BASIC' topos start here - // - // The result of using one of these Mosaic topos is that multiple monitors - // will combine to create a single desktop. - // - NV_MOSAIC_TOPO_BEGIN_BASIC, - NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC, - NV_MOSAIC_TOPO_2x1_BASIC, - NV_MOSAIC_TOPO_1x3_BASIC, - NV_MOSAIC_TOPO_3x1_BASIC, - NV_MOSAIC_TOPO_1x4_BASIC, - NV_MOSAIC_TOPO_4x1_BASIC, - NV_MOSAIC_TOPO_2x2_BASIC, - NV_MOSAIC_TOPO_2x3_BASIC, - NV_MOSAIC_TOPO_2x4_BASIC, - NV_MOSAIC_TOPO_3x2_BASIC, - NV_MOSAIC_TOPO_4x2_BASIC, - NV_MOSAIC_TOPO_1x5_BASIC, - NV_MOSAIC_TOPO_1x6_BASIC, - NV_MOSAIC_TOPO_7x1_BASIC, - - // Add padding for 10 more entries. 6 will be enough room to specify every - // possible topology with 8 or fewer displays, so this gives us a little - // extra should we need it. - NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9, - - // 'PASSIVE_STEREO' topos start here - // - // The result of using one of these Mosaic topos is that multiple monitors - // will combine to create a single PASSIVE STEREO desktop. What this means is - // that there will be two topos that combine to create the overall desktop. - // One topo will be used for the left eye, and the other topo (of the - // same rows x cols), will be used for the right eye. The difference between - // the two topos is that different GPUs and displays will be used. - // - NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, // value shadowed in nvEscDef.h - NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, - NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO, - NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO, - NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO, - NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO, - NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4, - - - // - // Total number of topos. Always leave this at the end of the enumeration. - // - NV_MOSAIC_TOPO_MAX //! Total number of topologies. - -} NV_MOSAIC_TOPO; - - -// -//! This is a "topology brief" structure. It tells you what you need to know about -//! a topology at a high level. A list of these is returned when you query for the -//! supported Mosaic information. -//! -//! If you need more detailed information about the topology, call -//! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure. -typedef struct -{ - NvU32 version; //!< Version of this structure - NV_MOSAIC_TOPO topo; //!< The topology - NvU32 enabled; //!< 1 if topo is enabled, else 0 - NvU32 isPossible; //!< 1 if topo *can* be enabled, else 0 - -} NV_MOSAIC_TOPO_BRIEF; - -//! Macro for constructing the version field of NV_MOSAIC_TOPO_BRIEF -#define NVAPI_MOSAIC_TOPO_BRIEF_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF,1) - - -// -//! Basic per-display settings that are used in setting/getting the Mosaic mode -typedef struct _NV_MOSAIC_DISPLAY_SETTING_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 width; //!< Per-display width - NvU32 height; //!< Per-display height - NvU32 bpp; //!< Bits per pixel - NvU32 freq; //!< Display frequency -} NV_MOSAIC_DISPLAY_SETTING_V1; - -typedef struct NV_MOSAIC_DISPLAY_SETTING_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 width; //!< Per-display width - NvU32 height; //!< Per-display height - NvU32 bpp; //!< Bits per pixel - NvU32 freq; //!< Display frequency - NvU32 rrx1k; //!< Display frequency in x1k -} NV_MOSAIC_DISPLAY_SETTING_V2; - -typedef NV_MOSAIC_DISPLAY_SETTING_V2 NV_MOSAIC_DISPLAY_SETTING; - -//! Macro for constructing the version field of NV_MOSAIC_DISPLAY_SETTING -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V1,1) -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V2,2) -#define NVAPI_MOSAIC_DISPLAY_SETTING_VER NVAPI_MOSAIC_DISPLAY_SETTING_VER2 - - -// -// Set a reasonable max number of display settings to support -// so arrays are bound. -// -#define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40 //!< Set a reasonable maximum number of display settings to support - //! so arrays are bound. - - -// -//! This structure is used to contain a list of supported Mosaic topologies -//! along with the display settings that can be used. -typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 topoBriefsCount; //!< Number of topologies in below array - NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details - NvU32 displaySettingsCount; //!< Number of display settings in below array - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible - -} NV_MOSAIC_SUPPORTED_TOPO_INFO_V1; - -typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 topoBriefsCount; //!< Number of topologies in below array - NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details - NvU32 displaySettingsCount; //!< Number of display settings in below array - NV_MOSAIC_DISPLAY_SETTING_V2 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible - -} NV_MOSAIC_SUPPORTED_TOPO_INFO_V2; - -typedef NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 NV_MOSAIC_SUPPORTED_TOPO_INFO; - -//! Macro forconstructing the version field of NV_MOSAIC_SUPPORTED_TOPO_INFO -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V1,1) -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V2,2) -#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 - - -// -// Indices to use to access the topos array within the mosaic topology -#define NV_MOSAIC_TOPO_IDX_DEFAULT 0 - -#define NV_MOSAIC_TOPO_IDX_LEFT_EYE 0 -#define NV_MOSAIC_TOPO_IDX_RIGHT_EYE 1 -#define NV_MOSAIC_TOPO_NUM_EYES 2 - - -// -//! This defines the maximum number of topos that can be in a topo group. -//! At this time, it is set to 2 because our largest topo group (passive -//! stereo) only needs 2 topos (left eye and right eye). -//! -//! If a new topo group with more than 2 topos is added above, then this -//! number will also have to be incremented. -#define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2 - - -// -//! This structure defines a group of topologies that work together to create one -//! overall layout. All of the supported topologies are represented with this -//! structure. -//! -//! For example, a 'Passive Stereo' topology would be represented with this -//! structure, and would have separate topology details for the left and right eyes. -//! The count would be 2. A 'Basic' topology is also represented by this structure, -//! with a count of 1. -//! -//! The structure is primarily used internally, but is exposed to applications in a -//! read-only fashion because there are some details in it that might be useful -//! (like the number of rows/cols, or connected display information). A user can -//! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup(). -//! -//! You can then look at the detailed values within the structure. There are no -//! entrypoints which take this structure as input (effectively making it read-only). -typedef struct -{ - NvU32 version; //!< Version of this structure - NV_MOSAIC_TOPO_BRIEF brief; //!< The brief details of this topo - NvU32 count; //!< Number of topos in array below - NV_MOSAIC_TOPO_DETAILS topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP]; - -} NV_MOSAIC_TOPO_GROUP; - -//! Macro for constructing the version field of NV_MOSAIC_TOPO_GROUP -#define NVAPI_MOSAIC_TOPO_GROUP_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP,1) - -//! @} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetSupportedTopoInfo -// -//! DESCRIPTION: This API returns information on the topologies and display resolutions -//! supported by Mosaic mode. -//! -//! NOTE: Not all topologies returned can be set immediately. -//! See 'OUT' Notes below. -//! -//! Once you get the list of supported topologies, you can call -//! NvAPI_Mosaic_GetTopoGroup() with one of the Mosaic topologies if you need -//! more information about it. -//! -//! 'IN' Notes: pSupportedTopoInfo->version must be set before calling this function. -//! If the specified version is not supported by this implementation, -//! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION). -//! -//! 'OUT' Notes: Some of the topologies returned might not be valid for one reason or -//! another. It could be due to mismatched or missing displays. It -//! could also be because the required number of GPUs is not found. -//! At a high level, you can see if the topology is valid and can be enabled -//! by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag. -//! If this is true, the topology can be enabled. If it -//! is false, you can find out why it cannot be enabled by getting the -//! details of the topology via NvAPI_Mosaic_GetTopoGroup(). From there, -//! look at the validityMask of the individual topologies. The bits can -//! be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits. -//! -//! It is possible for this function to return NVAPI_OK with no topologies -//! listed in the return structure. If this is the case, it means that -//! the current hardware DOES support Mosaic, but with the given configuration -//! no valid topologies were found. This most likely means that SLI was not -//! enabled for the hardware. Once enabled, you should see valid topologies -//! returned from this function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! -//! \param [in,out] pSupportedTopoInfo Information about what topologies and display resolutions -//! are supported for Mosaic. -//! \param [in] type The type of topologies the caller is interested in -//! getting. See NV_MOSAIC_TOPO_TYPE for possible values. -//! -//! \retval ::NVAPI_OK No errors in returning supported topologies. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -// compatible with this entry point. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetTopoGroup -// -//! DESCRIPTION: This API returns a structure filled with the details -//! of the specified Mosaic topology. -//! -//! If the pTopoBrief passed in matches the current topology, -//! then information in the brief and group structures -//! will reflect what is current. Thus the brief would have -//! the current 'enable' status, and the group would have the -//! current overlap values. If there is no match, then the -//! returned brief has an 'enable' status of FALSE (since it -//! is obviously not enabled), and the overlap values will be 0. -//! -//! 'IN' Notes: pTopoGroup->version must be set before calling this function. -//! If the specified version is not supported by this implementation, -//! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION). -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology for getting the details -//! This must be one of the topology briefs -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in,out] pTopoGroup The topology details matching the brief -//! -//! \retval ::NVAPI_OK Details were retrieved successfully. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -// compatible with this entry point. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetOverlapLimits -// -//! DESCRIPTION: This API returns the X and Y overlap limits required if -//! the given Mosaic topology and display settings are to be used. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology for getting limits -//! This must be one of the topo briefs -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in] pDisplaySetting The display settings for getting the limits. -//! This must be one of the settings -//! returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [out] pMinOverlapX X overlap minimum -//! \param [out] pMaxOverlapX X overlap maximum -//! \param [out] pMinOverlapY Y overlap minimum -//! \param [out] pMaxOverlapY Y overlap maximum -//! -//! \retval ::NVAPI_OK Details were retrieved successfully. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -//! compatible with this entry point. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_SetCurrentTopo -// -//! DESCRIPTION: This API sets the Mosaic topology and performs a mode switch -//! using the given display settings. -//! -//! If NVAPI_OK is returned, the current Mosaic topology was set -//! correctly. Any other status returned means the -//! topology was not set, and remains what it was before this -//! function was called. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pTopoBrief The topology to set. This must be one of the topologies returned from -//! NvAPI_Mosaic_GetSupportedTopoInfo(), and it must have an isPossible value of 1. -//! \param [in] pDisplaySetting The per display settings to be used in the Mosaic mode. This must be one of the -//! settings returned from NvAPI_Mosaic_GetSupportedTopoInfo(). -//! \param [in] overlapX The pixel overlap to use between horizontal displays (use positive a number for -//! overlap, or a negative number to create a gap.) If the overlap is out of bounds -//! for what is possible given the topo and display setting, the overlap will be clamped. -//! \param [in] overlapY The pixel overlap to use between vertical displays (use positive a number for -//! overlap, or a negative number to create a gap.) If the overlap is out of bounds for -//! what is possible given the topo and display setting, the overlap will be clamped. -//! \param [in] enable If 1, the topology being set will also be enabled, meaning that the mode set will -//! occur. \n -//! If 0, you don't want to be in Mosaic mode right now, but want to set the current -//! Mosaic topology so you can enable it later with NvAPI_Mosaic_EnableCurrentTopo(). -//! -//! \retval ::NVAPI_OK The Mosaic topology was set. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE The topology passed in is not currently possible. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available. -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not -//! compatible with this entrypoint. -//! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetCurrentTopo -// -//! DESCRIPTION: This API returns information for the current Mosaic topology. -//! This includes topology, display settings, and overlap values. -//! -//! You can call NvAPI_Mosaic_GetTopoGroup() with the topology -//! if you require more information. -//! -//! If there isn't a current topology, then pTopoBrief->topo will -//! be NV_MOSAIC_TOPO_NONE. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [out] pTopoBrief The current Mosaic topology -//! \param [out] pDisplaySetting The current per-display settings -//! \param [out] pOverlapX The pixel overlap between horizontal displays -//! \param [out] pOverlapY The pixel overlap between vertical displays -//! -//! \retval ::NVAPI_OK Success getting current info. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first. -//! \retval ::NVAPI_NO_IMPLEMENTATION This entry point not available. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnableCurrentTopo -// -//! DESCRIPTION: This API enables or disables the current Mosaic topology -//! based on the setting of the incoming 'enable' parameter. -//! -//! An "enable" setting enables the current (previously set) Mosaic topology. -//! Note that when the current Mosaic topology is retrieved, it must have an isPossible value of 1 or -//! an error will occur. -//! -//! A "disable" setting disables the current Mosaic topology. -//! The topology information will persist, even across reboots. -//! To re-enable the Mosaic topology, call this function -//! again with the enable parameter set to 1. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] enable 1 to enable the current Mosaic topo, 0 to disable it. -//! -//! \retval ::NVAPI_OK The Mosaic topo was enabled/disabled. -//! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE The current topology is not currently possible. -//! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable); - -//! \ingroup mosaicapi -//! @{ -typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V1 -{ - NvU32 displayId; //!< DisplayID of the display - NvS32 overlapX; //!< (+overlap, -gap) - NvS32 overlapY; //!< (+overlap, -gap) - NV_ROTATE rotation; //!< Rotation of display - NvU32 cloneGroup; //!< Reserved, must be 0 -} NV_MOSAIC_GRID_TOPO_DISPLAY_V1; - -typedef enum _NV_PIXEL_SHIFT_TYPE -{ - NV_PIXEL_SHIFT_TYPE_NO_PIXEL_SHIFT = 0, //!< No pixel shift will be applied to this display. - NV_PIXEL_SHIFT_TYPE_2x2_TOP_LEFT_PIXELS = 1, //!< This display will be used to scanout top left pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_RIGHT_PIXELS = 2, //!< This display will be used to scanout bottom right pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_TOP_RIGHT_PIXELS = 4, //!< This display will be used to scanout top right pixels in 2x2 PixelShift configuration - NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_LEFT_PIXELS = 8, //!< This display will be used to scanout bottom left pixels in 2x2 PixelShift configuration -} NV_PIXEL_SHIFT_TYPE; - -typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V2 -{ - NvU32 version; //!< Version of this structure - - NvU32 displayId; //!< DisplayID of the display - NvS32 overlapX; //!< (+overlap, -gap) - NvS32 overlapY; //!< (+overlap, -gap) - NV_ROTATE rotation; //!< Rotation of display - NvU32 cloneGroup; //!< Reserved, must be 0 - NV_PIXEL_SHIFT_TYPE pixelShiftType; //!< Type of the pixel shift enabled display -} NV_MOSAIC_GRID_TOPO_DISPLAY_V2; - -#ifndef NV_MOSAIC_GRID_TOPO_DISPLAY_VER - -typedef NV_MOSAIC_GRID_TOPO_DISPLAY_V1 NV_MOSAIC_GRID_TOPO_DISPLAY; - -#endif - -typedef struct _NV_MOSAIC_GRID_TOPO_V1 -{ - NvU32 version; //!< Version of this structure - NvU32 rows; //!< Number of rows - NvU32 columns; //!< Number of columns - NvU32 displayCount; //!< Number of display details - NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution - NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only) - NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only) - NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get. - NvU32 acceleratePrimaryDisplay : 1; //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get. - NvU32 reserved : 27; //!< Reserved, must be 0 - NV_MOSAIC_GRID_TOPO_DISPLAY_V1 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column] - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings -} NV_MOSAIC_GRID_TOPO_V1; - -typedef struct _NV_MOSAIC_GRID_TOPO_V2 -{ - NvU32 version; //!< Version of this structure - NvU32 rows; //!< Number of rows - NvU32 columns; //!< Number of columns - NvU32 displayCount; //!< Number of display details - NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution - NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only) - NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only) - NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get. - NvU32 acceleratePrimaryDisplay : 1; //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get. - NvU32 pixelShift : 1; //!< Enable Pixel shift - NvU32 reserved : 26; //!< Reserved, must be 0 - NV_MOSAIC_GRID_TOPO_DISPLAY_V2 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column] - NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings -} NV_MOSAIC_GRID_TOPO_V2; - -//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO -#define NV_MOSAIC_GRID_TOPO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V1,1) -#define NV_MOSAIC_GRID_TOPO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V2,2) -#ifndef NV_MOSAIC_GRID_TOPO_VER - -typedef NV_MOSAIC_GRID_TOPO_V2 NV_MOSAIC_GRID_TOPO; - -//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO -#define NV_MOSAIC_GRID_TOPO_VER NV_MOSAIC_GRID_TOPO_VER2 - -#endif - -//! @} - -//! since Release R290 - -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_INVALID_GPU NV_BIT(0) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_WRONG_CONNECTOR NV_BIT(1) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_COMMON_TIMINGS NV_BIT(2) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_EDID_AVAILABLE NV_BIT(3) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_MISMATCHED_OUTPUT_TYPE NV_BIT(4) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_DISPLAY_CONNECTED NV_BIT(5) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_GPU_TOPOLOGY NV_BIT(6) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NOT_SUPPORTED NV_BIT(7) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_SLI_BRIDGE NV_BIT(8) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_ECC_ENABLED NV_BIT(9) -#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_GPU_TOPOLOGY_NOT_SUPPORTED NV_BIT(10) - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_GetDisplayViewportsByResolution -// -//! DESCRIPTION: This API returns the viewports that would be applied on -//! the requested display. -//! -//! \param [in] displayId Display ID of a single display in the active -//! mosaic topology to query. -//! \param [in] srcWidth Width of full display topology. If both -//! width and height are 0, the current -//! resolution is used. -//! \param [in] srcHeight Height of full display topology. If both -//! width and height are 0, the current -//! resolution is used. -//! \param [out] viewports Array of NV_RECT viewports which represent -//! the displays as identified in -//! NvAPI_Mosaic_EnumGridTopologies. If the -//! requested resolution is a single-wide -//! resolution, only viewports[0] will -//! contain the viewport details, regardless -//! of which display is driving the display. -//! \param [out] bezelCorrected Returns 1 if the requested resolution is -//! bezel corrected. May be NULL. -//! -//! \retval ::NVAPI_OK Capabilties have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_MOSAIC_NOT_ACTIVE The display does not belong to an active Mosaic Topology -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_GetDisplayViewportsByResolution(NvU32 displayId, NvU32 srcWidth, NvU32 srcHeight, NV_RECT viewports[NV_MOSAIC_MAX_DISPLAYS], NvU8* bezelCorrected); - - - - - -//! Do not change the current GPU topology. If the NO_DRIVER_RELOAD bit is not -//! specified, then it may still require a driver reload. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_CURRENT_GPU_TOPOLOGY NV_BIT(0) - -//! Do not allow a driver reload. That is, stick with the same master GPU as well as the -//! same SLI configuration. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_NO_DRIVER_RELOAD NV_BIT(1) - -//! When choosing a GPU topology, choose the topology with the best performance. -//! Without this flag, it will choose the topology that uses the smallest number -//! of GPU's. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_MAXIMIZE_PERFORMANCE NV_BIT(2) - -//! Do not return an error if no configuration will work with all of the grids. -#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_ALLOW_INVALID NV_BIT(3) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_SetDisplayGrids -// -//! DESCRIPTION: Sets a new display topology, replacing any existing topologies -//! that use the same displays. -//! -//! This function will look for an SLI configuration that will -//! allow the display topology to work. -//! -//! To revert to a single display, specify that display as a 1x1 -//! grid. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pGridTopologies The topology details to set. -//! \param [in] gridCount The number of elements in the pGridTopologies array. -//! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_* -//! flags. -//! -//! -//! \retval ::NVAPI_OK Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY No matching GPU topologies could be found. -//! \retval ::NVAPI_TOPO_NOT_POSSIBLE One or more of the display grids are not valid. -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_SetDisplayGrids(__in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, __in NvU32 gridCount, __in NvU32 setTopoFlags); - - -//! \ingroup mosaicapi -//! Indicates that a display's position in the grid is sub-optimal. -#define NV_MOSAIC_DISPLAYTOPO_WARNING_DISPLAY_POSITION NV_BIT(0) - -//! \ingroup mosaicapi -//! Indicates that SetDisplaySettings would need to perform a driver reload. -#define NV_MOSAIC_DISPLAYTOPO_WARNING_DRIVER_RELOAD_REQUIRED NV_BIT(1) - -//! \ingroup mosaicapi -typedef struct -{ - NvU32 version; - NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags. - NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags. - - NvU32 displayCount; //!< (OUT) The number of valid entries in the displays array. - struct - { - NvU32 displayId; //!< (OUT) The DisplayID of this display. - NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYCAPS_PROBLEM_* flags. - NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags. - - NvU32 supportsRotation : 1; //!< (OUT) This display can be rotated - NvU32 reserved : 31; //!< (OUT) reserved - } displays[NVAPI_MAX_DISPLAYS]; -} NV_MOSAIC_DISPLAY_TOPO_STATUS; - -//! \ingroup mosaicapi -#define NV_MOSAIC_DISPLAY_TOPO_STATUS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_TOPO_STATUS,1) - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_ValidateDisplayGrids -// -//! DESCRIPTION: Determines if a list of grid topologies is valid. It will choose an SLI -//! configuration in the same way that NvAPI_Mosaic_SetDisplayGrids() does. -//! -//! On return, each element in the pTopoStatus array will contain any errors or -//! warnings about each grid topology. If any error flags are set, then the topology -//! is not valid. If any warning flags are set, then the topology is valid, but -//! sub-optimal. -//! -//! If the ALLOW_INVALID flag is set, then it will continue to validate the grids -//! even if no SLI configuration will allow all of the grids. In this case, a grid -//! grid with no matching GPU topology will have the error -//! flags NO_GPU_TOPOLOGY or NOT_SUPPORTED set. -//! -//! If the ALLOW_INVALID flag is not set and no matching SLI configuration is -//! found, then it will skip the rest of the validation and return -//! NVAPI_NO_ACTIVE_SLI_TOPOLOGY. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_* -//! flags. -//! \param [in] pGridTopologies The array of grid topologies to verify. -//! \param [in,out] pTopoStatus The array of problems and warnings with each grid topology. -//! \param [in] gridCount The number of elements in the pGridTopologies and -//! pTopoStatus arrays. -//! -//! -//! \retval ::NVAPI_OK: Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available -//! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY: No matching GPU topologies could be found. -//! \retval ::NVAPI_ERROR: Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_ValidateDisplayGrids(__in NvU32 setTopoFlags, - __in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, - __inout_ecount_full(gridCount) NV_MOSAIC_DISPLAY_TOPO_STATUS *pTopoStatus, - __in NvU32 gridCount); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnumDisplayModes -// -//! DESCRIPTION: Determines the set of available display modes for a given grid topology. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pGridTopology The grid topology to use. -//! \param [in,out] pDisplaySettings A pointer to an array of display settings to populate, -//! or NULL to find out the total number of available modes. -//! \param [in,out] pDisplayCount If pDisplaySettings is not NULL, then pDisplayCount -//! should point to the number of elements in the -//! pDisplaySettings array. On return, it will contain the -//! number of modes that were actually returned. If -//! pDisplaySettings is NULL, then pDisplayCount will receive -//! the total number of modes that are available. -//! -//! -//! \retval ::NVAPI_OK Capabilities have been returned. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaciapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayModes(__in NV_MOSAIC_GRID_TOPO *pGridTopology, - __inout_ecount_part_opt(*pDisplayCount, *pDisplayCount) NV_MOSAIC_DISPLAY_SETTING *pDisplaySettings, - __inout NvU32 *pDisplayCount); - - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Mosaic_EnumDisplayGrids -// -//! DESCRIPTION: Enumerates the current active grid topologies. This includes Mosaic, IG, and -//! Panoramic topologies, as well as single displays. -//! -//! If pGridTopologies is NULL, then pGridCount will be set to the number of active -//! grid topologies. -//! -//! If pGridTopologies is not NULL, then pGridCount contains the maximum number of -//! grid topologies to return. On return, pGridCount will be set to the number of -//! grid topologies that were returned. -//! -//! \param [out] pGridTopologies The list of active grid topologies. -//! \param [in,out] pGridCount A pointer to the number of grid topologies returned. -//! -//! \retval ::NVAPI_OK Capabilties have been returned. -//! \retval ::NVAPI_END_ENUMERATION There are no more topologies to return. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first -//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available -//! \retval ::NVAPI_ERROR Miscellaneous error occurred -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayGrids(__inout_ecount_part_opt(*pGridCount, *pGridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, - __inout NvU32 *pGridCount); - - -//////////////////////////////////////////////////////////////////////////////////////// -// -// ########################################################################### -// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS -// -// Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain -// once Phase 2 is complete. For a small amount of time, the two will co-exist. As -// soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2 -// entrypoints, the code below will be deleted. -// -// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS -// ########################################################################### -// -// Supported topos 1x4, 4x1 and 2x2 to start with. -// -// Selected scan out targets can be one per GPU or more than one on the same GPU. -// -// SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap -// -//+-------------------------++-------------------------++-------------------------++-------------------------+ -//| || || || | -//| || || || | -//| || || || | -//| DVI1 || DVI2 || DVI3 || DVI4 | -//| || || || | -//| || || || | -//| || || || | -//| || || || | -//+-------------------------++-------------------------++-------------------------++-------------------------+ - - -//! \addtogroup mosaicapi -//! @{ - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8 - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8 - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MAX_MOSAIC_TOPOS 16 - -//! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology(). -typedef struct -{ - NvU32 version; //!< Version number of the mosaic topology - NvU32 rowCount; //!< Horizontal display count - NvU32 colCount; //!< Vertical display count - - struct - { - NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology - NvU32 displayOutputId; //!< Connected display target - NvS32 overlapX; //!< Pixels of overlap on the left of target: (+overlap, -gap) - NvS32 overlapY; //!< Pixels of overlap on the top of target: (+overlap, -gap) - - } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS]; - -} NV_MOSAIC_TOPOLOGY; - -//! Used in NV_MOSAIC_TOPOLOGY. -#define NVAPI_MOSAIC_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY,1) - -//! Used in NvAPI_GetSupportedMosaicTopologies(). -typedef struct -{ - NvU32 version; - NvU32 totalCount; //!< Count of valid topologies - NV_MOSAIC_TOPOLOGY topos[NVAPI_MAX_MOSAIC_TOPOS]; //!< Maximum number of topologies - -} NV_MOSAIC_SUPPORTED_TOPOLOGIES; - -//! Used in NV_MOSAIC_SUPPORTED_TOPOLOGIES. -#define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES,1) - -//!@} - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetSupportedMosaicTopologies -// -//! DESCRIPTION: This API returns all valid Mosaic topologies. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [out] pMosaicTopos An array of valid Mosaic topologies. -//! -//! \retval NVAPI_OK Call succeeded; 1 or more topologies were returned -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_MIXED_TARGET_TYPES Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE. -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetCurrentMosaicTopology -// -//! DESCRIPTION: This API gets the current Mosaic topology. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [out] pMosaicTopo The current Mosaic topology -//! \param [out] pEnabled TRUE if returned topology is currently enabled, else FALSE -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SetCurrentMosaicTopology -// -//! DESCRIPTION: This API sets the Mosaic topology, and enables it so that the -//! Mosaic display settings are enumerated upon request. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [in] pMosaicTopo A valid Mosaic topology -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_EnableCurrentMosaicTopology -// -//! DESCRIPTION: This API enables or disables the current Mosaic topology. -//! When enabling, the last Mosaic topology will be set. -//! -//! - If enabled, enumeration of display settings will include valid Mosaic resolutions. -//! - If disabled, enumeration of display settings will not include Mosaic resolutions. -//! -//! SUPPORTED OS: Windows XP -//! -//! -//! \since Release: 177 -//! -//! \param [in] enable TRUE to enable the Mosaic Topology, FALSE to disable it. -//! -//! \retval NVAPI_OK Call succeeded -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid -//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found -//! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system. -//! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed. -//! -//! \ingroup mosaicapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable); - - -#define NVAPI_MAX_GSYNC_DEVICES 4 - - -// Sync Display APIs - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_EnumSyncDevices -// -//! DESCRIPTION: This API returns an array of Sync device handles. A Sync device handle represents a -//! single Sync device on the system. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [out] nvGSyncHandles- The caller provides an array of handles, which must contain at least -//! NVAPI_MAX_GSYNC_DEVICES elements. The API will zero out the entire array and then fill in one -//! or more handles. If an error occurs, the array is invalid. -//! \param [out] *gsyncCount- The caller provides the storage space. NvAPI_GSync_EnumSyncDevices -//! sets *gsyncCount to indicate how many of the elements in the nvGSyncHandles[] array are valid. -//! If an error occurs, *gsyncCount will be set to zero. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT nvGSyncHandles or gsyncCount is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_EnumSyncDevices(__out NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES], __out NvU32 *gsyncCount); - - -// GSync boardId values -#define NVAPI_GSYNC_BOARD_ID_P358 856 //!< GSync board ID 0x358, see NV_GSYNC_CAPABILITIES -#define NVAPI_GSYNC_BOARD_ID_P2060 8288 //!< GSync board ID 0x2060, see NV_GSYNC_CAPABILITIES - -//! \since Release: 375 -#define NVAPI_GSYNC_BOARD_ID_P2061 8289 //!< GSync board ID 0x2061, see NV_GSYNC_CAPABILITIES - - -//! Used in NvAPI_GSync_QueryCapabilities(). -typedef struct _NV_GSYNC_CAPABILITIES_V1 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA Revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use -} NV_GSYNC_CAPABILITIES_V1; - -typedef struct _NV_GSYNC_CAPABILITIES_V2 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA major revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use - NvU32 extendedRevision; //!< FPGA minor revision -} NV_GSYNC_CAPABILITIES_V2; - -typedef struct _NV_GSYNC_CAPABILITIES_V3 -{ - NvU32 version; //!< Version of the structure - NvU32 boardId; //!< Board ID - NvU32 revision; //!< FPGA major revision - NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use - NvU32 extendedRevision; //!< FPGA minor revision - NvU32 bIsMulDivSupported : 1; //!< Indicates if multiplication/division of the frequency of house sync signal is supported. - NvU32 reserved : 31; //!< Reserved for future use - NvU32 maxMulDivValue; //!< This parameter returns the maximum possible value that can be programmed - //!< for multiplying / dividing house sync. Only valid if bIsMulDivSupported is set to 1. -} NV_GSYNC_CAPABILITIES_V3; - -typedef NV_GSYNC_CAPABILITIES_V3 NV_GSYNC_CAPABILITIES; - - -//! \ingroup gsyncapi -//! Macro for constructing the version field of NV_GSYNC_CAPABILITIES. -#define NV_GSYNC_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V1,1) -#define NV_GSYNC_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V2,2) -#define NV_GSYNC_CAPABILITIES_VER3 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V3,3) -#define NV_GSYNC_CAPABILITIES_VER NV_GSYNC_CAPABILITIES_VER3 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_QueryCapabilities -// -//! DESCRIPTION: This API returns the capabilities of the Sync device. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The handle for a Sync device for which the capabilities will be queried. -//! \param [inout] *pNvGSyncCapabilities- The caller provides the storage space. NvAPI_GSync_QueryCapabilities() sets -//! *pNvGSyncCapabilities to the version and capabilities details of the Sync device -//! If an error occurs, *pNvGSyncCapabilities will be set to NULL. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_QueryCapabilities(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CAPABILITIES *pNvGSyncCapabilities); - - - -//! Connector values for a GPU. Used in NV_GSYNC_GPU. -typedef enum _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR -{ - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE = 0, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY = 1, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY = 2, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY = 3, - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY = 4, -} NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR; - -//! Display sync states. Used in NV_GSYNC_DISPLAY. -typedef enum _NVAPI_GSYNC_DISPLAY_SYNC_STATE -{ - NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED = 0, - NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE = 1, - NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER = 2, -} NVAPI_GSYNC_DISPLAY_SYNC_STATE; - -typedef struct _NV_GSYNC_GPU -{ - NvU32 version; //!< Version of the structure - NvPhysicalGpuHandle hPhysicalGpu; //!< GPU handle - NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR connector; //!< Indicates which connector on the device the GPU is connected to. - NvPhysicalGpuHandle hProxyPhysicalGpu; //!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected) - //!< - this is NULL otherwise - NvU32 isSynced : 1; //!< Whether this GPU is sync'd or not. - NvU32 reserved : 31; //!< Should be set to ZERO -} NV_GSYNC_GPU; - -typedef struct _NV_GSYNC_DISPLAY -{ - NvU32 version; //!< Version of the structure - NvU32 displayId; //!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId - NvU32 isMasterable : 1; //!< Can this display be the master? (Read only) - NvU32 reserved : 31; //!< Should be set to ZERO - NVAPI_GSYNC_DISPLAY_SYNC_STATE syncState; //!< Is this display slave/master - //!< (Retrieved with topology or set by caller for enable/disable sync) -} NV_GSYNC_DISPLAY; - -#define NV_GSYNC_DISPLAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DISPLAY,1) -#define NV_GSYNC_GPU_VER MAKE_NVAPI_VERSION(NV_GSYNC_GPU,1) - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetTopology -// -//! DESCRIPTION: This API returns the topology for the specified Sync device. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle for a Sync device for which the topology will be queried. -//! \param [in, out] gsyncGpuCount- It returns number of GPUs connected to Sync device -//! \param [in, out] gsyncGPUs- It returns info about GPUs connected to Sync device -//! \param [in, out] gsyncDisplayCount- It returns number of active displays that belongs to Sync device -//! \param [in, out] gsyncDisplays- It returns info about all active displays that belongs to Sync device -//! -//! HOW TO USE: 1) make a call to get the number of GPUs connected OR displays synced through Sync device -//! by passing the gsyncGPUs OR gsyncDisplays as NULL respectively. Both gsyncGpuCount and gsyncDisplayCount can be retrieved in same call by passing -//! both gsyncGPUs and gsyncDisplays as NULL -//! On call success: -//! 2) Allocate memory based on gsyncGpuCount(for gsyncGPUs) and/or gsyncDisplayCount(for gsyncDisplays) then make a call to populate gsyncGPUs and/or gsyncDisplays respectively. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_INSUFFICIENT_BUFFER When the actual number of GPUs/displays in the topology exceed the number of elements allocated for SyncGPUs/SyncDisplays respectively. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetTopology(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout_opt NvU32 *gsyncGpuCount, __inout_ecount_part_opt(*gsyncGpuCount, *gsyncGpuCount) NV_GSYNC_GPU *gsyncGPUs, - __inout_opt NvU32 *gsyncDisplayCount, __inout_ecount_part_opt(*gsyncDisplayCount, *gsyncDisplayCount) NV_GSYNC_DISPLAY *gsyncDisplays); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_SetSyncStateSettings -// -//! DESCRIPTION: Sets a new sync state for the displays in system. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] gsyncDisplayCount- The number of displays in gsyncDisplays. -//! \param [in] pGsyncDisplays- The caller provides the structure containing all displays that need to be synchronized in the system. -//! The displays that are not part of pGsyncDisplays, will be un-synchronized. -//! \param [in] flags- Reserved for future use. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_INVALID_ARGUMENT If the display topology or count not valid. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_INVALID_SYNC_TOPOLOGY 1.If any mosaic grid is partial. -//! 2.If timing(HVisible/VVisible/refreshRate) applied of any display is different. -//! 3.If There is a across GPU mosaic grid in system and that is not a part of pGsyncDisplays. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_SetSyncStateSettings(__in NvU32 gsyncDisplayCount, __in_ecount(gsyncDisplayCount) NV_GSYNC_DISPLAY *pGsyncDisplays, __in NvU32 flags); - - -//! \ingroup gsyncapi - -//! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_POLARITY -{ - NVAPI_GSYNC_POLARITY_RISING_EDGE = 0, - NVAPI_GSYNC_POLARITY_FALLING_EDGE = 1, - NVAPI_GSYNC_POLARITY_BOTH_EDGES = 2, -} NVAPI_GSYNC_POLARITY; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_VIDEO_MODE -{ - NVAPI_GSYNC_VIDEO_MODE_NONE = 0, - NVAPI_GSYNC_VIDEO_MODE_TTL = 1, - NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM = 2, - NVAPI_GSYNC_VIDEO_MODE_HDTV = 3, - NVAPI_GSYNC_VIDEO_MODE_COMPOSITE = 4, -} NVAPI_GSYNC_VIDEO_MODE; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_SYNC_SOURCE -{ - NVAPI_GSYNC_SYNC_SOURCE_VSYNC = 0, - NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC = 1, -} NVAPI_GSYNC_SYNC_SOURCE; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef struct _NV_GSYNC_DELAY -{ - NvU32 version; //!< Version of the structure - NvU32 numLines; //!< delay to be induced in number of horizontal lines. - NvU32 numPixels; //!< delay to be induced in number of pixels. - NvU32 maxLines; //!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only. - NvU32 minPixels; //!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only. -} NV_GSYNC_DELAY; - -#define NV_GSYNC_DELAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DELAY,1) - -//! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters(). -typedef struct _NV_GSYNC_CONTROL_PARAMS_V1 -{ - NvU32 version; //!< Version of the structure - NVAPI_GSYNC_POLARITY polarity; //!< Leading edge / Falling edge / both - NVAPI_GSYNC_VIDEO_MODE vmode; //!< None, TTL, NTSCPALSECAM, HDTV - NvU32 interval; //!< Number of pulses to wait between framelock signal generation - NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync - NvU32 interlaceMode:1; //!< interlace mode for a Sync device - NvU32 syncSourceIsOutput:1; //!< Set this to make house sync as an output; valid only when NV_GSYNC_CONTROL_PARAMS::source is NVAPI_GSYNC_SYNC_SOURCE_VSYNC on P2061 boards. - //!< syncSourceIsOutput should always be NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC i.e. 0 on P2060 boards or when NV_GSYNC_CONTROL_PARAMS::source is set to NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU32 reserved:30; //!< should be set zero - NV_GSYNC_DELAY syncSkew; //!< The time delay between the frame sync signal and the GPUs signal. - NV_GSYNC_DELAY startupDelay; //!< Sync start delay for master. -} NV_GSYNC_CONTROL_PARAMS_V1; - -//! Used in NV_GSYNC_CONTROL_PARAMS. -typedef enum _NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE -{ - NVAPI_GSYNC_UNDEFINED_MODE = 0, - NVAPI_GSYNC_MULTIPLY_MODE = 1, - NVAPI_GSYNC_DIVIDE_MODE = 2, -} NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE; - -typedef struct _NV_GSYNC_CONTROL_PARAMS_V2 -{ - NvU32 version; //!< Version of the structure - NVAPI_GSYNC_POLARITY polarity; //!< Leading edge / Falling edge / both - NVAPI_GSYNC_VIDEO_MODE vmode; //!< None, TTL, NTSCPALSECAM, HDTV - NvU32 interval; //!< Number of pulses to wait between framelock signal generation - NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync - NvU32 interlaceMode:1; //!< interlace mode for a Sync device - NvU32 syncSourceIsOutput:1; //!< Set this to make house sync as an output; valid only when NV_GSYNC_CONTROL_PARAMS::source is NVAPI_GSYNC_SYNC_SOURCE_VSYNC on P2061 boards. - //!< syncSourceIsOutput should always be NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC i.e. 0 on P2060 boards or when NV_GSYNC_CONTROL_PARAMS::source is set to NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU32 reserved:30; //!< should be set zero - NV_GSYNC_DELAY syncSkew; //!< The time delay between the frame sync signal and the GPUs signal. - NV_GSYNC_DELAY startupDelay; //!< Sync start delay for master. - NVAPI_GSYNC_MULTIPLY_DIVIDE_MODE multiplyDivideMode; //!< Indicates multiplier/divider mode for the housesync signal. - //!< While setting multiplyDivideMode, source needs to be set as NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC. - NvU8 multiplyDivideValue; //!< Indicates the multiplier/divider value for the housesync signal. Only supported if bIsMulDivSupported field of the structure NV_GSYNC_CAPABILITIES is set to 1. - //!< The maximum supported value for this field can be obtained from maxMulDivValue field of the structure NV_GSYNC_CAPABILITIES. -} NV_GSYNC_CONTROL_PARAMS_V2; - -typedef NV_GSYNC_CONTROL_PARAMS_V2 NV_GSYNC_CONTROL_PARAMS; -#define NV_GSYNC_CONTROL_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS_V1,1) -#define NV_GSYNC_CONTROL_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS_V2,2) -#define NV_GSYNC_CONTROL_PARAMS_VER NV_GSYNC_CONTROL_PARAMS_VER2 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetControlParameters -// -//! DESCRIPTION: This API queries for sync control parameters as defined in NV_GSYNC_CONTROL_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [inout] *pGsyncControls- The caller provides the storage space. NvAPI_GSync_GetControlParameters() populates *pGsyncControls with values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls); - - - -////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_SetControlParameters -// -//! DESCRIPTION: This API sets control parameters as defined in NV_SYNC_CONTROL_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [inout] *pGsyncControls- The caller provides NV_GSYNC_CONTROL_PARAMS. skew and startDelay will be updated to the applied values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device. -//! \retval ::NVAPI_SYNC_MASTER_NOT_FOUND Control Parameters can only be set if there is a Sync Master enabled on the Gsync card. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_SetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls); - - - - -//! Used in NvAPI_GSync_AdjustSyncDelay() -typedef enum _NVAPI_GSYNC_DELAY_TYPE -{ - NVAPI_GSYNC_DELAY_TYPE_UNKNOWN = 0, - NVAPI_GSYNC_DELAY_TYPE_SYNC_SKEW = 1, - NVAPI_GSYNC_DELAY_TYPE_STARTUP = 2 -} NVAPI_GSYNC_DELAY_TYPE; - -////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_AdjustSyncDelay -// -//! DESCRIPTION: This API adjusts the skew and startDelay to the closest possible values. Use this API before calling NvAPI_GSync_SetControlParameters for skew or startDelay. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 319 -//! -//! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters -//! \param [in] delayType- Specifies whether the delay is syncSkew or startupDelay. -//! \param [inout] *pGsyncDelay- The caller provides NV_GSYNC_DELAY. skew and startDelay will be adjusted and updated to the closest values. -//! \param [out] *syncSteps- This parameter is optional. It returns the sync delay in unit steps. If 0, it means either the NV_GSYNC_DELAY::numPixels is less than NV_GSYNC_DELAY::minPixels or NV_GSYNC_DELAY::numOfLines exceeds the NV_GSYNC_DELAY::maxLines. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_AdjustSyncDelay(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NVAPI_GSYNC_DELAY_TYPE delayType, __inout NV_GSYNC_DELAY *pGsyncDelay, __out_opt NvU32* syncSteps); - - - -//! Used in NvAPI_GSync_GetSyncStatus(). -typedef struct _NV_GSYNC_STATUS -{ - NvU32 version; //!< Version of the structure - NvU32 bIsSynced; //!< Is timing in sync? - NvU32 bIsStereoSynced; //!< Does the phase of the timing signal from the GPU = the phase of the master sync signal? - NvU32 bIsSyncSignalAvailable; //!< Is the sync signal available? -} NV_GSYNC_STATUS; - -//! Macro for constructing the version field for NV_GSYNC_STATUS. -#define NV_GSYNC_STATUS_VER MAKE_NVAPI_VERSION(NV_GSYNC_STATUS,1) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetSyncStatus -// -//! DESCRIPTION: This API queries the sync status of a GPU - timing, stereosync and sync signal availability. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice- Handle of the Sync device -//! \param [in] hPhysicalGpu- GPU to be queried for sync status. -//! \param [out] *status- The caller provides the storage space. NvAPI_GSync_GetSyncStatus() populates *status with -//! values - timing, stereosync and signal availability. On error, *status is set to NULL. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / SyncTarget is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any G-Sync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetSyncStatus(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GSYNC_STATUS *status); - - -//! \ingroup gsyncapi - -#define NVAPI_MAX_RJ45_PER_GSYNC 2 - -//! Used in NV_GSYNC_STATUS_PARAMS. -typedef enum _NVAPI_GSYNC_RJ45_IO -{ - NVAPI_GSYNC_RJ45_OUTPUT = 0, - NVAPI_GSYNC_RJ45_INPUT = 1, - NVAPI_GSYNC_RJ45_UNUSED = 2 //!< This field is used to notify that the framelock is not actually present. - -} NVAPI_GSYNC_RJ45_IO; - -//! \ingroup gsyncapi -//! Used in NvAPI_GSync_GetStatusParameters(). -typedef struct _NV_GSYNC_STATUS_PARAMS_V1 -{ - NvU32 version; - NvU32 refreshRate; //!< The refresh rate - NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output - NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!] - NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz - NvU32 bHouseSync; //!< Is house sync connected? -} NV_GSYNC_STATUS_PARAMS_V1; - -typedef struct _NV_GSYNC_STATUS_PARAMS_V2 -{ - NvU32 version; - NvU32 refreshRate; //!< The refresh rate - NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output - NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!] - NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz - NvU32 bHouseSync; //!< Is house sync connected? - NvU32 bInternalSlave : 1; //!< Valid only for P2061 board. - //!< If set to 1, it means that this P2061 board receives input from another P2061 board. - NvU32 reserved : 31; //!< Reserved for future use. -} NV_GSYNC_STATUS_PARAMS_V2; - - -typedef NV_GSYNC_STATUS_PARAMS_V2 NV_GSYNC_STATUS_PARAMS; - -//! \ingroup gsyncapi -//! Macro for constructing the version field of NV_GSYNC_STATUS_PARAMS -#define NV_GSYNC_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V1,1) -#define NV_GSYNC_STATUS_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V2,2) -#define NV_GSYNC_STATUS_PARAMS_VER NV_GSYNC_STATUS_PARAMS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GSync_GetStatusParameters -// -//! DESCRIPTION: This API queries for sync status parameters as defined in NV_GSYNC_STATUS_PARAMS. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 313 -//! -//! \param [in] hNvGSyncDevice The caller provides the handle of the GSync device for which to get parameters -//! \param [out] *pStatusParams The caller provides the storage space. NvAPI_GSync_GetStatusParameters populates *pStatusParams with -//! values. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / pStatusParams is NULL. -//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any GSync Device. -//! -//! \ingroup gsyncapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GSync_GetStatusParameters(NvGSyncDeviceHandle hNvGSyncDevice, NV_GSYNC_STATUS_PARAMS *pStatusParams); - -//! @} - - -//----------------------------------------------------------------------------- -// DirectX APIs -//----------------------------------------------------------------------------- - - -//! \ingroup dx -//! Used in NvAPI_D3D10_GetCurrentSLIState(), and NvAPI_D3D_GetCurrentSLIState(). -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups - NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system - NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered - NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present) - NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet) - NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group - -} NV_GET_CURRENT_SLI_STATE_V1; - -typedef struct -{ - NvU32 version; //!< Structure version - NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups - NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system - NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered - NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present) - NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet) - NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group - NvU32 numVRSLIGpus; //!< [OUT] The number of GPUs used in VR-SLI. If it is 0 VR-SLI is not active - -} NV_GET_CURRENT_SLI_STATE_V2; - -//! \ingroup dx -#define NV_GET_CURRENT_SLI_STATE_VER1 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V1,1) -#define NV_GET_CURRENT_SLI_STATE_VER2 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V2,1) -#define NV_GET_CURRENT_SLI_STATE_VER NV_GET_CURRENT_SLI_STATE_VER2 -#define NV_GET_CURRENT_SLI_STATE NV_GET_CURRENT_SLI_STATE_V2 - - -#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -//! \ingroup dx -//! D3D_FEATURE_LEVEL supported - used in NvAPI_D3D11_CreateDevice() and NvAPI_D3D11_CreateDeviceAndSwapChain() -typedef enum -{ - NVAPI_DEVICE_FEATURE_LEVEL_NULL = -1, - NVAPI_DEVICE_FEATURE_LEVEL_10_0 = 0, - NVAPI_DEVICE_FEATURE_LEVEL_10_0_PLUS = 1, - NVAPI_DEVICE_FEATURE_LEVEL_10_1 = 2, - NVAPI_DEVICE_FEATURE_LEVEL_11_0 = 3, -} NVAPI_DEVICE_FEATURE_LEVEL; - -#endif //defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -NV_DECLARE_HANDLE(NVDX_ObjectHandle); // DX Objects -static const NVDX_ObjectHandle NVDX_OBJECT_NONE = 0; - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetCurrentSLIState -// -//! DESCRIPTION: This function returns the current SLI state for the specified device. The structure -//! contains the number of AFR groups, the current AFR group index, -//! and what the AFR group index will be for the next frame. \p -//! pDevice can be either a IDirect3DDevice9 or ID3D10Device pointer. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 173 -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Error occurred -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET_CURRENT_SLI_STATE *pSliState); -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_RegisterResource -// -//! DESCRIPTION: This API binds a resource (surface/texture) so that it can be retrieved -//! internally by NVAPI. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \param [in] pResource surface/texture -//! -//! \return ::NVAPI_OK, ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResource); -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_UnregisterResource -// -//! DESCRIPTION: This API unbinds a resource (surface/texture) after use. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pResource surface/texture -//! -//! \return ::NVAPI_OK, ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9* pResource); - -#endif //defined(_D3D9_H_) - - - - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture -// -//! \fn NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev, -//! IDirect3DSurface9* pSurface, -//! IDirect3DTexture9 **ppTexture, -//! DWORD dwFlag); -//! DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI. The -//! new texture can be bound with IDirect3DDevice9::SetTexture(). Note that the texture must -//! be unbound before drawing to the surface again. -//! Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before -//! being used as a texture. MSAA depth buffers are resolved with a point filter, -//! and non-depth MSAA surfaces are resolved with a linear filter. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The D3D device that owns the objects -//! \param [in] pSurface Pointer to a surface that has been registered with NvAPI -//! to which a texture alias is to be provided -//! \param [out] ppTexture Fill with the texture created -//! \param [in] dwFlag NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument -//! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid, probably dwFlag. -//! \retval ::NVAPI_UNREGISTERED_RESOURCE pSurface has not been registered with NvAPI -//! \retval ::NVAPI_ERROR error occurred -// -/////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dx -//! See NvAPI_D3D9_AliasSurfaceAsTexture(). -typedef enum { - NVAPI_ALIAS_SURFACE_FLAG_NONE = 0x00000000, - NVAPI_ALIAS_SURFACE_FLAG_USE_SUPER = 0x00000001, //!< Use the surface's msaa buffer directly as a texture, rather than resolving. (This is much slower, but potentially has higher quality.) - NVAPI_ALIAS_SURFACE_FLAG_MASK = 0x00000001 -} NVAPI_ALIAS_SURFACE_FLAG; - - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev, - IDirect3DSurface9* pSurface, - IDirect3DTexture9 **ppTexture, - DWORD dwFlag); -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_StretchRectEx -// -//! DESCRIPTION: This API copies the contents of the source resource to the destination -//! resource. This function can convert -//! between a wider range of surfaces than -//! IDirect3DDevice9::StretchRect. For example, it can copy -//! from a depth/stencil surface to a texture. -//! -//! The source and destination resources *must* be registered -//! with NvAPI before being used with NvAPI_D3D9_StretchRectEx(). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device that owns the objects. -//! \param [in] pSourceResource Pointer to the source resource. -//! \param [in] pSrcRect Defines the rectangle on the source to copy from. If NULL, copy from the entire resource. -//! \param [in] pDestResource Pointer to the destination resource. -//! \param [in] pDstRect Defines the rectangle on the destination to copy to. If NULL, copy to the entire resource. -//! \param [in] Filter Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR. -//! -//! \retval ::NVAPI_OK completed request -//! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid -//! \retval ::NVAPI_UNREGISTERED_RESOURCE a resource was passed in without being registered -//! \retval ::NVAPI_ERROR error occurred -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 * pDevice, - IDirect3DResource9 * pSourceResource, - CONST RECT * pSourceRect, - IDirect3DResource9 * pDestResource, - CONST RECT * pDestRect, - D3DTEXTUREFILTERTYPE Filter); - -#endif //defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_ClearRT -// -//! DESCRIPTION: This API Clears the currently bound render target(s) with the -//! given color -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device that owns the objects. -//! \param [in] dwNumRects The no of rectangles to clear. If 0, clear the entire surface (clipped to viewport) -//! \param [in] pRects Defines the rectangles to clear. Should be NULL if dwNumRects == 0 -//! \param [in] r red component of the clear color -//! \param [in] g green component of the clear color -//! \param [in] b blue component of the clear color -//! \param [in] a alpha component of the clear color -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_ClearRT(IDirect3DDevice9 * pDevice, - NvU32 dwNumRects, - CONST RECT * pRects, - float r, float g, float b, float a); -#endif //if defined(_D3D9_H_) - - - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetObjectHandleForResource -// -//! DESCRIPTION: This API gets a handle to a resource. -//! -//! \param [in] pDev The ID3D11Device, ID3D10Device or IDirect3DDevice9 or ID3D11DeviceContext to use -//! \param [in] pResource The ID3D11Resource, ID3D10Resource or IDirect3DResource9 from which -//! we want the NvAPI handle -//! \param [out] pHandle A handle to the resource -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \return ::NVAPI_OK if the handle was populated. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetObjectHandleForResource( - IUnknown *pDevice, - IUnknown *pResource, - NVDX_ObjectHandle *pHandle); - - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetResourceHint -// -//! \fn NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj, -//! NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory, -//! NvU32 dwHintName, -//! NvU32 *pdwHintValue) -//! -//! DESCRIPTION: This is a general purpose function for passing down various resource -//! related hints to the driver. Hints are divided into categories -//! and types within each category. For DX11 devices this function is free-threaded. -//! An application is responsible to complete this call before making use of the resource -//! in a rendering context (therefore applying inter-thread synchronization as appropriate). -//! As a debug help to an application the driver enforces that a resource in this call was never bound. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev The ID3D10Device or IDirect3DDevice9 that is a using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] dwHintCategory Category of the hints -//! \param [in] dwHintName A hint within this category -//! \param [in/out] *pdwHintValue Pointer to location containing hint value, function returns previous hint value in this slot -//! -//! \return an int which could be an NvAPI status or DX HRESULT code -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_INVALID_ARGUMENT -//! \retval ::NVAPI_INVALID_CALL It is illegal to change a hint dynamically when the resource is already bound. -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -//! \ingroup dx -//! Valid categories for NvAPI_D3D_SetResourceHint() -typedef enum _NVAPI_D3D_SETRESOURCEHINT_CATEGORY -{ - NVAPI_D3D_SRH_CATEGORY_SLI = 1 -} NVAPI_D3D_SETRESOURCEHINT_CATEGORY; - - -// -// NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: -// NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USING: -// NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: - - -//! \ingroup dx -//! Types of SLI hints; \n -//! NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will not track any rendering operations that would mark this resource as dirty, -//! avoiding any form of synchronization across frames rendered in parallel in multiple GPUs in AFR mode. -//! -//! NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will try to perform operations which involved target resource in broadcast, -//! where it's possible. Hint is static and must be set before resource starts using. -//! -//! NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n -//! Default value: 0 \n -//! Explanation: If the value is 1, the driver will do dirty resource resolve regardless of discard flags in the application profile or -//! AFR-FriendlyD3DHints.exe name using. -//! -typedef enum _NVAPI_D3D_SETRESOURCEHINT_SLI -{ - NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC = 1, - NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE = 2, - NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC = 3 -} NVAPI_D3D_SETRESOURCEHINT_SLI; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj, - NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory, - NvU32 dwHintName, - NvU32 *pdwHintValue); -#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_BeginResourceRendering -// -//! \fn NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags) -//! DESCRIPTION: This function tells the driver that the resource will begin to receive updates. It must be used in combination with NvAPI_D3D_EndResourceRendering(). -//! The primary use of this function is allow the driver to initiate early inter-frame synchronization of resources while running in AFR SLI mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] Flags The flags for functionality applied to resource while being used. -//! -//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources. -//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values -//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dx -//! Used in NvAPI_D3D_BeginResourceRendering(). -typedef enum _NVAPI_D3D_RESOURCERENDERING_FLAG -{ - NVAPI_D3D_RR_FLAG_DEFAULTS = 0x00000000, //!< All bits set to 0 are defaults. - NVAPI_D3D_RR_FLAG_FORCE_DISCARD_CONTENT = 0x00000001, //!< (bit 0) The flag forces to discard previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint - NVAPI_D3D_RR_FLAG_FORCE_KEEP_CONTENT = 0x00000002, //!< (bit 1) The flag forces to respect previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint - NVAPI_D3D_RR_FLAG_MULTI_FRAME = 0x00000004 //!< (bit 2) The flag hints the driver that content will be used for many frames. If not specified then the driver assumes that content is used only on the next frame -} NVAPI_D3D_RESOURCERENDERING_FLAG; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags); - -#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - - - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_EndResourceRendering -// -//! DESCRIPTION: This function tells the driver that the resource is done receiving updates. It must be used in combination with -//! NvAPI_D3D_BeginResourceRendering(). -//! The primary use of this function is allow the driver to initiate early inter-frame syncs of resources while running in AFR SLI mode. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource -//! \param [in] obj Previously obtained HV resource handle -//! \param [in] Flags Reserved, must be zero -// -//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources. -//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values -//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_EndResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags); -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) - - -#if defined(_D3D9_H_) && defined(__cplusplus) -//! SUPPORTED OS: Windows 7 and higher -//! - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_GetSurfaceHandle -// -//! This function gets the handle of a given surface. This handle uniquely -//! identifies the surface through all NvAPI entries. -//! -//! -//! \since Release: 313 -//! -//! \param [in] pSurface Surface to be identified -//! \param [out] pHandle Will be filled by the return handle -//! -//! \return An int which could be an NvAPI status or DX HRESULT code -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_GetSurfaceHandle(IDirect3DSurface9 *pSurface, - NVDX_ObjectHandle *pHandle); - -#endif //defined(_D3D9_H_) && defined(__cplusplus) - -#if defined(_D3D9_H_) && defined(__cplusplus) -//! SUPPORTED OS: Windows 7 and higher -//! -//! \addtogroup dxvidcontrol -//! @{ - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION_NAME: NvAPI_D3D9_VideoSetStereoInfo -// -//! \fn NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev, -//! NV_DX_VIDEO_STEREO_INFO *pStereoInfo); -//! \code -//! DESCRIPTION: This api specifies the stereo format of a surface, so that the -//! surface could be used for stereo video processing or compositing. -//! In particular, this api could be used to link the left and right -//! views of a decoded picture. -//! -//! \since Release: 313 -//! -//! INPUT: pDev - The device on which the stereo surface will be used -//! pStereoInfo - The stereo format of the surface -//! -//! RETURN STATUS: an int which could be an NvAPI status or DX HRESULT code -//! \endcode -/////////////////////////////////////////////////////////////////////////////// - -#ifndef NV_STEREO_VIDEO_FORMAT_DEFINE -#define NV_STEREO_VIDEO_FORMAT_DEFINE - - -typedef enum _NV_STEREO_VIDEO_FORMAT -{ - NV_STEREO_VIDEO_FORMAT_NOT_STEREO = 0, - - NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_LR = 1, - NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_RL = 2, - NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_LR = 3, - NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_RL = 4, - NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_LR = 5, - NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_RL = 6, - NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR = 7, - NV_STEREO_VIDEO_FORMAT_MONO_PLUS_OFFSET = 8, - - NV_STEREO_VIDEO_FORMAT_LAST = 9, -} NV_STEREO_VIDEO_FORMAT; - -#endif // NV_STEREO_VIDEO_FORMAT_DEFINE - - -typedef struct _NV_DX_VIDEO_STEREO_INFO { - NvU32 dwVersion; //!< Must be NV_DX_VIDEO_STEREO_INFO_VER - NVDX_ObjectHandle hSurface; //!< The surface whose stereo format is to be set - NVDX_ObjectHandle hLinkedSurface; //!< The linked surface (must be valid when eFormat==NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR) - NV_STEREO_VIDEO_FORMAT eFormat; //!< Stereo format of the surface - NvS32 sViewOffset; //!< Signed offset of each view (positive offset indicating left view is shifted left) - BOOL bStereoEnable; //!< Whether stereo rendering should be enabled (if FALSE, only left view will be used) -} NV_DX_VIDEO_STEREO_INFO; - -//! Macro for constructing the version field of ::NV_DX_VIDEO_STEREO_INFO -#define NV_DX_VIDEO_STEREO_INFO_VER MAKE_NVAPI_VERSION(NV_DX_VIDEO_STEREO_INFO,1) - -NVAPI_INTERFACE NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev, - NV_DX_VIDEO_STEREO_INFO *pStereoInfo); - -//! @} -#endif //defined(_D3D9_H_) && defined(__cplusplus) - - -#if defined(__cplusplus) && defined(__d3d10_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D10_SetDepthBoundsTest -// -//! DESCRIPTION: This function enables/disables the depth bounds test. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device to set the depth bounds test -//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test -//! \param [in] fMinDepth The minimum depth for the depth bounds test -//! \param [in] fMaxDepth The maximum depth for the depth bounds test \n -//! The valid values for fMinDepth and fMaxDepth -//! are such that 0 <= fMinDepth <= fMaxDepth <= 1 -//! -//! \return NVAPI_OK if the depth bounds test was correctly enabled or disabled -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D10_SetDepthBoundsTest(ID3D10Device *pDev, - NvU32 bEnable, - float fMinDepth, - float fMaxDepth); - -#endif //defined(__cplusplus) && defined(__d3d10_h__) - -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDevice -// -//! DESCRIPTION: This function tries to create a DirectX 11 device. If the call fails (if we are running -//! on pre-DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR DirectX 10.0+ -//! OR DirectX 10.0 device. The function call is the same as D3D11CreateDevice(), but with an extra -//! argument (D3D_FEATURE_LEVEL supported by the device) that the function fills in. This argument -//! can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel is less than DirecX 10.0. -//! -//! NOTE: When NvAPI_D3D11_CreateDevice is called with 10+ feature level we have an issue on few set of -//! tesla hardware (G80/G84/G86/G92/G94/G96) which does not support all feature level 10+ functionality -//! e.g. calling driver with mismatch between RenderTarget and Depth Buffer. App developers should -//! take into consideration such limitation when using NVAPI on such tesla hardwares. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pAdapter -//! \param [in] DriverType -//! \param [in] Software -//! \param [in] Flags -//! \param [in] *pFeatureLevels -//! \param [in] FeatureLevels -//! \param [in] SDKVersion -//! \param [in] **ppDevice -//! \param [in] *pFeatureLevel -//! \param [in] **ppImmediateContext -//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported -//! -//! \return NVAPI_OK if the createDevice call succeeded. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateDevice(IDXGIAdapter* pAdapter, - D3D_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - CONST D3D_FEATURE_LEVEL *pFeatureLevels, - UINT FeatureLevels, - UINT SDKVersion, - ID3D11Device **ppDevice, - D3D_FEATURE_LEVEL *pFeatureLevel, - ID3D11DeviceContext **ppImmediateContext, - NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel); - - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDeviceAndSwapChain -// -//! DESCRIPTION: This function tries to create a DirectX 11 device and swap chain. If the call fails (if we are -//! running on pre=DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR -//! DirectX 10.0+ OR DirectX 10.0 device. The function call is the same as D3D11CreateDeviceAndSwapChain, -//! but with an extra argument (D3D_FEATURE_LEVEL supported by the device) that the function fills -//! in. This argument can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel -//! is less than DirectX 10.0. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] pAdapter -//! \param [in] DriverType -//! \param [in] Software -//! \param [in] Flags -//! \param [in] *pFeatureLevels -//! \param [in] FeatureLevels -//! \param [in] SDKVersion -//! \param [in] *pSwapChainDesc -//! \param [in] **ppSwapChain -//! \param [in] **ppDevice -//! \param [in] *pFeatureLevel -//! \param [in] **ppImmediateContext -//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported -//! -//!return NVAPI_OK if the createDevice with swap chain call succeeded. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter, - D3D_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - CONST D3D_FEATURE_LEVEL *pFeatureLevels, - UINT FeatureLevels, - UINT SDKVersion, - CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, - IDXGISwapChain **ppSwapChain, - ID3D11Device **ppDevice, - D3D_FEATURE_LEVEL *pFeatureLevel, - ID3D11DeviceContext **ppImmediateContext, - NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel); - - - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined(__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetDepthBoundsTest -// -//! DESCRIPTION: This function enables/disables the depth bounds test -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDeviceOrContext The device or device context to set depth bounds test -//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test -//! \param [in] fMinDepth The minimum depth for depth bounds test -//! \param [in] fMaxDepth The maximum depth for depth bounds test -//! The valid values for fMinDepth and fMaxDepth -//! are such that 0 <= fMinDepth <= fMaxDepth <= 1 -//! -//! \return ::NVAPI_OK if the depth bounds test was correcly enabled or disabled -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetDepthBoundsTest(IUnknown* pDeviceOrContext, - NvU32 bEnable, - float fMinDepth, - float fMaxDepth); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_IsNvShaderExtnOpCodeSupported -// -//! DESCRIPTION: This function checks if a nv HLSL shader extension opcode is -//! supported on current hardware. List of opcodes is in nvShaderExtnEnums.h -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device on which to query for support, -//! should be a ID3D11Device+ device -//! \param [in] opCode the opcode to check -//! \param [out] pSupported true if supported, false otherwise -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK if the call succeeded -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_IsNvShaderExtnOpCodeSupported(__in IUnknown *pDev, - __in NvU32 opCode, - __out bool *pSupported); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlot -// -//! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL -//! shader extensions globally. All createShader calls made to the driver after -//! setting this slot would treat writes/reads to this UAV in a -//! different way. Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D11Device+ device -//! \param [in] uavSlot the uav slot to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlot(__in IUnknown *pDev, - __in NvU32 uavSlot); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && defined (__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpace -// -//! DESCRIPTION: This function is specifically created for ray tracing since we do not -//! currently support PSOs with DXR. -//! This function sets the device's fake UAV slot and space that is used by Nvidia HLSL -//! shader extensions globally. All state objects created by the driver after -//! setting this slot would treat writes/reads to this UAV in a -//! different way. Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D12Device+ device -//! \param [in] uavSlot The uav slot to use -//! \param [in] uavSpace The uav space to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpace(__in IUnknown *pDev, - __in NvU32 uavSlot, - __in NvU32 uavSpace); - - /////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread -// -//! DESCRIPTION: This function is specifically created for ray tracing shaders since we do not -//! currently support PSOs with DXR. -//! This function sets the device's fake UAV slot that is used by Nvidia HLSL -//! shader extensions on local thread. All state objects created by the driver -//! on the same thread that call this function after setting this slot would treat writes/reads -//! to this UAV in a different way. -//! Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages for the device. -//! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! -//! \since Release: 387 -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D12Device+ device -//! \param [in] uavSlot the uav slot to use -//! \param [in] uavSpace the uav space to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread(__in IUnknown *pDev, - __in NvU32 uavSlot, - __in NvU32 uavSpace); - -#endif //defined (__cplusplus) && defined (__d3d12_h__) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlotLocalThread -// -//! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL -//! shader extensions on local thread. All createShader calls on the same thread -//! that calls this function after setting this slot would treat writes/reads -//! to this UAV in a different way. -//! Applications are expected to bind null UAV to this slot. -//! The same slot is used for all shader stages. -//! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF. -//! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h -//! in the hlsl shader code. See nvHLSLExtns.h for more details. -//! -//! This function can be called from a different thread than the one calling immediate device setstate functions. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 387 -//! -//! \param [in] pDev The device for which to set the extension slot -//! should be a ID3D11Device+ device -//! \param [in] uavSlot the uav slot to use -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlotLocalThread(__in IUnknown *pDev, - __in NvU32 uavSlot); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlapEx -// -//! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs. -//! Applications must use this with caution otherwise this might cause data hazards when -//! multiple draw calls/compute shader launches are accessing same memory locations -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! \param [in] insertWFIFlags bit fields to indicate which WFI would be inserted (gfx / compute / both). -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -typedef enum _NVAPI_D3D11_INSERTWFI_FLAG -{ - NVAPI_D3D_BEGIN_UAV_OVERLAP_NO_WFI = 0x00000000, //!< no WFI - NVAPI_D3D_BEGIN_UAV_OVERLAP_GFX_WFI = 0x00000001, //!< (bit 0) force graphics WFI - NVAPI_D3D_BEGIN_UAV_OVERLAP_COMP_WFI = 0x00000002, //!< (bit 1) force compute WFI -} NVAPI_D3D11_INSERTWFI_FLAG; - -NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlapEx(__in IUnknown *pDeviceOrContext, __in NvU32 insertWFIFlags); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlap -// -//! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs. -//! Applications must use this with caution otherwise this might cause data hazards when -//! multiple draw calls/compute shader launches are accessing same memory locations -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlap(__in IUnknown *pDeviceOrContext); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_EndUAVOverlap -// -//! DESCRIPTION: Re-enables driver synchronization between calls that access same UAVs -//! See NvAPI_D3D_BeginUAVOverlap for more details. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_EndUAVOverlap(__in IUnknown *pDeviceOrContext); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -#if defined(__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_GetResourceHandle -// -//! \code -//! DESCRIPTION: This function retrieves a driver handle to a DX10 resource -//! -//! INPUT: pDev The device on which the resource was created -//! pResource The resource for which we want to retrieve a -//! driver handle. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! OUTPUT: phObject Pointer to an NvAPI handle to be populated -//! on success -//! -//! RETURN STATUS: NVAPI_OK if and only if phObject was populated with a valid -//! driver handle -//! \endcode -//! \ingroup nsightapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_GetResourceHandle(ID3D11Device *pDev, - ID3D11Resource* pResource, - NVDX_ObjectHandle* phObject); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetFPSIndicatorState -// -//! DESCRIPTION: Display an overlay that tracks the number of times the app presents per second, or, -//! the number of frames-per-second (FPS) -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] bool Whether or not to enable the fps indicator. -//! -//! \return ::NVAPI_OK, -//! ::NVAPI_ERROR -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetFPSIndicatorState(IUnknown *pDev, NvU8 doEnable); - -#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_Present -// -//! DESCRIPTION: This API presents the contents of the next buffer in the sequence of back buffers -//! owned by a IDirect3DDevice9 device. -//! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain -//! that owns the back buffer to be presented. -//! -//! NOTE: NvAPI_D3D9_Present is a wrapper of the method IDirect3DDevice9::Present which -//! additionally notifies the D3D driver of the SwapChain used by the runtime for -//! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier -//! functionality to that SwapChain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The IDirect3DDevice9 interface that is used to issue the Present, -//! using the following IDirect3DDevice9::Present input parameters -//! \param [in] pSwapChain Optional pointer to a IDirect3DSwapChain9 interface. If provided, the presentation is executed -//! using this interface (i.e. pSwapChain->Present()) for the given swapchain only. -//! If NULL, the presentation is executed on the device for all swapchains as in pDevice->Present() -//! \param [in] pSourceRect A pointer to a RECT structure containing the source rectangle. -//! If NULL, the entire source surface is presented. -//! \param [in] pDestRect A pointer to a RECT structure containing the destination rectangle, in window client coordinates. -//! If NULL, the entire client area is filled. -//! \param [in] hDestWindowOverride A pointer to a destination window whose client area is taken as the target for this presentation. -//! If this value is NULL, then the hWndDeviceWindow member of D3DPRESENT_PARAMTERS is taken. -//! \param [in] pDirtyRegion (IN) A pointer to a region to be presented. It must be NULL unless the swap chain was reated with -//! D3DSWAPEFFECT_COPY. If this value is non-NULL, the contained region is expressed in back buffer coordinates. -//! -//! \retval ::NVAPI_OK the Present operation was successfully executed -//! \retval ::NVAPI_D3D_DEVICE_LOST D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET, the caller has to reset device -//! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error other than D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET -//! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//!\ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_Present(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - const RECT *pSourceRect, - const RECT *pDestRect, - HWND hDestWindowOverride, - const RGNDATA *pDirtyRegion); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QueryFrameCount -// -//! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device -//! \param [out] pFrameCount The caller provides the storage space where the framecount is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK *pFrameCount populated with framecount value. -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QueryFrameCount(IDirect3DDevice9 *pDevice, - NvU32 *pFrameCount); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_ResetFrameCount -// -//! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK framecounter has been reset -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_ResetFrameCount(IDirect3DDevice9 *pDevice); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QueryMaxSwapGroup -// -//! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored. -//! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QueryMaxSwapGroup(IDirect3DDevice9 *pDevice, - NvU32 *pMaxGroups, - NvU32 *pMaxBarriers); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_QuerySwapGroup -// -//! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain -//! that belongs to the swapgroup client device -//! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored. -//! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_QuerySwapGroup(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - NvU32 *pSwapGroup, - NvU32 *pSwapBarrier); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_JoinSwapGroup -// -//! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain -//! that belongs to the swapgroup client device -//! \param [in] group The caller specifies the SwapGroup which the SwapChain should join. -//! - If the value of group is zero, the SwapChain leaves the SwapGroup. -//! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or -//! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block -//! until all members of the SwapGroup are ready and the presentation was actually executed. -//! A boolean value of false means the Present operation returns immediately and a value of true -//! means the Present operation is blocking. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_JoinSwapGroup(IDirect3DDevice9 *pDevice, - IDirect3DSwapChain9 *pSwapChain, - NvU32 group, - BOOL blocking); -#endif //if defined(_D3D9_H_) - -#if defined(_D3D9_H_) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_BindSwapBarrier -// -//! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier. -//! -//! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client -//! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier. -//! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to. -//! - If the value of barrier is zero, the SwapGroup will be released from the SwapBarrier. -//! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive -//! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapGroup is bound to or released from the specified SwapBarrier -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_BindSwapBarrier(IDirect3DDevice9 *pDevice, - NvU32 group, - NvU32 barrier); -#endif //if defined(_D3D9_H_) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_Present -// -//! DESCRIPTION: Presents the contents of the next buffer in the sequence of back buffers -//! owned by a D3D device. -//! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain -//! that owns the back buffer to be presented. -//! -//! NOTE: NvAPI_D3D1x_Present is a wrapper of the method IDXGISwapChain::Present which -//! additionally notifies the D3D driver of the SwapChain used by the runtime for -//! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier -//! functionality to that SwapChain. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The D3D device interface that is used to issue the Present operation, -//! using the following IDirect3DDevice9::Present input parameters. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is intended to present -//! \param [in] SyncInterval An integer that specifies the how to synchronize presentation of a frame with the vertical blank. -//! Values are: -//! - 0: The presentation occurs immediately, there is no synchronization. -//! - 1,2,3,4 : Synchronize presentation after the n'th vertical blank. -//! \param [in] Flags An integer value that contains swap-chain presentation options as defined in DXGI_PRESENT. -//! -//! \retval ::NVAPI_OK the Present operation was successfully executed -//! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error DXGI_ERROR_DEVICE_RESET or DXGI_ERROR_DEVICE_REMOVED, -// DXGI_STATUS_OCCLUDED, or D3DDDIERR_DEVICEREMOVED. -//! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_Present(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - UINT SyncInterval, - UINT Flags); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QueryFrameCount -// -//! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device, -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [out] pFrameCount The caller provides the storage space where the framecount is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK *pFrameCount populated with framecount value. -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QueryFrameCount(IUnknown *pDevice, - NvU32 *pFrameCount); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_ResetFrameCount -// -//! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device. -//! -//! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device, -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK framecounter has been reset -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT pDevice arg passed in is invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_ResetFrameCount(IUnknown *pDevice); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QueryMaxSwapGroup -// -//! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system. -//! -//! \param [in] pDevice The caller provides the D3D device that is intended to use SwapGroup functionality. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored. -//! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QueryMaxSwapGroup(IUnknown *pDevice, - NvU32 *pMaxGroups, - NvU32 *pMaxBarriers); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_QuerySwapGroup -// -//! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client. -//! -//! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored. -//! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_QuerySwapGroup(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - NvU32 *pSwapGroup, - NvU32 *pSwapBarrier); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_JoinSwapGroup -// -//! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client. -//! \param [in] group The caller specifies the SwapGroup which the SwapChain should join. -//! - If the value of group is zero, the SwapChain leaves the SwapGroup. -//! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or -//! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup. -//! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block -//! until all members of the SwapGroup are ready and the presentation was actually executed. -//! A boolean value of false means the Present operation returns immediately and a value of true -//! means the Present operation is blocking. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_JoinSwapGroup(IUnknown *pDevice, - IDXGISwapChain *pSwapChain, - NvU32 group, - BOOL blocking); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_BindSwapBarrier -// -//! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier. -//! -//! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client. -//! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device. -//! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier. -//! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to. -//! - If the value of barrier is zero, the SwapGroup releases the SwapBarrier. -//! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive -//! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_D3D1x_QueryMaxSwapGroup. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \retval ::NVAPI_OK the SwapGroup is bound to the specified SwapBarrier -//! \retval ::NVAPI_ERROR The operation failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid. -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_BindSwapBarrier(IUnknown *pDevice, - NvU32 group, - NvU32 barrier); -#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryPresentBarrierSupport -// -//! DESCRIPTION: This API returns if presentBarrier feature is supported on the specified device. -//! -//! \since Release: 470 -//! -//! \param [in] pDevice The ID3D12Device device which owns the SwapChain as a PresentBarrier client. -//! \param [out] pSupported Pointer to a boolean returning true if supported, false otherwise. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_QueryPresentBarrierSupport(__in ID3D12Device *pDevice, __out bool *pSupported); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreatePresentBarrierClient -// -//! DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle, which -//! owns the swapchain to be synchronized through PresentBarrier. -//! This handle is used in other PresentBarrier functions. -//! -//! \since Release: 470 -//! -//! \param [in] pDevice The ID3D12Device device which owns the SwapChain as a PresentBarrier client. -//! \param [in] pSwapChain The IDXGISwapChain interface that presentBarrier is operated on. -//! \param [OUT] pPresentBarrierClient Pointer to an NvPresentBarrierClientHandle handle created by the driver -//! on success. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreatePresentBarrierClient(__in ID3D12Device *pDevice, - __in IDXGISwapChain *pSwapChain, - __out NvPresentBarrierClientHandle *pPresentBarrierClient); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RegisterPresentBarrierResources -// -//! DESCRIPTION: This API registers scanout resources of a presentBarrier client -//! to the presentBarrier, and a fence object which is used for -//! presentBarrier synchronization. Once the registration has completed -//! successfully, it is not allowed to add additional resources, i.e. the -//! number of back buffers and fence object are not allowed to be -//! changed. However, application must call this function whenever the -//! back buffers are changed, e.g. ResizeBuffers() is called. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient The NvPresentBarrierClientHandle client handle that owns the resources. -//! \param [in] pFence An ID3D12Fence object created by the application and used for present -//! synchronization through presentBarrier. Application must wait on this -//! fence to ensure the scanout resources are ready for use in the next -//! rendering loop. The fence is only signaled by the driver and must not -//! be signaled through any other queue command. The fence value must be -//! monotonically increasing on every present call, and tracked by the -//! application. -//! \param [in] ppResources An array of ID3D12Resource to be synchronized through presentBarrier, and -//! the size is specified by numResources. -//! \param [in] numResources The number of ID3D12Resource elements in ppResources. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \return ::NVAPI_INVALID_ARGUMENT an invalid number of resources was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RegisterPresentBarrierResources(__in NvPresentBarrierClientHandle presentBarrierClient, - __in ID3D12Fence *pFence, - __in ID3D12Resource **ppResources, - __in NvU32 numResources); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DestroyPresentBarrierClient -// -//! DESCRIPTION: This API destroys a presentBarrier client, and must be called -//! after client leaves presentBarrier to avoid memory leak. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DestroyPresentBarrierClient(__in NvPresentBarrierClientHandle presentBarrierClient); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -typedef struct _NV_JOIN_PRESENT_BARRIER_PARAMS -{ - NvU32 dwVersion; //!< Must be NV_JOIN_PRESENT_BARRIER_PARAMS_VER1 -} NV_JOIN_PRESENT_BARRIER_PARAMS; - -//! Macro for constructing the version field of ::NV_JOIN_PRESENT_BARRIER_PARAMS -#define NV_JOIN_PRESENT_BARRIER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_JOIN_PRESENT_BARRIER_PARAMS, 1) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_JoinPresentBarrier -// -//! DESCRIPTION: This API adds a registered PresentBarrier client to the presentBarrier. -//! If the call suceeds, image present of the registered scanout resources -//! from this client is under the synchronization of presentBarrier. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient -//! \param [in] pParams Parameters to joining presentBarrier. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of data structure is not correct -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_JoinPresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient, __in NV_JOIN_PRESENT_BARRIER_PARAMS *pParams); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_LeavePresentBarrier -// -//! DESCRIPTION: This API removes a registered client from presentBarrier. If this -//! client does not join presentBarrier, this function does nothing. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_LeavePresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) - -#define NV_PRESENT_BARRIER_FRAME_STATICS_VER1 MAKE_NVAPI_VERSION(NV_PRESENT_BARRIER_FRAME_STATISTICS,1) - -typedef enum _NV_PRESENT_BARRIER_SYNC_MODE -{ - PRESENT_BARRIER_NOT_JOINED = 0x00000000, //!< The client hasn't joined presentBarrier - PRESENT_BARRIER_SYNC_CLIENT = 0x00000001, //!< The client joined the presentBarrier, but is not synchronized with - //! any other presentBarrier clients. This happens if the back buffers - //! of this client are composited instead of being flipped out to screen - PRESENT_BARRIER_SYNC_SYSTEM = 0x00000002, //!< The client joined the presentBarrier, and is synchronized with other - //! presentBarrier clients within the system - PRESENT_BARRIER_SYNC_CLUSTER = 0x00000003, //!< The client joined the presentBarrier, and is synchronized with other - //! clients within the system and across systems through QSync devices -} NV_PRESENT_BARRIER_SYNC_MODE; - -typedef struct _NV_PRESENT_BARRIER_FRAME_STATISTICS -{ - NvU32 dwVersion; //!< Must be NV_PRESENT_BARRIER_FRAME_STATICS_VER1 - NV_PRESENT_BARRIER_SYNC_MODE SyncMode; //!< The presentBarrier mode of this client from last present call - NvU32 PresentCount; //!< The total count of times that a frame has been presented from this - //! client after it joined presentBarrier successfully. - NvU32 PresentInSyncCount; //!< The total count of times that a frame has been presented from this - //! client and that has happened since the returned SyncMode is - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - NvU32 FlipInSyncCount; //!< The total count of flips from this client since the returned SyncMode - //! is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - NvU32 RefreshCount; //!< The total count of v-blanks since the returned SyncMode of this client - //! is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. - //! If the returned SyncMode is any other mode, this value is 0. - //! This count is set back to 0 in case the SyncMode switches away from - //! PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER. -} NV_PRESENT_BARRIER_FRAME_STATISTICS; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_QueryPresentBarrierFrameStatistics -// -//! DESCRIPTION: This API returns the presentBarrier frame statistics of last -//! present call from this client. If the client did not join -//! presentBarrier, the SyncMode is returned as PRESENT_BARRIER_NOT_JOINED, -//! and all other fields are reset. Driver does not retain any -//! presentBarrier info of the client once it leaves presentBarrier. -//! -//! \since Release: 470 -//! -//! \param [in] presentBarrierClient An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient. -//! \param [out] pFrameStats Pointer to NV_PRESENT_BARRIER_FRAME_STATISTICS structure about presentBarrier statistics. -//! -//! \retval ::NVAPI_OK the call succeeded -//! \retval ::NVAPI_ERROR the call failed -//! \retval ::NVAPI_NO_IMPLEMENTATION the interface is not implemented -//! \retval ::NVAPI_INVALID_HANDLE an invalid NvPresentBarrierClientHandle was passed as an argument -//! \retval ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument (probably NULL) -//! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION invalid version of frameStatistics params -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_QueryPresentBarrierFrameStatistics(__in NvPresentBarrierClientHandle presentBarrierClient, - __out NV_PRESENT_BARRIER_FRAME_STATISTICS *pFrameStats); -#endif // defined(__cplusplus) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateDDisplayPresentBarrierClient -// -//! DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle. -//! -//! \since Release: 510 -//! -//! \param [in] pDevice The ID3D12Device device which executes the rendering commands of this PresentBarrier -//! client. It must be created on the same adapter as DisplayDevice. -//! \param [in] sourceId The adapter-relative identifier for the DisplaySource obtained from DisplaySource.SourceId(). -//! \param [OUT] pPresentBarrierClient Pointer to an NvPresentBarrierClientHandle handle created by the driver on success. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \return ::NVAPI_INVALID_HANDLE the input displaySource handle is not owned by the process -//! \return ::NVAPI_NOT_SUPPORTED PresentBarrier featue is not supported on this configuration -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateDDisplayPresentBarrierClient(__in ID3D12Device *pDevice, __in NvU32 sourceId, __out NvPresentBarrierClientHandle *pPresentBarrierClient); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__)) - -enum NVAPI_QUAD_FILLMODE -{ - NVAPI_QUAD_FILLMODE_DISABLED = 0, - NVAPI_QUAD_FILLMODE_BBOX = 1, - NVAPI_QUAD_FILLMODE_FULL_VIEWPORT = 2, -}; - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -typedef struct NvAPI_D3D11_RASTERIZER_DESC_EX -{ - // D3D11_RASTERIZER_DESC member variables - D3D11_FILL_MODE FillMode; - D3D11_CULL_MODE CullMode; - BOOL FrontCounterClockwise; - INT DepthBias; - FLOAT DepthBiasClamp; - FLOAT SlopeScaledDepthBias; - BOOL DepthClipEnable; - BOOL ScissorEnable; - BOOL MultisampleEnable; - BOOL AntialiasedLineEnable; - - // NvAPI_D3D11_RASTERIZER_DESC_EX specific member variables - NvU32 ForcedSampleCount; //1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set - NvU8 SamplePositionsX[16]; // 1 && (pDesc->MiscFlags&D3D11_RESOURCE_MISC_TILED) -//! \param [in] pInitialData A pointer to an array of D3D11_SUBRESOURCE_DATA structures that describe subresources for the 2D texture resource. -//! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the created texture. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateTiledTexture2DArray(__in ID3D11Device *pDevice, - __in const D3D11_TEXTURE2D_DESC *pDesc, - __in const D3D11_SUBRESOURCE_DATA *pInitialData, - __out ID3D11Texture2D **ppTexture2D); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -typedef enum _NV_D3D11_FEATURE -{ - NV_D3D11_FEATURE_RASTERIZER, -} NV_D3D11_FEATURE; - -typedef struct _NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT -{ - BOOL TargetIndependentRasterWithDepth; - BOOL ProgrammableSamplePositions; - BOOL InterleavedSampling; - BOOL ConservativeRaster; - BOOL PostZCoverage; - BOOL CoverageToColor; -} NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CheckFeatureSupport -// -//! DESCRIPTION: This function gets information about the features that are supported by the current graphics driver. -//! -//! -//! -//! \param [in] pDevice The device on which to query for support. -//! \param [in] Feature A member of the NvAPI_D3D11_FEATURE enumerated type that describes which feature to query for suppor. -//! \param [in] pFeatureSupportData Upon completion of the method, the passed structure is filled with data that describes the feature support. -//! \param [out] FeatureSupportDataSize The size of the structure passed to the pFeatureSupportData parameter. -//! -//! \since Release: 410 -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! \retval :: Returns NVAPI_OK if successful; returns NVAPI_INVALID_ARGUMENT if an unsupported data type is passed to the pFeatureSupportData parameter -//! or a size mismatch is detected for the FeatureSupportDataSize parameter; -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CheckFeatureSupport(__in ID3D11Device *pDevice, - __in NV_D3D11_FEATURE Feature, - __out void *pFeatureSupportData, - __in UINT FeatureSupportDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateImplicitMSAATexture2D -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_CreateImplicitMSAATexture2D is a simple wrapper of ID3D11Device::CreateTexture2D -//! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture. -//! -//! \param [in] pDevice Current d3d device -//! \param [in] pDesc A pointer to a D3D11_TEXTURE2D_DESC structure that describes a 2D texture resource. -//! To create a typeless resource that can be interpreted at runtime into different, -//! compatible formats, specify a typeless format in the texture description. -//! To generatemipmap levels automatically, set the number of mipmap levels to 0. -//! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object -//! sees resource as non-multisampled. -//! -//! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the -//! created texture. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CreateImplicitMSAATexture2D(__in ID3D11Device *pDevice, - __in const D3D11_TEXTURE2D_DESC *pDesc, - __out ID3D11Texture2D **ppTexture2D); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateImplicitMSAATexture2D -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D is a simple wrapper of ID3D12Device::CreateCommittedResource -//! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture. -//! -//! \param [in] pDevice Current d3d device -//! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes a 2D texture resource. -//! To create a typeless resource that can be interpreted at runtime into different, -//! compatible formats, specify a typeless format in the texture description. -//! To generatemipmap levels automatically, set the number of mipmap levels to 0. -//! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object -//! sees resource as non-multisampled. -//! \param [in] pHeapProperties, HeapFlags, InitialResourceState, pOptimizedClearValue, riidResource See D3D12 docs -//! -//! \param [out] ppResource Same ID3D12Device::CreateCommittedResource -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D( - __in ID3D12Device* pDevice, - __in const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - __in const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - __in_opt const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riidResource, - __out void **ppvResource); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -//! SUPPORTED OS: Windows 10 and higher -//! - -//! \ingroup dx -//! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion -typedef enum _NV_RESOLVE_MODE { - NV_RESOLVE_MODE_SAMPLE_0, -} NV_RESOLVE_MODE; - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_ResolveSubresourceRegion -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion. -//! -//! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled. -//! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index. -//! \param [in] DstX The X coordinate of the left-most edge of the destination region. -//! The width of the destination region is the same as the width of the source rect. -//! -//! \param [in] DstY The Y coordinate of the top-most edge of the destination region. -//! The height of the destination region is the same as the height of the source rect. -//! -//! \param [in] pSrcResource Source resource. Must be multisampled. -//! \param [in] SrcSubresource The source subresource of the source resource. -//! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved. -//! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved. -//! -//! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource. -//! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode. -//! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_ResolveSubresourceRegion( - __in ID3D11Device *pDevice, - __in ID3D11Texture2D *pDstResource, - __in UINT DstSubresource, - __in UINT DstX, - __in UINT DstY, - __in ID3D11Texture2D *pSrcResource, - __in UINT SrcSubresource, - __in_opt const RECT *pSrcRect, - __in DXGI_FORMAT Format, - __in NV_RESOLVE_MODE ResolveMode); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_ResolveSubresourceRegion -// -//! \since Release: 410 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion. -//! -//! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled. -//! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index. -//! \param [in] DstX The X coordinate of the left-most edge of the destination region. -//! The width of the destination region is the same as the width of the source rect. -//! -//! \param [in] DstY The Y coordinate of the top-most edge of the destination region. -//! The height of the destination region is the same as the height of the source rect. -//! -//! \param [in] pSrcResource Source resource. Must be multisampled. -//! \param [in] SrcSubresource The source subresource of the source resource. -//! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved. -//! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved. -//! -//! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource. -//! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode. -//! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. See MSDN for the API specific error codes. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_ResolveSubresourceRegion( - __in ID3D12GraphicsCommandList1*pCommandList, - __in ID3D12Resource *pDstResource, - __in UINT DstSubresource, - __in UINT DstX, - __in UINT DstY, - __in ID3D12Resource *pSrcResource, - __in UINT SrcSubresource, - __in_opt RECT *pSrcRect, - __in DXGI_FORMAT Format, - __in NV_RESOLVE_MODE ResolveMode); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_TiledTexture2DArrayGetDesc -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_TiledTexture2DArrayGetDesc is an simple wrapper of ID3D11Texture2D::GetDesc -//! when pTiledTexture2DArray is created with NvAPI_D3D11_CreateTiledTexture2DArray. -//! Runtime doesn't know the created resource is actually a tiled resource. -//! So calling ID3D11Texture2D::GetDesc will get a desc without D3D11_RESOURCE_MISC_TILED in MiscFlags. -//! This wrapper API just adds D3D11_RESOURCE_MISC_TILED back. -//! -//! \param [in] pTiledTexture2DArray Pointer of tiled texture2D array to get resource desc from. -//! \param [out] pDesc Pointer to a resource description. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_TiledTexture2DArrayGetDesc(__in ID3D11Texture2D *pTiledTexture2DArray, - __out D3D11_TEXTURE2D_DESC *pDesc); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_UpdateTileMappings -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_UpdateTileMappings is an extension of ID3D11DeviceContext2::UpdateTileMappings. -//! It allows pTiledResource to be a resource created with NvAPI_D3D11_CreateTiledTexture2DArray, and should be used only in such case. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pTiledResource A pointer to the tiled texture 2D array resource created by NvAPI_D3D11_CreateTiledTexture2DArray. -//! \param [in] NumTiledResourceRegions The number of tiled resource regions. -//! \param [in] pTiledResourceRegionStartCoordinates An array of D3D11_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL. -//! \param [in] pTiledResourceRegionSizes An array of D3D11_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL. -//! \param [in] pTilePool A pointer to the tile pool. This resource should be created by standard API. -//! \param [in] NumRanges The number of tile-pool ranges. -//! \param [in] pRangeFlags An array of D3D11_TILE_RANGE_FLAG values that describe each tile-pool range. -//! \param [in] pTilePoolStartOffsets An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes). -//! \param [in] pRangeTileCounts An array of values that specify the number of tiles in each tile-pool range. -//! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_UpdateTileMappings( - __in ID3D11DeviceContext2 *pDeviceContext, - __in ID3D11Resource *pTiledResource, - __in UINT NumTiledResourceRegions, - __in const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates, - __in const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes, - __in ID3D11Buffer *pTilePool, - __in UINT NumRanges, - __in const UINT *pRangeFlags, - __in const UINT *pTilePoolStartOffsets, - __in const UINT *pRangeTileCounts, - __in UINT Flags); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CopyTileMappings -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_CopyTileMappings is an extension of ID3D11DeviceContext2::CopyTileMappings -//! It allows pDestTiledResource or pSourceTiledResource or both to be created with NvAPI_D3D11_CreateTiledTexture2DArray. -//! It should be used only in such case. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pDestTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings into. -//! \param [in] pDestRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination tiled resource. -//! \param [in] pSourceTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings from. -//! \param [in] pSourceRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source tiled resource. -//! \param [in] pTileRegionSize A pointer to a D3D11_TILE_REGION_SIZE structure that describes the size of the tiled region. -//! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_CopyTileMappings( - __in ID3D11DeviceContext *pDeviceContext, - __in ID3D11Resource *pDestTiledResource, - __in const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate, - __in ID3D11Resource *pSourceTiledResource, - __in const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate, - __in const D3D11_TILE_REGION_SIZE *pTileRegionSize, - __in UINT Flags); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 8 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_2_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_TiledResourceBarrier -// -//! \since Release: 375 -// -//! \code -//! DESCRIPTION: NvAPI_D3D11_TiledResourceBarrier is an extension of ID3D11DeviceContext2::TiledResourceBarrier, but only works on ID3D11Resource(no support for ID3D11View). -//! If pTiledResourceAccessBeforeBarrier or pTiledResourceAccessAfterBarrier or both are created by NvAPI_D3D11_CreateTiledTexture2DArray, -//! NvAPI_D3D11_TiledResourceBarrier must be used instead of ID3D11DeviceContext2::TiledResourceBarrier. -//! -//! \param [in] pDeviceContext Must be Immediate DeviceContext. -//! \param [in] pTiledResourceAccessBeforeBarrier Access operations on this resource must complete before the access operations on the object that pTiledResourceAccessAfterBarrier specifies. -//! \param [in] pTiledResourceAccessAfterBarrier Access operations on this resource must begin after the access operations on the object that pTiledResourceAccessBeforeBarrier specifies. - -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_TiledResourceBarrier( - __in ID3D11DeviceContext *pDeviceContext, - __in ID3D11Resource *pTiledResourceAccessBeforeBarrier, - __in ID3D11Resource *pTiledResourceAccessAfterBarrier); - -#endif //defined(__cplusplus) && defined(__d3d11_2_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA -// -//! \code -//! DESCRIPTION: This function allows creating (aliasing) a non-MSAA Texture2D object using the same memory as the given multi-sampled -//! texture (pInputTex). The surface created would be bloated in width and height but it will have SampleCount = 1 -//! For 2X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height -//! For 4X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height * 2 -//! For 8X MSAA: OutTex.Width = InputTex.Width * 4, outTex.Height = InputTex.Height * 2 -//! Only textures SampleQuality = 0 can be aliased as Non MSAA -//! The app should ensure that original texture is released only after the aliased copy is released. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \param [in] pDevice current d3d device -//! \param [in] pInputTex The MultiSampled Texture2D resource that is being aliased -//! \param [out] ppOutTex The aliased non AA copy MultiSampled Texture2D resource -//! -//! -//! \return :: NVAPI_OK if the call succeeds. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA(__in ID3D11Device *pDevice, - __in ID3D11Texture2D *pInputTex, - __out ID3D11Texture2D **ppOutTex); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) -typedef UINT NvAPI_D3D11_SWIZZLE_MODE; - -typedef enum _NV_SWIZZLE_MODE -{ - NV_SWIZZLE_POS_X = 0, - NV_SWIZZLE_NEG_X = 1, - NV_SWIZZLE_POS_Y = 2, - NV_SWIZZLE_NEG_Y = 3, - NV_SWIZZLE_POS_Z = 4, - NV_SWIZZLE_NEG_Z = 5, - NV_SWIZZLE_POS_W = 6, - NV_SWIZZLE_NEG_W = 7 -}NV_SWIZZLE_MODE; - -typedef enum _NV_SWIZZLE_OFFSET -{ - NV_SWIZZLE_OFFSET_X = 0, - NV_SWIZZLE_OFFSET_Y = 4, - NV_SWIZZLE_OFFSET_Z = 8, - NV_SWIZZLE_OFFSET_W = 12 -}NV_SWIZZLE_OFFSET; - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) -#define NV_CUSTOM_SEMANTIC_MAX_LIMIT 32 - -typedef enum NV_CUSTOM_SEMANTIC_TYPE -{ - NV_NONE_SEMANTIC = 0, - NV_X_RIGHT_SEMANTIC = 1, - NV_VIEWPORT_MASK_SEMANTIC = 2, - NV_XYZW_RIGHT_SEMANTIC = 3, - NV_VIEWPORT_MASK_2_SEMANTIC = 4, - - NV_POSITION_SEMANTIC = 5, - NV_CLIP_DISTANCE_0_SEMANTIC = 6, // MultiView can accept upto two vec4 values. So the application should not use - NV_CLIP_DISTANCE_1_SEMANTIC = 7, // more than 2 of the below Clip / Cull semantics in a single shader. - NV_CULL_DISTANCE_0_SEMANTIC = 8, - NV_CULL_DISTANCE_1_SEMANTIC = 9, - NV_GENERIC_ATTRIBUTE_SEMANTIC = 10, - - NV_PACKED_EYE_INDEX_SEMANTIC = 17, - NV_CUSTOM_SEMANTIC_MAX = NV_CUSTOM_SEMANTIC_MAX_LIMIT, -} NV_CUSTOM_SEMANTIC_TYPE; - -typedef struct _NV_CUSTOM_SEMANTIC -{ - UINT version; // NV_CUSTOM_SEMANTIC_VERSION - - NV_CUSTOM_SEMANTIC_TYPE NVCustomSemanticType; // type of custom semantic (NV_CUSTOM_SEMANTIC_TYPE) - NvAPI_LongString NVCustomSemanticNameString; // name of custom semantic e.g. "NV_X_RIGHT", "NV_VIEWPORT_MASK" - BOOL RegisterSpecified; // (optional) set to TRUE to explicitly provide register number and mask as below - NvU32 RegisterNum; // (optional) output register which has the custom semantic. - NvU32 RegisterMask; // (optional) output register component mask which has the custom semantic (X:1, Y:2, Z:4) - NvU32 Reserved; // reserved -} NV_CUSTOM_SEMANTIC; - -#define NV_CUSTOM_SEMANTIC_VERSION MAKE_NVAPI_VERSION(NV_CUSTOM_SEMANTIC, 1) - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -typedef struct NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 -{ - UINT version; - - BOOL UseViewportMask; - BOOL OffsetRtIndexByVpIndex; - BOOL ForceFastGS; - BOOL DontUseViewportOrder; - BOOL UseAttributeSkipMask; - BOOL UseCoordinateSwizzle; - NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL ConvertToFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5; - -typedef NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX; -#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5, 5) -#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VERSION NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateGeometryShaderEx -// -//! \fn NvAPI_D3D11_CreateGeometryShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of geometry shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateGeometryShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter is UseViewportMask which is to tell the driver to create a shader -//! that outputs a viewport mask instead when a viewport index is indicated. -//! Outputting a viewport mask allows a single primitive to land on many different viewports -//! as specified by the bits set in the mask, rather than to rely on a single number that tells it -//! which unique viewport it would be drawn on. -//! This can be used for example in conjunction with the setting of coordinates swizzling (see XXX_NVAPI function) -//! to generates multiple adjacent views of the same primitive in a more efficient fashion -//! (outputting the primitive only once). -//! -//! This function is free-threaded create compatible i.e. it can be called from a different -//! thread than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] UseViewportMask Set to FALSE for custom semantic shaders. Tell the driver to create a shader that outputs the viewport mask in lieu of the viewport index. See above description. -//! \param [in] OffsetRtIndexByVpIndex Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index -//! \param [in] ForceFastGS If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification -//! \param [in] DontUseViewportOrder Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow). -//! \param [in] UseAttributeSkipMask reserved -//! \param [in] UseCoordinateSwizzle reserved -//! \param [in] pCoordinateSwizzling reserved -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] ConvertToFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateGeometryShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX *pCreateGeometryShaderExArgs, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2; - -typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3; - -typedef NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 NvAPI_D3D11_CREATE_VERTEX_SHADER_EX; -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 3) -#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VERSION NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateVertexShaderEx -// -//! \fn NvAPI_D3D11_CreateVertexShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of vertex shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateVertexShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled vertex shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppVertexShader Address of a pointer to a ID3D11VertexShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateVertexShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_VERTEX_SHADER_EX *pCreateVertexShaderExArgs, - __out ID3D11VertexShader **ppVertexShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2; - -typedef NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 NvAPI_D3D11_CREATE_HULL_SHADER_EX; -#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 2) -#define NVAPI_D3D11_CREATEHULLSHADEREX_VERSION NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateHullShaderEx -// -//! \fn NvAPI_D3D11_CreateHullShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of hull shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateHullShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled hull shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppHullShader Address of a pointer to a ID3D11HullShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateHullShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_HULL_SHADER_EX *pCreateHullShaderExArgs, - __out ID3D11HullShader **ppHullShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1; - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2; - -typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - BOOL UseWithFastGS; // reserved - BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions -} NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3; - -typedef NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX; -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1, 1) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3, 3) -#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VERSION NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateDomainShaderEx -// -//! \fn NvAPI_D3D11_CreateDomainShaderEx -//! -//! DESCRIPTION: This function allows us to extend the creation of domain shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreateDomainShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled domain shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [in] UseWithFastGS reserved -//! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions -//! \param [out] ppDomainShader Address of a pointer to a ID3D11DomainShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateDomainShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX *pCreateDomainShaderExArgs, - __out ID3D11DomainShader **ppDomainShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) - -typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1 -{ - UINT version; - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC -} NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1; - -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1, 1) - -typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 -{ - UINT version; // Always use NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION - - NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics - NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC - NvU32 bEnableSuperSamplingPredicationForVRS : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for relevant attributes tagged with "sample" modifier - NvU32 bEnableSuperSamplingPredicationForVRSAllAttributes : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for all relevant attributes - NvU32 reserved : 30; // Reserved for further use -} NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2; - -typedef NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 NvAPI_D3D11_CREATE_PIXEL_SHADER_EX; -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2, 2) -#define NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreatePixelShaderEx_2 -// -//! \fn NvAPI_D3D11_CreatePixelShaderEx_2 -//! -//! DESCRIPTION: This function allows us to extend the creation of pixel shaders with extra bits -//! of functionality. -//! -//! The first parameters are identical to ID3D11Device::CreatePixelShader() -//! so please refer to its documentation for their usage. -//! -//! The new parameter are custom semantics which allow setting of custom semantic variables -//! in the shader -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled domain shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics -//! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC -//! \param [out] ppPixelShader Address of a pointer to a ID3D11PixelShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreatePixelShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_PIXEL_SHADER_EX *pCreatePixelShaderExArgs, - __out ID3D11PixelShader **ppPixelShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -typedef enum _NV_FASTGS_FLAGS -{ - NV_FASTGS_USE_VIEWPORT_MASK = 0x01, // Causes SV_ViewportArrayIndex value to be interpreted as a bitmask of viewports to broadcast to. - NV_FASTGS_OFFSET_RT_INDEX_BY_VP_INDEX = 0x02, // Causes SV_RenderTargetArrayIndex value to be offset by the viewport index when broadcasting. - NV_FASTGS_STRICT_API_ORDER = 0x04, // Causes broadcast primitives to be rendered strictly in API order (slow). - // By default, primitives may be batched per viewport to improve performance. -} NV_FASTGS_FLAGS; - -#endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE)) - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -struct NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 -{ - NvU32 version; // ALWAYS == NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER - NvU32 flags; // A combination of flags from NV_FASTGS_FLAGS - NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used. - // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their - // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport - // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after - // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK) - // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i. - // See NV_SWIZZLE_MODE for values of allowed swizzle modes. - // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component. - // For example : - // 1. To set swizzle for viewport 0 such that - w and z are unchanged and values of x and y are swapped : - // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) | - // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) | - // (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) | - // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X); - // 2. To set swizzle for viewport 0 such that - w, z and y are unchanged and value of x is negated : - // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) | - // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) | - // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) | - // (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X); - // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set. - // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device. -}; - -#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1, 1) -#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 - -typedef NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC; - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShaderExplicit -// -//! \fn NvAPI_D3D11_CreateFastGeometryShaderExplicit -//! -//! DESCRIPTION: This function will create a fast geometry shader written using an "explicit" -//! coding style, rather than converting a standard GS. For the explicit coding -//! style, the GS must be written with maxvertexcount(1), and must pass-through -//! input vertex 0 to the output without modification. -//! -//! Additional per-primitive outputs may also be computed and written to the single -//! output vertex. If these outputs are read by the pixel shader, they must be -//! declared with the "nointerpolation" attribute in the PS input signature; -//! otherwise, visual corruption may occur. Also, unlike D3D API, there is no guarantee -//! that pixel shader will get the default value of an attribute if that attribute is not written -//! by the earlier shader stage in the pipeline. -//! -//! The first four parameters are identical to ID3D11Device::CreateGeometryShader(), -//! so please refer to its documentation for their usage. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [in] pCreateFastGSArgs A pointer to a NvAPI_D3D11_CREATE_FASTGS_EXPLICIT struct. -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShaderExplicit(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __in const NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC *pCreateFastGSArgs, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) ) -//////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShader -// -//! \fn NvAPI_D3D11_CreateFastGeometryShader -//! -//! DESCRIPTION: This function will convert a regular geometry shader into a fast GS variant if possible. -//! It will not do any validation regarding the compatibility of the resulting fast GS with any -//! Pixel shader. The validation has to be done by the application manually. -//! -//! The parameters are identical to ID3D11Device::CreateGeometryShader() -//! so please refer to its documentation for their usage. -//! -//! If the shader is too complex or is not in adequate form to be converted to fast GS -//! this function will simply fail. You should then call ID3D11Device::CreateGeometryShader() -//! to create the regular geometry shader. -//! -//! This function is free-threaded create compatible i.e. it can be called from a different thread -//! than the one calling immediate device setstate functions. -//! -//! \since Release: -//! -//! \param [in] pDevice The device pointer -//! \param [in] pShaderBytecode A pointer to the compiled shader. -//! \param [in] BytecodeLength Size of the compiled geometry shader. -//! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL. -//! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -// -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShader(__in ID3D11Device *pDevice, __in const void *pShaderBytecode, - __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage, - __out ID3D11GeometryShader **ppGeometryShader); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined (__cplusplus) && defined(__d3d11_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_DecompressView -// -//! \code -//! DESCRIPTION: This function is used to decompress a surface using the currently bound programmable sample positions. -//! -//! This is needed: -//! - When writing to a surface in a region previously rendered by different sample positions and no clear was done. -//! - When reading a surface in a shader that was rendered using non-standard sample positions. -//! - When copying from a surface that was rendered using non-standard sample positions. -//! -//! \param [in] pDevice Current d3d11 device -//! \param [in] pDeviceContext Current d3d11 device context -//! \param [in] pView Current view to decompress -//! -//! -//! \return ::NVAPI_OK if the call succeeds. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D11_DecompressView(__in ID3D11Device* pDevice, __in ID3D11DeviceContext *pDeviceContext, __in ID3D11View* pView); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) - -//! Enum for CreatePSO extensions. -//! \ingroup dx -//! constant 5 is assigned to two members of this enum becuase the first member name contains a typo: EXTNENSION. Please use the correctly-spelled enumerator. -typedef enum _NV_PSO_EXTENSION -{ - NV_PSO_RASTER_EXTENSION = 0, - NV_PSO_REQUEST_FASTGS_EXTENSION = 1, - NV_PSO_GEOMETRY_SHADER_EXTENSION = 2, - NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION = 3, - NV_PSO_EXPLICIT_FASTGS_EXTENSION = 4, - NV_PSO_SET_SHADER_EXTNENSION_SLOT_AND_SPACE = 5, - NV_PSO_SET_SHADER_EXTENSION_SLOT_AND_SPACE = 5, - NV_PSO_VERTEX_SHADER_EXTENSION = 6, - NV_PSO_DOMAIN_SHADER_EXTENSION = 7, - NV_PSO_HULL_SHADER_EXTENSION = 9, -}NV_PSO_EXTENSION; - -struct NVAPI_D3D12_PSO_EXTENSION_DESC_V1 -{ - NvU32 baseVersion; //1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set - NvU8 SamplePositionsX[16]; //= 201103L - -#define compile_time_assert(b) static_assert((b), "Compile time assertion failed: "#b) - -enum NV_META_COMMAND_TENSOR_DATA_TYPE : NvU64 -{ - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32, - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16, - NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32, - - NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT, -}; - - -enum NV_META_COMMAND_TENSOR_LAYOUT : NvU64 -{ - NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout - NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost) - NV_META_COMMAND_TENSOR_LAYOUT_COUNT, -}; - -enum NV_META_COMMAND_TENSOR_FLAGS : NvU64 -{ - NV_META_COMMAND_TENSOR_FLAG_NONE = 0, - NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording) -}; - -enum NV_META_COMMAND_PRECISION : NvU64 -{ - NV_META_COMMAND_PRECISION_FLOAT32, - NV_META_COMMAND_PRECISION_FLOAT16, - NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32, - - NV_META_COMMAND_PRECISION_COUNT, -}; - -struct NV_META_COMMAND_TENSOR_DESC -{ - NV_META_COMMAND_TENSOR_DATA_TYPE DataType; - NV_META_COMMAND_TENSOR_LAYOUT Layout; - NV_META_COMMAND_TENSOR_FLAGS Flags; - NvU64 DimensionCount; // 4 or 5 - NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM]; - NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD -}; - -enum NV_META_COMMAND_ACTIVATION_FUNCTION : NvU64 -{ - NV_META_COMMAND_ACTIVATION_FUNCTION_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY, - NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR, - NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN, - NV_META_COMMAND_ACTIVATION_FUNCTION_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU, - - NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT, -}; - -struct NV_META_COMMAND_ACTIVATION_DESC -{ - NV_META_COMMAND_ACTIVATION_FUNCTION Function; - float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS]; -}; - -#else - -#define compile_time_assert(b) typedef char compile_time_assertion_failed_in_line_##__LINE__[(b)?1:-1] - -enum NV_META_COMMAND_TENSOR_DATA_TYPE -{ - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32, - NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16, - NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32, - - NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT, -}; - - -enum NV_META_COMMAND_TENSOR_LAYOUT -{ - NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout - NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost) - NV_META_COMMAND_TENSOR_LAYOUT_COUNT, -}; - -enum NV_META_COMMAND_TENSOR_FLAGS -{ - NV_META_COMMAND_TENSOR_FLAG_NONE = 0, - NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording) -}; - -enum NV_META_COMMAND_PRECISION -{ - NV_META_COMMAND_PRECISION_FLOAT32, - NV_META_COMMAND_PRECISION_FLOAT16, - NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32, - - NV_META_COMMAND_PRECISION_COUNT, -}; - -struct NV_META_COMMAND_TENSOR_DESC -{ - NvU64 DataType; // NV_META_COMMAND_TENSOR_DATA_TYPE - NvU64 Layout; // NV_META_COMMAND_TENSOR_LAYOUT - NvU64 Flags; // NV_META_COMMAND_TENSOR_FLAGS - NvU64 DimensionCount; // 4 or 5 - NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM]; - NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD -}; - -enum NV_META_COMMAND_ACTIVATION_FUNCTION -{ - NV_META_COMMAND_ACTIVATION_FUNCTION_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY, - NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR, - NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_RELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU, - NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS, - NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN, - NV_META_COMMAND_ACTIVATION_FUNCTION_TANH, - NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU, - - NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT, -}; - -struct NV_META_COMMAND_ACTIVATION_DESC -{ - NvU64 Function; // NV_META_COMMAND_ACTIVATION_FUNCTION - float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS]; -}; - -#endif - -struct NV_META_COMMAND_OPTIONAL_TENSOR_DESC : NV_META_COMMAND_TENSOR_DESC -{ - // true when the tensor isn't needed (e.g, bias is optional) - NV_META_COMMAND_BOOL IsNull; -}; - - -struct NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC : NV_META_COMMAND_ACTIVATION_DESC -{ - // true when activation isn't needed - NV_META_COMMAND_BOOL IsNull; -}; - - -enum NV_META_COMMAND_PADDING_MODE -{ - NV_META_COMMAND_PADDING_ZEROS, - NV_META_COMMAND_PADDING_MIRROR, - NV_META_COMMAND_PADDING_CLAMP, - NV_META_COMMAND_PADDING_CONSTANT, - - NV_META_COMMAND_PADDING_COUNT, -}; - -struct NV_META_COMMAND_PADDING_DESC -{ - NV_META_COMMAND_PADDING_MODE Mode; - - // used with NV_META_COMMAND_PADDING_CONSTANT - float ConstantPadVal; -}; - -// use this enum to query resource sizes using GetRequiredParameterResourceSize() call -enum NV_META_COMMAND_RESOURCE_TYPE -{ - NV_META_COMMAND_RESOURCE_TYPE_INPUT = 0, - NV_META_COMMAND_RESOURCE_TYPE_OUTPUT = 1, - - NV_META_COMMAND_RESOURCE_TYPE_FILTER = 2, - NV_META_COMMAND_RESOURCE_TYPE_WEIGHT = 2, - NV_META_COMMAND_RESOURCE_TYPE_BIAS = 3, - - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_A = 0, - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_B = 2, - NV_META_COMMAND_RESOURCE_TYPE_MATRIX_C = 3, - - NV_META_COMMAND_RESOURCE_TYPE_PERSISTENT = 4, - NV_META_COMMAND_RESOURCE_TYPE_TEMPORARY = 5, -}; - - -// Extended version of convolution operation that performs: -// -// y = act ( alpha1 * conv(x) + alpha2 * z + bias ) -// -// alpha1 and alpha2 are either scalars or if PerChannelScaling is TRUE, they are vectors of -// same dimension as the bias tensor (vector of size equal to number of output channels) -// -// z (SkipConnectionResource) has same dimension as output tensor y (OutputResource). - -static const GUID MetaCommand_ConvolutionEx = -{ 0xa7666f1e, 0x9c55, 0x47ee, { 0x9e, 0xb3, 0xe1, 0x62, 0x0, 0x92, 0xd1, 0xe9 } }; - -#define NV_META_COMMAND_NUM_SPATIAL_DIM 3 -// D, H, W when DimensionCount is 3 -// H, W when DimensionCount is 2 - - -#if __cplusplus >= 201103L -enum NV_META_COMMAND_CONVOLUTION_DIRECTION : NvU64 -{ - NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution - NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose - - NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_MODE : NvU64 -{ - NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION, - NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION, - - NV_META_COMMAND_CONVOLUTION_MODE_COUNT, -}; - -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - // Descriptor of the input tensor - NV_META_COMMAND_TENSOR_DESC DescIn; - - // Descriptor of the tensor acting as the filter kernel - NV_META_COMMAND_TENSOR_DESC DescFilter; - - // Descriptor of the optional bias tensor - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias; - - // Descriptor of the output tensor - NV_META_COMMAND_TENSOR_DESC DescOut; - - // Convolution mode (CROSS_CORRELATION or CONVOLUTION) - NV_META_COMMAND_CONVOLUTION_MODE Mode; - - // Convolution direction (FORWARD or BACKWARD) - NV_META_COMMAND_CONVOLUTION_DIRECTION Direction; - - // Precision at which convolution is done - NV_META_COMMAND_PRECISION Precision; - - // Optional activation function - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; - - // Padding mode (only used when output tensor dimensions are different from input tensor dimensions) - NV_META_COMMAND_PADDING_DESC Padding; - - // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource - // instead of Alpha1 and Alpha2 below - NV_META_COMMAND_BOOL PerChannelScaling; - - // scaling factors used when PerChannelScaling is FALSE - // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions - // that don't need scaling or skip connection - float Alpha1; - float Alpha2; - - // Strides for the filter kernel position - NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // The distance per dimension between elements that are multiplied - NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the start of each dimension - NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the end of each dimension - NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Number of dimensions to which convolution occurs (2 or 3) - NvU64 DimensionCount; - - // Number of channel groups convolved independently - NvU64 GroupCount; -}; - -#else - -enum NV_META_COMMAND_CONVOLUTION_DIRECTION -{ - NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution - NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose - - NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_MODE -{ - NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION, - NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION, - - NV_META_COMMAND_CONVOLUTION_MODE_COUNT, -}; - -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - // Descriptor of the input tensor - NV_META_COMMAND_TENSOR_DESC DescIn; - - // Descriptor of the tensor acting as the filter kernel - NV_META_COMMAND_TENSOR_DESC DescFilter; - - // Descriptor of the optional bias tensor - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias; - - // Descriptor of the output tensor - NV_META_COMMAND_TENSOR_DESC DescOut; - - // Convolution mode (CROSS_CORRELATION or CONVOLUTION) - NvU64 Mode; // NV_META_COMMAND_CONVOLUTION_MODE - - // Convolution direction (FORWARD or BACKWARD) - NvU64 Direction; // NV_META_COMMAND_CONVOLUTION_DIRECTION - - // Precision at which convolution is done - NvU64 Precision; // NV_META_COMMAND_PRECISION - - // Optional activation function - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; - - // Padding mode (only used when output tensor dimensions are different from input tensor dimensions) - NV_META_COMMAND_PADDING_DESC Padding; - - // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource - // instead of Alpha1 and Alpha2 below - NV_META_COMMAND_BOOL PerChannelScaling; - - // scaling factors used when PerChannelScaling is FALSE - // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions - // that don't need scaling or skip connection - float Alpha1; - float Alpha2; - - // Strides for the filter kernel position - NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // The distance per dimension between elements that are multiplied - NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the start of each dimension - NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Padding at the end of each dimension - NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM]; - - // Number of dimensions to which convolution occurs (2 or 3) - NvU64 DimensionCount; - - // Number of channel groups convolved independently - NvU64 GroupCount; -}; -#endif - - -// Fused Convolution variants - -// supported combinations right now are: -// - Convolution + Max Pooling (also optionally outputs pre-pool data) -// - 2x2 upsample + (optional) residual add + Convolution -// -// other combinations may be exposed in future - -static const GUID MetaCommand_ConvolutionExFused = -{ 0xe1b112eb, 0xdecd, 0x4ff6,{ 0x85, 0xbb, 0x1f, 0xe, 0x3a, 0xb0, 0x4, 0x14 } }; - - -enum NV_META_COMMAND_CONVOLUTION_POOL_MODE -{ - NV_META_COMMAND_CONVOLUTION_POOL_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MAX, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_AVG, - NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MIN, - - NV_META_COMMAND_CONVOLUTION_POOL_MODE_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE -{ - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_REPLICATE, - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_BILINEAR, - - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_COUNT, -}; - -enum NV_META_COMMAND_CONVOLUTION_SKIP_MODE -{ - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_NONE, - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_ADD, - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_CONCAT, - - NV_META_COMMAND_CONVOLUTION_SKIP_MODE_COUNT, -}; - -struct NV_META_COMMAND_CONVOLUTION_FUSE_DESC -{ - NV_META_COMMAND_CONVOLUTION_POOL_MODE PoolMode; - NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE UpsampleMode; - NV_META_COMMAND_CONVOLUTION_SKIP_MODE SkipMode; - - NV_META_COMMAND_BOOL OutputPrepool; // used with NV_META_COMMAND_CONVOLUTION_POOL_MODE -}; - -// uses same structures for init and execute descriptors -// SkipConnectionResource is used to specify the resource for pre-pool data or residual add -struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC : NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC -{ - NV_META_COMMAND_CONVOLUTION_FUSE_DESC FuseDesc; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_META_COMMAND_TENSOR_DESC) == 112); -compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC) == 640); -compile_time_assert(sizeof(NV_META_COMMAND_CONVOLUTION_FUSE_DESC) == 20); -compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC) == 660); - - -// GEMM (General matrix multiply) -// -// Y = alpha * t(A) * t(B) + beta * C, -// -// where t is a matrix transform option -// -// If C is null, and beta is non-zero, the output -// matrix is used as C matrix. i.e, the operation performed is: -// Y = alpha * t(A) * t(B) + beta * Y -// -static const GUID MetaCommand_Gemm = - { 0x8f9ff059, 0xfe72, 0x488e, { 0xa0, 0x66, 0xb1, 0x4e, 0x79, 0x48, 0xec, 0x8 } }; - -#if __cplusplus >= 201103L - -enum NV_META_COMMAND_MATRIX_TRANSFORM : NvU64 -{ - NV_META_COMMAND_MATRIX_TRANSFORM_NONE, - NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE, - - NV_META_COMMAND_MATRIX_TRANSFORM_COUNT, -}; - -struct NV_META_COMMAND_CREATE_GEMM_DESC -{ - NV_META_COMMAND_TENSOR_DESC DescA; - NV_META_COMMAND_TENSOR_DESC DescB; - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC; - NV_META_COMMAND_TENSOR_DESC DescOut; - NV_META_COMMAND_PRECISION Precision; - - NV_META_COMMAND_MATRIX_TRANSFORM TransA; - NV_META_COMMAND_MATRIX_TRANSFORM TransB; - float Alpha; - float Beta; - - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; -}; - -#else - -enum NV_META_COMMAND_MATRIX_TRANSFORM -{ - NV_META_COMMAND_MATRIX_TRANSFORM_NONE, - NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE, - - NV_META_COMMAND_MATRIX_TRANSFORM_COUNT, -}; - -struct NV_META_COMMAND_CREATE_GEMM_DESC -{ - NV_META_COMMAND_TENSOR_DESC DescA; - NV_META_COMMAND_TENSOR_DESC DescB; - NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC; - NV_META_COMMAND_TENSOR_DESC DescOut; - NvU64 Precision; // NV_META_COMMAND_PRECISION - - NvU64 TransA; // NV_META_COMMAND_MATRIX_TRANSFORM - NvU64 TransB; // NV_META_COMMAND_MATRIX_TRANSFORM - float Alpha; - float Beta; - - NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation; -}; - -#endif - - -#pragma pack(pop) - -#endif // #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_EnumerateMetaCommands -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Enumerates MetaCommands supported on the system -//! -//! \param [in] pDevice A pointer to D3D11 device. -//! \param [in/out] pNumMetaCommands Should be non-null. When the value pointed by pNumMetaCommands is 0 (or when pDescs is NULL), the function returns number of metacommands supported. -//! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array. -//! \param [out] pDescs Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands. -//! Otherwise should have enough space to hold *pNumMetaCommands descriptors -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_EnumerateMetaCommands(__in ID3D11Device *pDevice, - __inout NvU32 *pNumMetaCommands, - __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions. -//! -//! \param [in] pDevice A pointer to D3D11 device. -//! \param [in] CommandId GUID of the operations to perform -//! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand -//! \param [in] CreationParametersDataSize size of parameter data structure -//! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object. -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! NVAPI_NOT_SUPPORTED - The requested Metacommand is not supported. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -#pragma pack(push, 4) -struct NV_D3D11_META_COMMAND_RESOURCE -{ - union - { - NVDX_ObjectHandle ResourceHandle; // NVAPI handle of a buffer resource (use NvAPI_D3D11_GetResourceHandle to get this handle) - NvU64 unused; // to get correct sturcutre size on 32 bit builds - }; - NvU64 Offset; // offset within the resource in bytes -}; - -struct NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC -{ - // Persistent resource used as scratch space by driver - // it's written at time of init, and read at time of execute - // use GetRequiredParameterResourceSize to query its size - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; -}; - -struct NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE InputResource; - NV_D3D11_META_COMMAND_RESOURCE FilterResource; - NV_D3D11_META_COMMAND_RESOURCE BiasResource; // optional - NV_D3D11_META_COMMAND_RESOURCE OutputResource; - - // Alpha1Resource and Alpha2Resource are used only when - // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used - // should have same dimension as bias - NV_D3D11_META_COMMAND_RESOURCE Alpha1Resource; - NV_D3D11_META_COMMAND_RESOURCE Alpha2Resource; - - // optional, same dimension/descriptor as output - NV_D3D11_META_COMMAND_RESOURCE SkipConnectionResource; - - - // should point to same memory that was specified at time of init - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; - - // temporary resource used as scratch space by driver - // used for both read and write at the time of execute - // use GetRequiredParameterResourceSize to query its size - NV_D3D11_META_COMMAND_RESOURCE TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 16); -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 144); - -struct NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; -}; - -struct NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC -{ - NV_D3D11_META_COMMAND_RESOURCE AResource; - NV_D3D11_META_COMMAND_RESOURCE BResource; - NV_D3D11_META_COMMAND_RESOURCE CResource; - NV_D3D11_META_COMMAND_RESOURCE OutputResource; - - NV_D3D11_META_COMMAND_RESOURCE PersistentResource; - NV_D3D11_META_COMMAND_RESOURCE TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC) == 16); -compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC) == 96); - - -#pragma pack(pop) - -DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D11NvMetaCommand_V1, IUnknown) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // ** ID3D11NvMetaCommand methods *** - // Return size of parameter - STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE; - - END_INTERFACE -}; - -typedef ID3D11NvMetaCommand_V1 ID3D11NvMetaCommand; -#define ID3D11NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D11NvMetaCommand_V1, 1) -#define ID3D11NvMetaCommand_VER ID3D11NvMetaCommand_VER1 - -NVAPI_INTERFACE NvAPI_D3D11_CreateMetaCommand(__in ID3D11Device *pDevice, - __in REFGUID CommandId, - __in_bcount(CreationParametersDataSize) const void *pCreationParametersData, - __in NvU32 CreationParametersDataSize, - __out ID3D11NvMetaCommand **ppMetaCommand); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_InitializeMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in -//! -//! \param [in] pDeviceContext A pointer to the d3d11 device context -//! \param [in] pMetaCommand the MetaCommand to initialize -//! \param [in] pInitializationParametersData Structure containing parameters -//! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_InitializeMetaCommand(__in ID3D11DeviceContext *pDeviceContext, - __in ID3D11NvMetaCommand *pMetaCommand, - __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData, - __in NvU32 InitializationParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_ExecuteMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Executes the given MetaCommand with the parameters passed in -//! -//! \param [in] pDeviceContext A pointer to the d3d11 device context -//! \param [in] pMetaCommand the MetaCommand to execute -//! \param [in] pExecutionParametersData Structure containing parameters -//! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_ExecuteMetaCommand(__in ID3D11DeviceContext *pDeviceContext, - __in ID3D11NvMetaCommand *pMetaCommand, - __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData, - __in NvU32 ExecutionParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EnumerateMetaCommands -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Enumerates MetaCommands supported on the system -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in/out] pNumMetaCommands Should be non-null. When the value pointed by pNumMetaCommands is 0 or when pDescs is NULL, the function returns number of metacommands supported. -//! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array. -//! \param [out] pDescs Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands. -//! Otherwise should have enough space to hold *pNumMetaCommands descriptors -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_EnumerateMetaCommands(__in ID3D12Device *pDevice, - __inout NvU32 *pNumMetaCommands, - __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions. -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in] CommandId GUID of the operations to perform -//! \param [in] NodeMask GPU mask for which metacommand is to be created. Set it to 0 for single GPU systems -//! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand -//! \param [in] CreationParametersDataSize size of parameter data structure -//! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object. -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! NVAPI_NOT_SUPPORTED - The requested Metacommand is not supported. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -#pragma pack(push, 4) -struct NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC -{ - // Persistent resource used as scratch space by driver - // it's written at time of init, and read at time of execute - // use GetRequiredParameterResourceSize to query its size - D3D12_GPU_VIRTUAL_ADDRESS PersistentResource; -}; - -struct NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS InputResource; - D3D12_GPU_VIRTUAL_ADDRESS FilterResource; - D3D12_GPU_VIRTUAL_ADDRESS BiasResource; // optional - D3D12_GPU_VIRTUAL_ADDRESS OutputResource; - - // Alpha1Resource and Alpha2Resource are used only when - // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used - // should have same dimension as bias - D3D12_GPU_VIRTUAL_ADDRESS Alpha1Resource; - D3D12_GPU_VIRTUAL_ADDRESS Alpha2Resource; - - // optional, same dimension/descriptor as output - D3D12_GPU_VIRTUAL_ADDRESS SkipConnectionResource; - - // should point to same memory that was specified at time of init - D3D12_GPU_VIRTUAL_ADDRESS PersistentResource; - - // temporary resource used as scratch space by driver - // both written and read at time of execute - // use GetRequiredParameterResourceSize to query its size - D3D12_GPU_VIRTUAL_ADDRESS TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 8); -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 72); - -struct NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC -{ - NvU64 PersistentResource; -}; - -struct NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC -{ - NvU64 AResource; - NvU64 BResource; - NvU64 CResource; - NvU64 OutputResource; - - NvU64 PersistentResource; - NvU64 TemporaryResource; -}; - -// make sure structure sizes match what the driver assumes -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC) == 8); -compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC) == 48); - - -#pragma pack(pop) - -DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D12NvMetaCommand_V1, IUnknown) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // ** ID3D12NvMetaCommand methods *** - // Return size of parameter - STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE; - - END_INTERFACE -}; - -typedef ID3D12NvMetaCommand_V1 ID3D12NvMetaCommand; -#define ID3D12NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D12NvMetaCommand_V1, 1) -#define ID3D12NvMetaCommand_VER ID3D12NvMetaCommand_VER1 - -NVAPI_INTERFACE NvAPI_D3D12_CreateMetaCommand(__in ID3D12Device *pDevice, - __in REFGUID CommandId, - __in NvU32 NodeMask, - __in_bcount(CreationParametersDataSize) const void *pCreationParametersData, - __in NvU32 CreationParametersDataSize, - __out ID3D12NvMetaCommand **ppMetaCommand); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_InitializeMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in -//! -//! \param [in] pCommandList A pointer to D3D12 command list. -//! \param [in] pMetaCommand the MetaCommand to initialize -//! \param [in] pInitializationParametersData Structure containing parameters -//! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_InitializeMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist, - __in ID3D12NvMetaCommand *pMetaCommand, - __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData, - __in NvU32 InitializationParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_ExecuteMetaCommand -// -//! \since Release: 400 -// -//! \code -//! DESCRIPTION: Executes the given MetaCommand with the parameters passed in -//! -//! \param [in] pCommandList A pointer to D3D12 command list. -//! \param [in] pMetaCommand the MetaCommand to execute -//! \param [in] pExecutionParametersData Structure containing parameters -//! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_ExecuteMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist, - __in ID3D12NvMetaCommand *pMetaCommand, - __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData, - __in NvU32 ExecutionParametersDataSize); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateCommittedResource -// -//! \since Release: 384 -// -//! \code -//! DESCRIPTION: Wrapper around ID3D12Device::CreateCommittedResource to allow creation of resources according to params provided. -//! HTEX resource is created when NV_D3D12_RESOURCE_FLAG_HTEX is set in the nvResourceFlags parameter. -//! NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM gives driver hint to create the resource on cpu visible vidmem -//! only upload resources use this flag currently, others behave exactly as ID3D12Device::CreateCommittedResource -//! Otherwise the function behaves exactly same as regular ID3D12Device::CreateCommittedResource. -//! When NV_D3D12_RESOURCE_FLAG_HTEX is set, the texels are centered on integer coordinates and filtering -//! and LOD are calculated based on the size minus one, which then allows the edges to filter to the exact texels on the edge, -//! eliminating the border/edge filtering issue. Dimension of next mip level is CEIL(currentMipDimension/2), and size of smallest mip is 2x2. -//! Note that NV_D3D12_RESOURCE_FLAG_HTEX can't be used for shared resources. -//! Best practice: Query available space in cpu visible vidmem using NvAPI_D3D12_QueryCpuVisibleVidmem -//! before using NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM -//! -//! \param [in] pDevice A pointer to D3D12 device. -//! \param [in] pHeapProperties A pointer to a D3D12_HEAP_PROPERTIES structure that provides properties for the resource's heap. -//! \param [in] HeapFlags Heap options, as a bitwise-OR'd combination of D3D12_HEAP_FLAGS enumeration constants. -//! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes the resource. -//! \param [in] InitialState The initial state of the resource, as a bitwise-OR'd combination of D3D12_RESOURCE_STATES enumeration constants. -//! \param [in] pOptimizedClearValue Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color. -//! \param [in] pNVResourceParams A pointer to a structure containing additional NV specific resource creation information (see NV_D3D12_RESOURCE_FLAGS below for more info on flags) -//! \param [in] riid The globally unique identifier (GUID) for the resource interface. -//! \param [out] ppvResource A pointer to memory that receives the requested interface pointer to the created resource object. -//! ppvResource can be NULL, to enable capability testing. When ppvResource is NULL, no object will be created and pSupported -//! will be set to true when pResourceDesc is valid. -//! \param [out] pSupported optional, needed only for capability testing when ppvResource is NULL -//! SUPPORTED OS: Windows 10 -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -typedef enum { - NV_D3D12_RESOURCE_FLAG_NONE = 0, - NV_D3D12_RESOURCE_FLAG_HTEX = 1, //!< Create HTEX texture - NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM= 2, //!< Hint to create resource in cpuvisible vidmem -} NV_D3D12_RESOURCE_FLAGS; - -typedef struct _NV_RESOURCE_PARAMS_V1 -{ - NvU32 version; //!SetFence(dstGpu, hFence, Value); \ - pMultiGPUDevice->WaitForFence(1 << (srcGpu), hFence, Value); \ - Value++; - -#define FENCE_SYNCHRONIZATION_END(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \ - pMultiGPUDevice->SetFence(srcGpu, hFence, Value); \ - pMultiGPUDevice->WaitForFence(1 << (dstGpu), hFence, Value); \ - Value++; - -//! PresentCompositingConfig method flags. -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_USE_VIDEO_BRIDGE 0x01 -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_CLEAR_OUTBANDS 0x02 -#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_GET_VIDEO_BRIDGE_STATUS 0x80000000 - -#define NVAPI_VIDEO_BRIDGE_STATUS_AVAILABLE 0 -#define NVAPI_VIDEO_BRIDGE_STATUS_NOT_AVAILABLE 1 -#define NVAPI_VIDEO_BRIDGE_STATUS_FAILED_ACCESS 2 -#define NVAPI_VIDEO_BRIDGE_STATUS_UNKNOWN 3 - -#define NVAPI_ALL_GPUS 0 -typedef ID3D11MultiGPUDevice_V1 ID3D11MultiGPUDevice; - -#define ID3D11MultiGPUDevice_VER1 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 1) -#define ID3D11MultiGPUDevice_VER2 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 2) -#define ID3D11MultiGPUDevice_VER3 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 3) -#define ID3D11MultiGPUDevice_VER ID3D11MultiGPUDevice_VER3 - -#define ALL_GPUS 0 - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D11_CreateMultiGPUDevice(__in ID3D11Device *pDevice, __in ULONG version, __out ULONG *currentVersion, __out ID3D11MultiGPUDevice **ppD3D11MultiGPUDevice, __in UINT maxGpus=ALL_GPUS); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of Single Pass Stereo HW feature -//! \ingroup dx -typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 -{ - NvU32 version; // parameter struct version - NvU32 bSinglePassStereoSupported; // Single Pass Stereo supported -} NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1; - -typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 bSinglePassStereoSupported : 1; // _OUT_ Single Pass Stereo supported - NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ Single Pass Stereo XYZW supported - NvU32 reserved : 30; // _INOUT_ bits reserved for future use -} NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2; - -typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS; -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2, 2) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 - -#ifndef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER -typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS; -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 -#endif - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QuerySinglePassStereoSupport -// -//! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pSinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QuerySinglePassStereoSupport(__in IUnknown *pDevice, - __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetSinglePassStereoMode -// -//! DESCRIPTION: Set the Single Pass Stereo state -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that Single Pass Stereo is supported or is set in hardware. -//! One must call NvAPI_D3D_QuerySinglePassStereoSupport() to confirm that the current setup -//! supports Single Pass Stereo before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] numViews Number of views to render. -//! \param [in] renderTargetIndexOffset Offset between render targets of the different views. -//! \param [in] independentViewportMaskEnable Is the independent viewport mask enabled. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetSinglePassStereoMode(__in IUnknown *pDevOrContext, __in NvU32 numViews, __in NvU32 renderTargetIndexOffset, __in NvU8 independentViewportMaskEnable); - -#endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QuerySinglePassStereoSupport -// -//! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pDevice The IDirect3DDevice12 to use. -//! \param [inout] pQuerySinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_QuerySinglePassStereoSupport(__in ID3D12Device *pDevice, - __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetSinglePassStereoMode -// -//! DESCRIPTION: Set the Single Pass Stereo state. -//! -//! \note Note that Single Pass Stereo state persists on a particular CommandList till it is closed. -//! The state is reset to default (disabled) for every newly created CommandList. -//! One must call NvAPI_D3D12_QuerySinglePassStereoSupport() to confirm that the current setup -//! supports Single Pass Stereo before calling this set-function. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Single Pass Stereo feature -//! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature. -//! \param [in] numViews Number of views to render. -//! \param [in] RenderTargetIndexOffset Offset between render targets of the different views. -//! \param [in] IndependentViewportMaskEnable Is the independent viewport mask enabled. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_SetSinglePassStereoMode(__in ID3D12GraphicsCommandList* pCommandList, - __in NvU32 numViews, - __in NvU32 renderTargetIndexOffset, - __in NvU8 independentViewportMaskEnable); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of MultiView HW feature -//! \ingroup dx - -typedef struct _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 bMultiViewSupported : 1; // _OUT_ MultiView supported (Render 4 views in a single pass) - NvU32 bSinglePassStereoSupported : 1; // _OUT_ StereoX supported (Render 2 views in a single pass) - NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ StereoXYZW supported (Render 2 views in a single pass) - NvU32 reserved : 29; // _INOUT_ bits reserved for future use -} NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 NV_QUERY_MULTIVIEW_SUPPORT_PARAMS; -#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 -#define NV_MULTIVIEW_MAX_SUPPORTED_VIEWS 4 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryMultiViewSupport -// -//! DESCRIPTION: Queries the support of MultiView feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pMultiViewSupportedParams Stores value of whether MultiView is supported on current setup or not. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryMultiViewSupport(__in IUnknown *pDevice, - __inout NV_QUERY_MULTIVIEW_SUPPORT_PARAMS *pQueryMultiViewSupportedParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used for setting the Mode for MultiView HW Feature. -//! \ingroup dx -typedef struct _NV_MULTIVIEW_PARAMS_V1 -{ - NvU32 version; // _IN_ parameter struct version - NvU32 numViews; // _IN_ Number of views to render. - NvU32 renderTargetIndexOffset[NV_MULTIVIEW_MAX_SUPPORTED_VIEWS]; // _IN_ Offset between render targets for each of the per views. - NvU8 independentViewportMaskEnable; // _IN_ Is the independent viewport mask enabled. -} NV_MULTIVIEW_PARAMS_V1; - -typedef NV_MULTIVIEW_PARAMS_V1 NV_MULTIVIEW_PARAMS; -#define NV_MULTIVIEW_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MULTIVIEW_PARAMS_V1, 1) -#define NV_MULTIVIEW_PARAMS_VER NV_MULTIVIEW_PARAMS_VER1 - -#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetMultiViewMode -// -//! DESCRIPTION: Set the MultiView state -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that MultiView is supported or is set in hardware. -//! One must call NvAPI_D3D_QueryMultiViewSupport() to confirm that the current setup -//! supports MultiView before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] pMultiViewParams MultiView Params -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetMultiViewMode(__in IUnknown *pDevOrContext, __in NV_MULTIVIEW_PARAMS *pMultiViewParams); - -#endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to query the support of Lens Matched Shading HW feature -//! \ingroup dx -typedef struct _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS -{ - NvU32 version; // parameter struct version - NvU32 bModifiedWSupported; // Modified W supported -} NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1 NV_QUERY_MODIFIED_W_SUPPORT_PARAMS; -#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryModifiedWSupport -// -//! DESCRIPTION: Queries the support of Modified W feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevice The ID3D11Device to use. -//! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified W is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryModifiedWSupport(__in IUnknown *pDev, - __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#define NV_MODIFIED_W_MAX_VIEWPORTS 16 - -typedef struct _NV_MODIFIED_W_COEFFICIENTS -{ - float fA; // A coefficient in w' = w + Ax + By - float fB; // B coefficient in w' = w + Ax + By - float fAReserved; // reserved - float fBReserved; // reserved - - float fReserved[2]; // reserved -} NV_MODIFIED_W_COEFFICIENTS; - -typedef struct _NV_MODIFIED_W_PARAMS -{ - NvU32 version; // parameter struct version - NvU32 numEntries; // number of valid NV_MODIFIED_W_COEFFICIENTS structs in array - NV_MODIFIED_W_COEFFICIENTS modifiedWCoefficients[NV_MODIFIED_W_MAX_VIEWPORTS]; // coefficients - - NvU32 id; // reserved - NvU32 reserved[NV_MODIFIED_W_MAX_VIEWPORTS]; // reserved -} NV_MODIFIED_W_PARAMS_V1; - -typedef NV_MODIFIED_W_PARAMS_V1 NV_MODIFIED_W_PARAMS; -#define NV_MODIFIED_W_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MODIFIED_W_PARAMS_V1, 1) -#define NV_MODIFIED_W_PARAMS_VER NV_MODIFIED_W_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetModifiedWMode -// -//! DESCRIPTION: Set the Modified W state and A,B coefficients for HW support -//! -//! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid. -//! Returned value NVAPI_OK does not reflect that Modified-W is supported or is set in hardware. -//! One must call NvAPI_D3D_QueryModifiedWSupport() to confirm that the current setup -//! supports Modified-W before calling this set-function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use. -//! \param [in] psModifiedWParams Modified W parameters. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetModifiedWMode(__in IUnknown *pDevOrContext, __in NV_MODIFIED_W_PARAMS *psModifiedWParams); - -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryModifiedWSupport -// -//! DESCRIPTION: Queries the support of Modified-W feature on current setup and returns appropriate boolean value. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pDevice The ID3D12Device Device created by application -//! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified-W is supported on current setup or not. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_QueryModifiedWSupport(__in ID3D12Device *pDevice, - __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -#if defined(__cplusplus) && ( defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetModifiedWMode -// -//! DESCRIPTION: Set the Modified-W state and A, B coefficients for HW support -//! -//! \note Note that Modified-W state persists on a particular CommandList till it is closed. -//! The state is reset to default (disabled) for every newly created CommandList. -//! One must call NvAPI_D3D12_QueryModifiedWSupport() to confirm that the current setup -//! supports Modified-W before calling this set-function. -//! -//! SUPPORTED OS: Windows 10 -//! -//! -//! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Modified-W feature -//! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature. -//! \param [in] pModifiedWParams Modified-W parameters. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_SetModifiedWMode(__in ID3D12GraphicsCommandList* pCommandList, - __in NV_MODIFIED_W_PARAMS *pModifiedWParams); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -//! \ingroup dx -//! See NvAPI_D3D_CreateLateLatchObject -DECLARE_INTERFACE(ID3DLateLatchObject_V1) -{ - STDMETHOD_(UINT,Release) (THIS) PURE; //! Release the created LateLatch object and associated buffers. - STDMETHOD_(NvAPI_Status,Latch) (THIS_ __in IUnknown* pContext = NULL) PURE; //! Request to queue the latch operation to the GPU. - STDMETHOD_(ID3D11Buffer*,GetD3D11Buffer) (THIS_ __in UINT index = 0) PURE; //! Get ID3D11Buffer* available at the given 'index' - STDMETHOD_(UINT,GetBufferCount) (THIS) PURE; //! Returns the number of late latch buffers created for this LateLatchObject. - STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void **ppData) PURE; //! Fully update all LateLatch buffers with new data. - STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void *pData, __in size_t offset, - __in size_t size, __in UINT index = 0) PURE; //! Partially update one of the LateLatch buffers with new data. -}; - -//! \ingroup dx -//! See NvAPI_D3D_CreateLateLatchObject -typedef ID3DLateLatchObject_V1 ID3DLateLatchObject; -#define ID3DLateLatchObject_VER1 MAKE_NVAPI_VERSION(ID3DLateLatchObject_V1, 1) -#define ID3DLateLatchObject_VER ID3DLateLatchObject_VER1 - -typedef struct _NV_D3D_LATELATCH_OBJECT_DESC_V1 -{ - NvU32 version; - NvU32 numBuffers; // _IN_ Number of LateLatch buffers that the app wants to create. - D3D11_BUFFER_DESC **ppBufferDesc; // _IN_ Description of buffers - ID3DLateLatchObject **ppD3DLateLatchObject; // _Out_ Pointer to created interface -} NV_D3D_LATELATCH_OBJECT_DESC_V1; - -typedef NV_D3D_LATELATCH_OBJECT_DESC_V1 NV_D3D_LATELATCH_OBJECT_DESC; -#define NV_D3D_LATELATCH_OBJECT_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D_LATELATCH_OBJECT_DESC_V1, 1) -#define NV_D3D_LATELATCH_OBJECT_DESC_VER NV_D3D_LATELATCH_OBJECT_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_CreateLateLatchObject -// -//! DESCRIPTION: Creates a Late Latch Object interface -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 384 -//! -//! \param [in] pDevice Current ID3D11Device. -//! \param [inout] pLateLatchObjectDesc Pointer to in/out structure for late latch object creation -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_CreateLateLatchObject(__in IUnknown *pDevice, __inout NV_D3D_LATELATCH_OBJECT_DESC* pLateLatchObjectDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - - - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D_QueryLateLatchSupport -typedef struct _NV_QUERY_LATELATCH_SUPPORT_PARAMS -{ - NvU32 version; //!< (IN) Parameter structure version - NvU32 bLateLatchSupported; //!< (OUT) LateLatch supported -} NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1 NV_QUERY_LATELATCH_SUPPORT_PARAMS; -#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QueryLateLatchSupport -// -//! DESCRIPTION: Queries the support of DX11 Late Latch feature on current setup. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 384 -//! -//! \param [in] pDevice Current ID3D11Device. -//! \param [inout] pQueryLateLatchSupportParams Stores value of whether Late Latch is supported on current setup or not. -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QueryLateLatchSupport(__in IUnknown *pDevice, - __inout NV_QUERY_LATELATCH_SUPPORT_PARAMS *pQueryLateLatchSupportParams); -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - - - -#if defined (__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_RegisterDevice -// -//! DESCRIPTION: Tells NvAPI about a D3D device. This must be called prior to using any DX1x -//! deferred-context calls. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] pDev The ID3D10Device or ID3D11Device to use. -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_RegisterDevice(__in IUnknown *pDev); - -#endif //if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)) - - - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_MultiDrawInstancedIndirect -// -//! DESCRIPTION: Extension of DrawInstancedIndirect that takes a draw count in. The effect of this function is to loop over -//! that draw count and perform the DrawInstancedIndirect operation each time, incrementing the buffer offset -//! by the supplied stride each time. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC) -//! \param [in] drawCount Do DrawInstancedIndirect operation this many times -//! \param [in] *pBuffer ID3D11Buffer that contains the command parameters -//! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters -//! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 4 * sizeof(NvU32) -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet -//! been registered (NvAPI_D3D_RegisterDevice), this error is returned. -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_MultiDrawInstancedIndirect(__in ID3D11DeviceContext *pDevContext11, - __in NvU32 drawCount, - __in ID3D11Buffer *pBuffer, - __in NvU32 alignedByteOffsetForArgs, - __in NvU32 alignedByteStrideForArgs); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - - -#if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_MultiDrawIndexedInstancedIndirect -// -//! DESCRIPTION: Extension of DrawIndexedInstancedIndirect that takes a draw count in. The effect of this function is to loop over -//! that draw count and perform the DrawIndexedInstancedIndirect operation each time, incrementing the buffer offset -//! by the supplied stride each time. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC) -//! \param [in] drawCount Do DrawIndexedInstancedIndirect operation this many times -//! \param [in] *pBuffer ID3D11Buffer that contains the command parameters -//! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters -//! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 5 * sizeof(NvU32) -//! -//! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet -//! been registered (NvAPI_D3D_RegisterDevice), this error is returned. -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_MultiDrawIndexedInstancedIndirect(__in ID3D11DeviceContext *pDevContext11, - __in NvU32 drawCount, - __in ID3D11Buffer *pBuffer, - __in NvU32 alignedByteOffsetForArgs, - __in NvU32 alignedByteStrideForArgs); - -#endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) ) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_ImplicitSLIControl -// -//! This function enables/disables the SLI rendering mode. It has to be called prior to D3D device creation. Once this function is called with DISABLE_IMPLICIT_SLI -//! parameter all subsequently created devices will be forced to run in a single gpu mode until the same function is called with ENABLE_IMPLICIT_SLI parameter. The enable -//! call will force all subsequently created devices to run in default implicit SLI mode being determined by an application profile or a global control panel SLI setting. -//! This NvAPI call is supported in all DX10+ versions of the driver. It is supported on all Windows versions. -//! -//! \retval NVAPI_OK Completed request -//! \retval NVAPI_ERROR Error occurred -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup dx -typedef enum _IMPLICIT_SLI_CONTROL -{ - DISABLE_IMPLICIT_SLI = 0, - ENABLE_IMPLICIT_SLI = 1, -} IMPLICIT_SLI_CONTROL; - -//! \ingroup dx -NVAPI_INTERFACE NvAPI_D3D_ImplicitSLIControl(__in IMPLICIT_SLI_CONTROL implicitSLIControl); - -#endif //defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) ) - -//! SUPPORTED OS: Windows 10 -//! - -#if defined (__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_UseDriverHeapPriorities -// -//! \code -//! DESCRIPTION: Sets the driver to override Microsoft's heap allocation priority values with Nvidia driver priority values. Use this once per process before allocating resources. -//! -//! \param [in] pDevice The IDirect3DDevice12 to use. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \since Release: 381 -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_UseDriverHeapPriorities(__in ID3D12Device *pDevice); - -#endif // defined (__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && ( defined(__d3d12_h__)) - - -typedef struct _NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS -{ - __in NvU32 version; //!< Structure version - __in ID3D12Device *pDevice; //!< The ID3D12Device created by application. - __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain that has companion allocations. - __in NvU32 companionBufferCount; //!< The number of ID3D12Resource pointers requested to be returned in the ppComanionResources array, which should match ID3D12Device::GetNodeCount for the complete set of companion allocations. - __inout ID3D12Resource **ppCompanionResources; //!< An array of ID3D12Resource pointers sized to match companionBufferCount, which will receive the companion allocations. -} NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1; - -typedef NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1 NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS; -#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1, 1) -#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_Mosaic_GetCompanionAllocations -// -//! DESCRIPTION: Queries the driver for internally created allocations that accompany a swap chain buffer for present-related operations. -//! Surfaces returned by this interface must be destroied at the same time that the original swap chain buffer is destroyed. -//! In general this occurs prior to a ResizeBuffers call, or when the swap chain is released. -//! Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display -//! rotation will result in failure. -//! -//! \param [inout] companionBufferCount The parameters for this function. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! \retval NVAPI_INVALID_CALL System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetCompanionAllocations(__inout NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS *params); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && ( defined(__d3d12_h__)) - -typedef struct _NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS -{ - __in NvU32 version; //!< Structure version - __in ID3D12Device *pDevice; //!< The ID3D12Device created by application. - __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain. - __inout NvU32 *pPartitionCount; //!< A variable to receive the number of NV_MGPU_MOSAIC_DISPLAY_SURFACE_PARTITION elements returned or that holds the size of pPartitions when it is non-NULL. - __inout RECT *pViewport; //!< An optional array to hold the viewport information per partition. When this is valid pNodeMask must also be valid. - __inout NvU32 *pNodeMask; //!< An optional array to hold the GPU mask where this viewport must be valid per partition. When this is valid pViewport must also be valid. -} NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1; - -typedef NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1 NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS; -#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1, 1) -#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions -// -//! DESCRIPTION: Queries the driver for how a swap chain display surface is subdivided across devices in relation to display connectivity. -//! Call this interface with NULL pPartitions in order to know how many subdivisions exist and allocate the proper size to hold all data. -//! Call it a second time with a properly sized partitions array to receive all subdivisions along with GPU node masks of each rectangle. -//! Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display -//! rotation will result in failure. -//! -//! \param [inout] params The parameters for this function. -//! -//! \retval NVAPI_OK Call succeeded. -//! \retval NVAPI_ERROR Call failed. -//! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid. -//! \retval NVAPI_INVALID_CALL System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions(__inout NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS *params); - -#endif // defined(__cplusplus) && ( defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -//! \ingroup dx -//! See NvAPI_D3D1x_GetGraphicsCapabilities - -typedef struct _NV_D3D1x_GRAPHICS_CAPS_V1 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 reservedBits : 30; // Reserved bits for future expansion - NvU32 reserved[7]; // Reserved for future expansion -} NV_D3D1x_GRAPHICS_CAPS_V1; - -#define NV_D3D1x_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V1, 1) - -typedef struct _NV_D3D1x_GRAPHICS_CAPS_V2 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 bFastUAVClearSupported : 1; //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader - NvU32 reservedBits : 29; // Reserved bits for future expansion - NvU16 majorSMVersion; //!< (OUT) Major SM version of the device - NvU16 minorSMVersion; //!< (OUT) Minor SM version of the device - NvU32 reserved[14]; // Reserved for future expansion -} NV_D3D1x_GRAPHICS_CAPS_V2; - -typedef NV_D3D1x_GRAPHICS_CAPS_V2 NV_D3D1x_GRAPHICS_CAPS; -#define NV_D3D1x_GRAPHICS_CAPS_VER2 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V2, 2) -#define NV_D3D1x_GRAPHICS_CAPS_VER NV_D3D1x_GRAPHICS_CAPS_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_GetGraphicsCapabilities -// -//! DESCRIPTION: Get the graphics capabilities for current hardware/software setup -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D11Device device to be used for getting the graphics capabilities. -//! \param [in] structVersion Version of the caps struct. Should be set to NV_D3D1x_GRAPHICS_CAPS_VER. -//! \param [inout] pGraphicsCaps Pointer to a NV_D3D1x_GRAPHICS_CAPS_CAPS struct created by app. -//! Graphics capabilities will be filled in this struct by the driver. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D1x_GetGraphicsCapabilities(__in IUnknown *pDevice, - __in NvU32 structVersion, - __inout NV_D3D1x_GRAPHICS_CAPS *pGraphicsCaps); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D12_GetGraphicsCapabilities - -typedef struct _NV_D3D12_GRAPHICS_CAPS_V1 -{ - NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not - NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not - NvU32 bFastUAVClearSupported : 1; //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader - NvU32 reservedBits : 29; // Reserved bits for future expansion - NvU16 majorSMVersion; //!< (OUT) Major SM version of the device - NvU16 minorSMVersion; //!< (OUT) Minor SM version of the device - NvU32 reserved[6]; // Reserved for future expansion -} NV_D3D12_GRAPHICS_CAPS_V1; - -typedef NV_D3D12_GRAPHICS_CAPS_V1 NV_D3D12_GRAPHICS_CAPS; -#define NV_D3D12_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_GRAPHICS_CAPS_V1, 1) -#define NV_D3D12_GRAPHICS_CAPS_VER NV_D3D12_GRAPHICS_CAPS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetGraphicsCapabilities -// -//! DESCRIPTION: Get the graphics capabilities for current hardware/software setup -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The ID3D12Device device to be used for getting the graphics capabilities. -//! \param [in] structVersion Version of the caps struct. Should be set to NV_D3D12_GRAPHICS_CAPS_VER. -//! \param [inout] pGraphicsCaps Pointer to a NV_D3D12_GRAPHICS_CAPS_CAPS struct created by app. -//! Graphics capabilities will be filled in this struct by the driver. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D12_GetGraphicsCapabilities(__in IUnknown *pDevice, - __in NvU32 structVersion, - __inout NV_D3D12_GRAPHICS_CAPS *pGraphicsCaps); - -#endif // defined(__cplusplus) && (defined(__d3d12_h__)) - - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -#define NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS 16 -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSSetExclusiveScissorRects - -typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 -{ - bool enableExclusiveScissorRect; //!< (IN) Control of enabling Exclusive ScissorRect per rect - D3D11_RECT scissorRect; //!< (IN) Single rect dimensions -} NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1; - -typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 -{ - NvU32 version; //!< (IN) Parameter struct version - NvU32 numRects; //!< (IN) Number of Exclusive Scissor Rects to be set. - // \note Passing zero will globally disable Exclusive Scissor Rects - // \note Max value can be equal to NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS - NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 *pRects; //!< (IN) Array of NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC with number of elements equal to Exclusive Scissor Rects -} NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1; - -typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC; -typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC; -#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1, 1) -#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetExclusiveScissorRects -// -//! DESCRIPTION: Sets Exclusive Scissor Rects. The content bounded within the Scissor Rects -//! will be excluded from rendering unlike regular Scissor Rects. These are -//! orthogonal with Regular Scissor Rects. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Exclusive Scissor Rects. -//! \param [in] pExclusiveScissorRectsDesc Description of the Exclusive Scissor Rects duly filled with their dimensions -//! and control over enablement of individual ScissorRect -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetExclusiveScissorRects(__in IUnknown *pContext, - __in NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC *pExclusiveScissorRectsDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSSetViewportsPixelShadingRates - -#define NV_MAX_PIXEL_SHADING_RATES 16 // Currently only 12 Shading Rates are available -#define NV_MAX_NUM_VIEWPORTS 16 - -// Every element in Shading Rate Resource represents the shading rate for all pixels in the corresponding tile -// The Shading Rate Resource dimensions must be the bound render target size divided by the tile dimensions (width/height) - -#define NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH 16 // Width of the tile, in pixels -#define NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT 16 // Height of the tile, in pixels - -typedef enum -{ - NV_PIXEL_X0_CULL_RASTER_PIXELS, // No shading, tiles are culled - NV_PIXEL_X16_PER_RASTER_PIXEL, // 16 shading passes per 1 raster pixel - NV_PIXEL_X8_PER_RASTER_PIXEL, // 8 shading passes per 1 raster pixel - NV_PIXEL_X4_PER_RASTER_PIXEL, // 4 shading passes per 1 raster pixel - NV_PIXEL_X2_PER_RASTER_PIXEL, // 2 shading passes per 1 raster pixel - NV_PIXEL_X1_PER_RASTER_PIXEL, // Per-pixel shading - NV_PIXEL_X1_PER_2X1_RASTER_PIXELS, // 1 shading pass per 2 raster pixels - NV_PIXEL_X1_PER_1X2_RASTER_PIXELS, // 1 shading pass per 2 raster pixels - NV_PIXEL_X1_PER_2X2_RASTER_PIXELS, // 1 shading pass per 4 raster pixels - NV_PIXEL_X1_PER_4X2_RASTER_PIXELS, // 1 shading pass per 8 raster pixels - NV_PIXEL_X1_PER_2X4_RASTER_PIXELS, // 1 shading pass per 8 raster pixels - NV_PIXEL_X1_PER_4X4_RASTER_PIXELS // 1 shading pass per 16 raster pixels -} NV_PIXEL_SHADING_RATE; -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 -{ - bool enableVariablePixelShadingRate; //!< (IN) Control of enabling Variable Pixel Shading Rate per viewport - NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (IN) Lookup table of converting Shading Rate Index to NV_PIXEL_SHADING_RATE - // \note Shading Rate Resource View would be populated by application with indices of this table -} NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1; - -typedef struct _NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 numViewports; //!< (IN) Number of viewports with shading rate set. - // \note Passing zero will globally disable Variable Pixel Rate Shading for all viewports immaterial of values in pViewports - // \note Max value can be equal to NV_MAX_NUM_VIEWPORTS - NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 *pViewports; //!< (IN) Array of NV_D3D11_VIEWPORT_SHADING_RATE_DESC with number of elements equal to NumViewports -} NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1; - -typedef NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORTS_SHADING_RATE_DESC; -typedef NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORT_SHADING_RATE_DESC; -#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1, 1) -#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetViewportsPixelShadingRates -// -//! DESCRIPTION: Sets Pixel Shading Rates and Enables/Disables per-viewport Variable Pixel Shading Rate feature -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Viewports Shading Rates -//! \param [in] pShadingRateDesc Shading rate descriptor -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetViewportsPixelShadingRates(__in IUnknown *pContext, - __in NV_D3D11_VIEWPORTS_SHADING_RATE_DESC *pShadingRateDesc); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -typedef enum _NV_SRRV_DIMENSION -{ - NV_SRRV_DIMENSION_TEXTURE2D = 4, - NV_SRRV_DIMENSION_TEXTURE2DARRAY = 5, -} NV_SRRV_DIMENSION; - -typedef struct _NV_TEX2D_SRRV -{ - UINT MipSlice; -} NV_TEX2D_SRRV; - -typedef struct _NV_TEX2D_ARRAY_SRRV -{ - UINT MipSlice; - UINT FirstArraySlice; - UINT ArraySize; -} NV_TEX2D_ARRAY_SRRV; -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 -{ - NvU32 version; //!< (IN) Parameter struct version - DXGI_FORMAT Format; //!< (IN) Format of the resource used as Shading Rate Surface. Should be either DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS - NV_SRRV_DIMENSION ViewDimension; //!< (IN) This declares whether the Shading Rate Surface is a simple 2D Texture or Array of 2D Textures - union - { - NV_TEX2D_SRRV Texture2D; - NV_TEX2D_ARRAY_SRRV Texture2DArray; - }; -} NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1; - -typedef NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC; -#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1, 1) -#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 - -DECLARE_INTERFACE_(__declspec(uuid("E14BE7F6-8FF5-4F5E-B63A-AD016EB8FBE5"))ID3D11NvShadingRateResourceView_V1, ID3D11View) -{ - BEGIN_INTERFACE - - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // **** ID3D11View method **/ - // Get Shading Rate Resource used while creating the Shading Rate Resource View - STDMETHOD_(void,GetResource)(THIS_ _Outptr_ ID3D11Resource **ppResource) PURE; - - // ** ID3D11NvShadingRateResourceView methods *** - // The descriptor used while creating the Shading Rate Resource View - STDMETHOD(GetDesc)(THIS_ NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC* pDesc) PURE; - - END_INTERFACE -}; - -typedef ID3D11NvShadingRateResourceView_V1 ID3D11NvShadingRateResourceView; -#define ID3D11NvShadingRateResourceView_VER1 MAKE_NVAPI_VERSION(ID3D11NvShadingRateResourceView_V1, 1) -#define ID3D11NvShadingRateResourceView_VER ID3D11NvShadingRateResourceView_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_CreateShadingRateResourceView -// -//! DESCRIPTION: Creates Shading Rate Resource View by taking ID3D11Resource as an input Shading Rate Surface. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pDevice The device to be used for creating the Shading Rate Resource View -//! \param [in] pShadingRateResource Shading Rate Resource on which the view is to be created. -//! \note This should be of format DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS -//! \note This should be confined to size calculated using render target dimensions, -//! NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH and NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT -//! \param [in] pShadingRateDesc Shading Rate Resource View descriptor -//! \param [out] ppShadingRateResourceView Address of a pointer to ID3D11NvShadingRateResourceView for returning the newly created Shading Rate Resource View -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_CreateShadingRateResourceView(__in ID3D11Device *pDevice, - __in ID3D11Resource *pShadingRateResource, - __in NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC *pShadingRateResourceViewDesc, - __out ID3D11NvShadingRateResourceView **ppShadingRateResourceView); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetShadingRateResourceView -// -//! DESCRIPTION: Sets Shading Rate Resource View -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Resource View -//! \param [out] pShadingRateResourceView Shading Rate Resource View to be set -//! \note See NvAPI_D3D11_CreateShadingRateResourceView -//! \note Passing this as null will reset Shading Rate Resource View to defaults -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetShadingRateResourceView(__in IUnknown *pContext, - __in ID3D11NvShadingRateResourceView *pShadingRateResourceView); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) -//! \ingroup dx -//! See NvAPI_D3D11_RSGetPixelShadingRateSampleOrder -//! See NvAPI_D3D11_RSSetPixelShadingRateSampleOrder - -// X, Y = sample position. S = sample number. -// The inner-most dimension is the sample number, followed by X and Y. - -typedef struct _NV_PIXEL_SRSO_1x2 -{ - struct NV_PIXEL_SRSO_1x2_X1 { NvU8 Y[2]; } X1; - struct NV_PIXEL_SRSO_1x2_X2 { NvU8 YS[2][2]; } X2; - struct NV_PIXEL_SRSO_1x2_X4 { NvU8 YS[2][4]; } X4; - struct NV_PIXEL_SRSO_1x2_X8 { NvU8 YS[2][8]; } X8; -} NV_PIXEL_SRSO_1x2; - -typedef struct _NV_PIXEL_SRSO_2x1 -{ - struct NV_PIXEL_SRSO_2x1_X1 { NvU8 X[2]; } X1; - struct NV_PIXEL_SRSO_2x1_X2 { NvU8 XS[2][2]; } X2; - struct NV_PIXEL_SRSO_2x1_X4 { NvU8 XS[2][4]; } X4; -} NV_PIXEL_SRSO_2x1; - -typedef struct _NV_PIXEL_SRSO_2x2 -{ - struct NV_PIXEL_SRSO_2x2_X1 { NvU8 YX[2][2]; } X1; - struct NV_PIXEL_SRSO_2x2_X2 { NvU8 YXS[2][2][2]; } X2; - struct NV_PIXEL_SRSO_2x2_X4 { NvU8 YXS[2][2][4]; } X4; -} NV_PIXEL_SRSO_2x2; - -typedef struct _NV_PIXEL_SRSO_2x4 -{ - struct NV_PIXEL_SRSO_2x4_X1 { NvU8 YX[4][2]; } X1; - struct NV_PIXEL_SRSO_2x4_X2 { NvU8 YXS[4][2][2]; } X2; -} NV_PIXEL_SRSO_2x4; - -typedef struct _NV_PIXEL_SRSO_4x2 -{ - struct NV_PIXEL_SRSO_4x2_X1 { NvU8 YX[2][4]; } X1; -} NV_PIXEL_SRSO_4x2; - -typedef struct _NV_PIXEL_SRSO_4x4 -{ - struct NV_PIXEL_SRSO_4x4_X1 { NvU8 YX[4][4]; } X1; -} NV_PIXEL_SRSO_4x4; - -typedef struct _NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 -{ - NvU32 version; - NV_PIXEL_SRSO_1x2 Pixel_1x2; - NV_PIXEL_SRSO_2x1 Pixel_2x1; - NV_PIXEL_SRSO_2x2 Pixel_2x2; - NV_PIXEL_SRSO_2x4 Pixel_2x4; - NV_PIXEL_SRSO_4x2 Pixel_4x2; - NV_PIXEL_SRSO_4x4 Pixel_4x4; -} NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1; - -typedef NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE; -#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 MAKE_NVAPI_VERSION(NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1, 1) -#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 - -#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSGetPixelShadingRateSampleOrder -// -//! DESCRIPTION: Get the Sample Order for Variable Shading Rate -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for getting the Shading Rate Sample Order -//! \param [out] pSampleOrderTable A pointer to NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE where the current Sample Order for Variable Pixel Rate Shading that is returned -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSGetPixelShadingRateSampleOrder(__in IUnknown *pContext, - __out NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -#if defined(__cplusplus) && (defined(__d3d11_h__)) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D11_RSSetPixelShadingRateSampleOrder -// -//! DESCRIPTION: Set the Sample Order for Variable Shading Rate -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 410 -//! -//! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Sample Order -//! \param [out] pSampleOrderTable Sample Order for Variable Shading Rate to be set -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D11_RSSetPixelShadingRateSampleOrder(__in IUnknown *pContext, - __in NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -typedef struct _NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use -} NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1; - -typedef NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 NV_VRS_HELPER_LATCH_GAZE_PARAMS; -#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1, 1) -#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 - -typedef enum _NV_VRS_CONTENT_TYPE -{ - NV_VRS_CONTENT_TYPE_INVALID = 0x0, - NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING = 0x1, - NV_VRS_CONTENT_TYPE_MAX = NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING -} NV_VRS_CONTENT_TYPE; - -typedef enum _NV_FOVEATED_RENDERING_SHADING_RATE_PRESET -{ - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_INVALID = 0, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_PERFORMANCE = 1, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_PERFORMANCE = 2, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_BALANCED = 3, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_QUALITY = 4, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_QUALITY = 5, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM = 6, - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_MAX = NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM -} NV_FOVEATED_RENDERING_SHADING_RATE_PRESET; - -typedef struct _NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 -{ - NvU32 version; - - NV_PIXEL_SHADING_RATE InnerMostRegionShadingRate; //!< (IN) Shading Rate for the inner-most region of the foveated rendering pattern - NV_PIXEL_SHADING_RATE MiddleRegionShadingRate; //!< (IN) Shading Rate for the middle region of the foveated rendering pattern - NV_PIXEL_SHADING_RATE PeripheralRegionShadingRate; //!< (IN) Shading Rate for the peripheral region of the foveated rendering pattern -} NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1; - -typedef NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC; -#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 - -typedef enum _NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET -{ - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_INVALID = 0, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_WIDE = 1, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_BALANCED = 2, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_NARROW = 3, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM = 4, - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_MAX = NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM -} NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET; - -typedef struct _NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 -{ - NvU32 version; - - float fInnermostRadii[2]; //!< (IN) Horizontal and vertical radius for the inner-most region of the foveated rendering pattern - float fMiddleRadii[2]; //!< (IN) Horizontal and vertical radius for the middle region of the foveated rendering pattern - float fPeripheralRadii[2]; //!< (IN) Horizontal and vertical radius for the peripheral region of the foveated rendering pattern -} NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1; - -typedef NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC; -#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 - -typedef struct _NV_FOVEATED_RENDERING_DESC_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NV_FOVEATED_RENDERING_SHADING_RATE_PRESET ShadingRatePreset; //!< (IN) Preset of the shading rate - NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 ShadingRateCustomPresetDesc; //!< (IN) To be provided only if ShadingRatePreset is NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM - - NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET FoveationPatternPreset; //!< (IN) Preset of the foveation pattern - NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 FoveationPatternCustomPresetDesc; //!< (IN) To be provided only if FoveationPatternPreset is NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - -} NV_FOVEATED_RENDERING_DESC_V1; - -typedef NV_FOVEATED_RENDERING_DESC_V1 NV_FOVEATED_RENDERING_DESC; -#define NV_FOVEATED_RENDERING_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_DESC_V1, 1) -#define NV_FOVEATED_RENDERING_DESC_VER NV_FOVEATED_RENDERING_DESC_VER1 - -typedef enum _NV_VRS_RENDER_MODE -{ - NV_VRS_RENDER_MODE_INVALID = 0, - NV_VRS_RENDER_MODE_MONO = 1, // States mono rendering on the entire render target - NV_VRS_RENDER_MODE_LEFT_EYE = 2, // States Left eye rendering of a stereo pair on the entire render target - NV_VRS_RENDER_MODE_RIGHT_EYE = 3, // States Right eye rendering of a stereo pair on the entire render target - NV_VRS_RENDER_MODE_STEREO = 4, // States side-by-side stereo rendering on the render target - NV_VRS_RENDER_MODE_MAX = NV_VRS_RENDER_MODE_STEREO -} NV_VRS_RENDER_MODE; - -#define MAX_NUMBER_OF_GAZE_DATA_PROVIDERS 8 // Maximum number of gaze data providers / devices. - -typedef struct _NV_VRS_HELPER_ENABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NV_VRS_RENDER_MODE RenderMode; //!< (IN) This defines whether subsequent render calls are for mono/stereo - NV_VRS_CONTENT_TYPE ContentType; //!< (IN) This defines the type of content with which the VRS pattern will be generated - - NV_FOVEATED_RENDERING_DESC_V1 sFoveatedRenderingDesc; //!< (IN) Provide this if ContentType has NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING flag -} NV_VRS_HELPER_ENABLE_PARAMS_V1; - -typedef NV_VRS_HELPER_ENABLE_PARAMS_V1 NV_VRS_HELPER_ENABLE_PARAMS; -#define NV_VRS_HELPER_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_ENABLE_PARAMS_V1, 1) -#define NV_VRS_HELPER_ENABLE_PARAMS_VER NV_VRS_HELPER_ENABLE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_DISABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 reserved; //!< (IN) Reserved for future use -} NV_VRS_HELPER_DISABLE_PARAMS_V1; - -typedef NV_VRS_HELPER_DISABLE_PARAMS_V1 NV_VRS_HELPER_DISABLE_PARAMS; -#define NV_VRS_HELPER_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_DISABLE_PARAMS_V1, 1) -#define NV_VRS_HELPER_DISABLE_PARAMS_VER NV_VRS_HELPER_DISABLE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - IUnknown **ppShadingRateResource; //!< (OUT) Pointer to 2D Texture resource with currently applied shading rate pattern - NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (OUT) Shading Rate Table filled by the driver -} NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1; - -typedef NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS; -#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1, 1) -#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 - -typedef struct _NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 reserved; //!< (IN) Reserved for future use -} NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1; - -typedef NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS; -#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1, 1) -#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 - -DECLARE_INTERFACE(ID3DNvVRSHelper_V1) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Latches the latest gaze which will be used for subsequent foveated rendering. Recommended to be called once per frame before scene drawing begins. - STDMETHOD_(NvAPI_Status,LatchGaze)(THIS_ IUnknown* pContext, NV_VRS_HELPER_LATCH_GAZE_PARAMS* pLatchGazeParams) PURE; - - // Enables VRS with sepcified content type and preset. This can be called per draw call. - STDMETHOD_(NvAPI_Status,Enable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_ENABLE_PARAMS* pEnableParams) PURE; - - // Disables VRS till re-enabled. - STDMETHOD_(NvAPI_Status,Disable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_DISABLE_PARAMS* pDisableParams) PURE; - - // Creates a 2D texture, copies the current shading rate pattern on it and returns the pointer to this texture. - // It also returns an array that conveys which value in the shading rate resource corresponds to which exact pixel shading rate. - STDMETHOD_(NvAPI_Status,GetShadingRateResource)(THIS_ IUnknown* pContext, NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS *pGetShadingRateResourceParams) PURE; - - // Destroys all internally created shading rate resources and views. - STDMETHOD_(NvAPI_Status,PurgeInternalShadingRateResources)(THIS_ IUnknown* pContext, NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS* pPurgeParams) PURE; - - END_INTERFACE -}; - -typedef ID3DNvVRSHelper_V1 ID3DNvVRSHelper; -#define ID3DNvVRSHelper_VER1 MAKE_NVAPI_VERSION(ID3DNvVRSHelper_V1, 1) -#define ID3DNvVRSHelper_VER ID3DNvVRSHelper_VER1 - -typedef struct _NV_VRS_HELPER_INIT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - ID3DNvVRSHelper_V1 **ppVRSHelper; //!< (OUT) Interface for Shading Rate Pattern Tracker -} NV_VRS_HELPER_INIT_PARAMS_V1; - -typedef NV_VRS_HELPER_INIT_PARAMS_V1 NV_VRS_HELPER_INIT_PARAMS; -#define NV_VRS_HELPER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_INIT_PARAMS_V1, 1) -#define NV_VRS_HELPER_INIT_PARAMS_VER NV_VRS_HELPER_INIT_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeVRSHelper -// -//! DESCRIPTION: Creates an interface for updating, enabling and disabling internally tracked shading rate pattern for Variable Rate Shading -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 430 -//! -//! \param [in] pDevice The device to be used for creating the VRS Handler interface -//! \note This should be same the device used for Gaze Handler. See also: NvAPI_D3D_InitializeNvGazeHandler. -//! \param [in] pInitializeVRSHelperParams Descriptor for VRS Helper initialization -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_InitializeVRSHelper(__in IUnknown *pDevice, - __inout NV_VRS_HELPER_INIT_PARAMS *pInitializeVRSHelperParams); - -typedef enum _NV_GAZE_DATA_VALIDITY_FLAGS -{ - NV_GAZE_ORIGIN_VALID = 0x1, - NV_GAZE_DIRECTION_VALID = 0x2, - NV_GAZE_LOCATION_VALID = 0x4, - NV_GAZE_VELOCITY_VALID = 0x8, - NV_GAZE_PUPIL_DIAMETER_VALID = 0x10, - NV_GAZE_EYE_OPENNESS_VALID = 0x20, - NV_GAZE_EYE_SACCADE_DATA_VALID = 0x40 -} NV_GAZE_DATA_VALIDITY_FLAGS; - -typedef struct _NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE -{ - NvU32 version; //!< (IN) Version of the structure - - NvU32 GazeDataValidityFlags; //!< (IN) To be populated with OR'ing flags from NV_GAZE_DATA_VALIDITY_FLAGS - - float fGazeOrigin_mm[3]; //!< (IN) Use flag NV_GAZE_ORIGIN_VALID. Origin of the eye in millimeters. Used mainly to detect whether Left Eye or Right Eye. - float fGazeDirection[3]; //!< (IN) Use flag NV_GAZE_DIRECTION_VALID. Normalized direction of the gaze of the eye. Used for calculating the gaze location using the FOV. - float fGazeNormalizedLocation[2]; //!< (IN) Use flag NV_GAZE_LOCATION_VALID. Precalculated normalized gaze location in limits (-1 to +1) for X and Y. Center of the screen denotes (0, 0). If this is valid, this will be given higher priority than direction. - float fGazeVelocity[2]; //!< (IN) Use flag NV_GAZE_VELOCITY_VALID. Optional: Velocity of the eye on the normalized space in each direction. Central foveated region would be skewed in the direction of the velocity. - float fPupilDiameter_mm; //!< (IN) Use flag NV_GAZE_PUPIL_DIAMETER_VALID. Unused at the moment. - float fEyeOpenness; //!< (IN) Use flag NV_GAZE_EYE_OPENNESS_VALID. Unused at the moment. - BOOL bInSaccade; //!< (IN) Use flag NV_GAZE_EYE_SACCADE_DATA_VALID. Denotes whether eye is currently in saccade movement or not. -} NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1; - -typedef NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE; -#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1, 1) -#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 - -typedef struct _NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS -{ - NvU32 version; //!< (IN) Struct version - NvU32 flags; //!< (IN) Reserved for future use - - NvU64 Timestamp; //!< (IN) Timestamp at which the gaze data has been captured. Should be larger than timestamp provided at previous update. - union - { - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sMonoData; //!< (IN) Gaze data for Mono rendering mode - struct - { - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sLeftEye; //!< (IN) Gaze data for Left Eye of Stereo rendering mode - NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sRightEye; //!< (IN) Gaze data for Right Eye of Stereo rendering mode - } sStereoData; - }; -} NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1; - -typedef NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1 NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS; -#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1, 1) -#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 - - -DECLARE_INTERFACE(ID3DNvGazeHandler_V2) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Updates the gaze data for foveated rendering - STDMETHOD_(NvAPI_Status,UpdateGazeData)(THIS_ IUnknown* pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS* pUpdateGazeDataParams) PURE; - - - END_INTERFACE -}; -typedef ID3DNvGazeHandler_V2 ID3DNvGazeHandler; -#define ID3DNvGazeHandler_VER2 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V2, 2) -#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER2 - -DECLARE_INTERFACE(ID3DNvGazeHandler_V1) -{ - BEGIN_INTERFACE - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // Updates the gaze data for foveated rendering - STDMETHOD_(NvAPI_Status,UpdateGazeData)(THIS_ IUnknown* pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS* pUpdateGazeDataParams) PURE; - - END_INTERFACE -}; -#define ID3DNvGazeHandler_VER1 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V1, 1) -#ifndef ID3DNvGazeHandler_VER -typedef ID3DNvGazeHandler_V1 ID3DNvGazeHandler; -#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER1 -#endif - -typedef enum _NV_GAZE_DATA_TYPE -{ - NV_GAZE_DATA_INVALID = 0, - NV_GAZE_DATA_MONO = 1, - NV_GAZE_DATA_STEREO = 2, - NV_GAZE_DATA_MAX = NV_GAZE_DATA_STEREO -} NV_GAZE_DATA_TYPE; - -typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V2 -{ - NvU32 version; //!< (IN) Struct version - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - - NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo - NvU32 flags; //!< (IN) Reserved for future use - float fHorizontalFOV; //!< (IN) Horizontal Field of View - float fVericalFOV; //!< (IN) Vertical Field of View - - ID3DNvGazeHandler_V2 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler -} NV_GAZE_HANDLER_INIT_PARAMS_V2; - -typedef NV_GAZE_HANDLER_INIT_PARAMS_V2 NV_GAZE_HANDLER_INIT_PARAMS; -#define NV_GAZE_HANDLER_INIT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V2, 2) -#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER2 - -typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Struct version - - NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking. - // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1) - - NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo - NvU32 flags; //!< (IN) Reserved for future use - float fHorizontalFOV; //!< (IN) Horizontal Field of View - float fVericalFOV; //!< (IN) Vertical Field of View - - ID3DNvGazeHandler_V1 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler -} NV_GAZE_HANDLER_INIT_PARAMS_V1; - -#define NV_GAZE_HANDLER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V1, 1) -#ifndef NV_GAZE_HANDLER_INIT_PARAMS_VER -typedef NV_GAZE_HANDLER_INIT_PARAMS_V1 NV_GAZE_HANDLER_INIT_PARAMS; -#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER1 -#endif - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! - -#if defined(__cplusplus) && (defined(__d3d11_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeNvGazeHandler -// -//! DESCRIPTION: Creates an interface for updating and managing gaze data -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 430 -//! -//! \param [in] pDevice The device to be used for creating the Gaze Handler interface -//! \note This should be same as the device used with VRS Handler. See also: NvAPI_D3D_InitializeVRSHelper. -//! \param [in] pInitializeNvGazeHandlerParams Descriptor for Gaze Data Handler initialization -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! (none) -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// - -NVAPI_INTERFACE NvAPI_D3D_InitializeNvGazeHandler(__in IUnknown *pDevice, - __inout NV_GAZE_HANDLER_INIT_PARAMS *pInitializeNvGazeHandlerParams); - -#endif // defined(__cplusplus) && (defined(__d3d11_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && defined(__d3d11_h__) - -//! \ingroup dx - -typedef enum NV_SMP_ASSIST_TYPE -{ - NV_SMP_ASSIST_NONE = 0, - NV_SMP_ASSIST_MRS = 1, // SMP Assist required for Multi-Res Shading - NV_SMP_ASSIST_LMS = 2, // SMP Assist required for Lens Matched Shading - NV_SMP_ASSIST_NUM_TYPES -} NV_SMP_ASSIST_TYPE; - -typedef enum NV_SMP_ASSIST_LEVEL -{ - NV_SMP_ASSIST_LEVEL_FULL = 0, // Full assistance. App selects a pre-baked MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS - NV_SMP_ASSIST_LEVEL_PARTIAL = 1, // Partial assistance. App provides a custom MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS - NV_SMP_ASSIST_LEVEL_MINIMAL = 2, // Minimal assistance. App provides viewports and scissors. App sets FastGS as required. App sets LMS params as required (NvAPI_D3D_SetModifiedWMode). App provides SMPType as NONE. Driver handles correct setting of viewports and scissors. - NV_SMP_ASSIST_NUM_LEVELS -} NV_SMP_ASSIST_LEVEL; - -typedef enum NV_MRS_CONFIG -{ - NV_MRS_CONFIG_BALANCED = 0, - NV_MRS_CONFIG_AGGRESSIVE = 1, - NV_MRS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 2, - NV_MRS_CONFIG_OCULUSRIFT_CV1_BALANCED = 3, - NV_MRS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 4, - NV_MRS_CONFIG_HTC_VIVE_CONSERVATIVE = 5, - NV_MRS_CONFIG_HTC_VIVE_BALANCED = 6, - NV_MRS_CONFIG_HTC_VIVE_AGGRESSIVE = 7, - NV_MRS_NUM_CONFIGS -} NV_MRS_CONFIG; - -typedef enum NV_LMS_CONFIG -{ - NV_LMS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 0, - NV_LMS_CONFIG_OCULUSRIFT_CV1_BALANCED = 1, - NV_LMS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 2, - NV_LMS_CONFIG_HTC_VIVE_CONSERVATIVE = 3, - NV_LMS_CONFIG_HTC_VIVE_BALANCED = 4, - NV_LMS_CONFIG_HTC_VIVE_AGGRESSIVE = 5, - NV_LMS_NUM_CONFIGS -} NV_LMS_CONFIG; - -#define NV_SMP_ASSIST_FLAGS_DEFAULT 0x00000000 - -#define NV_SMP_ASSIST_MAX_VIEWPORTS 16 - -typedef struct _NV_MRS_CUSTOM_CONFIG_V1 -{ - float centerWidth; //!< (IN) Size of the central viewport, ranging (0,1], where 1 is full original viewport size - float centerHeight; - float centerX; //!< (IN) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen - float centerY; - float densityScaleX[3]; //!< (IN) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density) - float densityScaleY[3]; -} NV_MRS_CUSTOM_CONFIG_V1; - -typedef NV_MRS_CUSTOM_CONFIG_V1 NV_MRS_CUSTOM_CONFIG; - -typedef struct _NV_MRS_INSTANCED_STEREO_CONFIG_V1 -{ //!< (OUT) MRS Instanced stereo config returned by the SMP Assist GetConstants API - float centerWidth[2]; //!< (OUT) Size of the central viewport, ranging (0,1], where 1 is full original viewport size - float centerHeight; - float centerX[2]; //!< (OUT) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen - float centerY; - float densityScaleX[5]; //!< (OUT) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density) - float densityScaleY[3]; -} NV_MRS_INSTANCED_STEREO_CONFIG_V1; - -typedef NV_MRS_INSTANCED_STEREO_CONFIG_V1 NV_MRS_INSTANCED_STEREO_CONFIG; - -typedef struct _NV_LMS_CUSTOM_CONFIG_V1 -{ - float warpLeft; //!< (IN) LMS params to control warping of the 2 left quadrants - float warpRight; //!< (IN) LMS params to control warping of the 2 right quadrants - float warpUp; //!< (IN) LMS params to control warping of the 2 upper quadrants - float warpDown; //!< (IN) LMS params to control warping of the 2 lower quadrants - - float relativeSizeLeft; //!< (IN) LMS params to control the width of the 2 left quandrants relative to the bounding box width - float relativeSizeRight; //!< (IN) LMS params to control the width of the 2 right quandrants relative to the bounding box width - float relativeSizeUp; //!< (IN) LMS params to control the height of the 2 upper quandrants relative to the bounding box height - float relativeSizeDown; //!< (IN) LMS params to control the height of the 2 lower quandrants relative to the bounding box height -} NV_LMS_CUSTOM_CONFIG_V1; - -typedef NV_LMS_CUSTOM_CONFIG_V1 NV_LMS_CUSTOM_CONFIG; - -typedef struct _NV_LMS_INSTANCED_STEREO_CONFIG_V1 -{ //!< (OUT) LMS Instanced stereo config returned by the SMP Assist GetConstants API - NV_LMS_CUSTOM_CONFIG_V1 sLeftConfig; //!< (OUT) LMS config for the Left eye view - NV_LMS_CUSTOM_CONFIG_V1 sRightConfig; //!< (OUT) LMS config for the Right eye view -} NV_LMS_INSTANCED_STEREO_CONFIG_V1; - -typedef NV_LMS_INSTANCED_STEREO_CONFIG_V1 NV_LMS_INSTANCED_STEREO_CONFIG; - -typedef enum _NV_SMP_ASSIST_EYE_INDEX -{ - NV_SMP_ASSIST_EYE_INDEX_MONO = 0, // Non-stereo rendering - NV_SMP_ASSIST_EYE_INDEX_LEFT_EYE = 1, // Stereo - Rendering left eye - NV_SMP_ASSIST_EYE_INDEX_RIGHT_EYE = 2, // Stereo - Rendering right eye - NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO = 3, // Stereo - Rendering both eyes -} NV_SMP_ASSIST_EYE_INDEX; - -#define NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES 4 - -typedef struct _NV_CUSTOM_RECTS_V1 -{ - NvU32 numViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; - D3D11_VIEWPORT *pViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; //!< (IN) Viewports, for each eye index, that should be set when app calls Enable(eyeIndex) - D3D11_RECT *pScissors[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; //!< (IN) Scissors, for each eye index, that should be set when app calls Enable(eyeIndex) -} NV_CUSTOM_RECTS_V1; - -typedef NV_CUSTOM_RECTS_V1 NV_CUSTOM_RECTS; - -typedef struct _NV_SMP_ASSIST_ENABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Rendering mode for upcoming draw calls (Mono/Stereo-Left/Stereo-Right/Instanced Stereo) -} NV_SMP_ASSIST_ENABLE_PARAMS_V1; - -typedef NV_SMP_ASSIST_ENABLE_PARAMS_V1 NV_SMP_ASSIST_ENABLE_PARAMS; -#define NV_SMP_ASSIST_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_ENABLE_PARAMS_V1, 1) -#define NV_SMP_ASSIST_ENABLE_PARAMS_VER NV_SMP_ASSIST_ENABLE_PARAMS_VER1 - -typedef struct _NV_SMP_ASSIST_DISABLE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NvU32 Reserved; //!< (IN) Unused. -} NV_SMP_ASSIST_DISABLE_PARAMS_V1; - -typedef NV_SMP_ASSIST_DISABLE_PARAMS_V1 NV_SMP_ASSIST_DISABLE_PARAMS; -#define NV_SMP_ASSIST_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_DISABLE_PARAMS_V1, 1) -#define NV_SMP_ASSIST_DISABLE_PARAMS_VER NV_SMP_ASSIST_DISABLE_PARAMS_VER1 - -// FastGS constant buffer data returned by the GetConstants API. -// Refer VRWorks SDK's multiprojection_dx app (struct FastGSCBData) -typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_V1 -{ - float NDCSplitsX[2]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading/ Lens Matched Shading - float NDCSplitsY[2]; -} NV_SMP_ASSIST_FASTGSCBDATA_V1; - -typedef NV_SMP_ASSIST_FASTGSCBDATA_V1 NV_SMP_ASSIST_FASTGSCBDATA; - -typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 -{ - float NDCSplitsX[4]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading (Instanced stereo). 2 splits for left eye followed by 2 splits for right eye - float NDCSplitsY[2]; -} NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1; - -typedef NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO; - -// Constant buffer data to supply the UV-remapping helper functions -// Refer VRWorks SDK's multiprojection_dx app (struct RemapCBData) -typedef struct _NV_SMP_ASSIST_REMAPCBDATA_V1 -{ - //!< (OUT) Constant buffer data to supply the UV-remapping helper functions - float ClipToWindowSplitsX[2]; - float ClipToWindowSplitsY[2]; - float ClipToWindowX[3][2]; // ClipToWindowX[i][0] is Scale and ClipToWindowX[i][1] is Bias - float ClipToWindowY[3][2]; // ClipToWindowY[i][0] is Scale and ClipToWindowY[i][1] is Bias - float ClipToWindowZ[2]; // ClipToWindowZ[0] is Scale and ClipToWindowZ[1] is Bias - - float WindowToClipSplitsX[2]; - float WindowToClipSplitsY[2]; - float WindowToClipX[3][2]; // WindowToClipX[i][0] is Scale and WindowToClipX[i][1] is Bias - float WindowToClipY[3][2]; // WindowToClipY[i][0] is Scale and WindowToClipY[i][1] is Bias - float WindowToClipZ[2]; // WindowToClipZ[0] is Scale and WindowToClipZ[1] is Bias - - float BoundingRectOriginX; - float BoundingRectOriginY; - float BoundingRectSizeWidth; - float BoundingRectSizeHeight; - float BoundingRectSizeInvWidth; - float BoundingRectSizeInvHeight; - - float Padding[2]; -}NV_SMP_ASSIST_REMAPCBDATA_V1; - -typedef NV_SMP_ASSIST_REMAPCBDATA_V1 NV_SMP_ASSIST_REMAPCBDATA; - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_GET_CONSTANTS_V3 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Viewports/scissors/constant buffer data corresponding to the input eEyeIndex will be returned - NvU32 numViewports; //!< (OUT) Number of valid viewport entries - D3D11_VIEWPORT *pViewports; //!< (OUT) If not NULL, this will contain the viewports computed by driver based on init params - D3D11_RECT *pScissors; //!< (OUT) If not NULL, this will contain the scissors computed by the driver based on init params - - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (OUT) SMP type provided in Init call - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (OUT) SMP Assist level provided in Init call - - union - { - NV_MRS_CUSTOM_CONFIG_V1 sMRSConfig; //!< (OUT) If eSMPAssistType is MRS, then MRS config will be populated - NV_LMS_CUSTOM_CONFIG_V1 sLMSConfig; //!< (OUT) If eSMPAssistType is LMS, then LMS config will be populated - }; - - float projectionSizeWidth; //!< (OUT) MRS/LMS projection size - float projectionSizeHeight; //!< (OUT) - - NV_SMP_ASSIST_FASTGSCBDATA_V1 *pFastGSCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the FastGS for culling primitives per-viewport - NV_SMP_ASSIST_REMAPCBDATA_V1 *pRemapCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the UV-remapping helper functions - - D3D11_VIEWPORT boundingViewport; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual viewports populated in pViewports - D3D11_RECT boundingScissor; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual scissor rects populated in pScissors - - union - { - NV_MRS_INSTANCED_STEREO_CONFIG_V1 sMRS_ISConfig; //!< (OUT) If eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo config will be populated - NV_LMS_INSTANCED_STEREO_CONFIG_V1 sLMS_ISConfig; //!< (OUT) If eSMPAssistType is LMS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then LMS Instanced stereo config will be populated - }; - - NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 *pFastGSCBDataMRS_IS; //!< (OUT) If non-NULL and eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo FastGS constant buffer data will be populated -} NV_SMP_ASSIST_GET_CONSTANTS_V3; - -#define NV_SMP_ASSIST_GET_CONSTANTS_VER3 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_GET_CONSTANTS_V3, 3) -typedef NV_SMP_ASSIST_GET_CONSTANTS_V3 NV_SMP_ASSIST_GET_CONSTANTS; -#define NV_SMP_ASSIST_GET_CONSTANTS_VER NV_SMP_ASSIST_GET_CONSTANTS_VER3 - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_SETUP_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - union - { - NV_MRS_CONFIG eMRSConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Full then provide MRS config enum - NV_LMS_CONFIG eLMSConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Full then provide LMS config enum - NV_MRS_CUSTOM_CONFIG_V1 sMRSCustomConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Partial, then provide MRS config - NV_LMS_CUSTOM_CONFIG_V1 sLMSCustomConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Partial, then provide LMS config - NV_CUSTOM_RECTS_V1 sCustomRects; //!< (IN) If SMP Assist Level is Minimal, provide custom viewports and scissor rects for each eye index. - }; - - float resolutionScale; //!< (IN) A resolution multiplier in the range [0.1, 3.0] if app wants to render at higher resolution - D3D11_VIEWPORT boundingBox; //!< (IN) Rect on the rendertarget, to place the projection - float vpOffsets[2]; //!< (IN) Default set to 0. If non-zero, MRS/LMS viewports' TopLeftX and TopLeftY will be - //!< offset by vpOffsets[0] and vpOffsets[1] respectively. -} NV_SMP_ASSIST_SETUP_PARAMS_V1; - -typedef NV_SMP_ASSIST_SETUP_PARAMS_V1 NV_SMP_ASSIST_SETUP_PARAMS; -#define NV_SMP_ASSIST_SETUP_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_SETUP_PARAMS_V1, 1) -#define NV_SMP_ASSIST_SETUP_PARAMS_VER NV_SMP_ASSIST_SETUP_PARAMS_VER1 - -typedef struct _NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; // Patch instanced stereo shaders (created with packed eye index) with this SMPAssistType (NV_SMP_ASSIST_LMS only) - float leftCoeffs[4]; // Left eye: outpos.x = dotproduct(outputpos, leftCoeffs) + leftConst - float leftConst; - float rightCoeffs[4]; // Right eye: outpos.x = dotproduct(outputpos, rightCoeffs) + rightConst - float rightConst; -} NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1; - -typedef NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS; -#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1, 1) -#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! - -DECLARE_INTERFACE(ID3DNvSMPAssist_V1) -{ -////////////////////////////// VER1 methods ////////////////////////////////////////// - // Disable SMP Assist for further Draw calls - STDMETHOD_(NvAPI_Status,Disable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_DISABLE_PARAMS *psSMPAssistDisableParams) PURE; - - // Enable SMP Assist for further Draw calls. App has to provide the type of rendering done in upcoming Draw calls - Mono/Left eye/Right eye/Instanced Stereo - STDMETHOD_(NvAPI_Status,Enable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_ENABLE_PARAMS *psSMPAssistEnableParams) PURE; - - // Get the constants used by the drivers - STDMETHOD_(NvAPI_Status,GetConstants)(THIS_ __inout NV_SMP_ASSIST_GET_CONSTANTS *psSMPAssistGetConstants) PURE; - - // Setup the projections (rects, constant buffer data etc.) - STDMETHOD_(NvAPI_Status,SetupProjections)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_SETUP_PARAMS *psSMPAssistSetupParams) PURE; - - // Update instanced stereo specific data - STDMETHOD_(NvAPI_Status,UpdateInstancedStereoData)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS *psSMPAssistInstancedStereoParams) PURE; -////////////////////////////// end of VER1 methods ////////////////////////////////////////// -}; - -typedef ID3DNvSMPAssist_V1 ID3DNvSMPAssist; -#define ID3DNVSMPASSIST_VER1 MAKE_NVAPI_VERSION(ID3DNvSMPAssist_V1, 1) -#define ID3DNVSMPASSIST_VER ID3DNVSMPASSIST_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! - -typedef struct _NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal - NvU32 flags; //!< (IN) Flags, if any - - ID3DNvSMPAssist **ppD3DNvSMPAssist; //!< (OUT) Interface pointer returned by the Init call. Use for future Enable/Disable etc. calls - -} NV_SMP_ASSIST_INITIALIZE_PARAMS_V1; - -#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_INITIALIZE_PARAMS_V1, 1) -#ifndef NV_SMP_ASSIST_INITIALIZE_PARAMS_VER -typedef NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 NV_SMP_ASSIST_INITIALIZE_PARAMS; -#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_InitializeSMPAssist -// -//! DESCRIPTION: Initialize SMP Assist extension. Take the SMPAssist(MRS/LMS) params from the application. -//! Provide the application with a interface pointer for future use. -//! -//! \since Release: 396 -//! \param [in] pDevice Pointer to IUnknown (Currently supports ID3D11Device) -//! \param [inout] pSMPAssistInitParams SMP Assist initialization params -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_OK Call succeeded. -//! \retval ::NVAPI_ERROR Call failed. -//! \retval ::NVAPI_INVALID_ARGUMENT One of the required input arguments was NULL -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_InitializeSMPAssist(__in IUnknown *pDevice, __inout NV_SMP_ASSIST_INITIALIZE_PARAMS *pSMPAssistInitParams); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - -//! SUPPORTED OS: Windows 7 and higher -//! -#if defined (__cplusplus) && defined(__d3d11_h__) -//! \ingroup dx -typedef struct _NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 -{ - NvU32 version; //!< (IN) Structure version - NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS - NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal - NvBool bSMPAssistSupported; //!< (OUT) SMP Assist supported or not -} NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1; - -typedef NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS; -#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1, 1) -#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 - -//! SUPPORTED OS: Windows 7 and higher -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_QuerySMPAssistSupport -// -//! DESCRIPTION: Query SMP assist extension support. -//! -//! \since Release: 396 -//! \param [in] pDev Pointer to IUnknown (Currently supports ID3D11Device) -//! \param [out] pQuerySMPAssistSupportParams Pointer to a structure returning requested SMP assist support -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! \retval ::NVAPI_NOT_SUPPORTED Requested SMP assist is not supported. -//! \retval ::NVAPI_OK Call succeeded. Check value of pQuerySMPAssistSupportParams->bSMPAssistSupported -//! \retval ::NVAPI_INVALID_POINTER pDev or pQuerySMPAssistSupportParams was a NULL pointer -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_QuerySMPAssistSupport(__in IUnknown *pDev, __inout NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS *pQuerySMPAssistSupportParams); - -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to get sleep status -//! \ingroup dx -typedef struct _NV_GET_SLEEP_STATUS_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvBool bLowLatencyMode; //!< (OUT) Is low latency mode enabled? - NvU8 rsvd[128]; //!< (IN) Reserved. Must be set to 0s. -} NV_GET_SLEEP_STATUS_PARAMS_V1; - -typedef NV_GET_SLEEP_STATUS_PARAMS_V1 NV_GET_SLEEP_STATUS_PARAMS; -#define NV_GET_SLEEP_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GET_SLEEP_STATUS_PARAMS_V1, 1) -#define NV_GET_SLEEP_STATUS_PARAMS_VER NV_GET_SLEEP_STATUS_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetSleepStatus -// -//! DESCRIPTION: This function can be used to get the latest sleep status. -//! bLowLatencyMode indicates whether low latency mode is currently -//! enabled in the driver. -//! Note that it may not always reflect the previously requested sleep mode, -//! as the feature may not be available on the platform, or the setting has -//! been overridden by the control panel, for example. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! \param [in] pGetSleepStatusParams Sleep status params. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetSleepStatus(__in IUnknown *pDev, __in NV_GET_SLEEP_STATUS_PARAMS *pGetSleepStatusParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to set sleep mode -//! \ingroup dx -typedef struct _NV_SET_SLEEP_MODE_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvBool bLowLatencyMode; //!< (IN) Low latency mode enable/disable. - NvBool bLowLatencyBoost; //!< (IN) Request maximum GPU clock frequency regardless of workload. - NvU32 minimumIntervalUs; //!< (IN) Minimum frame interval in microseconds. 0 = no frame rate limit. - NvBool bUseMarkersToOptimize; //!< (IN) Allow latency markers to be used for runtime optimizations. - NvU8 rsvd[31]; //!< (IN) Reserved. Must be set to 0s. -} NV_SET_SLEEP_MODE_PARAMS_V1; - -typedef NV_SET_SLEEP_MODE_PARAMS_V1 NV_SET_SLEEP_MODE_PARAMS; -#define NV_SET_SLEEP_MODE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SET_SLEEP_MODE_PARAMS_V1, 1) -#define NV_SET_SLEEP_MODE_PARAMS_VER NV_SET_SLEEP_MODE_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetSleepMode -// -//! DESCRIPTION: This function can be used to update sleep mode dynamically. -//! The settings are not dependent to each other, meaning low latency mode -//! can be enabled/disabled regardless of whether minimum interval is set or -//! not. The former is to intelligently lower latency without impacting frame -//! rate. The later is to limit frame rate (e.g. minimumIntervalUs = 10000 -//! limits frame rate to 100 FPS). They work well separately and/or together. -//! Note that minimumIntervalUs usage is not limited to lowering latency, so -//! feel free to use it to limit frame rate for menu, cut scenes, etc. -//! Note that low latency mode can be enabled, and/or minimum interval can -//! be set, even without using NvAPI_D3D_Sleep(). However, without it, the -//! sleep to achieve these features would happen at a less optimal point, -//! resulting in higher overall latency. -//! The bLowLatencyBoost will request the GPU run at max clocks even in -//! scenarios where it is idle most of the frame and would normally try -//! to save power. This can decrease latency in CPU-limited scenarios. -//! While this function can be called as often as needed, it is not -//! necessary nor recommended to call this too frequently (e.g. every frame), -//! as the settings persist for the target device. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! \param [in] pSetSleepModeParams Sleep mode params. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetSleepMode(__in IUnknown *pDev, __in NV_SET_SLEEP_MODE_PARAMS *pSetSleepModeParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_Sleep -// -//! DESCRIPTION: It is recommended to call this function at the very start of -//! each frame (e.g. before input sampling). If there is a need to sleep, -//! due to frame rate limit and/or low latency features, for example, -//! this call provides an entry point for the driver to sleep at the most -//! optimal spot to achieve the lowest latency. -//! It is recommended to call this function even when low latency mode is -//! disabled and minimum interval is 0. Other features, such as Maximum Frame -//! Rate setting, could be enabled in the control panel to benefit from this. -//! It is OK to start (or stop) using this function at any time. However, -//! when using this function, it must be called exactly once on each frame. -//! If this function is not called, after several frames, the driver would -//! fallback to sleep at its less optimal spot. -//! -//! \since Release: 455 -//! \param [in] pDev The target device. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_Sleep(__in IUnknown *pDev); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used to get latency report. -//! \ingroup dx - -typedef struct _NV_LATENCY_RESULT_PARAMS -{ - NvU32 version; //!< (IN) Structure version - struct FrameReport { - NvU64 frameID; - NvU64 inputSampleTime; - NvU64 simStartTime; - NvU64 simEndTime; - NvU64 renderSubmitStartTime; - NvU64 renderSubmitEndTime; - NvU64 presentStartTime; - NvU64 presentEndTime; - NvU64 driverStartTime; - NvU64 driverEndTime; - NvU64 osRenderQueueStartTime; - NvU64 osRenderQueueEndTime; - NvU64 gpuRenderStartTime; - NvU64 gpuRenderEndTime; - NvU32 gpuActiveRenderTimeUs; //!< (OUT) Difference between gpuRenderStartTime and gpuRenderEndTime, excluding the idles in between, in microseconds. - NvU32 gpuFrameTimeUs; //!< (OUT) Difference between previous and current frame's gpuRenderEndTime, in microseconds. - NvU8 rsvd[120]; - } frameReport[64]; - NvU8 rsvd[32]; -} NV_LATENCY_RESULT_PARAMS_V1; - -typedef NV_LATENCY_RESULT_PARAMS_V1 NV_LATENCY_RESULT_PARAMS; -#define NV_LATENCY_RESULT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_RESULT_PARAMS_V1, 1) -#define NV_LATENCY_RESULT_PARAMS_VER NV_LATENCY_RESULT_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_GetLatency -// -//! DESCRIPTION: Get a latency report including the timestamps of the -//! application latency markers set with NvAPI_D3D_SetLatencyMarker as well -//! as driver, OS queue and graphics hardware times. Requires calling -//! NvAPI_D3D_SetLatencyMarker with incrementing frameID for valid results. -//! Rendering for at least 90 frames is recommended to properly fill out the -//! structure. The newest completed frame is at the end (element 63) and -//! is preceeded by older frames. If not enough frames are valid then all -//! frames are returned with all zeroes. -//! -//! \since Release: 455 -//! \param [in] pDev The target device -//! \param [in] pGetLatencyParams The latency result structure. -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_GetLatency(__in IUnknown *pDev, __out NV_LATENCY_RESULT_PARAMS *pGetLatencyParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used define latency marker type -//! \ingroup dx -typedef enum -{ - SIMULATION_START = 0, - SIMULATION_END = 1, - RENDERSUBMIT_START = 2, - RENDERSUBMIT_END = 3, - PRESENT_START = 4, - PRESENT_END = 5, - INPUT_SAMPLE = 6, - TRIGGER_FLASH = 7, - PC_LATENCY_PING = 8, - OUT_OF_BAND_RENDERSUBMIT_START = 9, - OUT_OF_BAND_RENDERSUBMIT_END = 10, - OUT_OF_BAND_PRESENT_START = 11, - OUT_OF_BAND_PRESENT_END = 12, -} NV_LATENCY_MARKER_TYPE; - -//! SUPPORTED OS: Windows 7 and higher -//! -//! Used set latency markers -//! \ingroup dx -typedef struct _NV_LATENCY_MARKER_PARAMS -{ - NvU32 version; //!< (IN) Structure version - NvU64 frameID; - NV_LATENCY_MARKER_TYPE markerType; - NvU8 rsvd[64]; -} NV_LATENCY_MARKER_PARAMS_V1; - -typedef NV_LATENCY_MARKER_PARAMS_V1 NV_LATENCY_MARKER_PARAMS; -#define NV_LATENCY_MARKER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_MARKER_PARAMS_V1, 1) -#define NV_LATENCY_MARKER_PARAMS_VER NV_LATENCY_MARKER_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D_SetLatencyMarker -// -//! DESCRIPTION: Set a latency marker to be tracked by the -//! NvAPI_D3D_GetLatency function. SIMULATION_START must be the first marker -//! sent in a frame, after the previous frame's Sleep call (if used). -//! INPUT_SAMPLE may be sent to record the moment user input was sampled and -//! should come between SIMULATION_START and SIMULATION_END. -//! RENDERSUBMIT_START should come before any Direct3D calls are made for -//! the given frame and RENDERSUBMIT_END should come before calling Present. -//! PRESENT_START and END should wrap the Present call to inform the driver -//! of a present block done by the OS before the driver receives the Present. -//! TRIGGER_FLASH tells the driver to render its flash indicator for latency -//! testing, typically driven by a mouse click. -//! The frameID can start at an abitrary moment in the application lifetime -//! but must strictly increment from that point forward for consistent results. -//! -//! \since Release: 455 -//! \param [in] pDev The target device -//! \param [in] pSetLatencyMarkerParams The latency marker structure -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D_SetLatencyMarker(__in IUnknown *pDev, __in NV_LATENCY_MARKER_PARAMS* pSetLatencyMarkerParams); -#endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)) - -//! Used in NvAPI_D3D12_SetAsyncFrameMarker -//! \ingroup dx -typedef NV_LATENCY_MARKER_PARAMS_V1 NV_ASYNC_FRAME_MARKER_PARAMS_V1; -typedef NV_ASYNC_FRAME_MARKER_PARAMS_V1 NV_ASYNC_FRAME_MARKER_PARAMS; -#define NV_ASYNC_FRAME_MARKER_PARAMS_VER1 NV_LATENCY_MARKER_PARAMS_VER1 -#define NV_ASYNC_FRAME_MARKER_PARAMS_VER NV_LATENCY_MARKER_PARAMS_VER1 - -#if defined(__cplusplus) && (defined(__d3d12_h__)) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetAsyncFrameMarker -// -//! DESCRIPTION: Set an async frame marker for present and out-of-band render tracking. -//! -//! \since Release: 520 -//! \param [in] pCommandQueue The D3D12CommandQueue -//! \param [in] pSetAsyncFrameMarkerParams The async frame marker structure -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetAsyncFrameMarker(__in ID3D12CommandQueue *pCommandQueue, __in NV_ASYNC_FRAME_MARKER_PARAMS* pSetAsyncFrameMarkerParams); -#endif //defined(__cplusplus) && (defined(__d3d12_h__)) - -//! SUPPORTED OS: Windows 10 and higher -//! -//! Used in NvAPI_D3D12_NotifyOutOfBandCommandQueue -//! \ingroup dx -typedef enum -{ - OUT_OF_BAND_RENDER = 0, - OUT_OF_BAND_PRESENT = 1, -} NV_OUT_OF_BAND_CQ_TYPE; - -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_NotifyOutOfBandCommandQueue -// -//! DESCRIPTION: Notifies the driver that this command queue runs out of band -//! from the application's frame cadence. -//! -//! \since Release: 520 -//! \param [in] pCommandQueue The D3D12CommandQueue -//! \param [in] cqType The type of out of band command queue -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_NotifyOutOfBandCommandQueue(__in ID3D12CommandQueue *pCommandQueue, __in NV_OUT_OF_BAND_CQ_TYPE cqType); -#endif //defined(__cplusplus) && defined(__d3d12_h__)) - - -#if defined (__cplusplus) && defined(__d3d12_h__) - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShader(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderEx(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in NvU32 dynSharedMemBytes, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderWithName(__in ID3D12Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_LaunchCubinShader(__in ID3D12GraphicsCommandList* pCommandList, - __in NVDX_ObjectHandle hShader, - __in NvU32 gridX, - __in NvU32 gridY, - __in NvU32 gridZ, - __in const void* pParams, - __in NvU32 paramSize); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCubinComputeShader(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_GetCudaTextureObject(__in ID3D12Device* pDevice, - __in D3D12_CPU_DESCRIPTOR_HANDLE texDesc, - __in D3D12_CPU_DESCRIPTOR_HANDLE smpDesc, - __out NvU32* pTextureHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_GetCudaSurfaceObject(__in ID3D12Device* pDevice, - __in D3D12_CPU_DESCRIPTOR_HANDLE uavDesc, - __out NvU32* pSurfaceHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_IsFatbinPTXSupported(__in ID3D12Device *pDevice, - __out bool *pSupported); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCuModule(__in ID3D12Device* pDevice, - __in const void* pBlob, - __in NvU32 size, - __out NVDX_ObjectHandle* phModule); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_EnumFunctionsInModule(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule, - __inout NvU32* pArraySize, - __out const char** const pFunctionNames); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_CreateCuFunction(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule, - __in const char* pName, - __out NVDX_ObjectHandle* phFunction); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! - -typedef struct _NVAPI_DIM3 -{ - NvU32 x; - NvU32 y; - NvU32 z; -} NVAPI_DIM3; - -typedef struct _NVAPI_CU_KERNEL_LAUNCH_PARAMS -{ - NVDX_ObjectHandle hFunction; - NVAPI_DIM3 gridDim; - NVAPI_DIM3 blockDim; - NvU32 dynSharedMemBytes; - void const * pParams; - NvU32 paramSize; -} NVAPI_CU_KERNEL_LAUNCH_PARAMS; - -NVAPI_INTERFACE NvAPI_D3D12_LaunchCuKernelChain(__in ID3D12GraphicsCommandList* pCommandList, - __in const NVAPI_CU_KERNEL_LAUNCH_PARAMS* pKernels, - __in NvU32 numKernels); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCuModule(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hModule); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D12_DestroyCuFunction(__in ID3D12Device* pDevice, - __in NVDX_ObjectHandle hFunction); -#endif //if defined (__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d11_h__) - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShader(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderEx(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in NvU32 dynSharedMemBytes, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderWithName(__in ID3D11Device* pDevice, - __in const void* pCubin, - __in NvU32 size, - __in NvU32 blockX, - __in NvU32 blockY, - __in NvU32 blockZ, - __in const char* pShaderName, - __out NVDX_ObjectHandle* phShader); - - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_LaunchCubinShader(__in ID3D11DeviceContext *pDeviceContext, - __in NVDX_ObjectHandle hShader, - __in NvU32 gridX, - __in NvU32 gridY, - __in NvU32 gridZ, - __in const void* pParams, - __in NvU32 paramSize, - __in const NVDX_ObjectHandle* pReadResources, - __in NvU32 numReadResources, - __in const NVDX_ObjectHandle* pWriteResources, - __in NvU32 numWriteResources); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_DestroyCubinComputeShader(__in ID3D11Device* pDevice, - __in NVDX_ObjectHandle hShader); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_IsFatbinPTXSupported(__in ID3D11Device *pDevice, - __out bool *pSupported); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateUnorderedAccessView(__in ID3D11Device* pDevice, - __in ID3D11Resource* pResource, - __in const D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc, - __out ID3D11UnorderedAccessView** ppUAV, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateShaderResourceView(__in ID3D11Device* pDevice, - __in ID3D11Resource* pResource, - __in const D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc, - __out ID3D11ShaderResourceView** ppSRV, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_CreateSamplerState(__in ID3D11Device* pDevice, - __in const D3D11_SAMPLER_DESC* pSamplerDesc, - __out ID3D11SamplerState** ppSamplerState, - __out NvU32* pDriverHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_GetCudaTextureObject(__in ID3D11Device* pDevice, - __in NvU32 srvDriverHandle, - __in NvU32 samplerDriverHandle, - __out NvU32* pCudaTextureHandle); - -// Experimental API for internal use. DO NOT USE! -//! SUPPORTED OS: Windows 10 and higher -//! -NVAPI_INTERFACE NvAPI_D3D11_GetResourceGPUVirtualAddress(__in ID3D11Device* pDevice, - __in const NVDX_ObjectHandle hResource, - __out NvU64* pGpuVA); -#endif //defined(__cplusplus) && defined(__d3d11_h__) - - -#if defined(__cplusplus) && defined(__d3d12_h__) -//! Flags specifying raytracing thread reordering hardware support. -//! Additional flags will be added as support becomes available. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS -{ - NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAP_NONE = 0x0, //!< Thread reordering acts as a no-op - NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAP_STANDARD = NV_BIT(0) //!< Standard thread reordering is supported -} NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS; - -//! Flags specifying raytracing Opacity Micromap support. -//! Additional flags will be added as support becomes available. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_NONE = 0x0, //!< Opacity Micromap support is not available. - //!< The application must not attempt to use any OMM entrypoints or flags. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_STANDARD = NV_BIT(0) //!< Standard Opacity Micromap support is available -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS; - -//! List of Raytracing CAPS types that can be queried. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_CAPS_TYPE -{ - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_THREAD_REORDERING = 0, - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_OPACITY_MICROMAP = 1, - NVAPI_D3D12_RAYTRACING_CAPS_TYPE_INVALID = -1 -} NVAPI_D3D12_RAYTRACING_CAPS_TYPE; - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingCaps -// -//! DESCRIPTION: Query raytracing capabilities of a device. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Pointer to the device on which raytracing caps should be queried from. -//! \param [in] type Raytracing caps type requested. (ex: NVAPI_D3D12_RAYTRACING_CAPS_TYPE_THREAD_REORDERING) -//! \param [out] pData Pointer to memory that receives caps. (ex: NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS*) -//! \param [in] dataSize Size in bytes to return to pData. Must match the size of the caps data requested. (ex: sizeof(NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS)) -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval ::NVAPI_OK Completed request -//! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument -//! \retval ::NVAPI_INVALID_ARGUMENT At least one of the arguments are invalid -//! \retval ::NVAPI_ERROR Error occurred -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingCaps( - __in ID3D12Device* pDevice, - __in NVAPI_D3D12_RAYTRACING_CAPS_TYPE type, - __out void* pData, - __in size_t dataSize); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - -//! SUPPORTED OS: Windows 10 and higher -//! -#if defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -// Types used by both device and command list functions. - -//! Flags specifying building instructions and hints when constructing an OMM Array. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_NONE = 0x0, //!< No options specified for the OMM Array build. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE = NV_BIT(0), //!< Allow the OMM Array build to take a little longer in order to optimize for traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_BUILD = NV_BIT(1) //!< Spend as little time as possible on the OMM Array build with some potential loss to traversal performance. - //!< This flag is incompatible with #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAG_PREFER_FAST_TRACE. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS; - -//! Specifies the input Opacity Micromap formats. -//! The OC1 (Opacity Compression 1) format follows the space-filling curve in barycentric space over the uniformly tessellated micro-triangles. -//! -//! \note This is a 16-bit value when used in #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT_OC1_2_STATE = 0x1, //!< 2-state (Transparent/Opaque) format. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT_OC1_4_STATE = 0x2 //!< 4-state (Transparent/Opaque, Known/Unknown) format. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT; - -//! Number of OMMs of a specific configuration in an OMM Array. -//! Used to compute conservative buffer size estimates for OMM Array builds. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT -{ - NvU32 count; //!< Total number of OMMs in the OMM Array with the particular \p subdivisionLevel and \p format specified in this descriptor. - NvU32 subdivisionLevel; //!< Number of subdivisions for the OMM; valid inputs are [0, 12] (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT format; //!< Opacity Micromap format. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT; - -//! Describes one Opacity Micromap. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC -{ - NvU32 byteOffset; //!< Byte offset from the \c inputBuffer, specified in the input structure #NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS, to where the input OMM data is located. - NvU16 subdivisionLevel; //!< Number of subdivisions for the OMM; valid inputs are [0, 12] (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL). - //!< The total number of micro-triangles is 4subdivisionLevel. - NvU16 format; //!< Format of the OMM of type #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_FORMAT. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC; - -//! Input structure to OMM Array construction. -//! Individual OMMs are accessed via indices when used in bottom-level acceleration structure (BLAS) construction. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BUILD_FLAGS flags; //!< Flags which apply to all OMMs in the array. - NvU32 numOMMUsageCounts; //!< Number of OMM usage count entries in the \p pOMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT* pOMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the OMM entries in the build. - D3D12_GPU_VIRTUAL_ADDRESS inputBuffer; //!< Address for raw OMM input data; it must be 256-byte aligned. - //!< It is recommended to try to organize OMMs together in memory that are expected to be used close together spatially. - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE perOMMDescs; //!< GPU array with one #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_DESC entry per OMM. -} NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS; - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && (defined(__ID3D12Device5_INTERFACE_DEFINED__) || defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__)) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Conservative memory requirements for building an OMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO -{ - NvU64 resultDataMaxSizeInBytes; //!< Size required to hold the result of an OMM Array build based on the specified inputs. - NvU64 scratchDataSizeInBytes; //!< Scratch storage on GPU required during OMM Array build based on the specified inputs. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO; - -//! Parameters given to NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS* pDesc; //!< [in] Description of the OMM Array build. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO* pInfo; //!< [out] Result of the query. -} NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1; -#define NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_V1 NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS; -#define NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo -// -//! DESCRIPTION: Query conservative memory requirements for building an OMM (Opacity Micromap) Array. -//! The returned size is conservative for OMM Array builds containing -//! a lower or equal number of entries for each resolution and format combination. -//! -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the OMM Array will be built. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo( - __in ID3D12Device5* pDevice, - __inout NVAPI_GET_RAYTRACING_OPACITY_MICROMAP_ARRAY_PREBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Pipeline creation state flags. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS -{ - NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS_NONE = 0, //!< [in] No pipeline flags. - NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS_ENABLE_OMM_SUPPORT = NV_BIT(0), //!< [in] Change whether raytracing pipelines are created with support for Opacity Micromaps. - //!< If a triangle with an OMM is encountered during traversal and the pipeline was not created with support for them, behavior is undefined. - //!< Support should only be enabled if there are OMMs present, since it may incur a small penalty on traversal performance overall. -} NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS; - -//! State used when creating new pipelines. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER. - NvU32 flags; //!< [in] A bitwise OR of one or more #NVAPI_D3D12_PIPELINE_CREATION_STATE_FLAGS flags for raytracing pipeline creation. -} NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1; -#define NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1, 1) -typedef NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_V1 NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS; -#define NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_SetCreatePipelineStateOptions -// -//! DESCRIPTION: Globally change the state affecting pipeline creations. -//! This affects all pipelines created after this call, and until this function is called again. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the pipelines will be created. -//! \param [in] pState State to be applied to all future pipeline creations. - -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_SetCreatePipelineStateOptions( - __in ID3D12Device5* pDevice, - __in const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* pState); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! Type of serialized data. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX -{ - // D3D12_SERIALIZED_DATA_TYPE flags - NVAPI_D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE_EX = 0x0, //!< Serialized data contains a raytracing acceleration structure. - //!< Starting from offset 0, the first bytes of the serialized acceleration structure can be reinterpreted as \c D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER. - //!< That structure contains the identifier to be passed along to NvAPI_D3D12_CheckDriverMatchingIdentifierEx(). - - // NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX specific flags - NVAPI_D3D12_SERIALIZED_DATA_RAYTRACING_OPACITY_MICROMAP_ARRAY_EX = 0x1, //!< Data blob contains an OMM Array. - //!< Starting from offset 0, the first bytes of the OMM Array can be reinterpreted as \c D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER. - -} NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX; - -//! Parameters given to NvAPI_D3D12_CheckDriverMatchingIdentifierEx(). -//! -//! \ingroup dx -typedef struct _NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER. - NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX serializedDataType; //!< [in] Type of data to be deserialized; see #NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX. - const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER* pIdentifierToCheck; //!< [in] Identifier from the header of the serialized data to check with the driver; see \c D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER. - //!< Information about how to retrieve that identifier can be found in the description of each #NVAPI_D3D12_SERIALIZED_DATA_TYPE_EX enum. - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS checkStatus; //!< [out] Result of the check; see \c D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS. -} NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1; -#define NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1, 1) -typedef NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_V1 NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS; -#define NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CheckDriverMatchingIdentifierEx -// -//! DESCRIPTION: This function is an extension of ID3D12Device5::CheckDriverMatchingIdentifier() with additional serialized data types. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the data will be deserialized. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CheckDriverMatchingIdentifierEx( - __in ID3D12Device5* pDevice, - __inout NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -//! This enum extends \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS with modified and additional values. -//! Only modified/new values are fully described; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX -{ - // D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS flags - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE_EX = 0x0, //!< No options specified for the acceleration structure build. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE_EX = NV_BIT(0), //!< Allow the acceleration structure to later be updated (via the flag #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE_EX), rather than always requiring a full rebuild. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION_EX = NV_BIT(1), //!< Allow for the acceleration structure to later be compacted. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE_EX = NV_BIT(2), //!< Favorize higher raytracing performance at the cost of longer build times. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD_EX = NV_BIT(3), //!< Favorize faster build times at the cost of lower raytracing performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY_EX = NV_BIT(4), //!< Minimize the memory footprint of the produced acceleration structure, potentially at the cost of longer build time or lower raytracing performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE_EX = NV_BIT(5), //!< Instead of rebuilding the acceleration structure from scratch, the existing acceleration structure will be updated. - //!< Added behaviour: If #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX is specified, OMM references may be changed along with positions when an update is performed. - - // NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX specific flags - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX = NV_BIT(6), //!< The acceleration structure (AS) supports updating OMM contents (base OMM Array and/or indices). - //!< Specifying this flag may result in larger AS size and may reduce traversal performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DISABLE_OMMS_EX = NV_BIT(7), //!< Only applicable for BLAS builds. If enabled, any instances referencing this BLAS are allowed to disable the OMM test through the #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX flag. - //!< Specifying this build flag may result in some reductions in traversal performance. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_OPACITY_STATES_UPDATE_EX = NV_BIT(8), //!< The acceleration structure (AS) supports updating OMM data (encoded opacity values). - //!< Specifying this flag may reduce traversal performance. - -} NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX; - -//! This enum extends \c D3D12_RAYTRACING_GEOMETRY_TYPE with additional values. -//! Only new values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX -{ - // D3D12_RAYTRACING_GEOMETRY_TYPE flags - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES_EX = 0x0, //!< This geometry is made of basic triangles. - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS_EX = 0x1, //!< This geometry is made of axis-aligned bounding boxes (AABBs). - - // NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX specific flags - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_OMM_TRIANGLES_EX = 0x2, //!< Shares most fields with the basic triangle geometry type, but allows an OMM Array to be attached to the geometry. - //!< The basic triangle type and this OMM-enabled type geometries may be mixed in the same BLAS build. - - -} NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX; - -//! If a triangle has a uniform OMM state in a BLAS build, it is preferable to signal this explicitly rather than attaching a single state OMM. -//! This can be accomplished by supplying these special indices as entries in \c opacityMicromapIndexBuffer, in #NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT = -1, //!< Uniform transparent OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE = -2, //!< Uniform opaque OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT = -3, //!< Uniform unknown-transparent OMM state. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE = -4 //!< Uniform unknown-opaque OMM state. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX; - -//! Geometry descriptor attachment with Opacity Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE opacityMicromapIndexBuffer; //!< Optional buffer specifying which OMM index to use for each triangle; if \c NULL, there is a 1:1 mapping between input triangles and OMM Array entries. - //!< Special values can be used to encode OMMs with uniform state for individual triangles (see #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_SPECIAL_INDEX). - //!< For BLAS updates, this input buffer must match that of the original build if the #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_OMM_UPDATE_EX build flag is not set. - DXGI_FORMAT opacityMicromapIndexFormat; //!< Format of \c opacityMicromapIndexBuffer, either \c DXGI_FORMAT_R32_UINT or \c DXGI_FORMAT_R16_UINT. - NvU32 opacityMicromapBaseLocation; //!< Constant added to all non-negative OMM indices in \p opacityMicromapIndexBuffer. - D3D12_GPU_VIRTUAL_ADDRESS opacityMicromapArray; //!< Pointer to an OMM Array used by this geometry; it may be set to \c NULL if no non-uniform OMMs are used. - //!< Unlike vertex, index, and transform buffers, this resource is dereferenced during raytracing. - - NvU32 numOMMUsageCounts; //!< Number of OMM usage count entries in the \p pOMMUsageCounts array. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_USAGE_COUNT* pOMMUsageCounts; //!< Usage counts for each subdivision level and format combination across all the OMM entries referred-to by the OMM index buffer specified by this geometry. - -} NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC; - -//! Geometry triangle descriptor with attached augmented Opacity Micromaps. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC -{ - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC triangles; //!< Triangle mesh descriptor. - NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_ATTACHMENT_DESC ommAttachment; //!< Opacity Micromap attachment descriptor. -} NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC; - -//! This structure extends \c D3D12_RAYTRACING_GEOMETRY_DESC by supporting additional geometry types. -//! Only new members are fully described below; for more information on the other members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX -{ - NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_EX type; //!< The type of geometry stored in the union of this structure. - D3D12_RAYTRACING_GEOMETRY_FLAGS flags; //!< Flags affecting how this geometry is processed by the raytracing pipeline. - union - { - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC triangles; //!< Describes triangle geometry if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - D3D12_RAYTRACING_GEOMETRY_AABBS_DESC aabbs; //!< Describes AABB geometry if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - NVAPI_D3D12_RAYTRACING_GEOMETRY_OMM_TRIANGLES_DESC ommTriangles; //!< Describes triangle geometry which may optionally use Opacity Micromaps, if \c type is #NVAPI_D3D12_RAYTRACING_GEOMETRY_TYPE_OMM_TRIANGLES_EX. - //!< Otherwise, this parameter is unused (space repurposed in a union). - }; -} NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX; - -//! This enum extends \c D3D12_RAYTRACING_INSTANCE_FLAGS with additional values. -//! Only new values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX -{ - // D3D12_RAYTRACING_INSTANCE_FLAGS flags - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_NONE_EX = 0x0, //!< No options specified for this instance. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE_EX = NV_BIT(0), //!< Disable triangle culling for this instance. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE_EX = NV_BIT(1), //!< Use counter-clockwise winding for defining front faces, instead of the default of clockwise winding. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE_EX = NV_BIT(2), //!< Force all geometries in this instance to be opaque. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE_EX = NV_BIT(3), //!< All geometries in this instance will be processed as if they never had the \c D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE flag applied to them. - - // NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX specific flags - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OMM_2_STATE_EX = NV_BIT(4), //!< Ignore the Unknown state and only consider the Transparent/Opaque bit for all 4-state OMMs encountered during traversal. - //!< This flag has no effect if #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX is set. - NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX = NV_BIT(5) //!< Disable OMMs for all triangles, and revert to using geometry opaque/non-opaque state instead (legacy behavior). - //!< This flag is only valid if the referenced BLAS was built with the #NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DISABLE_OMMS_EX flag; omitting that flag during BLAS build will result in undefined behavior. -} NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX; - -//! This structure extends \c D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS by supporting additional geometry types. -//! Only modified members are fully described below; for more information on the other members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX -{ - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE type; //!< Whether a top-level acceleration structure (TLAS) or bottom-level acceleration structure (BLAS) will be built using this information. - NVAPI_D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS_EX flags; //!< Options influencing how the acceleration structure is built and which of its features can be used. - NvU32 numDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, it represents the number of descriptions stored in \c instanceDescs. - //!< Otherwise, it contains the number of geometry descriptions stored in \c pGeometryDescs or \c ppGeometryDescs. - D3D12_ELEMENTS_LAYOUT descsLayout; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL, it specifies which of \c pGeometryDescs and \c ppGeometryDescs to use. - //!< Otherwise, this parameter is unused. - NvU32 geometryDescStrideInBytes; //!< Stride between consecutive geometry descriptors. Should typically be set to sizeof(NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX). - //!< Only used if \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY. - //!< This field guarantees backwards compatibility, even if the geometry descriptor size increases in future NVAPI versions. - union - { - D3D12_GPU_VIRTUAL_ADDRESS instanceDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, the referenced instance structures can used the extended set of flags #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAGS_EX in place of the \c D3D12_RAYTRACING_INSTANCE_FLAGS mentioned in \c D3D12_RAYTRACING_INSTANCE_DESC. - //!< Otherwise, this parameter is unused (space repurposed in a union). - const NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX* pGeometryDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY, it contains the descriptions of all geometries to be built into a BLAS. - //!< Otherwise, this parameter is unused (space repurposed in a union). - const NVAPI_D3D12_RAYTRACING_GEOMETRY_DESC_EX*const* ppGeometryDescs; //!< If \c type is \c D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL and \c descLayout is \c D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS, it contains the addresses of descriptions for all geometries to be built into a BLAS. - //!< Otherwise, this parameter is unused (space repurposed in a union). - }; -} NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX; - -//! Parameters given to NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx(). -//! -//! \ingroup dx -typedef struct _NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX* pDesc; //!< [in] Description of the acceleration-structure build. - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO* pInfo; //!< [out] Result of the query. -} NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1; -#define NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1, 1) -typedef NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_V1 NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS; -#define NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx -// -//! DESCRIPTION: This function is an extension of ID3D12Device5::GetRaytracingAccelerationStructurePrebuildInfo() with additional input types. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pDevice Device on which the acceleration structure will be built. -//! \param [in,out] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx( - __in ID3D12Device5* pDevice, - __inout NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12Device5_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Description of the inputs and memory areas used during the building of OMM Arrays. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destOpacityMicromapArrayData; //!< Output location for the OMM Array build. - //!< NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() reports the amount of memory required for the result given a set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). - NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_INPUTS inputs; //!< Description of the input data for the OMM Array build. - D3D12_GPU_VIRTUAL_ADDRESS scratchOpacityMicromapArrayData; //!< Location where the build will store temporary data. - //!< NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() reports the amount of scratch memory the implementation will need for a given set of input parameters. - //!< The address must be aligned to 256 bytes (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). - //!< Contents of this memory going into a build on the GPU timeline are irrelevant and will not be preserved. - //!< After the build is complete on the GPU timeline, the memory is left with whatever undefined contents the build finished with. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. -} NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC; - -//! Structure emitted by NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo(), and optionally NvAPI_D3D12_BuildRaytracingOpacityMicromapArray(), when \c type equals #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC -{ - NvU64 currentSizeInBytes; //!< Size of the OMM Array buffer. - //!< The queried size may be smaller than the size reported by NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo(). - //!< This allows the application to move and relocate the OMM Array to a smaller buffer to reclaim any unused memory after the OMM Array build is complete. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC; - -//! Type of postbuild info to emit after an OMM Array build. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE = 0x0 //!< Size of the current OMM Array. May be smaller than reported by the NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo() call. - //!< Unused memory can be reclaimed by copying the OMM Array into a new resource; see #NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_CURRENT_SIZE_DESC. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE; - -//! Description of the postbuild information to generate from an OMM Array. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC -{ - D3D12_GPU_VIRTUAL_ADDRESS destBuffer; //!< Result storage. - //!< Size required and the layout of the contents written by the system depend on \p infoType. - //!< The memory pointed to must be in state \c D3D12_RESOURCE_STATE_UNORDERED_ACCESS. - //!< The memory must be aligned to the natural alignment for the members of the particular output structure being generated (e.g. 8 bytes for a struct with the largest member being \c NvU64). - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_TYPE infoType; //!< Type of postbuild information to retrieve. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC; - -//! Parameters given to NvAPI_D3D12_BuildRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_DESC* pDesc; //!< [in] Description of the OMM Array build. - NvU32 numPostbuildInfoDescs; //!< [in] Size of postbuild info desc array. Set to 0 if none are needed. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pPostbuildInfoDescs; //!< [in] Optional array of descriptions for postbuild info to generate describing properties of the acceleration structure that was built. - //!< [in] Any given postbuild info type, \c D3D12_RAYTRACING_ACCEELRATION_STRUCTURE_POSTBUILD_INFO_TYPE, can only be selected for output by at most one array entry. -} NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS; -#define NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_BuildRaytracingOpacityMicromapArray -// -//! DESCRIPTION: Construct OMM Array for a collection of OMMs on the GPU. -//! The CPU-side input buffers are not referenced after this call. -//! The GPU-side input resources are not referenced after the build has concluded after ExecuteCommandList(). -//! Additionally, the application may optionally output postbuild information immediately after the build. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_COMBINATION pParams->pPostbuildInfoDescs was set to \c NULL while pParams->numPostbuildInfoDescs is non zero. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_BuildRaytracingOpacityMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in NVAPI_BUILD_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER. - D3D12_GPU_VIRTUAL_ADDRESS opacityMicromapArray; //!< [in] OMM Array current memory address; it must be 256-byte aligned (#NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT). -} NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1; -#define NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1, 1) -typedef NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_V1 NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS; -#define NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray -// -//! DESCRIPTION: Makes the OMM Array usable at its current location in memory. -//! An OMM Array that has been copied to a new location must be relocated using this function before it may be attached to any BLAS. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_RELOCATE_RAYTRACING_OPACITY_MICROMAP_ARRAY_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! Parameters given to NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo(). -//! -//! \ingroup dx -typedef struct _NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER. - const NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_DESC* pDesc; //!< [in] Description of which postbuild info to emit. - NvU32 numSources; //!< [in] Number of OMM Arrays in \p pSources. - const D3D12_GPU_VIRTUAL_ADDRESS* pSources; //!< [in] List of OMM Arrays for which postbuild info should be emitted. -} NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1; -#define NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1, 1) -typedef NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_V1 NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS; -#define NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo -// -//! DESCRIPTION: Emits information about one or more OMM Arrays, only available after the OMM Array constructions have finished. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -//! This structure extends \c D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC by supporting additional geometry types as inputs. -//! For more information on the different members, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef struct _NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX -{ - D3D12_GPU_VIRTUAL_ADDRESS destAccelerationStructureData; //!< Memory where the resulting acceleration structure will be stored. - NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS_EX inputs; //!< The inputs to the build process. - D3D12_GPU_VIRTUAL_ADDRESS sourceAccelerationStructureData; //!< The acceleration structure to be updated. - //!< Otherwise if the acceleration structure should be rebuilt entirely, this value must be \c NULL. - D3D12_GPU_VIRTUAL_ADDRESS scratchAccelerationStructureData; //!< Memory that will be temporarily used during the building process. -} NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX; - -//! Parameters given to NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray(). -//! -//! \ingroup dx -typedef struct _NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1 -{ - NvU32 version; //!< [in] Structure version; it should be set to #NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER. - const NVAPI_D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC_EX* pDesc; //!< [in] Description of the acceleration structure to build. - NvU32 numPostbuildInfoDescs; //!< [in] Size of postbuild info desc array. Set to 0 if none are needed. - const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC* pPostbuildInfoDescs; //!< [in] Optional array of descriptions for postbuild info to generate describing properties of the acceleration structure that was built. - //!< Any given postbuild info type, \c D3D12_RAYTRACING_ACCEELRATION_STRUCTURE_POSTBUILD_INFO_TYPE, can only be selected for output by at most one array entry. -} NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1; -#define NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1, 1) -typedef NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_V1 NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS; -#define NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_BuildRaytracingAccelerationStructureEx -// -//! DESCRIPTION: Perform an acceleration structure build on the GPU. -//! Also optionally output postbuild information immediately after the build. -//! This function is an extension of ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure() with additional serialized data types. -//! -//! \note Only supported on GPUs capable of DXR. -//! Some of the flags and fields have further restrictions, in which case their description will include a note with more details. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release: 520 -//! -//! \param [in] pCommandList Command list on which the command will execute. -//! \param [in] pParams Wrapper around the inputs and outputs of the function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, they are listed below. -//! -//! \retval NVAPI_INVALID_COMBINATION pParams->pPostbuildInfoDescs was set to \c NULL while pParams->numPostbuildInfoDescs is non zero. -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_BuildRaytracingAccelerationStructureEx( - __in ID3D12GraphicsCommandList4* pCommandList, - __in const NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS* pParams); - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -#if defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - -/////////////////////////////////////////////////////////////////////////////// -// -// Miscellaneous -// -/////////////////////////////////////////////////////////////////////////////// - -//! Opacity Micromap micro-triangle states. -//! Not part of any input, but listed here for convenience. -//! -//! \ingroup dx -typedef enum _NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE -{ - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_TRANSPARENT = 0, //!< Transparent OMM state: hit is ignored. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_OPAQUE = 1, //!< Opaque OMM state: hit is committed. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_UNKNOWN_TRANSPARENT = 2, //!< Unknown-transparent OMM state. - //!< * If operating in 2-state mode, ignore hit. - //!< * If operating in 4-state mode, invoke any-hit shader. - NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE_UNKNOWN_OPAQUE = 3 //!< Unknown-opaque OMM state. - //!< * If operating in 2-state mode, commit hit. - //!< * If operating in 4-state mode, invoke any-hit shader. -} NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_STATE; - -//! Mandatory alignment for the address of an OMM Array. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_ARRAY_BYTE_ALIGNMENT 256 - -//! Highest subdivision-level allowed with OC1. -//! -//! \ingroup dx -#define NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_OC1_MAX_SUBDIVISION_LEVEL 12 - -//! A list of flags that can be given to the \c TraceRay() function in HLSL. -//! Only new or modified values are fully described below; for more information on the other values, please check Microsoft's DirectX Raytracing Specification. -//! -//! \ingroup dx -typedef enum _NVAPI_RAY_FLAGS_EX -{ - // RAY_FLAGS flags - NVAPI_RAY_FLAG_NONE_EX = 0x0, //!< No flag specified. - NVAPI_RAY_FLAG_FORCE_OPAQUE_EX = NV_BIT( 0), //!< Consider all intersected geometries to be opaque, regardless of the flags specified at the geometry and instance level. - NVAPI_RAY_FLAG_FORCE_NON_OPAQUE_EX = NV_BIT( 1), //!< Consider all intersected geometries to be non-opaque, regardless of the flags specified at the geometry and instance level. - NVAPI_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH_EX = NV_BIT( 2), //!< End the traversal as soon as a geometry is hit, and that hit is not ignored by the any hit shader. - NVAPI_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER_EX = NV_BIT( 3), //!< Do not invoke the closest hit shader once the traversal ends. - NVAPI_RAY_FLAG_CULL_BACK_FACING_TRIANGLES_EX = NV_BIT( 4), //!< Never intersect triangle geometries that are back facing with regard to the ray. - NVAPI_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES_EX = NV_BIT( 5), //!< Never intersect triangle geometries that are front facing with regard to the ray. - NVAPI_RAY_FLAG_CULL_OPAQUE_EX = NV_BIT( 6), //!< Never intersect geometries that were flagged as opaque. - NVAPI_RAY_FLAG_CULL_NON_OPAQUE_EX = NV_BIT( 7), //!< Never intersect geometries that were not flagged as opaque. - NVAPI_RAY_FLAG_SKIP_TRIANGLES_EX = NV_BIT( 8), //!< Never intersect triangle geometries. - NVAPI_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES_EX = NV_BIT( 9), //!< Never intersect AABB geometries. - - // NVAPI_RAY_FLAGS_EX specific flags - NVAPI_RAY_FLAG_FORCE_OMM_2_STATE_EX = NV_BIT(10), //!< Treat unknown-opaque and unknown-transparent as opaque and transparent, respectively, during traversal. - //!< If an instance is flagged with #NVAPI_D3D12_RAYTRACING_INSTANCE_FLAG_DISABLE_OMMS_EX, that takes precedence over this flag. -} NVAPI_RAY_FLAG_EX; - -#endif // defined(__cplusplus) && defined(__d3d12_h__) && defined(__ID3D12GraphicsCommandList4_INTERFACE_DEFINED__) - - -//! \ingroup DX -typedef enum _NV_D3D12_WORKSTATION_FEATURE_TYPE -{ - NV_D3D12_WORKSTATION_FEATURE_TYPE_PRESENT_BARRIER = 1, // PresentBarrier feature - NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_SUPPORT = 2, // RDMA heap supported via Bar1 carveout -} NV_D3D12_WORKSTATION_FEATURE_TYPE; - -// parameter structure for NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_AVAILABLE related information -typedef struct _NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES -{ - NvU64 rdmaHeapSize; // maximum available Bar1 heap size for RDMA allocations -} NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES; - -// parameter structure for querying workstation feature information -typedef struct _NV_D3D12_WORKSTATION_FEATURE_PROPERTIES -{ - NvU32 version; //!< (IN) Structure version - NV_D3D12_WORKSTATION_FEATURE_TYPE workstationFeatureType; //!< (IN) the type of workstation feature to be queried - NvBool supported; //!< (OUT) boolean returning if feature is supported - union - { - NV_D3D12_WORKSTATION_FEATURE_RDMA_PROPERTIES rdmaInfo; //!< (OUT) RDMA feature related information, returned only if - //!< workstationFeatureType is NV_D3D12_WORKSTATION_FEATURE_TYPE_RDMA_BAR1_SUPPORT - }; -} NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1; - -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER1 MAKE_NVAPI_VERSION(NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1,1) -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_VER1 -#define NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS_V1 - - -#if defined(__cplusplus) && defined(__d3d12_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_QueryWorkstationFeatureProperties -// -//! DESCRIPTION: This API returns information about the properties of specific workstation features on the specified device. -//! -//! \since Release: 530 -//! -//! \param [in] pDevice The ID3D12Device device which is queried for feature properties -//! \param [inout] pWorkstationFeatureProperties Pointer to a structure containing workstation feature query information. -//! -//! \return ::NVAPI_OK the call succeeded -//! \return ::NVAPI_ERROR the call failed -//! \return ::NVAPI_NO_IMPLEMENTATION the API is not implemented -//! \return ::NVAPI_INVALID_POINTER an invalid pointer was passed as an argument -//! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_QueryWorkstationFeatureProperties(__in ID3D12Device *pDevice, __inout NVAPI_D3D12_WORKSTATION_FEATURE_PROPERTIES_PARAMS *pWorkstationFeatureProperties); -#endif // defined(__cplusplus) && defined(__d3d12_h__) - - -#if defined (__cplusplus) && defined(__d3d12_h__) - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D12_CreateCommittedRDMABuffer -// -//! \since Release: 530 -// -//! \code -//! DESCRIPTION: NvAPI_D3D12_CreateCommittedRDMABuffer is a wrapper of ID3D12Device::CreateCommittedResource -//! which allows to allocate linear memory which can be used for remote direct memory access (RDMA) from other devices. -//! It creates an implicit D3D12 heap of the requested size, allocates the resource and returns an RDMA address for remote direct memory access. -//! The created memory will reside on the specified device local memory and won't be cpu accessible. -//! -//! \param [in] pDevice A pointer to a D3D12 device. -//! \param [in] size Size in bytes of the linear buffer to be allocated for the resource. -//! \param [in] heapCreationNodeMask This mask indicates the node where the resource should be created. -//! \param [in] heapVisibleNodeMask This mask indicates on which nodes the resource is accessible. -//! \param [in] riidResource The globally unique identifier (GUID) for the resource interface. -//! \param [out] ppvResource A pointer to memory that receives the requested interface pointer to the created resource object. -//! \param [out] ppRDMAAddress A pointer to memory that receives the Bar1 memory region for remote direct memory access. - -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. -//! -//! \endcode -//! \ingroup dx -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedRDMABuffer( - __in ID3D12Device* pDevice, - __in NvU64 size, - __in NvU32 heapCreationNodeMask, - __in NvU32 heapVisibleNodeMask, - __in REFIID riidResource, - __out void **ppvResource, - __out void **ppRDMAAddress); - -#endif //defined(__cplusplus) && defined(__d3d12_h__) - -///////////////////////////////////////////////////////////////////////// -// Video Input Output (VIO) API -///////////////////////////////////////////////////////////////////////// - - - -//! \ingroup vidio -//! Unique identifier for VIO owner (process identifier or NVVIOOWNERID_NONE) -typedef NvU32 NVVIOOWNERID; - - -//! \addtogroup vidio -//! @{ - - -#define NVVIOOWNERID_NONE 0 //!< Unregistered ownerId - - -//! Owner type for device -typedef enum _NVVIOOWNERTYPE -{ - NVVIOOWNERTYPE_NONE , //!< No owner for the device - NVVIOOWNERTYPE_APPLICATION , //!< Application owns the device - NVVIOOWNERTYPE_DESKTOP , //!< Desktop transparent mode owns the device (not applicable for video input) -}NVVIOOWNERTYPE; - -// Access rights for NvAPI_VIO_Open() - -//! Read access (not applicable for video output) -#define NVVIO_O_READ 0x00000000 - -//! Write exclusive access (not applicable for video input) -#define NVVIO_O_WRITE_EXCLUSIVE 0x00010001 - -//! -#define NVVIO_VALID_ACCESSRIGHTS (NVVIO_O_READ | \ - NVVIO_O_WRITE_EXCLUSIVE ) - - -//! VIO_DATA.ulOwnerID high-bit is set only if device has been initialized by VIOAPI -//! examined at NvAPI_GetCapabilities|NvAPI_VIO_Open to determine if settings need to be applied from registry or POR state read -#define NVVIO_OWNERID_INITIALIZED 0x80000000 - -//! VIO_DATA.ulOwnerID next-bit is set only if device is currently in exclusive write access mode from NvAPI_VIO_Open() -#define NVVIO_OWNERID_EXCLUSIVE 0x40000000 - -//! VIO_DATA.ulOwnerID lower bits are: -//! NVGVOOWNERTYPE_xxx enumerations indicating use context -#define NVVIO_OWNERID_TYPEMASK 0x0FFFFFFF //!< mask for NVVIOOWNERTYPE_xxx - - -//! @} - -//--------------------------------------------------------------------- -// Enumerations -//--------------------------------------------------------------------- - - -//! \addtogroup vidio -//! @{ - -//! Video signal format and resolution -typedef enum _NVVIOSIGNALFORMAT -{ - NVVIOSIGNALFORMAT_NONE, //!< Invalid signal format - NVVIOSIGNALFORMAT_487I_59_94_SMPTE259_NTSC, //!< 01 487i 59.94Hz (SMPTE259) NTSC - NVVIOSIGNALFORMAT_576I_50_00_SMPTE259_PAL, //!< 02 576i 50.00Hz (SMPTE259) PAL - NVVIOSIGNALFORMAT_1035I_60_00_SMPTE260, //!< 03 1035i 60.00Hz (SMPTE260) - NVVIOSIGNALFORMAT_1035I_59_94_SMPTE260, //!< 04 1035i 59.94Hz (SMPTE260) - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE295, //!< 05 1080i 50.00Hz (SMPTE295) - NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274, //!< 06 1080i 60.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274, //!< 07 1080i 59.94Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274, //!< 08 1080i 50.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274, //!< 09 1080p 30.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274, //!< 10 1080p 29.97Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274, //!< 11 1080p 25.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274, //!< 12 1080p 24.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080P_23_976_SMPTE274, //!< 13 1080p 23.976Hz (SMPTE274) - NVVIOSIGNALFORMAT_720P_60_00_SMPTE296, //!< 14 720p 60.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_59_94_SMPTE296, //!< 15 720p 59.94Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_50_00_SMPTE296, //!< 16 720p 50.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274, //!< 17 1080I 48.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274, //!< 18 1080I 47.96Hz (SMPTE274) - NVVIOSIGNALFORMAT_720P_30_00_SMPTE296, //!< 19 720p 30.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_29_97_SMPTE296, //!< 20 720p 29.97Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_25_00_SMPTE296, //!< 21 720p 25.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_24_00_SMPTE296, //!< 22 720p 24.00Hz (SMPTE296) - NVVIOSIGNALFORMAT_720P_23_98_SMPTE296, //!< 23 720p 23.98Hz (SMPTE296) - NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372, //!< 24 2048p 30.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372, //!< 25 2048p 29.97Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372, //!< 26 2048i 60.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372, //!< 27 2048i 59.94Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372, //!< 28 2048p 25.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372, //!< 29 2048i 50.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372, //!< 30 2048p 24.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372, //!< 31 2048p 23.98Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372, //!< 32 2048i 48.00Hz (SMPTE372) - NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372, //!< 33 2048i 47.96Hz (SMPTE372) - - NVVIOSIGNALFORMAT_1080PSF_25_00_SMPTE274, //!< 34 1080PsF 25.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_29_97_SMPTE274, //!< 35 1080PsF 29.97Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_30_00_SMPTE274, //!< 36 1080PsF 30.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_24_00_SMPTE274, //!< 37 1080PsF 24.00Hz (SMPTE274) - NVVIOSIGNALFORMAT_1080PSF_23_98_SMPTE274, //!< 38 1080PsF 23.98Hz (SMPTE274) - - NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_A, //!< 39 1080P 50.00Hz (SMPTE274) 3G Level A - NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_A, //!< 40 1080P 59.94Hz (SMPTE274) 3G Level A - NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_A, //!< 41 1080P 60.00Hz (SMPTE274) 3G Level A - - NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_B, //!< 42 1080p 60.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274_3G_LEVEL_B, //!< 43 1080i 60.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372_3G_LEVEL_B, //!< 44 2048i 60.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_B, //!< 45 1080p 50.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274_3G_LEVEL_B, //!< 46 1080i 50.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372_3G_LEVEL_B, //!< 47 2048i 50.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274_3G_LEVEL_B, //!< 48 1080p 30.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372_3G_LEVEL_B, //!< 49 2048p 30.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274_3G_LEVEL_B, //!< 50 1080p 25.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372_3G_LEVEL_B, //!< 51 2048p 25.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274_3G_LEVEL_B, //!< 52 1080p 24.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372_3G_LEVEL_B, //!< 53 2048p 24.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274_3G_LEVEL_B, //!< 54 1080i 48.00Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372_3G_LEVEL_B, //!< 55 2048i 48.00Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_B, //!< 56 1080p 59.94Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274_3G_LEVEL_B, //!< 57 1080i 59.94Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372_3G_LEVEL_B, //!< 58 2048i 59.94Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274_3G_LEVEL_B, //!< 59 1080p 29.97Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372_3G_LEVEL_B, //!< 60 2048p 29.97Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080P_23_98_SMPTE274_3G_LEVEL_B, //!< 61 1080p 29.98Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372_3G_LEVEL_B, //!< 62 2048p 29.98Hz (SMPTE372) 3G Level B - NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274_3G_LEVEL_B, //!< 63 1080i 47.96Hz (SMPTE274) 3G Level B - NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372_3G_LEVEL_B, //!< 64 2048i 47.96Hz (SMPTE372) 3G Level B - - NVVIOSIGNALFORMAT_END //!< 65 To indicate end of signal format list - -}NVVIOSIGNALFORMAT; - -//! SMPTE standards format -typedef enum _NVVIOVIDEOSTANDARD -{ - NVVIOVIDEOSTANDARD_SMPTE259 , //!< SMPTE259 - NVVIOVIDEOSTANDARD_SMPTE260 , //!< SMPTE260 - NVVIOVIDEOSTANDARD_SMPTE274 , //!< SMPTE274 - NVVIOVIDEOSTANDARD_SMPTE295 , //!< SMPTE295 - NVVIOVIDEOSTANDARD_SMPTE296 , //!< SMPTE296 - NVVIOVIDEOSTANDARD_SMPTE372 , //!< SMPTE372 -}NVVIOVIDEOSTANDARD; - -//! HD or SD video type -typedef enum _NVVIOVIDEOTYPE -{ - NVVIOVIDEOTYPE_SD , //!< Standard-definition (SD) - NVVIOVIDEOTYPE_HD , //!< High-definition (HD) -}NVVIOVIDEOTYPE; - -//! Interlace mode -typedef enum _NVVIOINTERLACEMODE -{ - NVVIOINTERLACEMODE_PROGRESSIVE , //!< Progressive (p) - NVVIOINTERLACEMODE_INTERLACE , //!< Interlace (i) - NVVIOINTERLACEMODE_PSF , //!< Progressive Segment Frame (psf) -}NVVIOINTERLACEMODE; - -//! Video data format -typedef enum _NVVIODATAFORMAT -{ - NVVIODATAFORMAT_UNKNOWN = -1 , //!< Invalid DataFormat - NVVIODATAFORMAT_R8G8B8_TO_YCRCB444 , //!< R8:G8:B8 => YCrCb (4:4:4) - NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4444 , //!< R8:G8:B8:A8 => YCrCbA (4:4:4:4) - NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4444 , //!< R8:G8:B8:Z10 => YCrCbZ (4:4:4:4) - NVVIODATAFORMAT_R8G8B8_TO_YCRCB422 , //!< R8:G8:B8 => YCrCb (4:2:2) - NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4224 , //!< R8:G8:B8:A8 => YCrCbA (4:2:2:4) - NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4224 , //!< R8:G8:B8:Z10 => YCrCbZ (4:2:2:4) - NVVIODATAFORMAT_X8X8X8_444_PASSTHRU , //!< R8:G8:B8 => RGB (4:4:4) - NVVIODATAFORMAT_X8X8X8A8_4444_PASSTHRU , //!< R8:G8:B8:A8 => RGBA (4:4:4:4) - NVVIODATAFORMAT_X8X8X8Z10_4444_PASSTHRU , //!< R8:G8:B8:Z10 => RGBZ (4:4:4:4) - NVVIODATAFORMAT_X10X10X10_444_PASSTHRU , //!< Y10:CR10:CB10 => YCrCb (4:4:4) - NVVIODATAFORMAT_X10X8X8_444_PASSTHRU , //!< Y10:CR8:CB8 => YCrCb (4:4:4) - NVVIODATAFORMAT_X10X8X8A10_4444_PASSTHRU , //!< Y10:CR8:CB8:A10 => YCrCbA (4:4:4:4) - NVVIODATAFORMAT_X10X8X8Z10_4444_PASSTHRU , //!< Y10:CR8:CB8:Z10 => YCrCbZ (4:4:4:4) - NVVIODATAFORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422 , //!< R8:G8:B8 + R8:G8:B8 => YCrCb (4:2:2 + 4:2:2) - NVVIODATAFORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU , //!< Y8:CR8:CB8 + Y8:CR8:CB8 => YCrCb (4:2:2 + 4:2:2) - NVVIODATAFORMAT_R10G10B10_TO_YCRCB422 , //!< R10:G10:B10 => YCrCb (4:2:2) - NVVIODATAFORMAT_R10G10B10_TO_YCRCB444 , //!< R10:G10:B10 => YCrCb (4:4:4) - NVVIODATAFORMAT_X12X12X12_444_PASSTHRU , //!< X12:X12:X12 => XXX (4:4:4) - NVVIODATAFORMAT_X12X12X12_422_PASSTHRU , //!< X12:X12:X12 => XXX (4:2:2) - NVVIODATAFORMAT_Y10CR10CB10_TO_YCRCB422 , //!< Y10:CR10:CB10 => YCrCb (4:2:2) - NVVIODATAFORMAT_Y8CR8CB8_TO_YCRCB422 , //!< Y8:CR8:CB8 => YCrCb (4:2:2) - NVVIODATAFORMAT_Y10CR8CB8A10_TO_YCRCBA4224 , //!< Y10:CR8:CB8:A10 => YCrCbA (4:2:2:4) - NVVIODATAFORMAT_R10G10B10_TO_RGB444 , //!< R10:G10:B10 => RGB (4:4:4) - NVVIODATAFORMAT_R12G12B12_TO_YCRCB444 , //!< R12:G12:B12 => YCrCb (4:4:4) - NVVIODATAFORMAT_R12G12B12_TO_YCRCB422 , //!< R12:G12:B12 => YCrCb (4:2:2) -}NVVIODATAFORMAT; - -//! Video output area -typedef enum _NVVIOOUTPUTAREA -{ - NVVIOOUTPUTAREA_FULLSIZE , //!< Output to entire video resolution (full size) - NVVIOOUTPUTAREA_SAFEACTION , //!< Output to centered 90% of video resolution (safe action) - NVVIOOUTPUTAREA_SAFETITLE , //!< Output to centered 80% of video resolution (safe title) -}NVVIOOUTPUTAREA; - -//! Synchronization source -typedef enum _NVVIOSYNCSOURCE -{ - NVVIOSYNCSOURCE_SDISYNC , //!< SDI Sync (Digital input) - NVVIOSYNCSOURCE_COMPSYNC , //!< COMP Sync (Composite input) -}NVVIOSYNCSOURCE; - -//! Composite synchronization type -typedef enum _NVVIOCOMPSYNCTYPE -{ - NVVIOCOMPSYNCTYPE_AUTO , //!< Auto-detect - NVVIOCOMPSYNCTYPE_BILEVEL , //!< Bi-level signal - NVVIOCOMPSYNCTYPE_TRILEVEL , //!< Tri-level signal -}NVVIOCOMPSYNCTYPE; - -//! Video input output status -typedef enum _NVVIOINPUTOUTPUTSTATUS -{ - NVINPUTOUTPUTSTATUS_OFF , //!< Not in use - NVINPUTOUTPUTSTATUS_ERROR , //!< Error detected - NVINPUTOUTPUTSTATUS_SDI_SD , //!< SDI (standard-definition) - NVINPUTOUTPUTSTATUS_SDI_HD , //!< SDI (high-definition) -}NVVIOINPUTOUTPUTSTATUS; - -//! Synchronization input status -typedef enum _NVVIOSYNCSTATUS -{ - NVVIOSYNCSTATUS_OFF , //!< Sync not detected - NVVIOSYNCSTATUS_ERROR , //!< Error detected - NVVIOSYNCSTATUS_SYNCLOSS , //!< Genlock in use, format mismatch with output - NVVIOSYNCSTATUS_COMPOSITE , //!< Composite sync - NVVIOSYNCSTATUS_SDI_SD , //!< SDI sync (standard-definition) - NVVIOSYNCSTATUS_SDI_HD , //!< SDI sync (high-definition) -}NVVIOSYNCSTATUS; - -//! Video Capture Status -typedef enum _NVVIOCAPTURESTATUS -{ - NVVIOSTATUS_STOPPED , //!< Sync not detected - NVVIOSTATUS_RUNNING , //!< Error detected - NVVIOSTATUS_ERROR , //!< Genlock in use, format mismatch with output -}NVVIOCAPTURESTATUS; - -//! Video Capture Status -typedef enum _NVVIOSTATUSTYPE -{ - NVVIOSTATUSTYPE_IN , //!< Input Status - NVVIOSTATUSTYPE_OUT , //!< Output Status -}NVVIOSTATUSTYPE; - - -//! Assumption, maximum 4 SDI input and 4 SDI output cards supported on a system -#define NVAPI_MAX_VIO_DEVICES 8 - -//! 4 physical jacks supported on each SDI input card. -#define NVAPI_MAX_VIO_JACKS 4 - - -//! Each physical jack an on SDI input card can have -//! two "channels" in the case of "3G" VideoFormats, as specified -//! by SMPTE 425; for non-3G VideoFormats, only the first channel within -//! a physical jack is valid. -#define NVAPI_MAX_VIO_CHANNELS_PER_JACK 2 - -//! 4 Streams, 1 per physical jack -#define NVAPI_MAX_VIO_STREAMS 4 - -#define NVAPI_MIN_VIO_STREAMS 1 - -//! SDI input supports a max of 2 links per stream -#define NVAPI_MAX_VIO_LINKS_PER_STREAM 2 - - -#define NVAPI_MAX_FRAMELOCK_MAPPING_MODES 20 - -//! Min number of capture images -#define NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES 1 - -//! Max number of capture images -#define NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES 32 - -//! Default number of capture images -#define NVAPI_GVI_DEFAULT_RAW_CAPTURE_IMAGES 5 - - - -// Data Signal notification events. These need a event handler in RM. -// Register/Unregister and PopEvent NVAPI's are already available. - -//! Device configuration -typedef enum _NVVIOCONFIGTYPE -{ - NVVIOCONFIGTYPE_IN , //!< Input Status - NVVIOCONFIGTYPE_OUT , //!< Output Status -}NVVIOCONFIGTYPE; - -typedef enum _NVVIOCOLORSPACE -{ - NVVIOCOLORSPACE_UNKNOWN, - NVVIOCOLORSPACE_YCBCR, - NVVIOCOLORSPACE_YCBCRA, - NVVIOCOLORSPACE_YCBCRD, - NVVIOCOLORSPACE_GBR, - NVVIOCOLORSPACE_GBRA, - NVVIOCOLORSPACE_GBRD, -} NVVIOCOLORSPACE; - -//! Component sampling -typedef enum _NVVIOCOMPONENTSAMPLING -{ - NVVIOCOMPONENTSAMPLING_UNKNOWN, - NVVIOCOMPONENTSAMPLING_4444, - NVVIOCOMPONENTSAMPLING_4224, - NVVIOCOMPONENTSAMPLING_444, - NVVIOCOMPONENTSAMPLING_422 -} NVVIOCOMPONENTSAMPLING; - -typedef enum _NVVIOBITSPERCOMPONENT -{ - NVVIOBITSPERCOMPONENT_UNKNOWN, - NVVIOBITSPERCOMPONENT_8, - NVVIOBITSPERCOMPONENT_10, - NVVIOBITSPERCOMPONENT_12, -} NVVIOBITSPERCOMPONENT; - -typedef enum _NVVIOLINKID -{ - NVVIOLINKID_UNKNOWN, - NVVIOLINKID_A, - NVVIOLINKID_B, - NVVIOLINKID_C, - NVVIOLINKID_D -} NVVIOLINKID; - - -typedef enum _NVVIOANCPARITYCOMPUTATION -{ - NVVIOANCPARITYCOMPUTATION_AUTO, - NVVIOANCPARITYCOMPUTATION_ON, - NVVIOANCPARITYCOMPUTATION_OFF -} NVVIOANCPARITYCOMPUTATION; - - - -//! @} - - -//--------------------------------------------------------------------- -// Structures -//--------------------------------------------------------------------- - -//! \addtogroup vidio -//! @{ - - -//! Supports Serial Digital Interface (SDI) output -#define NVVIOCAPS_VIDOUT_SDI 0x00000001 - -//! Supports Internal timing source -#define NVVIOCAPS_SYNC_INTERNAL 0x00000100 - -//! Supports Genlock timing source -#define NVVIOCAPS_SYNC_GENLOCK 0x00000200 - -//! Supports Serial Digital Interface (SDI) synchronization input -#define NVVIOCAPS_SYNCSRC_SDI 0x00001000 - -//! Supports Composite synchronization input -#define NVVIOCAPS_SYNCSRC_COMP 0x00002000 - -//! Supports Desktop transparent mode -#define NVVIOCAPS_OUTPUTMODE_DESKTOP 0x00010000 - -//! Supports OpenGL application mode -#define NVVIOCAPS_OUTPUTMODE_OPENGL 0x00020000 - -//! Supports Serial Digital Interface (SDI) input -#define NVVIOCAPS_VIDIN_SDI 0x00100000 - -//! Supports Packed ANC -#define NVVIOCAPS_PACKED_ANC_SUPPORTED 0x00200000 - -//! Supports ANC audio blanking -#define NVVIOCAPS_AUDIO_BLANKING_SUPPORTED 0x00400000 - -//! SDI-class interface: SDI output with two genlock inputs -#define NVVIOCLASS_SDI 0x00000001 - -//! Device capabilities -typedef struct _NVVIOCAPS -{ - NvU32 version; //!< Structure version - NvAPI_String adapterName; //!< Graphics adapter name - NvU32 adapterClass; //!< Graphics adapter classes (NVVIOCLASS_SDI mask) - NvU32 adapterCaps; //!< Graphics adapter capabilities (NVVIOCAPS_* mask) - NvU32 dipSwitch; //!< On-board DIP switch settings bits - NvU32 dipSwitchReserved; //!< On-board DIP switch settings reserved bits - NvU32 boardID; //!< Board ID - //! Driver version - struct // - { - NvU32 majorVersion; //!< Major version. For GVI, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD) - NvU32 minorVersion; //!< Minor version. For GVI, minorVersion contains Revison(HIWORD) And Build(LOWORD) - } driver; // - //! Firmware version - struct - { - NvU32 majorVersion; //!< Major version. In version 2, for both GVI and GVO, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD) - NvU32 minorVersion; //!< Minor version. In version 2, for both GVI and GVO, minorVersion contains Revison(HIWORD) And Build(LOWORD) - } firmWare; // - NVVIOOWNERID ownerId; //!< Unique identifier for owner of video output (NVVIOOWNERID_INVALID if free running) - NVVIOOWNERTYPE ownerType; //!< Owner type (OpenGL application or Desktop mode) -} NVVIOCAPS; - -//! Macro for constructing the version field of NVVIOCAPS -#define NVVIOCAPS_VER1 MAKE_NVAPI_VERSION(NVVIOCAPS,1) -#define NVVIOCAPS_VER2 MAKE_NVAPI_VERSION(NVVIOCAPS,2) -#define NVVIOCAPS_VER NVVIOCAPS_VER2 - -//! Input channel status -typedef struct _NVVIOCHANNELSTATUS -{ - NvU32 smpte352; //!< 4-byte SMPTE 352 video payload identifier - NVVIOSIGNALFORMAT signalFormat; //!< Signal format - NVVIOBITSPERCOMPONENT bitsPerComponent; //!< Bits per component - NVVIOCOMPONENTSAMPLING samplingFormat; //!< Sampling format - NVVIOCOLORSPACE colorSpace; //!< Color space - NVVIOLINKID linkID; //!< Link ID -} NVVIOCHANNELSTATUS; - -//! Input device status -typedef struct _NVVIOINPUTSTATUS -{ - NVVIOCHANNELSTATUS vidIn[NVAPI_MAX_VIO_JACKS][NVAPI_MAX_VIO_CHANNELS_PER_JACK]; //!< Video input status per channel within a jack - NVVIOCAPTURESTATUS captureStatus; //!< status of video capture -} NVVIOINPUTSTATUS; - -//! Output device status -typedef struct _NVVIOOUTPUTSTATUS -{ - NVVIOINPUTOUTPUTSTATUS vid1Out; //!< Video 1 output status - NVVIOINPUTOUTPUTSTATUS vid2Out; //!< Video 2 output status - NVVIOSYNCSTATUS sdiSyncIn; //!< SDI sync input status - NVVIOSYNCSTATUS compSyncIn; //!< Composite sync input status - NvU32 syncEnable; //!< Sync enable (TRUE if using syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSIGNALFORMAT syncFormat; //!< Sync format - NvU32 frameLockEnable; //!< Framelock enable flag - NvU32 outputVideoLocked; //!< Output locked status - NvU32 dataIntegrityCheckErrorCount; //!< Data integrity check error count - NvU32 dataIntegrityCheckEnabled; //!< Data integrity check status enabled - NvU32 dataIntegrityCheckFailed; //!< Data integrity check status failed - NvU32 uSyncSourceLocked; //!< genlocked to framelocked to ref signal - NvU32 uPowerOn; //!< TRUE: indicates there is sufficient power -} NVVIOOUTPUTSTATUS; - -//! Video device status. -typedef struct _NVVIOSTATUS -{ - NvU32 version; //!< Structure version - NVVIOSTATUSTYPE nvvioStatusType; //!< Input or Output status - union - { - NVVIOINPUTSTATUS inStatus; //!< Input device status - NVVIOOUTPUTSTATUS outStatus; //!< Output device status - }vioStatus; -} NVVIOSTATUS; - -//! Macro for constructingthe version field of NVVIOSTATUS -#define NVVIOSTATUS_VER MAKE_NVAPI_VERSION(NVVIOSTATUS,1) - -//! Output region -typedef struct _NVVIOOUTPUTREGION -{ - NvU32 x; //!< Horizontal origin in pixels - NvU32 y; //!< Vertical origin in pixels - NvU32 width; //!< Width of region in pixels - NvU32 height; //!< Height of region in pixels -} NVVIOOUTPUTREGION; - -//! Gamma ramp (8-bit index) -typedef struct _NVVIOGAMMARAMP8 -{ - NvU16 uRed[256]; //!< Red channel gamma ramp (8-bit index, 16-bit values) - NvU16 uGreen[256]; //!< Green channel gamma ramp (8-bit index, 16-bit values) - NvU16 uBlue[256]; //!< Blue channel gamma ramp (8-bit index, 16-bit values) -} NVVIOGAMMARAMP8; - -//! Gamma ramp (10-bit index) -typedef struct _NVVIOGAMMARAMP10 -{ - NvU16 uRed[1024]; //!< Red channel gamma ramp (10-bit index, 16-bit values) - NvU16 uGreen[1024]; //!< Green channel gamma ramp (10-bit index, 16-bit values) - NvU16 uBlue[1024]; //!< Blue channel gamma ramp (10-bit index, 16-bit values) -} NVVIOGAMMARAMP10; - - -//! Sync delay -typedef struct _NVVIOSYNCDELAY -{ - NvU32 version; //!< Structure version - NvU32 horizontalDelay; //!< Horizontal delay in pixels - NvU32 verticalDelay; //!< Vertical delay in lines -} NVVIOSYNCDELAY; - -//! Macro for constructing the version field of NVVIOSYNCDELAY -#define NVVIOSYNCDELAY_VER MAKE_NVAPI_VERSION(NVVIOSYNCDELAY,1) - - -//! Video mode information -typedef struct _NVVIOVIDEOMODE -{ - NvU32 horizontalPixels; //!< Horizontal resolution (in pixels) - NvU32 verticalLines; //!< Vertical resolution for frame (in lines) - float fFrameRate; //!< Frame rate - NVVIOINTERLACEMODE interlaceMode; //!< Interlace mode - NVVIOVIDEOSTANDARD videoStandard; //!< SMPTE standards format - NVVIOVIDEOTYPE videoType; //!< HD or SD signal classification -} NVVIOVIDEOMODE; - -//! Signal format details -typedef struct _NVVIOSIGNALFORMATDETAIL -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format enumerated value - NVVIOVIDEOMODE videoMode; //!< Video mode for signal format -}NVVIOSIGNALFORMATDETAIL; - - -//! R8:G8:B8 -#define NVVIOBUFFERFORMAT_R8G8B8 0x00000001 - -//! R8:G8:B8:Z24 -#define NVVIOBUFFERFORMAT_R8G8B8Z24 0x00000002 - -//! R8:G8:B8:A8 -#define NVVIOBUFFERFORMAT_R8G8B8A8 0x00000004 - -//! R8:G8:B8:A8:Z24 -#define NVVIOBUFFERFORMAT_R8G8B8A8Z24 0x00000008 - -//! R16FP:G16FP:B16FP -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FP 0x00000010 - -//! R16FP:G16FP:B16FP:Z24 -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPZ24 0x00000020 - -//! R16FP:G16FP:B16FP:A16FP -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FP 0x00000040 - -//! R16FP:G16FP:B16FP:A16FP:Z24 -#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FPZ24 0x00000080 - - - -//! Data format details -typedef struct _NVVIODATAFORMATDETAIL -{ - NVVIODATAFORMAT dataFormat; //!< Data format enumerated value - NvU32 vioCaps; //!< Data format capabilities (NVVIOCAPS_* mask) -}NVVIODATAFORMATDETAIL; - -//! Colorspace conversion -typedef struct _NVVIOCOLORCONVERSION -{ - NvU32 version; //!< Structure version - float colorMatrix[3][3]; //!< Output[n] = - float colorOffset[3]; //!< Input[0] * colorMatrix[n][0] + - float colorScale[3]; //!< Input[1] * colorMatrix[n][1] + - //!< Input[2] * colorMatrix[n][2] + - //!< OutputRange * colorOffset[n] - //!< where OutputRange is the standard magnitude of - //!< Output[n][n] and colorMatrix and colorOffset - //!< values are within the range -1.0 to +1.0 - NvU32 compositeSafe; //!< compositeSafe constrains luminance range when using composite output -} NVVIOCOLORCONVERSION; - -//! macro for constructing the version field of _NVVIOCOLORCONVERSION. -#define NVVIOCOLORCONVERSION_VER MAKE_NVAPI_VERSION(NVVIOCOLORCONVERSION,1) - -//! Gamma correction -typedef struct _NVVIOGAMMACORRECTION -{ - NvU32 version; //!< Structure version - NvU32 vioGammaCorrectionType; //!< Gamma correction type (8-bit or 10-bit) - //! Gamma correction: - union - { - NVVIOGAMMARAMP8 gammaRamp8; //!< Gamma ramp (8-bit index, 16-bit values) - NVVIOGAMMARAMP10 gammaRamp10; //!< Gamma ramp (10-bit index, 16-bit values) - }gammaRamp; - float fGammaValueR; //!< Red Gamma value within gamma ranges. 0.5 - 6.0 - float fGammaValueG; //!< Green Gamma value within gamma ranges. 0.5 - 6.0 - float fGammaValueB; //!< Blue Gamma value within gamma ranges. 0.5 - 6.0 -} NVVIOGAMMACORRECTION; - -//! Macro for constructing thevesion field of _NVVIOGAMMACORRECTION -#define NVVIOGAMMACORRECTION_VER MAKE_NVAPI_VERSION(NVVIOGAMMACORRECTION,1) - -//! Maximum number of ranges per channel -#define MAX_NUM_COMPOSITE_RANGE 2 - - -typedef struct _NVVIOCOMPOSITERANGE -{ - NvU32 uRange; - NvU32 uEnabled; - NvU32 uMin; - NvU32 uMax; -} NVVIOCOMPOSITERANGE; - - - -// Device configuration (fields masks indicating NVVIOCONFIG fields to use for NvAPI_VIO_GetConfig/NvAPI_VIO_SetConfig() ) -// -#define NVVIOCONFIG_SIGNALFORMAT 0x00000001 //!< fields: signalFormat -#define NVVIOCONFIG_DATAFORMAT 0x00000002 //!< fields: dataFormat -#define NVVIOCONFIG_OUTPUTREGION 0x00000004 //!< fields: outputRegion -#define NVVIOCONFIG_OUTPUTAREA 0x00000008 //!< fields: outputArea -#define NVVIOCONFIG_COLORCONVERSION 0x00000010 //!< fields: colorConversion -#define NVVIOCONFIG_GAMMACORRECTION 0x00000020 //!< fields: gammaCorrection -#define NVVIOCONFIG_SYNCSOURCEENABLE 0x00000040 //!< fields: syncSource and syncEnable -#define NVVIOCONFIG_SYNCDELAY 0x00000080 //!< fields: syncDelay -#define NVVIOCONFIG_COMPOSITESYNCTYPE 0x00000100 //!< fields: compositeSyncType -#define NVVIOCONFIG_FRAMELOCKENABLE 0x00000200 //!< fields: EnableFramelock -#define NVVIOCONFIG_422FILTER 0x00000400 //!< fields: bEnable422Filter -#define NVVIOCONFIG_COMPOSITETERMINATE 0x00000800 //!< fields: bCompositeTerminate (Not supported on Quadro FX 4000 SDI) -#define NVVIOCONFIG_DATAINTEGRITYCHECK 0x00001000 //!< fields: bEnableDataIntegrityCheck (Not supported on Quadro FX 4000 SDI) -#define NVVIOCONFIG_CSCOVERRIDE 0x00002000 //!< fields: colorConversion override -#define NVVIOCONFIG_FLIPQUEUELENGTH 0x00004000 //!< fields: flipqueuelength control -#define NVVIOCONFIG_ANCTIMECODEGENERATION 0x00008000 //!< fields: bEnableANCTimeCodeGeneration -#define NVVIOCONFIG_COMPOSITE 0x00010000 //!< fields: bEnableComposite -#define NVVIOCONFIG_ALPHAKEYCOMPOSITE 0x00020000 //!< fields: bEnableAlphaKeyComposite -#define NVVIOCONFIG_COMPOSITE_Y 0x00040000 //!< fields: compRange -#define NVVIOCONFIG_COMPOSITE_CR 0x00080000 //!< fields: compRange -#define NVVIOCONFIG_COMPOSITE_CB 0x00100000 //!< fields: compRange -#define NVVIOCONFIG_FULL_COLOR_RANGE 0x00200000 //!< fields: bEnableFullColorRange -#define NVVIOCONFIG_RGB_DATA 0x00400000 //!< fields: bEnableRGBData -#define NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE 0x00800000 //!< fields: bEnableSDIOutput -#define NVVIOCONFIG_STREAMS 0x01000000 //!< fields: streams -#define NVVIOCONFIG_ANC_PARITY_COMPUTATION 0x02000000 //!< fields: ancParityComputation -#define NVVIOCONFIG_ANC_AUDIO_REPEAT 0x04000000 //!< fields: enableAudioBlanking - - -// Don't forget to update NVVIOCONFIG_VALIDFIELDS in nvapi.spec when NVVIOCONFIG_ALLFIELDS changes. -#define NVVIOCONFIG_ALLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_GAMMACORRECTION | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_FLIPQUEUELENGTH | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_FULL_COLOR_RANGE | \ - NVVIOCONFIG_RGB_DATA | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_STREAMS | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT ) - -#define NVVIOCONFIG_VALIDFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_GAMMACORRECTION | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_FLIPQUEUELENGTH | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_FULL_COLOR_RANGE | \ - NVVIOCONFIG_RGB_DATA | \ - NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \ - NVVIOCONFIG_STREAMS | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT) - -#define NVVIOCONFIG_DRIVERFIELDS ( NVVIOCONFIG_OUTPUTREGION | \ - NVVIOCONFIG_OUTPUTAREA | \ - NVVIOCONFIG_COLORCONVERSION | \ - NVVIOCONFIG_FLIPQUEUELENGTH) - -#define NVVIOCONFIG_GAMMAFIELDS ( NVVIOCONFIG_GAMMACORRECTION ) - -#define NVVIOCONFIG_RMCTRLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_422FILTER | \ - NVVIOCONFIG_COMPOSITETERMINATE | \ - NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB) - -#define NVVIOCONFIG_RMSKEWFIELDS ( NVVIOCONFIG_SYNCDELAY ) - -#define NVVIOCONFIG_ALLOWSDIRUNNING_FIELDS ( NVVIOCONFIG_DATAINTEGRITYCHECK | \ - NVVIOCONFIG_SYNCDELAY | \ - NVVIOCONFIG_CSCOVERRIDE | \ - NVVIOCONFIG_ANCTIMECODEGENERATION | \ - NVVIOCONFIG_COMPOSITE | \ - NVVIOCONFIG_ALPHAKEYCOMPOSITE | \ - NVVIOCONFIG_COMPOSITE_Y | \ - NVVIOCONFIG_COMPOSITE_CR | \ - NVVIOCONFIG_COMPOSITE_CB | \ - NVVIOCONFIG_ANC_PARITY_COMPUTATION) - - - #define NVVIOCONFIG_RMMODESET_FIELDS ( NVVIOCONFIG_SIGNALFORMAT | \ - NVVIOCONFIG_DATAFORMAT | \ - NVVIOCONFIG_SYNCSOURCEENABLE | \ - NVVIOCONFIG_FRAMELOCKENABLE | \ - NVVIOCONFIG_COMPOSITESYNCTYPE | \ - NVVIOCONFIG_ANC_AUDIO_REPEAT) - - -//! Output device configuration -// No members can be deleted from below structure. Only add new members at the -// end of the structure. -typedef struct _NVVIOOUTPUTCONFIG_V1 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flipqueue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Inicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format -} NVVIOOUTPUTCONFIG_V1; - -typedef struct _NVVIOOUTPUTCONFIG_V2 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format - NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off) -} NVVIOOUTPUTCONFIG_V2; - -typedef struct _NVVIOOUTPUTCONFIG_V3 -{ - NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output - NVVIODATAFORMAT dataFormat; //!< Data format for video output - NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode) - NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area) - NVVIOCOLORCONVERSION colorConversion; //!< Color conversion. - NVVIOGAMMACORRECTION gammaCorrection; - NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource) - NVVIOSYNCSOURCE syncSource; //!< Sync source - NVVIOSYNCDELAY syncDelay; //!< Sync delay - NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type - NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off - NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format - NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter - NvU32 compositeTerminate; //!< Composite termination - NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable - NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite - NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue - NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation - NvU32 enableComposite; //!< Enable composite - NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite - NVVIOCOMPOSITERANGE compRange; //!< Composite ranges - NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF - NvU32 enableFullColorRange; //!< Flag indicating Full Color Range - NvU32 enableRGBData; //!< Indicates data is in RGB format - NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off) - NvU32 enableAudioBlanking; //!< Enable HANC audio blanking on repeat frames -} NVVIOOUTPUTCONFIG_V3; - -//! Stream configuration -typedef struct _NVVIOSTREAM -{ - NvU32 bitsPerComponent; //!< Bits per component - NVVIOCOMPONENTSAMPLING sampling; //!< Sampling - NvU32 expansionEnable; //!< Enable/disable 4:2:2->4:4:4 expansion - NvU32 numLinks; //!< Number of active links - struct - { - NvU32 jack; //!< This stream's link[i] will use the specified (0-based) channel within the - NvU32 channel; //!< specified (0-based) jack - } links[NVAPI_MAX_VIO_LINKS_PER_STREAM]; -} NVVIOSTREAM; - -//! Input device configuration -typedef struct _NVVIOINPUTCONFIG -{ - NvU32 numRawCaptureImages; //!< numRawCaptureImages is the number of frames to keep in the capture queue. - //!< must be between NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES and NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES, - NVVIOSIGNALFORMAT signalFormat; //!< Signal format. - //!< Please note that both numRawCaptureImages and signalFormat should be set together. - NvU32 numStreams; //!< Number of active streams. - NVVIOSTREAM streams[NVAPI_MAX_VIO_STREAMS]; //!< Stream configurations - NvU32 bTestMode; //!< This attribute controls the GVI test mode. - //!< Possible values 0/1. When testmode enabled, the - //!< GVI device will generate fake data as quickly as possible. -} NVVIOINPUTCONFIG; - -typedef struct _NVVIOCONFIG_V1 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V1 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V1; - - -typedef struct _NVVIOCONFIG_V2 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V2 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V2; - -typedef struct _NVVIOCONFIG_V3 -{ - NvU32 version; //!< Structure version - NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use - NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration - union - { - NVVIOINPUTCONFIG inConfig; //!< Input device configuration - NVVIOOUTPUTCONFIG_V3 outConfig; //!< Output device configuration - }vioConfig; -} NVVIOCONFIG_V3; -typedef NVVIOOUTPUTCONFIG_V3 NVVIOOUTPUTCONFIG; -typedef NVVIOCONFIG_V3 NVVIOCONFIG; - -#define NVVIOCONFIG_VER1 MAKE_NVAPI_VERSION(NVVIOCONFIG_V1,1) -#define NVVIOCONFIG_VER2 MAKE_NVAPI_VERSION(NVVIOCONFIG_V2,2) -#define NVVIOCONFIG_VER3 MAKE_NVAPI_VERSION(NVVIOCONFIG_V3,3) -#define NVVIOCONFIG_VER NVVIOCONFIG_VER3 - - -typedef struct -{ - NvPhysicalGpuHandle hPhysicalGpu; //!< Handle to Physical GPU (This could be NULL for GVI device if its not binded) - NvVioHandle hVioHandle; //!Create Stereo Handle->InitActivation->Reset Device -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 302 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] bDelayed Use delayed activation -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// - -//! \addtogroup stereoapi -//! @{ - -//! InitActivation Flags -typedef enum _NVAPI_STEREO_INIT_ACTIVATION_FLAGS -{ - NVAPI_STEREO_INIT_ACTIVATION_IMMEDIATE = 0X00, - NVAPI_STEREO_INIT_ACTIVATION_DELAYED = 0x01, -} NVAPI_STEREO_INIT_ACTIVATION_FLAGS; - -NVAPI_INTERFACE NvAPI_Stereo_InitActivation(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_INIT_ACTIVATION_FLAGS flags); - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Trigger_Activation -// -//! DESCRIPTION: This API allows an application to trigger creation of a stereo desktop, -//! in case the creation was stopped on application launch. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! \since Release: 302 -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE - Stereo InitActivation not called. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Trigger_Activation(__in StereoHandle hStereoHandle); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_CapturePngImage -// -//! DESCRIPTION: This API captures the current stereo image in PNG stereo format. -//! Only the last capture call per flip will be effective. -//! -//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! -//! \retval ::NVAPI_OK Image captured. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_CapturePngImage(StereoHandle stereoHandle); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl -// -//! DESCRIPTION: This API turns on/off reverse stereo blit. -//! -//! HOW TO USE: Use after the stereo handle for the device interface is created via successfull call to the appropriate -//! NvAPI_Stereo_CreateHandleFrom() function. -//! After reversed stereo blit control is turned on, blits from the stereo surface will -//! produce the right-eye image in the left side of the destination surface and the left-eye -//! image in the right side of the destination surface. -//! -//! In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used. -//! Conditions: -//! - DstWidth == 2*SrcWidth -//! - DstHeight == SrcHeight -//! - Src surface is the stereo surface. -//! - SrcRect must be {0,0,SrcWidth,SrcHeight} -//! - DstRect must be {0,0,DstWidth,DstHeight} -//! -//! In DirectX 10, ResourceCopyRegion must be used. -//! Conditions: -//! - DstWidth == 2*SrcWidth -//! - DstHeight == SrcHeight -//! - dstX == 0, -//! - dstY == 0, -//! - dstZ == 0, -//! - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1; -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 185 -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] TurnOn != 0 : Turns on \n -//! == 0 : Turns off -//! -//! -//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_ReverseStereoBlitControl(StereoHandle hStereoHandle, NvU8 TurnOn); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage -// -//! DESCRIPTION: This API is a Setup notification message that the stereo driver uses to notify the application -//! when the user changes the stereo driver state. -//! -//! When the user changes the stereo state (Activated or Deactivated, separation or conversion) -//! the stereo driver posts a defined message with the following parameters: -//! -//! lParam is the current conversion. (Actual conversion is *(float*)&lParam ) -//! -//! wParam == MAKEWPARAM(l, h) where -//! - l == 0 if stereo is deactivated -//! - l == 1 if stereo is deactivated -//! - h is the current separation. (Actual separation is float(h*100.f/0xFFFF) -//! -//! Call this API with NULL hWnd to prohibit notification. -//! -//! WHEN TO USE: Use after the stereo handle for device interface is created via successful call to appropriate -//! NvAPI_Stereo_CreateHandleFrom() function. -//! -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 180 -//! -//! -//! \param [in] stereoHandle Stereo handle corresponding to the device interface. -//! \param [in] hWnd Window HWND that will be notified when the user changes the stereo driver state. -//! Actual HWND must be cast to an NvU64. -//! \param [in] messageID MessageID of the message that will be posted to hWnd -//! -//! \retval ::NVAPI_OK Notification set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetNotificationMessage(StereoHandle hStereoHandle, NvU64 hWnd,NvU64 messageID); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetActiveEye -// -//! \fn NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye); -//! DESCRIPTION: This API sets the back buffer to left or right in Direct stereo mode. -//! -//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate -//! NvAPI_Stereo_CreateHandleFrom function. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] StereoEye Defines active eye in Direct stereo mode -//! -//! \retval ::NVAPI_OK - Active eye is set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_INVALID_ARGUMENT - StereoEye parameter has not allowed value. -//! \retval ::NVAPI_SET_NOT_ALLOWED - Current stereo mode is not Direct -//! \retval ::NVAPI_ERROR - Something is wrong (generic error). -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NV_StereoActiveEye -{ - NVAPI_STEREO_EYE_RIGHT = 1, - NVAPI_STEREO_EYE_LEFT = 2, - NVAPI_STEREO_EYE_MONO = 3, -} NV_STEREO_ACTIVE_EYE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetDriverMode -// -//! \fn NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode ); -//! DESCRIPTION: This API sets the 3D stereo driver mode: Direct or Automatic -//! -//! HOW TO USE: This API must be called before the device is created. -//! Applies to DirectX 9 and higher. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] mode Defines the 3D stereo driver mode: Direct or Automatic -//! -//! \retval ::NVAPI_OK Active eye is set. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_INVALID_ARGUMENT mode parameter has not allowed value. -//! \retval ::NVAPI_ERROR Something is wrong (generic error). -// -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NV_StereoDriverMode -{ - NVAPI_STEREO_DRIVER_MODE_AUTOMATIC = 0, - NVAPI_STEREO_DRIVER_MODE_DIRECT = 2, -} NV_STEREO_DRIVER_MODE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode ); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetEyeSeparation -// -//! DESCRIPTION: This API returns eye separation as a ratio of /. -//! -//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate API. Applies only to DirectX 9 and up. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] stereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pSeparation Eye separation. -//! -//! \retval ::NVAPI_OK Active eye is set. -//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR (generic error). -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetEyeSeparation(StereoHandle hStereoHandle, float *pSeparation ); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_IsWindowedModeSupported -// -//! DESCRIPTION: This API returns availability of windowed mode stereo -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] bSupported(OUT) != 0 - supported, \n -//! == 0 - is not supported -//! -//! -//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull. -//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized. -//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized. -//! \retval ::NVAPI_ERROR Something is wrong (generic error). -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_IsWindowedModeSupported(NvU8* bSupported); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetSurfaceCreationMode -// -//! \function NvAPI_Stereo_SetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE creationMode) -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [in] creationMode New surface creation mode for this device interface. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API sets surface creation mode for this device interface. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -typedef enum _NVAPI_STEREO_SURFACECREATEMODE -{ - NVAPI_STEREO_SURFACECREATEMODE_AUTO, //!< Use driver registry profile settings for surface creation mode. - NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO, //!< Always create stereo surfaces. - NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO //!< Always create mono surfaces. -} NVAPI_STEREO_SURFACECREATEMODE; - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_SetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE creationMode); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetSurfaceCreationMode -// -//! \function NvAPI_Stereo_GetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE* pCreationMode) -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pCreationMode The current creation mode for this device interface. -//! -//! \since Release: 295 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API gets surface creation mode for this device interface. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -/////////////////////////////////////////////////////////////////////////////// - -//! \ingroup stereoapi -NVAPI_INTERFACE NvAPI_Stereo_GetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE* pCreationMode); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_Debug_WasLastDrawStereoized -// -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [out] pWasStereoized Address where result of the inquiry will be placed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API checks if the last draw call was stereoized. It is a very expensive to call and should be used for debugging purpose *only*. -//! -//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! There are no return error codes with specific meaning for this API. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_Debug_WasLastDrawStereoized(__in StereoHandle hStereoHandle, __out NvU8 *pWasStereoized); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_SetDefaultProfile -// -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API defines the stereo profile used by the driver in case the application has no associated profile. -//! -//! WHEN TO USE: To take effect, this API must be called before D3D device is created. Calling once a device has been created will not affect the current device. -//! -//! \param [in] szProfileName Default profile name. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! Error codes specific to this API are described below. -//! -//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName. -//! \retval NVAPI_INVALID_ARGUMENT - szProfileName == NULL. -//! \retval NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST - Default stereo profile does not exist -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_SetDefaultProfile(__in const char* szProfileName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_Stereo_GetDefaultProfile -// -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! DESCRIPTION: This API retrieves the current default stereo profile. -//! -//! After call cbSizeOut contain 0 if default profile is not set required buffer size cbSizeOut. -//! To get needed buffer size this function can be called with szProfileName==0 and cbSizeIn == 0. -//! -//! WHEN TO USE: This API can be called at any time. -//! -//! -//! \param [in] cbSizeIn Size of buffer allocated for default stereo profile name. -//! \param [out] szProfileName Default stereo profile name. -//! \param [out] pcbSizeOut Required buffer size. -//! # ==0 - there is no default stereo profile name currently set -//! # !=0 - size of buffer required for currently set default stereo profile name including trailing '0'. -//! -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! Error codes specific to this API are described below. -//! -//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName. -//! \retval NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED - There is no default stereo profile set at this time. -//! \retval NVAPI_INVALID_ARGUMENT - pcbSizeOut == 0 or cbSizeIn >= *pcbSizeOut && szProfileName == 0 -//! \retval NVAPI_INSUFFICIENT_BUFFER - cbSizeIn < *pcbSizeOut -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_Stereo_GetDefaultProfile( __in NvU32 cbSizeIn, __out_bcount_part_opt(cbSizeIn, *pcbSizeOut) char* szProfileName, __out NvU32 *pcbSizeOut); - - -//! \ingroup stereoapi -#define NVAPI_STEREO_QUADBUFFERED_API_VERSION 0x2 - -//! \ingroup stereoapi - typedef enum _NV_StereoSwapChainMode - { - NVAPI_STEREO_SWAPCHAIN_DEFAULT = 0, - NVAPI_STEREO_SWAPCHAIN_STEREO = 1, - NVAPI_STEREO_SWAPCHAIN_MONO = 2, - } NV_STEREO_SWAPCHAIN_MODE; - -#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D1x_CreateSwapChain -// -//! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain. -//! -//! NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which -//! additionally notifies the D3D driver of the mode in which stereo mode the swap chain is to be -//! created. -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! A pointer to the device that will write 2D images to the swap chain. -//! \param [in] pDesc A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter cannot be NULL. -//! \param [out] ppSwapChain A pointer to the swap chain created. -//! \param [in] mode The stereo mode fot the swap chain. -//! NVAPI_STEREO_SWAPCHAIN_DEFAULT -//! NVAPI_STEREO_SWAPCHAIN_STEREO -//! NVAPI_STEREO_SWAPCHAIN_MONO -//! -//! \retval ::NVAPI_OK The swap chain was created successfully. -//! \retval ::NVAPI_ERROR The operation failed. -//! -//! \ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D1x_CreateSwapChain(StereoHandle hStereoHandle, - DXGI_SWAP_CHAIN_DESC* pDesc, - IDXGISwapChain** ppSwapChain, - NV_STEREO_SWAPCHAIN_MODE mode); - -#endif //if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) - - -#if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_D3D9_CreateSwapChain -// -//! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain. -//! -//! NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which -//! additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono. -//! -//! -//! \since Release: 285 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface. -//! \param [in, out] pPresentationParameters A pointer to the swap-chain description (DXGI). This parameter cannot be NULL. -//! \param [out] ppSwapChain A pointer to the swap chain created. -//! \param [in] mode The stereo mode for the swap chain. -//! NVAPI_STEREO_SWAPCHAIN_DEFAULT -//! NVAPI_STEREO_SWAPCHAIN_STEREO -//! NVAPI_STEREO_SWAPCHAIN_MONO -//! -//! \retval ::NVAPI_OK The swap chain creation was successful -//! \retval ::NVAPI_ERROR The operation failed. -//! -//!\ingroup stereoapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_D3D9_CreateSwapChain(StereoHandle hStereoHandle, - D3DPRESENT_PARAMETERS *pPresentationParameters, - IDirect3DSwapChain9 **ppSwapChain, - NV_STEREO_SWAPCHAIN_MODE mode); -#endif //if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain - - - - - -//! \addtogroup drsapi -//! @{ - - -// GPU Profile APIs - -NV_DECLARE_HANDLE(NvDRSSessionHandle); -NV_DECLARE_HANDLE(NvDRSProfileHandle); - -#define NVAPI_DRS_GLOBAL_PROFILE ((NvDRSProfileHandle) -1) - -#define NVAPI_SETTING_MAX_VALUES 100 - -typedef enum _NVDRS_SETTING_TYPE -{ - NVDRS_DWORD_TYPE, - NVDRS_BINARY_TYPE, - NVDRS_STRING_TYPE, - NVDRS_WSTRING_TYPE -} NVDRS_SETTING_TYPE; - -typedef enum _NVDRS_SETTING_LOCATION -{ - NVDRS_CURRENT_PROFILE_LOCATION, - NVDRS_GLOBAL_PROFILE_LOCATION, - NVDRS_BASE_PROFILE_LOCATION, - NVDRS_DEFAULT_PROFILE_LOCATION -} NVDRS_SETTING_LOCATION; - - -typedef struct _NVDRS_GPU_SUPPORT -{ - NvU32 geforce : 1; - NvU32 quadro : 1; - NvU32 nvs : 1; - NvU32 reserved4 : 1; - NvU32 reserved5 : 1; - NvU32 reserved6 : 1; - NvU32 reserved7 : 1; - NvU32 reserved8 : 1; - NvU32 reserved9 : 1; - NvU32 reserved10 : 1; - NvU32 reserved11 : 1; - NvU32 reserved12 : 1; - NvU32 reserved13 : 1; - NvU32 reserved14 : 1; - NvU32 reserved15 : 1; - NvU32 reserved16 : 1; - NvU32 reserved17 : 1; - NvU32 reserved18 : 1; - NvU32 reserved19 : 1; - NvU32 reserved20 : 1; - NvU32 reserved21 : 1; - NvU32 reserved22 : 1; - NvU32 reserved23 : 1; - NvU32 reserved24 : 1; - NvU32 reserved25 : 1; - NvU32 reserved26 : 1; - NvU32 reserved27 : 1; - NvU32 reserved28 : 1; - NvU32 reserved29 : 1; - NvU32 reserved30 : 1; - NvU32 reserved31 : 1; - NvU32 reserved32 : 1; -} NVDRS_GPU_SUPPORT; - -//! Enum to decide on the datatype of setting value. -typedef struct _NVDRS_BINARY_SETTING -{ - NvU32 valueLength; //!< valueLength should always be in number of bytes. - NvU8 valueData[NVAPI_BINARY_DATA_MAX]; -} NVDRS_BINARY_SETTING; - -typedef struct _NVDRS_SETTING_VALUES -{ - NvU32 version; //!< Structure Version - NvU32 numSettingValues; //!< Total number of values available in a setting. - NVDRS_SETTING_TYPE settingType; //!< Type of setting value. - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32DefaultValue; //!< Accessing default DWORD value of this setting. - NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in. - NvAPI_UnicodeString wszDefaultValue; //!< Accessing default unicode string value of this setting. - }; - union //!< Setting values can be of either DWORD, Binary values or String type, - { //!< NOT mixed types. - NvU32 u32Value; //!< All possible DWORD values for a setting - NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting - NvAPI_UnicodeString wszValue; //!< Accessing current unicode string value of this setting. - }settingValues[NVAPI_SETTING_MAX_VALUES]; -} NVDRS_SETTING_VALUES; - -//! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES -#define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1) - -typedef struct _NVDRS_SETTING_V1 -{ - NvU32 version; //!< Structure Version - NvAPI_UnicodeString settingName; //!< String name of setting - NvU32 settingId; //!< 32 bit setting Id - NVDRS_SETTING_TYPE settingType; //!< Type of setting value. - NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from. - NvU32 isCurrentPredefined; //!< It is different than 0 if the currentValue is a predefined Value, - //!< 0 if the currentValue is a user value. - NvU32 isPredefinedValid; //!< It is different than 0 if the PredefinedValue union contains a valid value. - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32PredefinedValue; //!< Accessing default DWORD value of this setting. - NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, - //!< or only valueLength will be filled in. - NvAPI_UnicodeString wszPredefinedValue; //!< Accessing default unicode string value of this setting. - }; - union //!< Setting can hold either DWORD or Binary value or string. Not mixed types. - { - NvU32 u32CurrentValue; //!< Accessing current DWORD value of this setting. - NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting. - //!< Must be allocated by caller with valueLength specifying buffer size, - //!< or only valueLength will be filled in. - NvAPI_UnicodeString wszCurrentValue; //!< Accessing current unicode string value of this setting. - }; -} NVDRS_SETTING_V1; - -//! Macro for constructing the version field of ::_NVDRS_SETTING -#define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1) - -typedef NVDRS_SETTING_V1 NVDRS_SETTING; -#define NVDRS_SETTING_VER NVDRS_SETTING_VER1 - -typedef struct _NVDRS_APPLICATION_V1 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the application -} NVDRS_APPLICATION_V1; - -typedef struct _NVDRS_APPLICATION_V2 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. -} NVDRS_APPLICATION_V2; - -typedef struct _NVDRS_APPLICATION_V3 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. - NvU32 isMetro:1; //!< Windows 8 style app - NvU32 isCommandLine:1; //!< Command line parsing for the application name - NvU32 reserved:30; //!< Reserved. Should be 0. -} NVDRS_APPLICATION_V3; - -typedef struct _NVDRS_APPLICATION_V4 -{ - NvU32 version; //!< Structure Version - NvU32 isPredefined; //!< Is the application userdefined/predefined - NvAPI_UnicodeString appName; //!< String name of the Application - NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application - NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application - NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found. - //!< When specifying multiple files, separate them using the ':' character. - NvU32 isMetro:1; //!< Windows 8 style app - NvU32 isCommandLine:1; //!< Command line parsing for the application name - NvU32 reserved:30; //!< Reserved. Should be 0. - NvAPI_UnicodeString commandLine; //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1 - //!< this contains application's command line as if it was returned by GetCommandLineW. -} NVDRS_APPLICATION_V4; - -#define NVDRS_APPLICATION_VER_V1 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V1,1) -#define NVDRS_APPLICATION_VER_V2 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V2,2) -#define NVDRS_APPLICATION_VER_V3 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V3,3) -#define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4,4) - -typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION; -#define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4 - -typedef struct _NVDRS_PROFILE_V1 -{ - NvU32 version; //!< Structure Version - NvAPI_UnicodeString profileName; //!< String name of the Profile - NVDRS_GPU_SUPPORT gpuSupport; //!< This read-only flag indicates the profile support on either - //!< Quadro, or Geforce, or both. - NvU32 isPredefined; //!< Is the Profile user-defined, or predefined - NvU32 numOfApps; //!< Total number of applications that belong to this profile. Read-only - NvU32 numOfSettings; //!< Total number of settings applied for this Profile. Read-only -} NVDRS_PROFILE_V1; - -typedef NVDRS_PROFILE_V1 NVDRS_PROFILE; - -//! Macro for constructing the version field of ::NVDRS_PROFILE -#define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1,1) -#define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1 - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateSession -// -//! DESCRIPTION: This API allocates memory and initializes the session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] *phSession Return pointer to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR: For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DestroySession -// -//! DESCRIPTION: This API frees the allocation: cleanup of NvDrsSession. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_LoadSettings -// -//! DESCRIPTION: This API loads and parses the settings data. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SaveSettings -// -//! DESCRIPTION: This API saves the settings data to the system. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SaveSettings(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_LoadSettingsFromFile -// -//! DESCRIPTION: This API loads settings from the given file path. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle -//! \param [in] fileName Binary File Name/Path -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_LoadSettingsFromFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SaveSettingsToFile -// -//! DESCRIPTION: This API saves settings to the given file path. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] fileName Binary File Name/Path -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -// -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SaveSettingsToFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName); - -//! @} - - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateProfile -// -//! DESCRIPTION: This API creates an empty profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] *pProfileInfo Input pointer to NVDRS_PROFILE. -//! \param [in] *phProfile Returns pointer to profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateProfile(NvDRSSessionHandle hSession, NVDRS_PROFILE *pProfileInfo, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteProfile -// -//! DESCRIPTION: This API deletes a profile or sets it back to a predefined value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetCurrentGlobalProfile -// -//! DESCRIPTION: This API sets the current global profile in the driver. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] wszGlobalProfileName Input current Global profile name. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvAPI_UnicodeString wszGlobalProfileName); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetCurrentGlobalProfile -// -//! DESCRIPTION: This API returns the handle to the current global profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [out] *phProfile Returns current Global profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetProfileInfo -// -//! DESCRIPTION: This API gets information about the given profile. User needs to specify the name of the Profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [out] *pProfileInfo Return the profile info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetProfileInfo -// -//! DESCRIPTION: Specifies flags for a given profile. Currently only the NVDRS_GPU_SUPPORT is -//! used to update the profile. Neither the name, number of settings or applications -//! or other profile information can be changed with this function. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pProfileInfo Input the new profile info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_FindProfileByName -// -//! DESCRIPTION: This API finds a profile in the current session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] profileName Input profileName. -//! \param [out] phProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_FindProfileByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString profileName, NvDRSProfileHandle* phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumProfiles -// -//! DESCRIPTION: This API enumerates through all the profiles in the session. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] index Input the index for enumeration. -//! \param [out] *phProfile Returns profile handle. -//! -//! RETURN STATUS: NVAPI_OK: SUCCESS if the profile is found -//! NVAPI_ERROR: For miscellaneous errors. -//! NVAPI_END_ENUMERATION: index exceeds the total number of available Profiles in DB. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumProfiles(NvDRSSessionHandle hSession, NvU32 index, NvDRSProfileHandle *phProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetNumProfiles -// -//! DESCRIPTION: This API obtains the number of profiles in the current session object. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param out] *numProfiles Returns count of profiles in the current hSession. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_API_NOT_INTIALIZED Failed to initialize. -//! \retval ::NVAPI_INVALID_ARGUMENT Invalid Arguments. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetNumProfiles(NvDRSSessionHandle hSession, NvU32 *numProfiles); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_CreateApplication -// -//! DESCRIPTION: This API adds an executable name to a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pApplication Input NVDRS_APPLICATION struct with the executable name to be added. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_CreateApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApplication); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteApplicationEx -// -//! DESCRIPTION: This API removes an executable from a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession - Input to the session handle. -//! \param [in] hProfile - Input profile handle. -//! \param [in] *pApp - Input all the information about the application to be removed. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables, -//! this error will be returned. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteApplicationEx(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApp); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteApplication -// -//! DESCRIPTION: This API removes an executable name from a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSessionPARAMETERS Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] appName Input the executable name to be removed. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables, -//! this error will be returned -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetApplicationInfo -// -//! DESCRIPTION: This API gets information about the given application. The input application name -//! must match exactly what the Profile has stored for the application. -//! This function is better used to retrieve application information from a previous -//! enumeration. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] appName Input application name. -//! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below. -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS The application name could not -// single out only one executable. -//! \retval ::NVAPI_EXECUTABLE_NOT_FOUND No application with that name is found on the profile. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetApplicationInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName, NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumApplications -// -//! DESCRIPTION: This API enumerates all the applications in a given profile from the starting index to the maximum length. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] startIndex Indicates starting index for enumeration. -//! \param [in,out] *appCount Input maximum length of the passed in arrays. Returns the actual length. -//! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumApplications(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *appCount, NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_FindApplicationByName -// -//! DESCRIPTION: This API searches the application and the associated profile for the given application name. -//! If a fully qualified path is provided, this function will always return the profile -//! the driver will apply upon running the application (on the path provided). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the hSession handle -//! \param [in] appName Input appName. For best results, provide a fully qualified path of the type -//! c:/Folder1/Folder2/App.exe -//! \param [out] *phProfile Returns profile handle. -//! \param [in,out] *pApplication Returns NVDRS_APPLICATION struct pointer. -//! -//! \return This API can return any of the error codes enumerated in #NvAPI_Status. -//! If there are return error codes with specific meaning for this API, -//! they are listed below: -//! \retval ::NVAPI_APPLICATION_NOT_FOUND If App not found -//! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the input appName was not fully qualified, this error might return in the case of multiple matches -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_FindApplicationByName(__in NvDRSSessionHandle hSession, __in NvAPI_UnicodeString appName, __out NvDRSProfileHandle *phProfile, __inout NVDRS_APPLICATION *pApplication); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_SetSetting -// -//! DESCRIPTION: This API adds/modifies a setting to a profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] *pSetting Input NVDRS_SETTING struct pointer. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_SetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_SETTING *pSetting); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSetting -// -//! DESCRIPTION: This API gets information about the given setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId. -//! \param [out] *pSetting Returns all the setting info -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting); - - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumSettings -// -//! DESCRIPTION: This API enumerates all the settings of a given profile from startIndex to the maximum length. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] startIndex Indicates starting index for enumeration. -//! \param [in,out] *settingsCount Input max length of the passed in arrays, Returns the actual length. -//! \param [out] *pSetting Returns all the settings info. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumSettings(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *settingsCount, NVDRS_SETTING *pSetting); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingIds -// -//! DESCRIPTION: This API enumerates all the Ids of all the settings recognized by NVAPI. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [out] pSettingIds User-provided array of length *pMaxCount that NVAPI will fill with IDs. -//! \param [in,out] pMaxCount Input max length of the passed in array, Returns the actual length. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! NVAPI_END_ENUMERATION: the provided pMaxCount is not enough to hold all settingIds. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingIds(NvU32 *pSettingIds, NvU32 *pMaxCount); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingValues -// -//! DESCRIPTION: This API enumerates all available setting values for a given setting. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingId Input settingId. -//! \param [in,out] pMaxNumValues Input max length of the passed in arrays, Returns the actual length. -//! \param [out] *pSettingValues Returns all available setting values and its count. -//! -//! \retval ::NVAPI_OK SUCCESS -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingValues(NvU32 settingId, NvU32 *pMaxNumValues, NVDRS_SETTING_VALUES *pSettingValues); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSettingIdFromName -// -//! DESCRIPTION: This API gets the binary ID of a setting given the setting name. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingName Input Unicode settingName. -//! \param [out] *pSettingId Returns corresponding settingId. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSettingIdFromName(NvAPI_UnicodeString settingName, NvU32 *pSettingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetSettingNameFromId -// -//! DESCRIPTION: This API gets the setting name given the binary ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] settingId Input settingId. -//! \param [in] *pSettingName Returns corresponding Unicode settingName. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found -//! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetSettingNameFromId(NvU32 settingId, NvAPI_UnicodeString *pSettingName); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_DeleteProfileSetting -// -//! DESCRIPTION: This API deletes a setting or sets it back to predefined value. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId to be deleted. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_DeleteProfileSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreAllDefaults -// -//! DESCRIPTION: This API restores the whole system to predefined(default) values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreAllDefaults(NvDRSSessionHandle hSession); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreProfileDefault -// -//! DESCRIPTION: This API restores the given profile to predefined(default) values. -//! Any and all user specified modifications will be removed. -//! If the whole profile was set by the user, the profile will be removed. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! \retval ::NVAPI_PROFILE_REMOVED SUCCESS, and the hProfile is no longer valid. -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefault(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_RestoreProfileDefaultSetting -// -//! DESCRIPTION: This API restores the given profile setting to predefined(default) values. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] hProfile Input profile handle. -//! \param [in] settingId Input settingId. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefaultSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId); - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_DRS_GetBaseProfile -// -//! DESCRIPTION: Returns the handle to the current global profile. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hSession Input to the session handle. -//! \param [in] *phProfile Returns Base profile handle. -//! -//! \retval ::NVAPI_OK SUCCESS if the profile is found -//! \retval ::NVAPI_ERROR For miscellaneous errors. -//! -//! \ingroup drsapi -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile); - - - - -//! \addtogroup sysgeneral -//! @{ - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< Chipset vendor identification - NvU32 deviceId; //!< Chipset device identification - NvAPI_ShortString szVendorName; //!< Chipset vendor Name - NvAPI_ShortString szChipsetName; //!< Chipset device Name - NvU32 flags; //!< Chipset info flags - obsolete - NvU32 subSysVendorId; //!< Chipset subsystem vendor identification - NvU32 subSysDeviceId; //!< Chipset subsystem device identification - NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name - NvU32 HBvendorId; //!< Host bridge vendor identification - NvU32 HBdeviceId; //!< Host bridge device identification - NvU32 HBsubSysVendorId; //!< Host bridge subsystem vendor identification - NvU32 HBsubSysDeviceId; //!< Host bridge subsystem device identification - -} NV_CHIPSET_INFO_v4; - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< vendor ID - NvU32 deviceId; //!< device ID - NvAPI_ShortString szVendorName; //!< vendor Name - NvAPI_ShortString szChipsetName; //!< device Name - NvU32 flags; //!< Chipset info flags - obsolete - NvU32 subSysVendorId; //!< subsystem vendor ID - NvU32 subSysDeviceId; //!< subsystem device ID - NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name -} NV_CHIPSET_INFO_v3; - -typedef enum -{ - NV_CHIPSET_INFO_HYBRID = 0x00000001, -} NV_CHIPSET_INFO_FLAGS; - -typedef struct -{ - NvU32 version; //!< structure version - NvU32 vendorId; //!< vendor ID - NvU32 deviceId; //!< device ID - NvAPI_ShortString szVendorName; //!< vendor Name - NvAPI_ShortString szChipsetName; //!< device Name - NvU32 flags; //!< Chipset info flags -} NV_CHIPSET_INFO_v2; - -typedef struct -{ - NvU32 version; //structure version - NvU32 vendorId; //vendor ID - NvU32 deviceId; //device ID - NvAPI_ShortString szVendorName; //vendor Name - NvAPI_ShortString szChipsetName; //device Name -} NV_CHIPSET_INFO_v1; - -#define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1) -#define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2) -#define NV_CHIPSET_INFO_VER_3 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v3,3) -#define NV_CHIPSET_INFO_VER_4 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v4,4) - -#define NV_CHIPSET_INFO NV_CHIPSET_INFO_v4 -#define NV_CHIPSET_INFO_VER NV_CHIPSET_INFO_VER_4 - -//! @} - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetChipSetInfo -// -//! This function returns information about the system's chipset. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 95 -//! -//! \retval NVAPI_INVALID_ARGUMENT pChipSetInfo is NULL. -//! \retval NVAPI_OK *pChipSetInfo is now set. -//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_CHIPSET_INFO version not compatible with driver. -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo); - - -//! \ingroup sysgeneral -//! Lid and dock information - used in NvAPI_GetLidDockInfo() -typedef struct -{ - NvU32 version; //! Structure version, constructed from the macro #NV_LID_DOCK_PARAMS_VER - NvU32 currentLidState; - NvU32 currentDockState; - NvU32 currentLidPolicy; - NvU32 currentDockPolicy; - NvU32 forcedLidMechanismPresent; - NvU32 forcedDockMechanismPresent; -}NV_LID_DOCK_PARAMS; - - -//! ingroup sysgeneral -#define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1) -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GetLidDockInfo -// -//! DESCRIPTION: This function returns the current lid and dock information. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 177 -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_NOT_SUPPORTED -//! \retval ::NVAPI_HANDLE_INVALIDATED -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock); - - - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetDisplayIdFromGpuAndOutputId -// -//! DESCRIPTION: This API converts a Physical GPU handle and output ID to a -//! display ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] hPhysicalGpu Handle to the physical GPU -//! \param [in] outputId Connected display output ID on the -//! target GPU - must only have one bit set -//! \param [out] displayId Pointer to an NvU32 which contains -//! the display ID -//! -//! \retval ::NVAPI_OK - completed request -//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! \retval ::NVAPI_ERROR - miscellaneous error occurred -//! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDisplayIdFromGpuAndOutputId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NvU32* displayId); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetGpuAndOutputIdFromDisplayId -// -//! DESCRIPTION: This API converts a display ID to a Physical GPU handle and output ID. -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \param [in] displayId Display ID of display to retrieve -//! GPU and outputId for -//! \param [out] hPhysicalGpu Handle to the physical GPU -//! \param [out] outputId ) Connected display output ID on the -//! target GPU will only have one bit set. -//! -//! \retval ::NVAPI_OK -//! \retval ::NVAPI_API_NOT_INTIALIZED -//! \retval ::NVAPI_ID_OUT_OF_RANGE The DisplayId corresponds to a -//! display which is not within the -//! normal outputId range. -//! \retval ::NVAPI_ERROR -//! \retval ::NVAPI_INVALID_ARGUMENT -//! -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetGpuAndOutputIdFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu, NvU32 *outputId); - - -/////////////////////////////////////////////////////////////////////////////// -// FUNCTION NAME: NvAPI_SYS_GetPhysicalGpuFromDisplayId -// -//! \code -//! DESCRIPTION: This API retrieves the Physical GPU handle of the connected display -//! -//! \since Release: 313 -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! PARAMETERS: displayId(IN) - Display ID of display to retrieve -//! GPU handle -//! hPhysicalGpu(OUT) - Handle to the physical GPU -//! -//! RETURN STATUS: -//! NVAPI_OK - completed request -//! NVAPI_API_NOT_INTIALIZED - NVAPI not initialized -//! NVAPI_ERROR - miscellaneous error occurred -//! NVAPI_INVALID_ARGUMENT - Invalid input parameter. -//! \endcode -//! \ingroup sysgeneral -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetPhysicalGpuFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu); - -typedef struct _NV_DISPLAY_DRIVER_INFO -{ - NvU32 version; //!< Structure Version. - NvU32 driverVersion; //!< Contains the driver version after successful return. - NvAPI_ShortString szBuildBranch; //!< Contains the driver-branch string after successful return. - NvU32 bIsDCHDriver : 1; //!< Contains the driver DCH status after successful return. - //!< Value of 1 means that this is DCH driver. - //!< Value of 0 means that this is not a DCH driver (NVAPI may be unable to query the DCH status of the driver due to some registry API errors, in that case the API will return with NVAPI_ERROR) - NvU32 bIsNVIDIAStudioPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Studio Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Studio Driver package. - NvU32 bIsNVIDIAGameReadyPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Game Ready Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Game Ready Driver package. - NvU32 bIsNVIDIARTXProductionBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX Enterprise Production Branch which offers ISV certifications, long life-cycle support, regular security updates, and access to the same functionality as corresponding NVIDIA Studio Driver Packages (i.e., of the same driver version number). - //!< Value of 1 means that this driver is from the NVIDIA RTX Enterprise Production Branch package. - NvU32 bIsNVIDIARTXNewFeatureBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX New Feature Branch. - //!< This driver typically gives access to new features, bug fixes, new operating system support, and other driver enhancements offered between NVIDIA RTX Enterprise Production Branch releases. Support duration for NVIDIA RTX New Feature Branches is shorter than that for NVIDIA RTX Enterprise Production Branches. - //!< Value of 1 means that this driver is from the NVIDIA RTX New Feature Branch package. - NvU32 reserved : 27; //!< Reserved for future use. -} NV_DISPLAY_DRIVER_INFO_V1; - -typedef struct _NV_DISPLAY_DRIVER_INFO_V2 -{ - NvU32 version; //!< Structure Version. - NvU32 driverVersion; //!< Contains the driver version after successful return. - NvAPI_ShortString szBuildBranch; //!< Contains the driver-branch string after successful return. - NvU32 bIsDCHDriver : 1; //!< Contains the driver DCH status after successful return. - //!< Value of 1 means that this is DCH driver. - //!< Value of 0 means that this is not a DCH driver (NVAPI may be unable to query the DCH status of the driver due to some registry API errors, in that case the API will return with NVAPI_ERROR) - NvU32 bIsNVIDIAStudioPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Studio Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Studio Driver package. - NvU32 bIsNVIDIAGameReadyPackage : 1; //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Game Ready Driver package. - //!< Value of 1 means that this driver is from the NVIDIA Game Ready Driver package. - NvU32 bIsNVIDIARTXProductionBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX Enterprise Production Branch which offers ISV certifications, long life-cycle support, regular security updates, and access to the same functionality as corresponding NVIDIA Studio Driver Packages (i.e., of the same driver version number). - //!< Value of 1 means that this driver is from the NVIDIA RTX Enterprise Production Branch package. - NvU32 bIsNVIDIARTXNewFeatureBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX New Feature Branch. - //!< This driver typically gives access to new features, bug fixes, new operating system support, and other driver enhancements offered between NVIDIA RTX Enterprise Production Branch releases. Support duration for NVIDIA RTX New Feature Branches is shorter than that for NVIDIA RTX Enterprise Production Branches. - //!< Value of 1 means that this driver is from the NVIDIA RTX New Feature Branch package. - NvU32 reserved : 27; //!< Reserved for future use. - NvAPI_ShortString szBuildBaseBranch; //!< (OUT) Contains the driver base branch string after successful return. - NvU32 reservedEx; //!< Reserved for future use -} NV_DISPLAY_DRIVER_INFO_V2; - -#define NV_DISPLAY_DRIVER_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_INFO_V1, 1) -#define NV_DISPLAY_DRIVER_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_INFO_V2, 2) -typedef NV_DISPLAY_DRIVER_INFO_V2 NV_DISPLAY_DRIVER_INFO; -#define NV_DISPLAY_DRIVER_INFO_VER NV_DISPLAY_DRIVER_INFO_VER2 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_SYS_GetDisplayDriverInfo -// -//! DESCRIPTION: This API will return information related to the NVIDIA Display Driver. -//! Note that out of the driver types - Studio, Game Ready, RTX Production Branch, RTX New Feature Branch - only one driver type can be available in system. -//! If NVAPI is unable to get the information of particular driver type, we report all flags as 0 (Unknown). -//! -//! SUPPORTED OS: Windows 7 and higher -//! -//! -//! \since Release: 396 -//! -//! \param [inout] pDriverInfo - This structure will be filled with required information. -//! -//! \return This API can return any of the error codes enumerated in -//! #NvAPI_Status. If there are return error codes with specific -//! meaning for this API, they are listed below. -//! -//! \ingroup gpu -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_SYS_GetDisplayDriverInfo(__inout NV_DISPLAY_DRIVER_INFO *pDriverInfo); - - -/*! - * Callback settings common to all client callbacks. - */ -typedef struct _NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1 -{ - /*! - * [in] Generic callback parameter which will be passed to the callback. - */ - void* pCallbackParam; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[64]; -} NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1; - -typedef NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1 NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1; - - -/*! - * Callback settings common to all periodic client callbacks. - */ -typedef struct _NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1 -{ - /*! - * [in] Super class data. - */ - NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1 super; - - /*! - * [in] Minimum interval at which callback will be called. - * - * The callback may be invoked slower than this interval if underlying - * sampling rate does not align precisely to the provided period. - */ - NvU32 callbackPeriodms; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1; - -/*! - * Callback data common to all client callbacks. - */ -typedef struct _NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1 -{ - /*! - * [out] Generic callback parameter which was passed in at registration time. - */ - void* pCallbackParam; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1; - - -/*! - * Enumeration of different utilization domains - */ -typedef enum _NV_GPU_CLIENT_UTIL_DOMAIN_ID -{ - NV_GPU_CLIENT_UTIL_DOMAIN_GRAPHICS = 0, - NV_GPU_CLIENT_UTIL_DOMAIN_FRAME_BUFFER = 1, - NV_GPU_CLIENT_UTIL_DOMAIN_VIDEO = 2, - /*! - * Reserved for future use. - */ - NV_GPU_CLIENT_UTIL_DOMAIN_RSVD = 3, -} NV_GPU_CLIENT_UTIL_DOMAIN_ID; - -#define NV_GPU_CLIENT_UTIL_DOMAINS_MAX_V1 (4) - -/*! - * Data specific to a single utilization domain. - */ -typedef struct _NV_GPU_CLIENT_UTILIZATION_DATA_V1 -{ - /*! - * [out] Utilization domain identifier. - */ - NV_GPU_CLIENT_UTIL_DOMAIN_ID utilId; - - /*! - * [out] Percentage of time where the domain is considered busy since the - * last sample. Units of percent*100; i.e. 5000 = 50%. - */ - NvU32 utilizationPercent; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[61]; -} NV_GPU_CLIENT_UTILIZATION_DATA_V1; - -/*! - * Data passed back to callback registered with - * @ref NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates. - */ -typedef struct _NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1 -{ - /*! - * [out] Super struct. - */ - NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1 super; - - /*! - * [out] Number of valid entries in `utils` array. - */ - NvU32 numUtils; - - /*! - * [out] Time at which data was collected. Represented as elapsed - * microseconds since 00:00:00 UTC on January 1, 1970. - */ - NvU64 timestamp; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[64]; - - /*! - * [out] Status data for each utilization domain. - */ - NV_GPU_CLIENT_UTILIZATION_DATA_V1 utils[NV_GPU_CLIENT_UTIL_DOMAINS_MAX_V1]; -} NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1; - -/*! - * Function prototype for a periodic utilization data callback that will be registered with NvAPI. - */ -typedef void (__cdecl *NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1)(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1* pData); - -/*! - * Data required to register a periodic callback for utilization data. - */ -typedef struct _NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1 -{ - /*! - * [in] Structure Version, must always be first. - */ - NvU32 version; - - /*! - * [in] Generic callback settings. Some data within will be passed to the - * callback when invoked. - */ - NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1 super; - - /*! - * [in] Callback. Pass in NULL or nullptr to indicate request to unregister. - */ - NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1 callback; - - /*! - * Reserved bytes for future expansion. - */ - NvU8 rsvd[64]; -} NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1; - -#define NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1, 1) -typedef NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1 NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS; -#define NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER1 - -/////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION NAME: NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates -// -//! \fn NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates() -//! \code -//! DESCRIPTION: Register to receive samples of utilization data periodically -//! via a function pointer callback. -//! -//! SUPPORTED OS: Windows 10 and higher -//! -//! -//! \since Release 455 -//! -//! \return NVAPI_OK - Registration was successful -//! NVAPI_API_NOT_INITIALIZED - NVAPI not initialized -//! NVAPI_INCOMPATIBLE_STRUCT_VERSION - Invalid structure version specified -//! NVAPI_INVALID_CONFIGURATION - Invalid software environment configuration -//! NVAPI_TIMEOUT - Registration request timed out -//! NVAPI_ERROR - Unknown underlying error -//! -//! \endcode -//! \ingroup nvtopps -/////////////////////////////////////////////////////////////////////////////// -NVAPI_INTERFACE NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates(__in NvPhysicalGpuHandle hPhysicalGpu, __in NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS* pCallbackSettings); - - - -#if (!defined(NVAPI_INTERNAL) && (((defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) && (_MSC_VER <= 1399)) || defined(NVAPI_DEPRECATED_OLD))) -#pragma deprecated( NvAPI_SetView, NvAPI_SetViewEx, NvAPI_GetDisplayDriverVersion, NvAPI_GPU_GetMemoryInfo, NvAPI_GPU_GetAllOutputs, NvAPI_GPU_GetConnectedOutputs, NvAPI_GPU_GetConnectedSLIOutputs, NvAPI_GPU_GetConnectedOutputsWithLidState, NvAPI_GPU_GetConnectedSLIOutputsWithLidState, NvAPI_GPU_GetAGPAperture, NvAPI_GPU_GetCurrentAGPRate, NvAPI_GPU_GetQuadroStatus, NvAPI_GPU_CudaEnumComputeCapableGpus, NvAPI_GPU_GetAdapterIdFromPhysicalGpu, NvAPI_GPU_GetPstatesInfoEx, NvAPI_GetView, NvAPI_GetViewEx, NvAPI_VIO_GetCapabilities, NvAPI_VIO_Open, NvAPI_VIO_Close, NvAPI_VIO_Status, NvAPI_VIO_SyncFormatDetect, NvAPI_VIO_GetConfig, NvAPI_VIO_SetConfig, NvAPI_VIO_SetCSC, NvAPI_VIO_GetCSC, NvAPI_VIO_SetGamma, NvAPI_VIO_GetGamma, NvAPI_VIO_SetSyncDelay, NvAPI_VIO_GetSyncDelay, NvAPI_VIO_GetPCIInfo, NvAPI_VIO_IsRunning, NvAPI_VIO_Start, NvAPI_VIO_Stop, NvAPI_VIO_IsFrameLockModeCompatible, NvAPI_VIO_EnumDevices, NvAPI_VIO_QueryTopology, NvAPI_VIO_EnumSignalFormats, NvAPI_VIO_EnumDataFormats ) -#endif - -#ifndef __NVAPI_EMPTY_SAL -#ifdef __nvapi_undef__ecount - #undef __ecount - #undef __nvapi_undef__ecount -#endif -#ifdef __nvapi_undef__bcount - #undef __bcount - #undef __nvapi_undef__bcount -#endif -#ifdef __nvapi_undef__in - #undef __in - #undef __nvapi_undef__in -#endif -#ifdef __nvapi_undef__in_ecount - #undef __in_ecount - #undef __nvapi_undef__in_ecount -#endif -#ifdef __nvapi_undef__in_bcount - #undef __in_bcount - #undef __nvapi_undef__in_bcount -#endif -#ifdef __nvapi_undef__in_z - #undef __in_z - #undef __nvapi_undef__in_z -#endif -#ifdef __nvapi_undef__in_ecount_z - #undef __in_ecount_z - #undef __nvapi_undef__in_ecount_z -#endif -#ifdef __nvapi_undef__in_bcount_z - #undef __in_bcount_z - #undef __nvapi_undef__in_bcount_z -#endif -#ifdef __nvapi_undef__in_nz - #undef __in_nz - #undef __nvapi_undef__in_nz -#endif -#ifdef __nvapi_undef__in_ecount_nz - #undef __in_ecount_nz - #undef __nvapi_undef__in_ecount_nz -#endif -#ifdef __nvapi_undef__in_bcount_nz - #undef __in_bcount_nz - #undef __nvapi_undef__in_bcount_nz -#endif -#ifdef __nvapi_undef__out - #undef __out - #undef __nvapi_undef__out -#endif -#ifdef __nvapi_undef__out_ecount - #undef __out_ecount - #undef __nvapi_undef__out_ecount -#endif -#ifdef __nvapi_undef__out_bcount - #undef __out_bcount - #undef __nvapi_undef__out_bcount -#endif -#ifdef __nvapi_undef__out_ecount_part - #undef __out_ecount_part - #undef __nvapi_undef__out_ecount_part -#endif -#ifdef __nvapi_undef__out_bcount_part - #undef __out_bcount_part - #undef __nvapi_undef__out_bcount_part -#endif -#ifdef __nvapi_undef__out_ecount_full - #undef __out_ecount_full - #undef __nvapi_undef__out_ecount_full -#endif -#ifdef __nvapi_undef__out_bcount_full - #undef __out_bcount_full - #undef __nvapi_undef__out_bcount_full -#endif -#ifdef __nvapi_undef__out_z - #undef __out_z - #undef __nvapi_undef__out_z -#endif -#ifdef __nvapi_undef__out_z_opt - #undef __out_z_opt - #undef __nvapi_undef__out_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_z - #undef __out_ecount_z - #undef __nvapi_undef__out_ecount_z -#endif -#ifdef __nvapi_undef__out_bcount_z - #undef __out_bcount_z - #undef __nvapi_undef__out_bcount_z -#endif -#ifdef __nvapi_undef__out_ecount_part_z - #undef __out_ecount_part_z - #undef __nvapi_undef__out_ecount_part_z -#endif -#ifdef __nvapi_undef__out_bcount_part_z - #undef __out_bcount_part_z - #undef __nvapi_undef__out_bcount_part_z -#endif -#ifdef __nvapi_undef__out_ecount_full_z - #undef __out_ecount_full_z - #undef __nvapi_undef__out_ecount_full_z -#endif -#ifdef __nvapi_undef__out_bcount_full_z - #undef __out_bcount_full_z - #undef __nvapi_undef__out_bcount_full_z -#endif -#ifdef __nvapi_undef__out_nz - #undef __out_nz - #undef __nvapi_undef__out_nz -#endif -#ifdef __nvapi_undef__out_nz_opt - #undef __out_nz_opt - #undef __nvapi_undef__out_nz_opt -#endif -#ifdef __nvapi_undef__out_ecount_nz - #undef __out_ecount_nz - #undef __nvapi_undef__out_ecount_nz -#endif -#ifdef __nvapi_undef__out_bcount_nz - #undef __out_bcount_nz - #undef __nvapi_undef__out_bcount_nz -#endif -#ifdef __nvapi_undef__inout - #undef __inout - #undef __nvapi_undef__inout -#endif -#ifdef __nvapi_undef__inout_ecount - #undef __inout_ecount - #undef __nvapi_undef__inout_ecount -#endif -#ifdef __nvapi_undef__inout_bcount - #undef __inout_bcount - #undef __nvapi_undef__inout_bcount -#endif -#ifdef __nvapi_undef__inout_ecount_part - #undef __inout_ecount_part - #undef __nvapi_undef__inout_ecount_part -#endif -#ifdef __nvapi_undef__inout_bcount_part - #undef __inout_bcount_part - #undef __nvapi_undef__inout_bcount_part -#endif -#ifdef __nvapi_undef__inout_ecount_full - #undef __inout_ecount_full - #undef __nvapi_undef__inout_ecount_full -#endif -#ifdef __nvapi_undef__inout_bcount_full - #undef __inout_bcount_full - #undef __nvapi_undef__inout_bcount_full -#endif -#ifdef __nvapi_undef__inout_z - #undef __inout_z - #undef __nvapi_undef__inout_z -#endif -#ifdef __nvapi_undef__inout_ecount_z - #undef __inout_ecount_z - #undef __nvapi_undef__inout_ecount_z -#endif -#ifdef __nvapi_undef__inout_bcount_z - #undef __inout_bcount_z - #undef __nvapi_undef__inout_bcount_z -#endif -#ifdef __nvapi_undef__inout_nz - #undef __inout_nz - #undef __nvapi_undef__inout_nz -#endif -#ifdef __nvapi_undef__inout_ecount_nz - #undef __inout_ecount_nz - #undef __nvapi_undef__inout_ecount_nz -#endif -#ifdef __nvapi_undef__inout_bcount_nz - #undef __inout_bcount_nz - #undef __nvapi_undef__inout_bcount_nz -#endif -#ifdef __nvapi_undef__ecount_opt - #undef __ecount_opt - #undef __nvapi_undef__ecount_opt -#endif -#ifdef __nvapi_undef__bcount_opt - #undef __bcount_opt - #undef __nvapi_undef__bcount_opt -#endif -#ifdef __nvapi_undef__in_opt - #undef __in_opt - #undef __nvapi_undef__in_opt -#endif -#ifdef __nvapi_undef__in_ecount_opt - #undef __in_ecount_opt - #undef __nvapi_undef__in_ecount_opt -#endif -#ifdef __nvapi_undef__in_bcount_opt - #undef __in_bcount_opt - #undef __nvapi_undef__in_bcount_opt -#endif -#ifdef __nvapi_undef__in_z_opt - #undef __in_z_opt - #undef __nvapi_undef__in_z_opt -#endif -#ifdef __nvapi_undef__in_ecount_z_opt - #undef __in_ecount_z_opt - #undef __nvapi_undef__in_ecount_z_opt -#endif -#ifdef __nvapi_undef__in_bcount_z_opt - #undef __in_bcount_z_opt - #undef __nvapi_undef__in_bcount_z_opt -#endif -#ifdef __nvapi_undef__in_nz_opt - #undef __in_nz_opt - #undef __nvapi_undef__in_nz_opt -#endif -#ifdef __nvapi_undef__in_ecount_nz_opt - #undef __in_ecount_nz_opt - #undef __nvapi_undef__in_ecount_nz_opt -#endif -#ifdef __nvapi_undef__in_bcount_nz_opt - #undef __in_bcount_nz_opt - #undef __nvapi_undef__in_bcount_nz_opt -#endif -#ifdef __nvapi_undef__out_opt - #undef __out_opt - #undef __nvapi_undef__out_opt -#endif -#ifdef __nvapi_undef__out_ecount_opt - #undef __out_ecount_opt - #undef __nvapi_undef__out_ecount_opt -#endif -#ifdef __nvapi_undef__out_bcount_opt - #undef __out_bcount_opt - #undef __nvapi_undef__out_bcount_opt -#endif -#ifdef __nvapi_undef__out_ecount_part_opt - #undef __out_ecount_part_opt - #undef __nvapi_undef__out_ecount_part_opt -#endif -#ifdef __nvapi_undef__out_bcount_part_opt - #undef __out_bcount_part_opt - #undef __nvapi_undef__out_bcount_part_opt -#endif -#ifdef __nvapi_undef__out_ecount_full_opt - #undef __out_ecount_full_opt - #undef __nvapi_undef__out_ecount_full_opt -#endif -#ifdef __nvapi_undef__out_bcount_full_opt - #undef __out_bcount_full_opt - #undef __nvapi_undef__out_bcount_full_opt -#endif -#ifdef __nvapi_undef__out_ecount_z_opt - #undef __out_ecount_z_opt - #undef __nvapi_undef__out_ecount_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_z_opt - #undef __out_bcount_z_opt - #undef __nvapi_undef__out_bcount_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_part_z_opt - #undef __out_ecount_part_z_opt - #undef __nvapi_undef__out_ecount_part_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_part_z_opt - #undef __out_bcount_part_z_opt - #undef __nvapi_undef__out_bcount_part_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_full_z_opt - #undef __out_ecount_full_z_opt - #undef __nvapi_undef__out_ecount_full_z_opt -#endif -#ifdef __nvapi_undef__out_bcount_full_z_opt - #undef __out_bcount_full_z_opt - #undef __nvapi_undef__out_bcount_full_z_opt -#endif -#ifdef __nvapi_undef__out_ecount_nz_opt - #undef __out_ecount_nz_opt - #undef __nvapi_undef__out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__out_bcount_nz_opt - #undef __out_bcount_nz_opt - #undef __nvapi_undef__out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__inout_opt - #undef __inout_opt - #undef __nvapi_undef__inout_opt -#endif -#ifdef __nvapi_undef__inout_ecount_opt - #undef __inout_ecount_opt - #undef __nvapi_undef__inout_ecount_opt -#endif -#ifdef __nvapi_undef__inout_bcount_opt - #undef __inout_bcount_opt - #undef __nvapi_undef__inout_bcount_opt -#endif -#ifdef __nvapi_undef__inout_ecount_part_opt - #undef __inout_ecount_part_opt - #undef __nvapi_undef__inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__inout_bcount_part_opt - #undef __inout_bcount_part_opt - #undef __nvapi_undef__inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__inout_ecount_full_opt - #undef __inout_ecount_full_opt - #undef __nvapi_undef__inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__inout_bcount_full_opt - #undef __inout_bcount_full_opt - #undef __nvapi_undef__inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__inout_z_opt - #undef __inout_z_opt - #undef __nvapi_undef__inout_z_opt -#endif -#ifdef __nvapi_undef__inout_ecount_z_opt - #undef __inout_ecount_z_opt - #undef __nvapi_undef__inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__inout_ecount_z_opt - #undef __inout_ecount_z_opt - #undef __nvapi_undef__inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__inout_bcount_z_opt - #undef __inout_bcount_z_opt - #undef __nvapi_undef__inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__inout_nz_opt - #undef __inout_nz_opt - #undef __nvapi_undef__inout_nz_opt -#endif -#ifdef __nvapi_undef__inout_ecount_nz_opt - #undef __inout_ecount_nz_opt - #undef __nvapi_undef__inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__inout_bcount_nz_opt - #undef __inout_bcount_nz_opt - #undef __nvapi_undef__inout_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_ecount - #undef __deref_ecount - #undef __nvapi_undef__deref_ecount -#endif -#ifdef __nvapi_undef__deref_bcount - #undef __deref_bcount - #undef __nvapi_undef__deref_bcount -#endif -#ifdef __nvapi_undef__deref_out - #undef __deref_out - #undef __nvapi_undef__deref_out -#endif -#ifdef __nvapi_undef__deref_out_ecount - #undef __deref_out_ecount - #undef __nvapi_undef__deref_out_ecount -#endif -#ifdef __nvapi_undef__deref_out_bcount - #undef __deref_out_bcount - #undef __nvapi_undef__deref_out_bcount -#endif -#ifdef __nvapi_undef__deref_out_ecount_part - #undef __deref_out_ecount_part - #undef __nvapi_undef__deref_out_ecount_part -#endif -#ifdef __nvapi_undef__deref_out_bcount_part - #undef __deref_out_bcount_part - #undef __nvapi_undef__deref_out_bcount_part -#endif -#ifdef __nvapi_undef__deref_out_ecount_full - #undef __deref_out_ecount_full - #undef __nvapi_undef__deref_out_ecount_full -#endif -#ifdef __nvapi_undef__deref_out_bcount_full - #undef __deref_out_bcount_full - #undef __nvapi_undef__deref_out_bcount_full -#endif -#ifdef __nvapi_undef__deref_out_z - #undef __deref_out_z - #undef __nvapi_undef__deref_out_z -#endif -#ifdef __nvapi_undef__deref_out_ecount_z - #undef __deref_out_ecount_z - #undef __nvapi_undef__deref_out_ecount_z -#endif -#ifdef __nvapi_undef__deref_out_bcount_z - #undef __deref_out_bcount_z - #undef __nvapi_undef__deref_out_bcount_z -#endif -#ifdef __nvapi_undef__deref_out_nz - #undef __deref_out_nz - #undef __nvapi_undef__deref_out_nz -#endif -#ifdef __nvapi_undef__deref_out_ecount_nz - #undef __deref_out_ecount_nz - #undef __nvapi_undef__deref_out_ecount_nz -#endif -#ifdef __nvapi_undef__deref_out_bcount_nz - #undef __deref_out_bcount_nz - #undef __nvapi_undef__deref_out_bcount_nz -#endif -#ifdef __nvapi_undef__deref_inout - #undef __deref_inout - #undef __nvapi_undef__deref_inout -#endif -#ifdef __nvapi_undef__deref_inout_z - #undef __deref_inout_z - #undef __nvapi_undef__deref_inout_z -#endif -#ifdef __nvapi_undef__deref_inout_ecount - #undef __deref_inout_ecount - #undef __nvapi_undef__deref_inout_ecount -#endif -#ifdef __nvapi_undef__deref_inout_bcount - #undef __deref_inout_bcount - #undef __nvapi_undef__deref_inout_bcount -#endif -#ifdef __nvapi_undef__deref_inout_ecount_part - #undef __deref_inout_ecount_part - #undef __nvapi_undef__deref_inout_ecount_part -#endif -#ifdef __nvapi_undef__deref_inout_bcount_part - #undef __deref_inout_bcount_part - #undef __nvapi_undef__deref_inout_bcount_part -#endif -#ifdef __nvapi_undef__deref_inout_ecount_full - #undef __deref_inout_ecount_full - #undef __nvapi_undef__deref_inout_ecount_full -#endif -#ifdef __nvapi_undef__deref_inout_bcount_full - #undef __deref_inout_bcount_full - #undef __nvapi_undef__deref_inout_bcount_full -#endif -#ifdef __nvapi_undef__deref_inout_z - #undef __deref_inout_z - #undef __nvapi_undef__deref_inout_z -#endif -#ifdef __nvapi_undef__deref_inout_ecount_z - #undef __deref_inout_ecount_z - #undef __nvapi_undef__deref_inout_ecount_z -#endif -#ifdef __nvapi_undef__deref_inout_bcount_z - #undef __deref_inout_bcount_z - #undef __nvapi_undef__deref_inout_bcount_z -#endif -#ifdef __nvapi_undef__deref_inout_nz - #undef __deref_inout_nz - #undef __nvapi_undef__deref_inout_nz -#endif -#ifdef __nvapi_undef__deref_inout_ecount_nz - #undef __deref_inout_ecount_nz - #undef __nvapi_undef__deref_inout_ecount_nz -#endif -#ifdef __nvapi_undef__deref_inout_bcount_nz - #undef __deref_inout_bcount_nz - #undef __nvapi_undef__deref_inout_bcount_nz -#endif -#ifdef __nvapi_undef__deref_ecount_opt - #undef __deref_ecount_opt - #undef __nvapi_undef__deref_ecount_opt -#endif -#ifdef __nvapi_undef__deref_bcount_opt - #undef __deref_bcount_opt - #undef __nvapi_undef__deref_bcount_opt -#endif -#ifdef __nvapi_undef__deref_out_opt - #undef __deref_out_opt - #undef __nvapi_undef__deref_out_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_opt - #undef __deref_out_ecount_opt - #undef __nvapi_undef__deref_out_ecount_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_opt - #undef __deref_out_bcount_opt - #undef __nvapi_undef__deref_out_bcount_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_part_opt - #undef __deref_out_ecount_part_opt - #undef __nvapi_undef__deref_out_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_part_opt - #undef __deref_out_bcount_part_opt - #undef __nvapi_undef__deref_out_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_full_opt - #undef __deref_out_ecount_full_opt - #undef __nvapi_undef__deref_out_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_full_opt - #undef __deref_out_bcount_full_opt - #undef __nvapi_undef__deref_out_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_out_z_opt - #undef __deref_out_z_opt - #undef __nvapi_undef__deref_out_z_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_z_opt - #undef __deref_out_ecount_z_opt - #undef __nvapi_undef__deref_out_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_z_opt - #undef __deref_out_bcount_z_opt - #undef __nvapi_undef__deref_out_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_out_nz_opt - #undef __deref_out_nz_opt - #undef __nvapi_undef__deref_out_nz_opt -#endif -#ifdef __nvapi_undef__deref_out_ecount_nz_opt - #undef __deref_out_ecount_nz_opt - #undef __nvapi_undef__deref_out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_out_bcount_nz_opt - #undef __deref_out_bcount_nz_opt - #undef __nvapi_undef__deref_out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_opt - #undef __deref_inout_opt - #undef __nvapi_undef__deref_inout_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_opt - #undef __deref_inout_ecount_opt - #undef __nvapi_undef__deref_inout_ecount_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_opt - #undef __deref_inout_bcount_opt - #undef __nvapi_undef__deref_inout_bcount_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_part_opt - #undef __deref_inout_ecount_part_opt - #undef __nvapi_undef__deref_inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_part_opt - #undef __deref_inout_bcount_part_opt - #undef __nvapi_undef__deref_inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_full_opt - #undef __deref_inout_ecount_full_opt - #undef __nvapi_undef__deref_inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_full_opt - #undef __deref_inout_bcount_full_opt - #undef __nvapi_undef__deref_inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_inout_z_opt - #undef __deref_inout_z_opt - #undef __nvapi_undef__deref_inout_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_z_opt - #undef __deref_inout_ecount_z_opt - #undef __nvapi_undef__deref_inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_z_opt - #undef __deref_inout_bcount_z_opt - #undef __nvapi_undef__deref_inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_inout_nz_opt - #undef __deref_inout_nz_opt - #undef __nvapi_undef__deref_inout_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_ecount_nz_opt - #undef __deref_inout_ecount_nz_opt - #undef __nvapi_undef__deref_inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_inout_bcount_nz_opt - #undef __deref_inout_bcount_nz_opt - #undef __nvapi_undef__deref_inout_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_ecount - #undef __deref_opt_ecount - #undef __nvapi_undef__deref_opt_ecount -#endif -#ifdef __nvapi_undef__deref_opt_bcount - #undef __deref_opt_bcount - #undef __nvapi_undef__deref_opt_bcount -#endif -#ifdef __nvapi_undef__deref_opt_out - #undef __deref_opt_out - #undef __nvapi_undef__deref_opt_out -#endif -#ifdef __nvapi_undef__deref_opt_out_z - #undef __deref_opt_out_z - #undef __nvapi_undef__deref_opt_out_z -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount - #undef __deref_opt_out_ecount - #undef __nvapi_undef__deref_opt_out_ecount -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount - #undef __deref_opt_out_bcount - #undef __nvapi_undef__deref_opt_out_bcount -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_part - #undef __deref_opt_out_ecount_part - #undef __nvapi_undef__deref_opt_out_ecount_part -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_part - #undef __deref_opt_out_bcount_part - #undef __nvapi_undef__deref_opt_out_bcount_part -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_full - #undef __deref_opt_out_ecount_full - #undef __nvapi_undef__deref_opt_out_ecount_full -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_full - #undef __deref_opt_out_bcount_full - #undef __nvapi_undef__deref_opt_out_bcount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout - #undef __deref_opt_inout - #undef __nvapi_undef__deref_opt_inout -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount - #undef __deref_opt_inout_ecount - #undef __nvapi_undef__deref_opt_inout_ecount -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount - #undef __deref_opt_inout_bcount - #undef __nvapi_undef__deref_opt_inout_bcount -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_part - #undef __deref_opt_inout_ecount_part - #undef __nvapi_undef__deref_opt_inout_ecount_part -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_part - #undef __deref_opt_inout_bcount_part - #undef __nvapi_undef__deref_opt_inout_bcount_part -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_full - #undef __deref_opt_inout_ecount_full - #undef __nvapi_undef__deref_opt_inout_ecount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_full - #undef __deref_opt_inout_bcount_full - #undef __nvapi_undef__deref_opt_inout_bcount_full -#endif -#ifdef __nvapi_undef__deref_opt_inout_z - #undef __deref_opt_inout_z - #undef __nvapi_undef__deref_opt_inout_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_z - #undef __deref_opt_inout_ecount_z - #undef __nvapi_undef__deref_opt_inout_ecount_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_z - #undef __deref_opt_inout_bcount_z - #undef __nvapi_undef__deref_opt_inout_bcount_z -#endif -#ifdef __nvapi_undef__deref_opt_inout_nz - #undef __deref_opt_inout_nz - #undef __nvapi_undef__deref_opt_inout_nz -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_nz - #undef __deref_opt_inout_ecount_nz - #undef __nvapi_undef__deref_opt_inout_ecount_nz -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_nz - #undef __deref_opt_inout_bcount_nz - #undef __nvapi_undef__deref_opt_inout_bcount_nz -#endif -#ifdef __nvapi_undef__deref_opt_ecount_opt - #undef __deref_opt_ecount_opt - #undef __nvapi_undef__deref_opt_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_bcount_opt - #undef __deref_opt_bcount_opt - #undef __nvapi_undef__deref_opt_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_opt - #undef __deref_opt_out_opt - #undef __nvapi_undef__deref_opt_out_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_opt - #undef __deref_opt_out_ecount_opt - #undef __nvapi_undef__deref_opt_out_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_opt - #undef __deref_opt_out_bcount_opt - #undef __nvapi_undef__deref_opt_out_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_part_opt - #undef __deref_opt_out_ecount_part_opt - #undef __nvapi_undef__deref_opt_out_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_part_opt - #undef __deref_opt_out_bcount_part_opt - #undef __nvapi_undef__deref_opt_out_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_full_opt - #undef __deref_opt_out_ecount_full_opt - #undef __nvapi_undef__deref_opt_out_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_full_opt - #undef __deref_opt_out_bcount_full_opt - #undef __nvapi_undef__deref_opt_out_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_z_opt - #undef __deref_opt_out_z_opt - #undef __nvapi_undef__deref_opt_out_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_z_opt - #undef __deref_opt_out_ecount_z_opt - #undef __nvapi_undef__deref_opt_out_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_z_opt - #undef __deref_opt_out_bcount_z_opt - #undef __nvapi_undef__deref_opt_out_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_nz_opt - #undef __deref_opt_out_nz_opt - #undef __nvapi_undef__deref_opt_out_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_ecount_nz_opt - #undef __deref_opt_out_ecount_nz_opt - #undef __nvapi_undef__deref_opt_out_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_out_bcount_nz_opt - #undef __deref_opt_out_bcount_nz_opt - #undef __nvapi_undef__deref_opt_out_bcount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_opt - #undef __deref_opt_inout_opt - #undef __nvapi_undef__deref_opt_inout_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_opt - #undef __deref_opt_inout_ecount_opt - #undef __nvapi_undef__deref_opt_inout_ecount_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_opt - #undef __deref_opt_inout_bcount_opt - #undef __nvapi_undef__deref_opt_inout_bcount_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_part_opt - #undef __deref_opt_inout_ecount_part_opt - #undef __nvapi_undef__deref_opt_inout_ecount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_part_opt - #undef __deref_opt_inout_bcount_part_opt - #undef __nvapi_undef__deref_opt_inout_bcount_part_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_full_opt - #undef __deref_opt_inout_ecount_full_opt - #undef __nvapi_undef__deref_opt_inout_ecount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_full_opt - #undef __deref_opt_inout_bcount_full_opt - #undef __nvapi_undef__deref_opt_inout_bcount_full_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_z_opt - #undef __deref_opt_inout_z_opt - #undef __nvapi_undef__deref_opt_inout_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_z_opt - #undef __deref_opt_inout_ecount_z_opt - #undef __nvapi_undef__deref_opt_inout_ecount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_z_opt - #undef __deref_opt_inout_bcount_z_opt - #undef __nvapi_undef__deref_opt_inout_bcount_z_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_nz_opt - #undef __deref_opt_inout_nz_opt - #undef __nvapi_undef__deref_opt_inout_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_ecount_nz_opt - #undef __deref_opt_inout_ecount_nz_opt - #undef __nvapi_undef__deref_opt_inout_ecount_nz_opt -#endif -#ifdef __nvapi_undef__deref_opt_inout_bcount_nz_opt - #undef __deref_opt_inout_bcount_nz_opt - #undef __nvapi_undef__deref_opt_inout_bcount_nz_opt -#endif -#ifdef __nvapi_success - #undef __success - #undef __nvapi_success -#endif -#ifdef __nvapi__Ret_notnull_ - #undef __nvapi__Ret_notnull_ - #undef _Ret_notnull_ -#endif -#ifdef __nvapi__Post_writable_byte_size_ - #undef __nvapi__Post_writable_byte_size_ - #undef _Post_writable_byte_size_ -#endif -#ifdef __nvapi_Outptr_ - #undef __nvapi_Outptr_ - #undef _Outptr_ -#endif - -#endif // __NVAPI_EMPTY_SAL - -#ifdef __cplusplus -}; //extern "C" { - -#endif - -#pragma pack(pop) - -#endif // _NVAPI_H diff --git a/third-party/nvapi-opensource/nvapi_interface.h b/third-party/nvapi-opensource/nvapi_interface.h deleted file mode 100644 index ebcd190f4fa..00000000000 --- a/third-party/nvapi-opensource/nvapi_interface.h +++ /dev/null @@ -1,490 +0,0 @@ -/*****************************************************************************\ -|* *| -|* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. *| -|* *| -|* 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. *| -|* *| -|* *| -\*****************************************************************************/ -#ifndef _NVAPI_INTERFACE_H -#define _NVAPI_INTERFACE_H - -struct NVAPI_INTERFACE_TABLE { const char * func; unsigned int id; }; -struct NVAPI_INTERFACE_TABLE nvapi_interface_table[] = -{ - { "NvAPI_Initialize", 0x0150e828 }, - { "NvAPI_Unload", 0xd22bdd7e }, - { "NvAPI_GetErrorMessage", 0x6c2d048c }, - { "NvAPI_GetInterfaceVersionString", 0x01053fa5 }, - { "NvAPI_GPU_GetEDID", 0x37d32e69 }, - { "NvAPI_SetView", 0x0957d7b6 }, - { "NvAPI_SetViewEx", 0x06b89e68 }, - { "NvAPI_GetDisplayDriverVersion", 0xf951a4d1 }, - { "NvAPI_SYS_GetDriverAndBranchVersion", 0x2926aaad }, - { "NvAPI_GPU_GetMemoryInfo", 0x07f9b368 }, - { "NvAPI_GPU_GetMemoryInfoEx", 0xc0599498 }, - { "NvAPI_OGL_ExpertModeSet", 0x3805ef7a }, - { "NvAPI_OGL_ExpertModeGet", 0x22ed9516 }, - { "NvAPI_OGL_ExpertModeDefaultsSet", 0xb47a657e }, - { "NvAPI_OGL_ExpertModeDefaultsGet", 0xae921f12 }, - { "NvAPI_EnumPhysicalGPUs", 0xe5ac921f }, - { "NvAPI_EnumTCCPhysicalGPUs", 0xd9930b07 }, - { "NvAPI_EnumLogicalGPUs", 0x48b3ea59 }, - { "NvAPI_GetPhysicalGPUsFromDisplay", 0x34ef9506 }, - { "NvAPI_GetPhysicalGPUFromUnAttachedDisplay", 0x5018ed61 }, - { "NvAPI_GetLogicalGPUFromDisplay", 0xee1370cf }, - { "NvAPI_GetLogicalGPUFromPhysicalGPU", 0xadd604d1 }, - { "NvAPI_GetPhysicalGPUsFromLogicalGPU", 0xaea3fa32 }, - { "NvAPI_GetPhysicalGPUFromGPUID", 0x5380ad1a }, - { "NvAPI_GetGPUIDfromPhysicalGPU", 0x6533ea3e }, - { "NvAPI_GPU_GetShaderSubPipeCount", 0x0be17923 }, - { "NvAPI_GPU_GetGpuCoreCount", 0xc7026a87 }, - { "NvAPI_GPU_GetAllOutputs", 0x7d554f8e }, - { "NvAPI_GPU_GetConnectedOutputs", 0x1730bfc9 }, - { "NvAPI_GPU_GetConnectedSLIOutputs", 0x0680de09 }, - { "NvAPI_GPU_GetConnectedDisplayIds", 0x0078dba2 }, - { "NvAPI_GPU_GetAllDisplayIds", 0x785210a2 }, - { "NvAPI_GPU_GetConnectedOutputsWithLidState", 0xcf8caf39 }, - { "NvAPI_GPU_GetConnectedSLIOutputsWithLidState", 0x96043cc7 }, - { "NvAPI_GPU_GetSystemType", 0xbaaabfcc }, - { "NvAPI_GPU_GetActiveOutputs", 0xe3e89b6f }, - { "NvAPI_GPU_SetEDID", 0xe83d6456 }, - { "NvAPI_GPU_GetOutputType", 0x40a505e4 }, - { "NvAPI_GPU_ValidateOutputCombination", 0x34c9c2d4 }, - { "NvAPI_GPU_GetFullName", 0xceee8e9f }, - { "NvAPI_GPU_GetPCIIdentifiers", 0x2ddfb66e }, - { "NvAPI_GPU_GetGPUType", 0xc33baeb1 }, - { "NvAPI_GPU_GetBusType", 0x1bb18724 }, - { "NvAPI_GPU_GetBusId", 0x1be0b8e5 }, - { "NvAPI_GPU_GetBusSlotId", 0x2a0a350f }, - { "NvAPI_GPU_GetIRQ", 0xe4715417 }, - { "NvAPI_GPU_GetVbiosRevision", 0xacc3da0a }, - { "NvAPI_GPU_GetVbiosOEMRevision", 0x2d43fb31 }, - { "NvAPI_GPU_GetVbiosVersionString", 0xa561fd7d }, - { "NvAPI_GPU_GetAGPAperture", 0x6e042794 }, - { "NvAPI_GPU_GetCurrentAGPRate", 0xc74925a0 }, - { "NvAPI_GPU_GetCurrentPCIEDownstreamWidth", 0xd048c3b1 }, - { "NvAPI_GPU_GetPhysicalFrameBufferSize", 0x46fbeb03 }, - { "NvAPI_GPU_GetVirtualFrameBufferSize", 0x5a04b644 }, - { "NvAPI_GPU_GetQuadroStatus", 0xe332fa47 }, - { "NvAPI_GPU_GetBoardInfo", 0x22d54523 }, - { "NvAPI_GPU_GetRamBusWidth", 0x7975c581 }, - { "NvAPI_GPU_GetArchInfo", 0xd8265d24 }, - { "NvAPI_I2CRead", 0x2fde12c5 }, - { "NvAPI_I2CWrite", 0xe812eb07 }, - { "NvAPI_GPU_WorkstationFeatureSetup", 0x6c1f3fe4 }, - { "NvAPI_GPU_WorkstationFeatureQuery", 0x004537df }, - { "NvAPI_GPU_GetHDCPSupportStatus", 0xf089eef5 }, - { "NvAPI_GPU_CudaEnumComputeCapableGpus", 0x5786cc6e }, - { "NvAPI_GPU_GetTachReading", 0x5f608315 }, - { "NvAPI_GPU_GetECCStatusInfo", 0xca1ddaf3 }, - { "NvAPI_GPU_GetECCErrorInfo", 0xc71f85a6 }, - { "NvAPI_GPU_ResetECCErrorInfo", 0xc02eec20 }, - { "NvAPI_GPU_GetECCConfigurationInfo", 0x77a796f3 }, - { "NvAPI_GPU_SetECCConfiguration", 0x1cf639d9 }, - { "NvAPI_GPU_QueryWorkstationFeatureSupport", 0x80b1abb9 }, - { "NvAPI_GPU_SetScanoutIntensity", 0xa57457a4 }, - { "NvAPI_GPU_GetScanoutIntensityState", 0xe81ce836 }, - { "NvAPI_GPU_SetScanoutWarping", 0xb34bab4f }, - { "NvAPI_GPU_GetScanoutWarpingState", 0x6f5435af }, - { "NvAPI_GPU_SetScanoutCompositionParameter", 0xf898247d }, - { "NvAPI_GPU_GetScanoutCompositionParameter", 0x58fe51e6 }, - { "NvAPI_GPU_GetScanoutConfiguration", 0x6a9f5b63 }, - { "NvAPI_GPU_GetScanoutConfigurationEx", 0xe2e1e6f0 }, - { "NvAPI_GPU_GetAdapterIdFromPhysicalGpu", 0x0ff07fde }, - { "NvAPI_GPU_GetVirtualizationInfo", 0x44e022a9 }, - { "NvAPI_GPU_GetLogicalGpuInfo", 0x842b066e }, - { "NvAPI_GPU_GetLicensableFeatures", 0x3fc596aa }, - { "NvAPI_GPU_GetVRReadyData", 0x81d629c5 }, - { "NvAPI_GPU_GetPerfDecreaseInfo", 0x7f7f4600 }, - { "NvAPI_GPU_GetPstatesInfoEx", 0x843c0256 }, - { "NvAPI_GPU_GetPstates20", 0x6ff81213 }, - { "NvAPI_GPU_GetCurrentPstate", 0x927da4f6 }, - { "NvAPI_GPU_GetDynamicPstatesInfoEx", 0x60ded2ed }, - { "NvAPI_GPU_GetThermalSettings", 0xe3640a56 }, - { "NvAPI_GPU_GetAllClockFrequencies", 0xdcb616c3 }, - { "NvAPI_GPU_QueryIlluminationSupport", 0xa629da31 }, - { "NvAPI_GPU_GetIllumination", 0x9a1b9365 }, - { "NvAPI_GPU_SetIllumination", 0x0254a187 }, - { "NvAPI_GPU_ClientIllumDevicesGetInfo", 0xd4100e58 }, - { "NvAPI_GPU_ClientIllumDevicesGetControl", 0x73c01d58 }, - { "NvAPI_GPU_ClientIllumDevicesSetControl", 0x57024c62 }, - { "NvAPI_GPU_ClientIllumZonesGetInfo", 0x4b81241b }, - { "NvAPI_GPU_ClientIllumZonesGetControl", 0x3dbf5764 }, - { "NvAPI_GPU_ClientIllumZonesSetControl", 0x197d065e }, - { "NvAPI_Event_RegisterCallback", 0xe6dbea69 }, - { "NvAPI_Event_UnregisterCallback", 0xde1f9b45 }, - { "NvAPI_EnumNvidiaDisplayHandle", 0x9abdd40d }, - { "NvAPI_EnumNvidiaUnAttachedDisplayHandle", 0x20de9260 }, - { "NvAPI_CreateDisplayFromUnAttachedDisplay", 0x63f9799e }, - { "NvAPI_GetAssociatedNvidiaDisplayHandle", 0x35c29134 }, - { "NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle", 0xa70503b2 }, - { "NvAPI_GetAssociatedNvidiaDisplayName", 0x22a78b05 }, - { "NvAPI_GetUnAttachedAssociatedDisplayName", 0x4888d790 }, - { "NvAPI_EnableHWCursor", 0x2863148d }, - { "NvAPI_DisableHWCursor", 0xab163097 }, - { "NvAPI_GetVBlankCounter", 0x67b5db55 }, - { "NvAPI_SetRefreshRateOverride", 0x3092ac32 }, - { "NvAPI_GetAssociatedDisplayOutputId", 0xd995937e }, - { "NvAPI_GetDisplayPortInfo", 0xc64ff367 }, - { "NvAPI_SetDisplayPort", 0xfa13e65a }, - { "NvAPI_GetHDMISupportInfo", 0x6ae16ec3 }, - { "NvAPI_Disp_InfoFrameControl", 0x6067af3f }, - { "NvAPI_Disp_ColorControl", 0x92f9d80d }, - { "NvAPI_Disp_GetHdrCapabilities", 0x84f2a8df }, - { "NvAPI_Disp_HdrColorControl", 0x351da224 }, - { "NvAPI_Disp_SetSourceColorSpace", 0x473b6caf }, - { "NvAPI_Disp_GetSourceColorSpace", 0xceedc85b }, - { "NvAPI_Disp_SetSourceHdrMetadata", 0x905eb63b }, - { "NvAPI_Disp_GetSourceHdrMetadata", 0x0d3f52da }, - { "NvAPI_Disp_SetOutputMode", 0x98e7661a }, - { "NvAPI_Disp_GetOutputMode", 0x81fed88d }, - { "NvAPI_Disp_SetHdrToneMapping", 0xdd6da362 }, - { "NvAPI_Disp_GetHdrToneMapping", 0xfbd36e71 }, - { "NvAPI_DISP_GetTiming", 0x175167e9 }, - { "NvAPI_DISP_GetMonitorCapabilities", 0x3b05c7e1 }, - { "NvAPI_DISP_GetMonitorColorCapabilities", 0x6ae4cfb5 }, - { "NvAPI_DISP_EnumCustomDisplay", 0xa2072d59 }, - { "NvAPI_DISP_TryCustomDisplay", 0x1f7db630 }, - { "NvAPI_DISP_DeleteCustomDisplay", 0x552e5b9b }, - { "NvAPI_DISP_SaveCustomDisplay", 0x49882876 }, - { "NvAPI_DISP_RevertCustomDisplayTrial", 0xcbbd40f0 }, - { "NvAPI_GetView", 0xd6b99d89 }, - { "NvAPI_GetViewEx", 0xdbbc0af4 }, - { "NvAPI_GetSupportedViews", 0x66fb7fc0 }, - { "NvAPI_DISP_GetDisplayIdByDisplayName", 0xae457190 }, - { "NvAPI_DISP_GetGDIPrimaryDisplayId", 0x1e9d8a31 }, - { "NvAPI_DISP_GetDisplayConfig", 0x11abccf8 }, - { "NvAPI_DISP_SetDisplayConfig", 0x5d8cf8de }, - { "NvAPI_DISP_GetAdaptiveSyncData", 0xb73d1ee9 }, - { "NvAPI_DISP_SetAdaptiveSyncData", 0x3eebba1d }, - { "NvAPI_DISP_GetVirtualRefreshRateData", 0x8c00429a }, - { "NvAPI_DISP_SetVirtualRefreshRateData", 0x5abbe6a3 }, - { "NvAPI_DISP_SetPreferredStereoDisplay", 0xc9d0e25f }, - { "NvAPI_DISP_GetPreferredStereoDisplay", 0x1f6b4666 }, - { "NvAPI_DISP_GetNvManagedDedicatedDisplays", 0xdbdf0cb2 }, - { "NvAPI_DISP_AcquireDedicatedDisplay", 0x47c917ba }, - { "NvAPI_DISP_ReleaseDedicatedDisplay", 0x1247825f }, - { "NvAPI_Disp_GetDisplayIdInfo", 0xbae8aa5e }, - { "NvAPI_Disp_GetDisplayIdsFromTarget", 0xe7e5f89e }, - { "NvAPI_Disp_GetVRRInfo", 0xdf8fda57 }, - { "NvAPI_Mosaic_GetSupportedTopoInfo", 0xfdb63c81 }, - { "NvAPI_Mosaic_GetTopoGroup", 0xcb89381d }, - { "NvAPI_Mosaic_GetOverlapLimits", 0x989685f0 }, - { "NvAPI_Mosaic_SetCurrentTopo", 0x9b542831 }, - { "NvAPI_Mosaic_GetCurrentTopo", 0xec32944e }, - { "NvAPI_Mosaic_EnableCurrentTopo", 0x5f1aa66c }, - { "NvAPI_Mosaic_GetDisplayViewportsByResolution", 0xdc6dc8d3 }, - { "NvAPI_Mosaic_SetDisplayGrids", 0x4d959a89 }, - { "NvAPI_Mosaic_ValidateDisplayGrids", 0xcf43903d }, - { "NvAPI_Mosaic_EnumDisplayModes", 0x78db97d7 }, - { "NvAPI_Mosaic_EnumDisplayGrids", 0xdf2887af }, - { "NvAPI_GetSupportedMosaicTopologies", 0x410b5c25 }, - { "NvAPI_GetCurrentMosaicTopology", 0xf60852bd }, - { "NvAPI_SetCurrentMosaicTopology", 0xd54b8989 }, - { "NvAPI_EnableCurrentMosaicTopology", 0x74073cc9 }, - { "NvAPI_GSync_EnumSyncDevices", 0xd9639601 }, - { "NvAPI_GSync_QueryCapabilities", 0x44a3f1d1 }, - { "NvAPI_GSync_GetTopology", 0x4562bc38 }, - { "NvAPI_GSync_SetSyncStateSettings", 0x60acdfdd }, - { "NvAPI_GSync_GetControlParameters", 0x16de1c6a }, - { "NvAPI_GSync_SetControlParameters", 0x8bbff88b }, - { "NvAPI_GSync_AdjustSyncDelay", 0x2d11ff51 }, - { "NvAPI_GSync_GetSyncStatus", 0xf1f5b434 }, - { "NvAPI_GSync_GetStatusParameters", 0x70d404ec }, - { "NvAPI_D3D_GetCurrentSLIState", 0x4b708b54 }, - { "NvAPI_D3D9_RegisterResource", 0xa064bdfc }, - { "NvAPI_D3D9_UnregisterResource", 0xbb2b17aa }, - { "NvAPI_D3D9_AliasSurfaceAsTexture", 0xe5ceae41 }, - { "NvAPI_D3D9_StretchRectEx", 0x22de03aa }, - { "NvAPI_D3D9_ClearRT", 0x332d3942 }, - { "NvAPI_D3D_GetObjectHandleForResource", 0xfceac864 }, - { "NvAPI_D3D_SetResourceHint", 0x6c0ed98c }, - { "NvAPI_D3D_BeginResourceRendering", 0x91123d6a }, - { "NvAPI_D3D_EndResourceRendering", 0x37e7191c }, - { "NvAPI_D3D9_GetSurfaceHandle", 0x0f2dd3f2 }, - { "NvAPI_D3D9_VideoSetStereoInfo", 0xb852f4db }, - { "NvAPI_D3D10_SetDepthBoundsTest", 0x4eadf5d2 }, - { "NvAPI_D3D11_CreateDevice", 0x6a16d3a0 }, - { "NvAPI_D3D11_CreateDeviceAndSwapChain", 0xbb939ee5 }, - { "NvAPI_D3D11_SetDepthBoundsTest", 0x7aaf7a04 }, - { "NvAPI_D3D11_IsNvShaderExtnOpCodeSupported", 0x5f68da40 }, - { "NvAPI_D3D11_SetNvShaderExtnSlot", 0x8e90bb9f }, - { "NvAPI_D3D12_SetNvShaderExtnSlotSpace", 0xac2dfeb5 }, - { "NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread", 0x43d867c0 }, - { "NvAPI_D3D11_SetNvShaderExtnSlotLocalThread", 0x0e6482a0 }, - { "NvAPI_D3D11_BeginUAVOverlapEx", 0xba08208a }, - { "NvAPI_D3D11_BeginUAVOverlap", 0x65b93ca8 }, - { "NvAPI_D3D11_EndUAVOverlap", 0x2216a357 }, - { "NvAPI_D3D11_GetResourceHandle", 0x09d52986 }, - { "NvAPI_D3D_SetFPSIndicatorState", 0xa776e8db }, - { "NvAPI_D3D9_Present", 0x05650beb }, - { "NvAPI_D3D9_QueryFrameCount", 0x9083e53a }, - { "NvAPI_D3D9_ResetFrameCount", 0xfa6a0675 }, - { "NvAPI_D3D9_QueryMaxSwapGroup", 0x5995410d }, - { "NvAPI_D3D9_QuerySwapGroup", 0xeba4d232 }, - { "NvAPI_D3D9_JoinSwapGroup", 0x7d44bb54 }, - { "NvAPI_D3D9_BindSwapBarrier", 0x9c39c246 }, - { "NvAPI_D3D1x_Present", 0x03b845a1 }, - { "NvAPI_D3D1x_QueryFrameCount", 0x9152e055 }, - { "NvAPI_D3D1x_ResetFrameCount", 0xfbbb031a }, - { "NvAPI_D3D1x_QueryMaxSwapGroup", 0x9bb9d68f }, - { "NvAPI_D3D1x_QuerySwapGroup", 0x407f67aa }, - { "NvAPI_D3D1x_JoinSwapGroup", 0x14610cd7 }, - { "NvAPI_D3D1x_BindSwapBarrier", 0x9de8c729 }, - { "NvAPI_D3D12_QueryPresentBarrierSupport", 0xa15faef7 }, - { "NvAPI_D3D12_CreatePresentBarrierClient", 0x4d815de9 }, - { "NvAPI_D3D12_RegisterPresentBarrierResources", 0xd53c9ef0 }, - { "NvAPI_DestroyPresentBarrierClient", 0x3c5c351b }, - { "NvAPI_JoinPresentBarrier", 0x17f6bf82 }, - { "NvAPI_LeavePresentBarrier", 0xc3ec5a7f }, - { "NvAPI_QueryPresentBarrierFrameStatistics", 0x61b844a1 }, - { "NvAPI_D3D12_CreateDDisplayPresentBarrierClient", 0xb5a21987 }, - { "NvAPI_D3D11_CreateRasterizerState", 0xdb8d28af }, - { "NvAPI_D3D_ConfigureAnsel", 0x341c6c7f }, - { "NvAPI_D3D11_CreateTiledTexture2DArray", 0x7886981a }, - { "NvAPI_D3D11_CheckFeatureSupport", 0x106a487e }, - { "NvAPI_D3D11_CreateImplicitMSAATexture2D", 0xb8f79632 }, - { "NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D", 0x24c6a07b }, - { "NvAPI_D3D11_ResolveSubresourceRegion", 0xe6bfedd6 }, - { "NvAPI_D3D12_ResolveSubresourceRegion", 0xc24a15bf }, - { "NvAPI_D3D11_TiledTexture2DArrayGetDesc", 0xf1a2b9d5 }, - { "NvAPI_D3D11_UpdateTileMappings", 0x9a06ea07 }, - { "NvAPI_D3D11_CopyTileMappings", 0xc09ee6bc }, - { "NvAPI_D3D11_TiledResourceBarrier", 0xd6839099 }, - { "NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA", 0xf1c54fc9 }, - { "NvAPI_D3D11_CreateGeometryShaderEx_2", 0x99ed5c1c }, - { "NvAPI_D3D11_CreateVertexShaderEx", 0x0beaa0b2 }, - { "NvAPI_D3D11_CreateHullShaderEx", 0xb53cab00 }, - { "NvAPI_D3D11_CreateDomainShaderEx", 0xa0d7180d }, - { "NvAPI_D3D11_CreatePixelShaderEx_2", 0x4162822b }, - { "NvAPI_D3D11_CreateFastGeometryShaderExplicit", 0x71ab7c9c }, - { "NvAPI_D3D11_CreateFastGeometryShader", 0x525d43be }, - { "NvAPI_D3D11_DecompressView", 0x3a94e822 }, - { "NvAPI_D3D12_CreateGraphicsPipelineState", 0x2fc28856 }, - { "NvAPI_D3D12_CreateComputePipelineState", 0x2762deac }, - { "NvAPI_D3D12_SetDepthBoundsTestValues", 0xb9333fe9 }, - { "NvAPI_D3D12_CreateReservedResource", 0x2c85f101 }, - { "NvAPI_D3D12_CreateHeap", 0x5cb397cf }, - { "NvAPI_D3D12_CreateHeap2", 0x924be9d6 }, - { "NvAPI_D3D12_QueryCpuVisibleVidmem", 0x26322bc3 }, - { "NvAPI_D3D12_ReservedResourceGetDesc", 0x9aa2aabb }, - { "NvAPI_D3D12_UpdateTileMappings", 0xc6017a7d }, - { "NvAPI_D3D12_CopyTileMappings", 0x47f78194 }, - { "NvAPI_D3D12_ResourceAliasingBarrier", 0xb942bab7 }, - { "NvAPI_D3D12_CaptureUAVInfo", 0x6e5ea9db }, - { "NvAPI_D3D11_GetResourceGPUVirtualAddressEx", 0xaf6d14da }, - { "NvAPI_D3D11_EnumerateMetaCommands", 0xc7453ba8 }, - { "NvAPI_D3D11_CreateMetaCommand", 0xf505fba0 }, - { "NvAPI_D3D11_InitializeMetaCommand", 0xaec629e9 }, - { "NvAPI_D3D11_ExecuteMetaCommand", 0x82236c47 }, - { "NvAPI_D3D12_EnumerateMetaCommands", 0xcd9141d8 }, - { "NvAPI_D3D12_CreateMetaCommand", 0xeb29634b }, - { "NvAPI_D3D12_InitializeMetaCommand", 0xa4125399 }, - { "NvAPI_D3D12_ExecuteMetaCommand", 0xde24fc3d }, - { "NvAPI_D3D12_CreateCommittedResource", 0x027e98ae }, - { "NvAPI_D3D12_GetCopyableFootprints", 0xf6305eb5 }, - { "NvAPI_D3D12_CopyTextureRegion", 0x82b91b25 }, - { "NvAPI_D3D12_IsNvShaderExtnOpCodeSupported", 0x3dfacec8 }, - { "NvAPI_D3D12_GetOptimalThreadCountForMesh", 0xb43995cb }, - { "NvAPI_D3D_IsGSyncCapable", 0x9c1eed78 }, - { "NvAPI_D3D_IsGSyncActive", 0xe942b0ff }, - { "NvAPI_D3D1x_DisableShaderDiskCache", 0xd0cbca7d }, - { "NvAPI_D3D11_MultiGPU_GetCaps", 0xd2d25687 }, - { "NvAPI_D3D11_MultiGPU_Init", 0x017be49e }, - { "NvAPI_D3D11_CreateMultiGPUDevice", 0xbdb20007 }, - { "NvAPI_D3D_QuerySinglePassStereoSupport", 0x6f5f0a6d }, - { "NvAPI_D3D_SetSinglePassStereoMode", 0xa39e6e6e }, - { "NvAPI_D3D12_QuerySinglePassStereoSupport", 0x3b03791b }, - { "NvAPI_D3D12_SetSinglePassStereoMode", 0x83556d87 }, - { "NvAPI_D3D_QueryMultiViewSupport", 0xb6e0a41c }, - { "NvAPI_D3D_SetMultiViewMode", 0x8285c8da }, - { "NvAPI_D3D_QueryModifiedWSupport", 0xcbf9f4f5 }, - { "NvAPI_D3D_SetModifiedWMode", 0x06ea4bf4 }, - { "NvAPI_D3D12_QueryModifiedWSupport", 0x51235248 }, - { "NvAPI_D3D12_SetModifiedWMode", 0xe1fdaba7 }, - { "NvAPI_D3D_CreateLateLatchObject", 0x2db27d09 }, - { "NvAPI_D3D_QueryLateLatchSupport", 0x8ceca0ec }, - { "NvAPI_D3D_RegisterDevice", 0x8c02c4d0 }, - { "NvAPI_D3D11_MultiDrawInstancedIndirect", 0xd4e26bbf }, - { "NvAPI_D3D11_MultiDrawIndexedInstancedIndirect", 0x59e890f9 }, - { "NvAPI_D3D_ImplicitSLIControl", 0x2aede111 }, - { "NvAPI_D3D12_UseDriverHeapPriorities", 0xf0d978a8 }, - { "NvAPI_D3D12_Mosaic_GetCompanionAllocations", 0xa46022c7 }, - { "NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions", 0xb092b818 }, - { "NvAPI_D3D1x_GetGraphicsCapabilities", 0x52b1499a }, - { "NvAPI_D3D12_GetGraphicsCapabilities", 0x01e87354 }, - { "NvAPI_D3D11_RSSetExclusiveScissorRects", 0xae4d73ef }, - { "NvAPI_D3D11_RSSetViewportsPixelShadingRates", 0x34f7938f }, - { "NvAPI_D3D11_CreateShadingRateResourceView", 0x99ca2dff }, - { "NvAPI_D3D11_RSSetShadingRateResourceView", 0x1b0c2f83 }, - { "NvAPI_D3D11_RSGetPixelShadingRateSampleOrder", 0x092442a1 }, - { "NvAPI_D3D11_RSSetPixelShadingRateSampleOrder", 0xa942373a }, - { "NvAPI_D3D_InitializeVRSHelper", 0x4780d70b }, - { "NvAPI_D3D_InitializeNvGazeHandler", 0x5b3b7479 }, - { "NvAPI_D3D_InitializeSMPAssist", 0x42763d0c }, - { "NvAPI_D3D_QuerySMPAssistSupport", 0xc57921de }, - { "NvAPI_D3D_GetSleepStatus", 0xaef96ca1 }, - { "NvAPI_D3D_SetSleepMode", 0xac1ca9e0 }, - { "NvAPI_D3D_Sleep", 0x852cd1d2 }, - { "NvAPI_D3D_GetLatency", 0x1a587f9c }, - { "NvAPI_D3D_SetLatencyMarker", 0xd9984c05 }, - { "NvAPI_D3D12_SetAsyncFrameMarker", 0x13c98f73 }, - { "NvAPI_D3D12_NotifyOutOfBandCommandQueue", 0x03d6e8cb }, - { "NvAPI_D3D12_CreateCubinComputeShader", 0x2a2c79e8 }, - { "NvAPI_D3D12_CreateCubinComputeShaderEx", 0x3151211b }, - { "NvAPI_D3D12_CreateCubinComputeShaderWithName", 0x1dc7261f }, - { "NvAPI_D3D12_LaunchCubinShader", 0x5c52bb86 }, - { "NvAPI_D3D12_DestroyCubinComputeShader", 0x7fb785ba }, - { "NvAPI_D3D12_GetCudaTextureObject", 0x80403fc9 }, - { "NvAPI_D3D12_GetCudaSurfaceObject", 0x48f5b2ee }, - { "NvAPI_D3D12_IsFatbinPTXSupported", 0x70c07832 }, - { "NvAPI_D3D12_CreateCuModule", 0xad1a677d }, - { "NvAPI_D3D12_EnumFunctionsInModule", 0x7ab88d88 }, - { "NvAPI_D3D12_CreateCuFunction", 0xe2436e22 }, - { "NvAPI_D3D12_LaunchCuKernelChain", 0x24973538 }, - { "NvAPI_D3D12_DestroyCuModule", 0x41c65285 }, - { "NvAPI_D3D12_DestroyCuFunction", 0xdf295ea6 }, - { "NvAPI_D3D11_CreateCubinComputeShader", 0x0ed98181 }, - { "NvAPI_D3D11_CreateCubinComputeShaderEx", 0x32c2a0f6 }, - { "NvAPI_D3D11_CreateCubinComputeShaderWithName", 0xb672be19 }, - { "NvAPI_D3D11_LaunchCubinShader", 0x427e236d }, - { "NvAPI_D3D11_DestroyCubinComputeShader", 0x01682c86 }, - { "NvAPI_D3D11_IsFatbinPTXSupported", 0x6086bd93 }, - { "NvAPI_D3D11_CreateUnorderedAccessView", 0x74a497a1 }, - { "NvAPI_D3D11_CreateShaderResourceView", 0x65cb431e }, - { "NvAPI_D3D11_CreateSamplerState", 0x89eca416 }, - { "NvAPI_D3D11_GetCudaTextureObject", 0x9006fa68 }, - { "NvAPI_D3D11_GetResourceGPUVirtualAddress", 0x1819b423 }, - { "NvAPI_D3D12_GetRaytracingCaps", 0x85a6c2a0 }, - { "NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo", 0x4726d180 }, - { "NvAPI_D3D12_SetCreatePipelineStateOptions", 0x5c607a27 }, - { "NvAPI_D3D12_CheckDriverMatchingIdentifierEx", 0xafb237d4 }, - { "NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx", 0x8d025b77 }, - { "NvAPI_D3D12_BuildRaytracingOpacityMicromapArray", 0x814f8d11 }, - { "NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray", 0x0425c538 }, - { "NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo", 0x1d9a39b6 }, - { "NvAPI_D3D12_BuildRaytracingAccelerationStructureEx", 0xe24ead45 }, - { "NvAPI_D3D12_QueryWorkstationFeatureProperties", 0xa92ea23a }, - { "NvAPI_D3D12_CreateCommittedRDMABuffer", 0xe78dcb44 }, - { "NvAPI_VIO_GetCapabilities", 0x1dc91303 }, - { "NvAPI_VIO_Open", 0x44ee4841 }, - { "NvAPI_VIO_Close", 0xd01bd237 }, - { "NvAPI_VIO_Status", 0x0e6ce4f1 }, - { "NvAPI_VIO_SyncFormatDetect", 0x118d48a3 }, - { "NvAPI_VIO_GetConfig", 0xd34a789b }, - { "NvAPI_VIO_SetConfig", 0x0e4eec07 }, - { "NvAPI_VIO_SetCSC", 0xa1ec8d74 }, - { "NvAPI_VIO_GetCSC", 0x7b0d72a3 }, - { "NvAPI_VIO_SetGamma", 0x964bf452 }, - { "NvAPI_VIO_GetGamma", 0x51d53d06 }, - { "NvAPI_VIO_SetSyncDelay", 0x2697a8d1 }, - { "NvAPI_VIO_GetSyncDelay", 0x462214a9 }, - { "NvAPI_VIO_GetPCIInfo", 0xb981d935 }, - { "NvAPI_VIO_IsRunning", 0x96bd040e }, - { "NvAPI_VIO_Start", 0xcde8e1a3 }, - { "NvAPI_VIO_Stop", 0x6ba2a5d6 }, - { "NvAPI_VIO_IsFrameLockModeCompatible", 0x7bf0a94d }, - { "NvAPI_VIO_EnumDevices", 0xfd7c5557 }, - { "NvAPI_VIO_QueryTopology", 0x869534e2 }, - { "NvAPI_VIO_EnumSignalFormats", 0xead72fe4 }, - { "NvAPI_VIO_EnumDataFormats", 0x221fa8e8 }, - { "NvAPI_Stereo_CreateConfigurationProfileRegistryKey", 0xbe7692ec }, - { "NvAPI_Stereo_DeleteConfigurationProfileRegistryKey", 0xf117b834 }, - { "NvAPI_Stereo_SetConfigurationProfileValue", 0x24409f48 }, - { "NvAPI_Stereo_DeleteConfigurationProfileValue", 0x49bceecf }, - { "NvAPI_Stereo_Enable", 0x239c4545 }, - { "NvAPI_Stereo_Disable", 0x2ec50c2b }, - { "NvAPI_Stereo_IsEnabled", 0x348ff8e1 }, - { "NvAPI_Stereo_GetStereoSupport", 0x296c434d }, - { "NvAPI_Stereo_CreateHandleFromIUnknown", 0xac7e37f4 }, - { "NvAPI_Stereo_DestroyHandle", 0x3a153134 }, - { "NvAPI_Stereo_Activate", 0xf6a1ad68 }, - { "NvAPI_Stereo_Deactivate", 0x2d68de96 }, - { "NvAPI_Stereo_IsActivated", 0x1fb0bc30 }, - { "NvAPI_Stereo_GetSeparation", 0x451f2134 }, - { "NvAPI_Stereo_SetSeparation", 0x5c069fa3 }, - { "NvAPI_Stereo_DecreaseSeparation", 0xda044458 }, - { "NvAPI_Stereo_IncreaseSeparation", 0xc9a8ecec }, - { "NvAPI_Stereo_GetConvergence", 0x4ab00934 }, - { "NvAPI_Stereo_SetConvergence", 0x3dd6b54b }, - { "NvAPI_Stereo_DecreaseConvergence", 0x4c87e317 }, - { "NvAPI_Stereo_IncreaseConvergence", 0xa17daabe }, - { "NvAPI_Stereo_GetFrustumAdjustMode", 0xe6839b43 }, - { "NvAPI_Stereo_SetFrustumAdjustMode", 0x7be27fa2 }, - { "NvAPI_Stereo_CaptureJpegImage", 0x932cb140 }, - { "NvAPI_Stereo_InitActivation", 0xc7177702 }, - { "NvAPI_Stereo_Trigger_Activation", 0x0d6c6cd2 }, - { "NvAPI_Stereo_CapturePngImage", 0x8b7e99b5 }, - { "NvAPI_Stereo_ReverseStereoBlitControl", 0x3cd58f89 }, - { "NvAPI_Stereo_SetNotificationMessage", 0x6b9b409e }, - { "NvAPI_Stereo_SetActiveEye", 0x96eea9f8 }, - { "NvAPI_Stereo_SetDriverMode", 0x5e8f0bec }, - { "NvAPI_Stereo_GetEyeSeparation", 0xce653127 }, - { "NvAPI_Stereo_IsWindowedModeSupported", 0x40c8ed5e }, - { "NvAPI_Stereo_SetSurfaceCreationMode", 0xf5dcfcba }, - { "NvAPI_Stereo_GetSurfaceCreationMode", 0x36f1c736 }, - { "NvAPI_Stereo_Debug_WasLastDrawStereoized", 0xed4416c5 }, - { "NvAPI_Stereo_SetDefaultProfile", 0x44f0ecd1 }, - { "NvAPI_Stereo_GetDefaultProfile", 0x624e21c2 }, - { "NvAPI_D3D1x_CreateSwapChain", 0x1bc21b66 }, - { "NvAPI_D3D9_CreateSwapChain", 0x1a131e09 }, - { "NvAPI_DRS_CreateSession", 0x0694d52e }, - { "NvAPI_DRS_DestroySession", 0xdad9cff8 }, - { "NvAPI_DRS_LoadSettings", 0x375dbd6b }, - { "NvAPI_DRS_SaveSettings", 0xfcbc7e14 }, - { "NvAPI_DRS_LoadSettingsFromFile", 0xd3ede889 }, - { "NvAPI_DRS_SaveSettingsToFile", 0x2be25df8 }, - { "NvAPI_DRS_CreateProfile", 0xcc176068 }, - { "NvAPI_DRS_DeleteProfile", 0x17093206 }, - { "NvAPI_DRS_SetCurrentGlobalProfile", 0x1c89c5df }, - { "NvAPI_DRS_GetCurrentGlobalProfile", 0x617bff9f }, - { "NvAPI_DRS_GetProfileInfo", 0x61cd6fd6 }, - { "NvAPI_DRS_SetProfileInfo", 0x16abd3a9 }, - { "NvAPI_DRS_FindProfileByName", 0x7e4a9a0b }, - { "NvAPI_DRS_EnumProfiles", 0xbc371ee0 }, - { "NvAPI_DRS_GetNumProfiles", 0x1dae4fbc }, - { "NvAPI_DRS_CreateApplication", 0x4347a9de }, - { "NvAPI_DRS_DeleteApplicationEx", 0xc5ea85a1 }, - { "NvAPI_DRS_DeleteApplication", 0x2c694bc6 }, - { "NvAPI_DRS_GetApplicationInfo", 0xed1f8c69 }, - { "NvAPI_DRS_EnumApplications", 0x7fa2173a }, - { "NvAPI_DRS_FindApplicationByName", 0xeee566b2 }, - { "NvAPI_DRS_SetSetting", 0x577dd202 }, - { "NvAPI_DRS_GetSetting", 0x73bf8338 }, - { "NvAPI_DRS_EnumSettings", 0xae3039da }, - { "NvAPI_DRS_EnumAvailableSettingIds", 0xf020614a }, - { "NvAPI_DRS_EnumAvailableSettingValues", 0x2ec39f90 }, - { "NvAPI_DRS_GetSettingIdFromName", 0xcb7309cd }, - { "NvAPI_DRS_GetSettingNameFromId", 0xd61cbe6e }, - { "NvAPI_DRS_DeleteProfileSetting", 0xe4a26362 }, - { "NvAPI_DRS_RestoreAllDefaults", 0x5927b094 }, - { "NvAPI_DRS_RestoreProfileDefault", 0xfa5f6134 }, - { "NvAPI_DRS_RestoreProfileDefaultSetting", 0x53f0381e }, - { "NvAPI_DRS_GetBaseProfile", 0xda8466a0 }, - { "NvAPI_SYS_GetChipSetInfo", 0x53dabbca }, - { "NvAPI_SYS_GetLidAndDockInfo", 0xcda14d8a }, - { "NvAPI_SYS_GetDisplayIdFromGpuAndOutputId", 0x08f2bab4 }, - { "NvAPI_SYS_GetGpuAndOutputIdFromDisplayId", 0x112ba1a5 }, - { "NvAPI_SYS_GetPhysicalGpuFromDisplayId", 0x9ea74659 }, - { "NvAPI_SYS_GetDisplayDriverInfo", 0x721faceb }, - { "NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates", 0xadeeaf67 }, -}; - -#endif // _NVAPI_INTERFACE_H diff --git a/third-party/nvapi-opensource/readme.txt b/third-party/nvapi-opensource/readme.txt deleted file mode 100644 index e0671789995..00000000000 --- a/third-party/nvapi-opensource/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -Opensource version of nvapi -Updates can be found at https://download.nvidia.com/XFree86/nvapi-open-source-sdk/ -Rename version-RXXX file after updating to keep track of current version diff --git a/third-party/nvapi-opensource/version-R530 b/third-party/nvapi-opensource/version-R530 deleted file mode 100644 index e69de29bb2d..00000000000 From dcf1ce3fe5fc6904d436066e38c94e9427ca6177 Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Sat, 29 Jul 2023 18:21:58 +0000 Subject: [PATCH 042/576] Expose Connection environment variables to the app start (#1430) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- docs/source/about/app_examples.rst | 60 ++++++++++++-------------- src/nvhttp.cpp | 31 +++++++++++-- src/process.cpp | 27 +++++++++++- src/process.h | 3 +- src/rtsp.h | 10 +++++ src_assets/common/assets/web/apps.html | 26 ++++++++++- 6 files changed, 117 insertions(+), 40 deletions(-) diff --git a/docs/source/about/app_examples.rst b/docs/source/about/app_examples.rst index 30c99070e01..531a647e0d9 100644 --- a/docs/source/about/app_examples.rst +++ b/docs/source/about/app_examples.rst @@ -125,35 +125,35 @@ Linux Changing Resolution and Refresh Rate (Linux - X11) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+----------------------+--------------------------------------------------------------+ -| **Field** | **Value** | -+----------------------+--------------------------------------------------------------+ -| Command Preparations | Do: ``xrandr --output HDMI-1 --mode 1920x1080 --rate 60`` | -| +--------------------------------------------------------------+ -| | Undo: ``xrandr --output HDMI-1 --mode 3840×2160 --rate 120`` | -+----------------------+--------------------------------------------------------------+ ++----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ +| **Field** | **Value** | ++----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ +| Command Preparations | Do: ``sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --range ${SUNSHINE_CLIENT_FPS}"`` | +| +---------------------------------------------------------------------------------------------------------------------------------------+ +| | Undo: ``xrandr --output HDMI-1 --mode 3840x2160 --rate 120`` | ++----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ Changing Resolution and Refresh Rate (Linux - Wayland) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+----------------------+-------------------------------------------------------------+ -| **Field** | **Value** | -+----------------------+-------------------------------------------------------------+ -| Command Preparations | Do: ``wlr-xrandr --output HDMI-1 --mode 1920x1080@60Hz`` | -| +-------------------------------------------------------------+ -| | Undo: ``wlr-xrandr --output HDMI-1 --mode 3840×2160@120Hz`` | -+----------------------+-------------------------------------------------------------+ ++----------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +| **Field** | **Value** | ++----------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +| Command Preparations | Do: ``sh -c "wlr-xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz\""`` | +| +-------------------------------------------------------------------------------------------------------------------------------------+ +| | Undo: ``wlr-xrandr --output HDMI-1 --mode 3840x2160@120Hz`` | ++----------------------+-------------------------------------------------------------------------------------------------------------------------------------+ Changing Resolution and Refresh Rate (Linux - KDE Plasma - Wayland and X11) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+----------------------+-------------------------------------------------------------+ -| **Field** | **Value** | -+----------------------+-------------------------------------------------------------+ -| Command Preparations | Do: ``kscreen-doctor output.HDMI-A-1.mode.1920x1080@60`` | -| +-------------------------------------------------------------+ -| | Undo: ``kscreen-doctor output.HDMI-A-1.mode.3840×2160@120`` | -+----------------------+-------------------------------------------------------------+ ++----------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| **Field** | **Value** | ++----------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| Command Preparations | Do: ``sh -c "kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}"`` | +| +----------------------------------------------------------------------------------------------------------------------------------+ +| | Undo: ``kscreen-doctor output.HDMI-A-1.mode.3840x2160@120`` | ++----------------------+----------------------------------------------------------------------------------------------------------------------------------+ Flatpak ^^^^^^^ @@ -188,17 +188,13 @@ Changing Resolution and Refresh Rate (Windows) .. Note:: This example uses the `QRes` tool to change the resolution and refresh rate. This tool can be downloaded from their `SourceForge repository `_. -+----------------------+----------------------------------------------------+ -| **Field** | **Value** | -+----------------------+----------------------------------------------------+ -| Command Preparations | Do: ``FullPath\qres.exe /x:1920 /y:1080 /r:60`` | -| +----------------------------------------------------+ -| | Undo: ``FullPath\qres.exe /x:3840 /y:2160 /r:120`` | -+----------------------+----------------------------------------------------+ - -.. Tip:: You can change your host resolution to match the client resolution automatically using the - `Nonary/ResolutionAutomation `_ project. - ++----------------------+------------------------------------------------------------------------------------------------------------------+ +| **Field** | **Value** | ++----------------------+------------------------------------------------------------------------------------------------------------------+ +| Command Preparations | Do: ``cmd /C FullPath\qres.exe /x:%SUNSHINE_CLIENT_WIDTH% /y:%SUNSHINE_CLIENT_WIDTH% /r:%SUNSHINE_CLIENT_FPS%`` | +| +------------------------------------------------------------------------------------------------------------------+ +| | Undo: ``cmd /C FullPath\qres.exe /x:3840 /y:2160 /r:120`` | ++----------------------+------------------------------------------------------------------------------------------------------------------+ Elevating Commands (Windows) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index dfa0b9fef76..b23a087cd52 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -17,6 +17,7 @@ #include #include #include +#include // local includes #include "config.h" @@ -267,12 +268,32 @@ namespace nvhttp { launch_session.host_audio = host_audio; launch_session.gcm_key = util::from_hex(get_arg(args, "rikey"), true); + std::stringstream mode = std::stringstream(get_arg(args, "mode")); + // Split mode by the char "x", to populate width/height/fps + int x = 0; + std::string segment; + while (std::getline(mode, segment, 'x')) { + if (x == 0) launch_session.width = atoi(segment.c_str()); + if (x == 1) launch_session.height = atoi(segment.c_str()); + if (x == 2) launch_session.fps = atoi(segment.c_str()); + x++; + } + launch_session.unique_id = (get_arg(args, "uniqueid")); + launch_session.uuid = (get_arg(args, "uuid")); + launch_session.appid = util::from_view(get_arg(args, "appid")); + launch_session.enable_sops = util::from_view(get_arg(args, "sops")); + launch_session.surround_info = util::from_view(get_arg(args, "surroundAudioInfo")); + launch_session.gcmap = util::from_view(get_arg(args, "gcmap")); + launch_session.enable_hdr = 0; + if (args.find("enableHdr"s) != std::end(args)) { + launch_session.enable_hdr = util::from_view(get_arg(args, "enableHdr")); + } uint32_t prepend_iv = util::endian::big(util::from_view(get_arg(args, "rikeyid"))); auto prepend_iv_p = (uint8_t *) &prepend_iv; auto next = std::copy(prepend_iv_p, prepend_iv_p + sizeof(prepend_iv), std::begin(launch_session.iv)); std::fill(next, std::end(launch_session.iv), 0); - + BOOST_LOG(error) << launch_session.width << " h: " << launch_session.height << " fps: " << launch_session.fps; return launch_session; } @@ -757,8 +778,11 @@ namespace nvhttp { } } + host_audio = util::from_view(get_arg(args, "localAudioPlayMode")); + auto launch_session = make_launch_session(host_audio, args); + if (appid > 0) { - auto err = proc::proc.execute(appid); + auto err = proc::proc.execute(appid, launch_session); if (err) { tree.put("root..status_code", err); tree.put("root..status_message", "Failed to start the specified application"); @@ -768,8 +792,7 @@ namespace nvhttp { } } - host_audio = util::from_view(get_arg(args, "localAudioPlayMode")); - rtsp_stream::launch_session_raise(make_launch_session(host_audio, args)); + rtsp_stream::launch_session_raise(launch_session); tree.put("root..status_code", 200); tree.put("root.sessionUrl0", "rtsp://"s + request->local_endpoint().address().to_string() + ':' + std::to_string(map_port(rtsp_stream::RTSP_SETUP_PORT))); diff --git a/src/process.cpp b/src/process.cpp index 1a0f8e53e7b..83ada3469b2 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -1,6 +1,6 @@ /** * @file src/process.cpp - * @brief todo + * @brief Handles the startup and shutdown of the apps started by a streaming Session. */ #define BOOST_BIND_GLOBAL_PLACEHOLDERS @@ -101,7 +101,7 @@ namespace proc { } int - proc_t::execute(int app_id) { + proc_t::execute(int app_id, rtsp_stream::launch_session_t launch_session) { // Ensure starting from a clean slate terminate(); @@ -120,6 +120,29 @@ namespace proc { _app_prep_begin = std::begin(_app.prep_cmds); _app_prep_it = _app_prep_begin; + // Add Stream-specific environment variables + _env["SUNSHINE_APP_ID"] = std::to_string(_app_id); + _env["SUNSHINE_APP_NAME"] = _app.name; + _env["SUNSHINE_CLIENT_WIDTH"] = std::to_string(launch_session.width); + _env["SUNSHINE_CLIENT_HEIGHT"] = std::to_string(launch_session.height); + _env["SUNSHINE_CLIENT_FPS"] = std::to_string(launch_session.fps); + _env["SUNSHINE_CLIENT_HDR"] = launch_session.enable_hdr ? "true" : "false"; + _env["SUNSHINE_CLIENT_GCMAP"] = std::to_string(launch_session.gcmap); + _env["SUNSHINE_CLIENT_HOST_AUDIO"] = launch_session.host_audio ? "true" : "false"; + _env["SUNSHINE_CLIENT_ENABLE_SOPS"] = launch_session.enable_sops ? "true" : "false"; + int channelCount = launch_session.surround_info & (65535); + switch (channelCount) { + case 2: + _env["SUNSHINE_CLIENT_AUDIO_CONFIGURATION"] = "2.0"; + break; + case 6: + _env["SUNSHINE_CLIENT_AUDIO_CONFIGURATION"] = "5.1"; + break; + case 8: + _env["SUNSHINE_CLIENT_AUDIO_CONFIGURATION"] = "7.1"; + break; + } + if (!_app.output.empty() && _app.output != "null"sv) { #ifdef _WIN32 // fopen() interprets the filename as an ANSI string on Windows, so we must convert it diff --git a/src/process.h b/src/process.h index 038e86f0e82..25aa1714e26 100644 --- a/src/process.h +++ b/src/process.h @@ -15,6 +15,7 @@ #include "config.h" #include "platform/common.h" +#include "rtsp.h" #include "utility.h" namespace proc { @@ -65,7 +66,7 @@ namespace proc { _apps(std::move(apps)) {} int - execute(int app_id); + execute(int app_id, rtsp_stream::launch_session_t launch_session); /** * @return _app_id if a process is running, otherwise returns 0 diff --git a/src/rtsp.h b/src/rtsp.h index 2b0355fd947..58834f1ea12 100644 --- a/src/rtsp.h +++ b/src/rtsp.h @@ -17,6 +17,16 @@ namespace rtsp_stream { crypto::aes_t iv; bool host_audio; + std::string unique_id; + std::string uuid; + int width; + int height; + int fps; + int gcmap; + int appid; + int surround_info; + bool enable_hdr; + bool enable_sops; }; void diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 54a3bebfbe4..760a00074f6 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -302,6 +302,26 @@ must be a PNG file. If not set, Sunshine will send default box image. +
+
About Environment Variables: All commands get these environment variables by default:
+ + + + + + + + + + + + +
Var Name
SUNSHINE_APP_IDApp ID
SUNSHINE_APP_NAMEApp Name
SUNSHINE_CLIENT_WIDTHThe Width requested by the client
SUNSHINE_CLIENT_HEIGHTThe Height requested by the client
SUNSHINE_CLIENT_FPSThe FPS requested by the client
SUNSHINE_CLIENT_HDR(true/false) if HDR is enabled by the client
SUNSHINE_CLIENT_GCMAP(int) the requested gamepad mask, in a bitset/bitfield format
SUNSHINE_CLIENT_HOST_AUDIO(true/false) if the client has requested host audio
SUNSHINE_CLIENT_ENABLE_SOPS(true/false) if the client has requested the option to optimize the game for optimal streaming
SUNSHINE_CLIENT_AUDIO_CONFIGURATIONThe Audio Configuration requested by the client (2.0/5.1/7.1)
+
Example - QRes for Resolution Automation:
cmd /C <qres path>\QRes.exe /X:%SUNSHINE_CLIENT_WIDTH% /Y:%SUNSHINE_CLIENT_HEIGHT%
+
Example - Xrandr for Resolution Automation:
sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --range 60"
+
Example - displayplacer for Resolution Automation:
sh -c "displayplacer "id: res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:60 scaling:on origin:(0,0) degree:0""
+ +
+ +
+ + +
+ Allows the client to request AV1 Main 8-bit or 10-bit video streams.
+ AV1 is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding. +
+
@@ -1032,6 +1054,7 @@

Configuration

"fps": "[10,30,60,90,120]", "gamepad": "auto", "hevc_mode": 0, + "av1_mode": 0, "key_rightalt_to_key_win": "disabled", "keyboard": "enabled", "min_log_level": 2, From e8300461696ef4616ea4ce969b8a5ff7dca608f1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 13 Aug 2023 15:52:35 -0500 Subject: [PATCH 083/576] Turn off AMF filler data to match other encoders --- src/video.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index e95c31f83de..bb25ababbda 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -760,7 +760,7 @@ namespace video { { // Common options { - { "filler_data"s, true }, + { "filler_data"s, false }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, { "quality"s, &config::video.amd.amd_quality_av1 }, { "rc"s, &config::video.amd.amd_rc_av1 }, @@ -774,7 +774,7 @@ namespace video { { // Common options { - { "filler_data"s, true }, + { "filler_data"s, false }, { "gops_per_idr"s, 1 }, { "header_insertion_mode"s, "idr"s }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, @@ -793,7 +793,7 @@ namespace video { { // Common options { - { "filler_data"s, true }, + { "filler_data"s, false }, { "log_to_dbg"s, "1"s }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, { "qmax"s, 51 }, From e2753e38ac2f727279d72b1f41895bc235b5f5eb Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 13 Aug 2023 16:14:06 -0500 Subject: [PATCH 084/576] Move AMF version check into display_vram_t to avoid blocking software encoding --- src/platform/windows/display_base.cpp | 41 -------------------- src/platform/windows/display_vram.cpp | 56 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 66a687d488d..4fdf61b2d99 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -19,8 +19,6 @@ typedef long NTSTATUS; #include "src/platform/common.h" #include "src/video.h" -#include - namespace platf { using namespace std::literals; } @@ -487,45 +485,6 @@ namespace platf::dxgi { dup.use_dwmflush = config::video.dwmflush && !(config.framerate > refresh_rate) ? true : false; - // Older versions of the AMD AMF runtime can crash when fed P010 surfaces, so we'll - // check the AMF version if we are using HDR on an AMD GPU to avoid possibly crashing. - if (config.dynamicRange && adapter_desc.VendorId == 0x1002) { - HMODULE amfrt = LoadLibraryW(AMF_DLL_NAME); - if (amfrt) { - auto unload_amfrt = util::fail_guard([amfrt]() { - FreeLibrary(amfrt); - }); - - auto fnAMFQueryVersion = (AMFQueryVersion_Fn) GetProcAddress(amfrt, AMF_QUERY_VERSION_FUNCTION_NAME); - if (fnAMFQueryVersion) { - amf_uint64 version; - auto result = fnAMFQueryVersion(&version); - if (result == AMF_OK) { - // Fail if AMF version is below 1.4.23 where HEVC Main10 encoding was introduced. - // AMF 1.4.23 corresponds to driver version 21.12.1 (21.40.11.03) or newer. - if (version < AMF_MAKE_FULL_VERSION(1, 4, 23, 0)) { - BOOST_LOG(warning) << "HDR encoding is disabled on AMF version "sv - << AMF_GET_MAJOR_VERSION(version) << '.' - << AMF_GET_MINOR_VERSION(version) << '.' - << AMF_GET_SUBMINOR_VERSION(version) << '.' - << AMF_GET_BUILD_VERSION(version); - BOOST_LOG(warning) << "If your AMD GPU supports HEVC Main10 encoding, update your graphics drivers!"sv; - return -1; - } - } - else { - BOOST_LOG(warning) << "AMFQueryVersion() failed: "sv << result; - } - } - else { - BOOST_LOG(warning) << "AMF DLL missing export: "sv << AMF_QUERY_VERSION_FUNCTION_NAME; - } - } - else { - BOOST_LOG(warning) << "Detected AMD GPU but AMF failed to load"sv; - } - } - // Bump up thread priority { const DWORD flags = TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY; diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 601f084cceb..f523738925e 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -23,6 +23,8 @@ extern "C" { #include "src/nvenc/nvenc_utils.h" #include "src/video.h" +#include + #define SUNSHINE_SHADERS_DIR SUNSHINE_ASSETS_DIR "/shaders/directx" namespace platf { using namespace std::literals; @@ -1324,6 +1326,60 @@ namespace platf::dxgi { return -1; } + DXGI_ADAPTER_DESC adapter_desc; + adapter->GetDesc(&adapter_desc); + + // Perform AMF version checks if we're using an AMD GPU. This check is placed in display_vram_t + // to avoid hitting the display_ram_t path which uses software encoding and doesn't touch AMF. + if ((config.dynamicRange || config.videoFormat == 2) && adapter_desc.VendorId == 0x1002) { + HMODULE amfrt = LoadLibraryW(AMF_DLL_NAME); + if (amfrt) { + auto unload_amfrt = util::fail_guard([amfrt]() { + FreeLibrary(amfrt); + }); + + auto fnAMFQueryVersion = (AMFQueryVersion_Fn) GetProcAddress(amfrt, AMF_QUERY_VERSION_FUNCTION_NAME); + if (fnAMFQueryVersion) { + amf_uint64 version; + auto result = fnAMFQueryVersion(&version); + if (result == AMF_OK) { + if (config.videoFormat == 2 && version < AMF_MAKE_FULL_VERSION(1, 4, 30, 0)) { + // AMF 1.4.30 adds ultra low latency mode for AV1. Don't use AV1 on earlier versions. + // This corresponds to driver version 23.5.2 (23.10.01.45) or newer. + BOOST_LOG(warning) << "AV1 encoding is disabled on AMF version "sv + << AMF_GET_MAJOR_VERSION(version) << '.' + << AMF_GET_MINOR_VERSION(version) << '.' + << AMF_GET_SUBMINOR_VERSION(version) << '.' + << AMF_GET_BUILD_VERSION(version); + BOOST_LOG(warning) << "If your AMD GPU supports AV1 encoding, update your graphics drivers!"sv; + return -1; + } + else if (config.dynamicRange && version < AMF_MAKE_FULL_VERSION(1, 4, 23, 0)) { + // Older versions of the AMD AMF runtime can crash when fed P010 surfaces. + // Fail if AMF version is below 1.4.23 where HEVC Main10 encoding was introduced. + // AMF 1.4.23 corresponds to driver version 21.12.1 (21.40.11.03) or newer. + BOOST_LOG(warning) << "HDR encoding is disabled on AMF version "sv + << AMF_GET_MAJOR_VERSION(version) << '.' + << AMF_GET_MINOR_VERSION(version) << '.' + << AMF_GET_SUBMINOR_VERSION(version) << '.' + << AMF_GET_BUILD_VERSION(version); + BOOST_LOG(warning) << "If your AMD GPU supports HEVC Main10 encoding, update your graphics drivers!"sv; + return -1; + } + } + else { + BOOST_LOG(warning) << "AMFQueryVersion() failed: "sv << result; + } + } + else { + BOOST_LOG(warning) << "AMF DLL missing export: "sv << AMF_QUERY_VERSION_FUNCTION_NAME; + } + } + else { + BOOST_LOG(warning) << "Detected AMD GPU but AMF failed to load"sv; + } + } + D3D11_SAMPLER_DESC sampler_desc {}; sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; From be26aa07a06cf3c46b381541ee1e92bfa69f57e2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 14 Aug 2023 20:50:51 -0500 Subject: [PATCH 085/576] Remove nonsense operator combo --- src/cbs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cbs.cpp b/src/cbs.cpp index c1578825cff..c06b7c4a8b5 100644 --- a/src/cbs.cpp +++ b/src/cbs.cpp @@ -96,7 +96,7 @@ namespace cbs { cbs::frag_t frag; - int err = ff_cbs_read_packet(ctx.get(), &frag, &*packet); + int err = ff_cbs_read_packet(ctx.get(), &frag, packet); if (err < 0) { char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 }; BOOST_LOG(error) << "Couldn't read packet: "sv << av_make_error_string(err_str, AV_ERROR_MAX_STRING_SIZE, err); From 08a412fa341e93fdebb03795795dc5a3af59a143 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 16 Aug 2023 21:58:58 -0500 Subject: [PATCH 086/576] Print an error if the encoder doesn't produce an IDR frame on demand --- src/video.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index bb25ababbda..cb05991da2d 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1282,6 +1282,10 @@ namespace video { return ret; } + if (frame->key_frame && !(av_packet->flags & AV_PKT_FLAG_KEY)) { + BOOST_LOG(error) << "Encoder did not produce IDR frame when requested!"sv; + } + if (session.inject) { if (session.inject == 1) { auto h264 = cbs::make_sps_h264(ctx.get(), av_packet); From 7f8391386b676a4dcfe151643a90034b8bf07723 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 16 Aug 2023 22:02:20 -0500 Subject: [PATCH 087/576] Disable libsvtav1 due to showstopping bugs --- src/video.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index cb05991da2d..65b6343d6df 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -831,7 +831,15 @@ namespace video { {}, // SDR-specific options {}, // HDR-specific options std::make_optional("qp"s, &config::video.qp), + +#ifdef ENABLE_BROKEN_AV1_ENCODER + // Due to bugs preventing on-demand IDR frames from working and very poor + // real-time encoding performance, we do not enable libsvtav1 by default. + // It is only suitable for testing AV1 until the IDR frame issue is fixed. "libsvtav1"s, +#else + {}, +#endif }, { // x265's Info SEI is so long that it causes the IDR picture data to be From e113552d45c91bf4b75bb374181b1f39c1f8ef43 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Wed, 23 Aug 2023 06:24:47 +0300 Subject: [PATCH 088/576] nvenc: improve rfi logic (#1542) --- src/nvenc/nvenc_base.cpp | 28 ++++++++++++++++------------ src/nvenc/nvenc_base.h | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/nvenc/nvenc_base.cpp b/src/nvenc/nvenc_base.cpp index 071cf70974e..80376deb335 100644 --- a/src/nvenc/nvenc_base.cpp +++ b/src/nvenc/nvenc_base.cpp @@ -246,6 +246,7 @@ namespace nvenc { ref_frames_option = 1; encoder_params.rfi = false; } + encoder_params.ref_frames_in_dpb = ref_frames_option; // This limits ref frames any frame can use to 1, but allows larger buffer size for fallback if some frames are invalidated through rfi L0_option = NV_ENC_NUM_REF_FRAMES_1; }; @@ -489,33 +490,36 @@ namespace nvenc { nvenc_base::invalidate_ref_frames(uint64_t first_frame, uint64_t last_frame) { if (!encoder || !encoder_params.rfi) return false; - if (last_frame < first_frame || - encoder_state.last_encoded_frame_index < first_frame || - encoder_state.last_encoded_frame_index > first_frame + 100) { - BOOST_LOG(error) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " invalid range (last encoded frame " << encoder_state.last_encoded_frame_index << ")"; - return false; - } - if (first_frame >= encoder_state.last_rfi_range.first && last_frame <= encoder_state.last_rfi_range.second) { BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " already done"; return true; } + if (last_frame < first_frame) { + BOOST_LOG(error) << "NvEnc: invaid rfi request " << first_frame << "-" << last_frame << ", generating IDR"; + return false; + } + BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " expanding to last encoded frame " << encoder_state.last_encoded_frame_index; + last_frame = encoder_state.last_encoded_frame_index; + + if (last_frame - first_frame + 1 >= encoder_params.ref_frames_in_dpb) { + BOOST_LOG(debug) << "NvEnc: rfi request too large, generating IDR"; + return false; + } encoder_state.rfi_needs_confirmation = true; - encoder_state.last_rfi_range = { first_frame, encoder_state.last_encoded_frame_index }; + encoder_state.last_rfi_range = { first_frame, last_frame }; - bool result = true; - for (auto i = first_frame; i <= encoder_state.last_encoded_frame_index; i++) { + for (auto i = first_frame; i <= last_frame; i++) { if (nvenc_failed(nvenc->nvEncInvalidateRefFrames(encoder, i))) { BOOST_LOG(error) << "NvEncInvalidateRefFrames " << i << " failed: " << last_error_string; - result = false; + return false; } } - return result; + return true; } bool diff --git a/src/nvenc/nvenc_base.h b/src/nvenc/nvenc_base.h index 5492b3a2d1a..aa02fbef620 100644 --- a/src/nvenc/nvenc_base.h +++ b/src/nvenc/nvenc_base.h @@ -56,6 +56,7 @@ namespace nvenc { uint32_t width = 0; uint32_t height = 0; NV_ENC_BUFFER_FORMAT buffer_format = NV_ENC_BUFFER_FORMAT_UNDEFINED; + uint32_t ref_frames_in_dpb = 0; bool rfi = false; } encoder_params; From a690e92abcbe1c9d83d1f87cf6f01a45b6be97f4 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Wed, 16 Aug 2023 02:13:31 +0300 Subject: [PATCH 089/576] Use MMCSS task in audio capture thread --- CMakeLists.txt | 1 + src/platform/windows/audio.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a13b46ffa2..3fa910ef5ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ if(WIN32) dwmapi userenv synchronization.lib + avrt ${CURL_STATIC_LIBRARIES}) set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index 1f794e24914..b10e6a7c344 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -13,6 +13,8 @@ #include +#include + #include "src/config.h" #include "src/main.h" #include "src/platform/common.h" @@ -449,6 +451,14 @@ namespace platf::audio { return -1; } + { + DWORD task_index = 0; + mmcss_task_handle = AvSetMmThreadCharacteristics("Pro Audio", &task_index); + if (!mmcss_task_handle) { + BOOST_LOG(error) << "Couldn't associate audio capture thread with Pro Audio MMCSS task [0x" << util::hex(GetLastError()).to_string_view() << ']'; + } + } + status = audio_client->Start(); if (FAILED(status)) { BOOST_LOG(error) << "Couldn't start recording [0x"sv << util::hex(status).to_string_view() << ']'; @@ -467,6 +477,10 @@ namespace platf::audio { if (audio_client) { audio_client->Stop(); } + + if (mmcss_task_handle) { + AvRevertMmThreadCharacteristics(mmcss_task_handle); + } } private: @@ -571,6 +585,8 @@ namespace platf::audio { util::buffer_t sample_buf; std::int16_t *sample_buf_pos; int channels; + + HANDLE mmcss_task_handle = NULL; }; class audio_control_t: public ::platf::audio_control_t { From 9b8db295377aa4be894da8807390ab7db34fbcbf Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:52:07 +0300 Subject: [PATCH 090/576] Add log message for audio buffer discontinuity --- src/platform/windows/audio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index b10e6a7c344..ee1091d0be3 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -543,6 +543,10 @@ namespace platf::audio { return capture_e::error; } + if (buffer_flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) { + BOOST_LOG(debug) << "Audio capture signaled buffer discontinuity"; + } + sample_aligned.uninitialized = std::end(sample_buf) - sample_buf_pos; auto n = std::min(sample_aligned.uninitialized, block_aligned.audio_sample_size * channels); From bce33da26adf216a78aacbf129635817c2e7ae21 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:53:48 +0300 Subject: [PATCH 091/576] Add log message for audio capture buffer oveflow --- src/platform/windows/audio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index ee1091d0be3..c02f1626fd6 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -550,6 +550,10 @@ namespace platf::audio { sample_aligned.uninitialized = std::end(sample_buf) - sample_buf_pos; auto n = std::min(sample_aligned.uninitialized, block_aligned.audio_sample_size * channels); + if (n < block_aligned.audio_sample_size * channels) { + BOOST_LOG(warning) << "Audio capture buffer overflow"; + } + if (buffer_flags & AUDCLNT_BUFFERFLAGS_SILENT) { std::fill_n(sample_buf_pos, n, 0); } From bb89caf4821bc5d68f088c01742227bf3f0bcc9b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 23 Aug 2023 23:41:30 -0500 Subject: [PATCH 092/576] Fix AMF debug logging to be conditional based on configured log level --- src/video.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video.cpp b/src/video.cpp index 65b6343d6df..8dd9c7ea2c0 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -761,6 +761,7 @@ namespace video { // Common options { { "filler_data"s, false }, + { "log_to_dbg"s, config::sunshine.min_log_level < 2 ? 1 : 0 }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, { "quality"s, &config::video.amd.amd_quality_av1 }, { "rc"s, &config::video.amd.amd_rc_av1 }, @@ -775,6 +776,7 @@ namespace video { // Common options { { "filler_data"s, false }, + { "log_to_dbg"s, config::sunshine.min_log_level < 2 ? 1 : 0 }, { "gops_per_idr"s, 1 }, { "header_insertion_mode"s, "idr"s }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, @@ -794,7 +796,7 @@ namespace video { // Common options { { "filler_data"s, false }, - { "log_to_dbg"s, "1"s }, + { "log_to_dbg"s, config::sunshine.min_log_level < 2 ? 1 : 0 }, { "preanalysis"s, &config::video.amd.amd_preanalysis }, { "qmax"s, 51 }, { "qmin"s, 0 }, From ad962e2e0f1fd8f3934f953cd7f478eb97b32c98 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 23 Aug 2023 23:42:09 -0500 Subject: [PATCH 093/576] Fix FFmpeg logging going to stdout rather than our log file --- src/main.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 45d45d5c3e6..e5352d1bf8f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -534,6 +534,31 @@ main(int argc, char *argv[]) { else { av_log_set_level(AV_LOG_DEBUG); } + av_log_set_callback([](void *ptr, int level, const char *fmt, va_list vl) { + static int print_prefix = 1; + char buffer[1024]; + + av_log_format_line(ptr, level, fmt, vl, buffer, sizeof(buffer), &print_prefix); + if (level <= AV_LOG_FATAL) { + BOOST_LOG(fatal) << buffer; + } + else if (level <= AV_LOG_ERROR) { + BOOST_LOG(error) << buffer; + } + else if (level <= AV_LOG_WARNING) { + BOOST_LOG(warning) << buffer; + } + else if (level <= AV_LOG_INFO) { + BOOST_LOG(info) << buffer; + } + else if (level <= AV_LOG_VERBOSE) { + // AV_LOG_VERBOSE is less verbose than AV_LOG_DEBUG + BOOST_LOG(debug) << buffer; + } + else { + BOOST_LOG(verbose) << buffer; + } + }); sink = boost::make_shared(); From e71790a7bbc4d33e0ade6e890215ba8287634cc4 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:19:44 -0400 Subject: [PATCH 094/576] ci(docker): fix arch linux cache issue (#1570) --- docker/archlinux.dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/archlinux.dockerfile b/docker/archlinux.dockerfile index c5deb36c30f..ce087274caf 100644 --- a/docker/archlinux.dockerfile +++ b/docker/archlinux.dockerfile @@ -11,7 +11,7 @@ FROM ${BASE}:${TAG} AS sunshine-base RUN <<_DEPS #!/bin/bash set -e -pacman -Syu --disable-download-timeout --needed --noconfirm \ +pacman -Syu --disable-download-timeout --needed --noconfirm \ archlinux-keyring _DEPS @@ -102,6 +102,9 @@ COPY --link --from=artifacts /sunshine.pkg.tar.zst / RUN <<_INSTALL_SUNSHINE #!/bin/bash set -e +# update keyring to prevent cached keyring errors +pacman -Syu --disable-download-timeout --needed --noconfirm \ + archlinux-keyring pacman -U --disable-download-timeout --needed --noconfirm \ /sunshine.pkg.tar.zst _INSTALL_SUNSHINE From deddcb4320f8b4cc926b720c820e7c38bc71567a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 24 Aug 2023 21:14:24 -0500 Subject: [PATCH 095/576] Allow the display to reject unsupported codecs --- src/platform/common.h | 11 ++ src/platform/windows/display.h | 3 + src/platform/windows/display_vram.cpp | 141 ++++++++++++++++---------- src/video.cpp | 13 ++- 4 files changed, 113 insertions(+), 55 deletions(-) diff --git a/src/platform/common.h b/src/platform/common.h index a9f432ea658..c80cdcedcc4 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -480,6 +480,17 @@ namespace platf { return false; } + /** + * @brief Checks that a given codec is supported by the display device. + * @param name The FFmpeg codec name (or similar for non-FFmpeg codecs). + * @param config The codec configuration. + * @return true if supported, false otherwise. + */ + virtual bool + is_codec_supported(std::string_view name, const ::video::config_t &config) { + return true; + } + virtual ~display_t() = default; // Offsets for when streaming a specific monitor. By default, they are 0. diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index 33cedaf854c..316a36f72ec 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -219,6 +219,9 @@ namespace platf::dxgi { int init(const ::video::config_t &config, const std::string &display_name); + bool + is_codec_supported(std::string_view name, const ::video::config_t &config) override; + std::unique_ptr make_avcodec_encode_device(pix_fmt_e pix_fmt) override; diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index f523738925e..890c4bb6dd7 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -25,6 +25,8 @@ extern "C" { #include +#include + #define SUNSHINE_SHADERS_DIR SUNSHINE_ASSETS_DIR "/shaders/directx" namespace platf { using namespace std::literals; @@ -1326,60 +1328,6 @@ namespace platf::dxgi { return -1; } - DXGI_ADAPTER_DESC adapter_desc; - adapter->GetDesc(&adapter_desc); - - // Perform AMF version checks if we're using an AMD GPU. This check is placed in display_vram_t - // to avoid hitting the display_ram_t path which uses software encoding and doesn't touch AMF. - if ((config.dynamicRange || config.videoFormat == 2) && adapter_desc.VendorId == 0x1002) { - HMODULE amfrt = LoadLibraryW(AMF_DLL_NAME); - if (amfrt) { - auto unload_amfrt = util::fail_guard([amfrt]() { - FreeLibrary(amfrt); - }); - - auto fnAMFQueryVersion = (AMFQueryVersion_Fn) GetProcAddress(amfrt, AMF_QUERY_VERSION_FUNCTION_NAME); - if (fnAMFQueryVersion) { - amf_uint64 version; - auto result = fnAMFQueryVersion(&version); - if (result == AMF_OK) { - if (config.videoFormat == 2 && version < AMF_MAKE_FULL_VERSION(1, 4, 30, 0)) { - // AMF 1.4.30 adds ultra low latency mode for AV1. Don't use AV1 on earlier versions. - // This corresponds to driver version 23.5.2 (23.10.01.45) or newer. - BOOST_LOG(warning) << "AV1 encoding is disabled on AMF version "sv - << AMF_GET_MAJOR_VERSION(version) << '.' - << AMF_GET_MINOR_VERSION(version) << '.' - << AMF_GET_SUBMINOR_VERSION(version) << '.' - << AMF_GET_BUILD_VERSION(version); - BOOST_LOG(warning) << "If your AMD GPU supports AV1 encoding, update your graphics drivers!"sv; - return -1; - } - else if (config.dynamicRange && version < AMF_MAKE_FULL_VERSION(1, 4, 23, 0)) { - // Older versions of the AMD AMF runtime can crash when fed P010 surfaces. - // Fail if AMF version is below 1.4.23 where HEVC Main10 encoding was introduced. - // AMF 1.4.23 corresponds to driver version 21.12.1 (21.40.11.03) or newer. - BOOST_LOG(warning) << "HDR encoding is disabled on AMF version "sv - << AMF_GET_MAJOR_VERSION(version) << '.' - << AMF_GET_MINOR_VERSION(version) << '.' - << AMF_GET_SUBMINOR_VERSION(version) << '.' - << AMF_GET_BUILD_VERSION(version); - BOOST_LOG(warning) << "If your AMD GPU supports HEVC Main10 encoding, update your graphics drivers!"sv; - return -1; - } - } - else { - BOOST_LOG(warning) << "AMFQueryVersion() failed: "sv << result; - } - } - else { - BOOST_LOG(warning) << "AMF DLL missing export: "sv << AMF_QUERY_VERSION_FUNCTION_NAME; - } - } - else { - BOOST_LOG(warning) << "Detected AMD GPU but AMF failed to load"sv; - } - } - D3D11_SAMPLER_DESC sampler_desc {}; sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; @@ -1581,6 +1529,91 @@ namespace platf::dxgi { }; } + /** + * @brief Checks that a given codec is supported by the display device. + * @param name The FFmpeg codec name (or similar for non-FFmpeg codecs). + * @param config The codec configuration. + * @return true if supported, false otherwise. + */ + bool + display_vram_t::is_codec_supported(std::string_view name, const ::video::config_t &config) { + DXGI_ADAPTER_DESC adapter_desc; + adapter->GetDesc(&adapter_desc); + + if (adapter_desc.VendorId == 0x1002) { // AMD + // If it's not an AMF encoder, it's not compatible with an AMD GPU + if (!boost::algorithm::ends_with(name, "_amf")) { + return false; + } + + // Perform AMF version checks if we're using an AMD GPU. This check is placed in display_vram_t + // to avoid hitting the display_ram_t path which uses software encoding and doesn't touch AMF. + HMODULE amfrt = LoadLibraryW(AMF_DLL_NAME); + if (amfrt) { + auto unload_amfrt = util::fail_guard([amfrt]() { + FreeLibrary(amfrt); + }); + + auto fnAMFQueryVersion = (AMFQueryVersion_Fn) GetProcAddress(amfrt, AMF_QUERY_VERSION_FUNCTION_NAME); + if (fnAMFQueryVersion) { + amf_uint64 version; + auto result = fnAMFQueryVersion(&version); + if (result == AMF_OK) { + if (config.videoFormat == 2 && version < AMF_MAKE_FULL_VERSION(1, 4, 30, 0)) { + // AMF 1.4.30 adds ultra low latency mode for AV1. Don't use AV1 on earlier versions. + // This corresponds to driver version 23.5.2 (23.10.01.45) or newer. + BOOST_LOG(warning) << "AV1 encoding is disabled on AMF version "sv + << AMF_GET_MAJOR_VERSION(version) << '.' + << AMF_GET_MINOR_VERSION(version) << '.' + << AMF_GET_SUBMINOR_VERSION(version) << '.' + << AMF_GET_BUILD_VERSION(version); + BOOST_LOG(warning) << "If your AMD GPU supports AV1 encoding, update your graphics drivers!"sv; + return false; + } + else if (config.dynamicRange && version < AMF_MAKE_FULL_VERSION(1, 4, 23, 0)) { + // Older versions of the AMD AMF runtime can crash when fed P010 surfaces. + // Fail if AMF version is below 1.4.23 where HEVC Main10 encoding was introduced. + // AMF 1.4.23 corresponds to driver version 21.12.1 (21.40.11.03) or newer. + BOOST_LOG(warning) << "HDR encoding is disabled on AMF version "sv + << AMF_GET_MAJOR_VERSION(version) << '.' + << AMF_GET_MINOR_VERSION(version) << '.' + << AMF_GET_SUBMINOR_VERSION(version) << '.' + << AMF_GET_BUILD_VERSION(version); + BOOST_LOG(warning) << "If your AMD GPU supports HEVC Main10 encoding, update your graphics drivers!"sv; + return false; + } + } + else { + BOOST_LOG(warning) << "AMFQueryVersion() failed: "sv << result; + } + } + else { + BOOST_LOG(warning) << "AMF DLL missing export: "sv << AMF_QUERY_VERSION_FUNCTION_NAME; + } + } + else { + BOOST_LOG(warning) << "Detected AMD GPU but AMF failed to load"sv; + } + } + else if (adapter_desc.VendorId == 0x8086) { // Intel + // If it's not a QSV encoder, it's not compatible with an Intel GPU + if (!boost::algorithm::ends_with(name, "_qsv")) { + return false; + } + } + else if (adapter_desc.VendorId == 0x10de) { // Nvidia + // If it's not an NVENC encoder, it's not compatible with an Nvidia GPU + if (!boost::algorithm::ends_with(name, "_nvenc")) { + return false; + } + } + else { + BOOST_LOG(warning) << "Unknown GPU vendor ID: " << util::hex(adapter_desc.VendorId).to_string_view(); + } + + return true; + } + std::unique_ptr display_vram_t::make_avcodec_encode_device(pix_fmt_e pix_fmt) { if (pix_fmt != platf::pix_fmt_e::nv12 && pix_fmt != platf::pix_fmt_e::p010) { diff --git a/src/video.cpp b/src/video.cpp index 8dd9c7ea2c0..a4a3aed64fb 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1377,7 +1377,7 @@ namespace video { auto &video_format = config.videoFormat == 0 ? encoder.h264 : config.videoFormat == 1 ? encoder.hevc : encoder.av1; - if (!video_format[encoder_t::PASSED]) { + if (!video_format[encoder_t::PASSED] || !disp->is_codec_supported(video_format.name, config)) { BOOST_LOG(error) << encoder.name << ": "sv << video_format.name << " mode not supported"sv; return nullptr; } @@ -2255,6 +2255,17 @@ namespace video { config_t config_max_ref_frames { 1920, 1080, 60, 1000, 1, 1, 1, 0, 0 }; config_t config_autoselect { 1920, 1080, 60, 1000, 1, 0, 1, 0, 0 }; + // If the encoder isn't supported at all (not even H.264), bail early + reset_display(disp, encoder.platform_formats->dev_type, config::video.output_name, config_autoselect); + if (!disp) { + return false; + } + if (!disp->is_codec_supported(encoder.h264.name, config_autoselect)) { + fg.disable(); + BOOST_LOG(info) << "Encoder ["sv << encoder.name << "] is not supported on this GPU"sv; + return false; + } + retry: // If we're expecting failure, use the autoselect ref config first since that will always succeed // if the encoder is available. From 7af2d9788be5a7ab1242edf004ab1a31f1e07084 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 24 Aug 2023 21:31:53 -0500 Subject: [PATCH 096/576] Treat codec modes as soft requirements --- src/video.cpp | 91 +++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index a4a3aed64fb..b2c22242923 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -2241,11 +2241,8 @@ namespace video { BOOST_LOG(info) << "Encoder ["sv << encoder.name << "] failed"sv; }); - auto force_hevc = active_hevc_mode >= 2; - auto test_hevc = force_hevc || (active_hevc_mode == 0 && !(encoder.flags & H264_ONLY)); - - auto force_av1 = active_av1_mode >= 2; - auto test_av1 = force_av1 || (active_av1_mode == 0 && !(encoder.flags & H264_ONLY)); + auto test_hevc = active_hevc_mode >= 2 || (active_hevc_mode == 0 && !(encoder.flags & H264_ONLY)); + auto test_av1 = active_av1_mode >= 2 || (active_av1_mode == 0 && !(encoder.flags & H264_ONLY)); encoder.h264.capabilities.set(); encoder.hevc.capabilities.set(); @@ -2303,18 +2300,11 @@ namespace video { retry_hevc: auto max_ref_frames_hevc = validate_config(disp, encoder, config_max_ref_frames); auto autoselect_hevc = max_ref_frames_hevc >= 0 ? max_ref_frames_hevc : validate_config(disp, encoder, config_autoselect); - if (autoselect_hevc < 0) { - if (encoder.hevc.qp && encoder.hevc[encoder_t::CBR]) { - // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt - encoder.hevc.capabilities.set(); - encoder.hevc[encoder_t::CBR] = false; - goto retry_hevc; - } - - // If HEVC must be supported, but it is not supported - if (force_hevc) { - return false; - } + if (autoselect_hevc < 0 && encoder.hevc.qp && encoder.hevc[encoder_t::CBR]) { + // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt + encoder.hevc.capabilities.set(); + encoder.hevc[encoder_t::CBR] = false; + goto retry_hevc; } for (auto [validate_flag, encoder_flag] : packet_deficiencies) { @@ -2336,18 +2326,11 @@ namespace video { retry_av1: auto max_ref_frames_av1 = validate_config(disp, encoder, config_max_ref_frames); auto autoselect_av1 = max_ref_frames_av1 >= 0 ? max_ref_frames_av1 : validate_config(disp, encoder, config_autoselect); - if (autoselect_av1 < 0) { - if (encoder.av1.qp && encoder.av1[encoder_t::CBR]) { - // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt - encoder.av1.capabilities.set(); - encoder.av1[encoder_t::CBR] = false; - goto retry_av1; - } - - // If AV1 must be supported, but it is not supported - if (force_av1) { - return false; - } + if (autoselect_av1 < 0 && encoder.av1.qp && encoder.av1[encoder_t::CBR]) { + // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt + encoder.av1.capabilities.set(); + encoder.av1[encoder_t::CBR] = false; + goto retry_av1; } for (auto [validate_flag, encoder_flag] : packet_deficiencies) { @@ -2419,6 +2402,27 @@ namespace video { active_av1_mode = config::video.av1_mode; last_encoder_probe_supported_ref_frames_invalidation = false; + auto adjust_encoder_constraints = [&](encoder_t *encoder) { + // If we can't satisfy both the encoder and codec requirement, prefer the encoder over codec support + if (active_hevc_mode == 3 && !encoder->hevc[encoder_t::DYNAMIC_RANGE]) { + BOOST_LOG(warning) << "Encoder ["sv << encoder->name << "] does not support HEVC Main10 on this system"sv; + active_hevc_mode = 0; + } + else if (active_hevc_mode == 2 && !encoder->hevc[encoder_t::PASSED]) { + BOOST_LOG(warning) << "Encoder ["sv << encoder->name << "] does not support HEVC on this system"sv; + active_hevc_mode = 0; + } + + if (active_av1_mode == 3 && !encoder->av1[encoder_t::DYNAMIC_RANGE]) { + BOOST_LOG(warning) << "Encoder ["sv << encoder->name << "] does not support AV1 Main10 on this system"sv; + active_av1_mode = 0; + } + else if (active_av1_mode == 2 && !encoder->av1[encoder_t::PASSED]) { + BOOST_LOG(warning) << "Encoder ["sv << encoder->name << "] does not support AV1 on this system"sv; + active_av1_mode = 0; + } + }; + if (!config::video.encoder.empty()) { // If there is a specific encoder specified, use it if it passes validation KITTY_WHILE_LOOP(auto pos = std::begin(encoder_list), pos != std::end(encoder_list), { @@ -2431,15 +2435,8 @@ namespace video { break; } - // If we can't satisfy both the encoder and HDR requirement, prefer the encoder over HDR support - if (active_hevc_mode == 3 && !encoder->hevc[encoder_t::DYNAMIC_RANGE]) { - BOOST_LOG(warning) << "Encoder ["sv << config::video.encoder << "] does not support HEVC Main10 on this system"sv; - active_hevc_mode = 0; - } - if (active_av1_mode == 3 && !encoder->av1[encoder_t::DYNAMIC_RANGE]) { - BOOST_LOG(warning) << "Encoder ["sv << config::video.encoder << "] does not support AV1 Main10 on this system"sv; - active_av1_mode = 0; - } + // We will return an encoder here even if it fails one of the codec requirements specified by the user + adjust_encoder_constraints(encoder); chosen_encoder = encoder; break; @@ -2455,8 +2452,8 @@ namespace video { BOOST_LOG(info) << "// Testing for available encoders, this may generate errors. You can safely ignore those errors. //"sv; - // If we haven't found an encoder yet, but we want one with HDR support, search for that now. - if (chosen_encoder == nullptr && (active_hevc_mode == 3 || active_av1_mode == 3)) { + // If we haven't found an encoder yet, but we want one with specific codec support, search for that now. + if (chosen_encoder == nullptr && (active_hevc_mode >= 2 || active_av1_mode >= 2)) { KITTY_WHILE_LOOP(auto pos = std::begin(encoder_list), pos != std::end(encoder_list), { auto encoder = *pos; @@ -2466,7 +2463,14 @@ namespace video { continue; } - // Skip it if it doesn't support HDR + // Skip it if it doesn't support the specified codec at all + if ((active_hevc_mode >= 2 && !encoder->hevc[encoder_t::PASSED]) || + (active_av1_mode >= 2 && !encoder->av1[encoder_t::PASSED])) { + pos++; + continue; + } + + // Skip it if it doesn't support HDR on the specified codec if ((active_hevc_mode == 3 && !encoder->hevc[encoder_t::DYNAMIC_RANGE]) || (active_av1_mode == 3 && !encoder->av1[encoder_t::DYNAMIC_RANGE])) { pos++; @@ -2478,7 +2482,7 @@ namespace video { }); if (chosen_encoder == nullptr) { - BOOST_LOG(error) << "Couldn't find any working HDR-capable encoder"sv; + BOOST_LOG(error) << "Couldn't find any working encoder that meets HEVC/AV1 requirements"sv; } } @@ -2496,6 +2500,9 @@ namespace video { continue; } + // We will return an encoder here even if it fails one of the codec requirements specified by the user + adjust_encoder_constraints(encoder); + chosen_encoder = encoder; break; }); From 4dd255c5f4933dd67de3837da3e9832242296370 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 24 Aug 2023 22:58:29 -0500 Subject: [PATCH 097/576] Allow displays to avoid probing HEVC or AV1 codecs even when H.264 is supported This is the case for AMF which requires certain versions for HEVC Main10 and AV1 support. --- src/video.cpp | 68 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index b2c22242923..6c9957d1f0b 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -2297,22 +2297,28 @@ namespace video { config_max_ref_frames.videoFormat = 1; config_autoselect.videoFormat = 1; - retry_hevc: - auto max_ref_frames_hevc = validate_config(disp, encoder, config_max_ref_frames); - auto autoselect_hevc = max_ref_frames_hevc >= 0 ? max_ref_frames_hevc : validate_config(disp, encoder, config_autoselect); - if (autoselect_hevc < 0 && encoder.hevc.qp && encoder.hevc[encoder_t::CBR]) { - // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt - encoder.hevc.capabilities.set(); - encoder.hevc[encoder_t::CBR] = false; - goto retry_hevc; - } + if (disp->is_codec_supported(encoder.hevc.name, config_autoselect)) { + retry_hevc: + auto max_ref_frames_hevc = validate_config(disp, encoder, config_max_ref_frames); + auto autoselect_hevc = max_ref_frames_hevc >= 0 ? max_ref_frames_hevc : validate_config(disp, encoder, config_autoselect); + if (autoselect_hevc < 0 && encoder.hevc.qp && encoder.hevc[encoder_t::CBR]) { + // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt + encoder.hevc.capabilities.set(); + encoder.hevc[encoder_t::CBR] = false; + goto retry_hevc; + } - for (auto [validate_flag, encoder_flag] : packet_deficiencies) { - encoder.hevc[encoder_flag] = (max_ref_frames_hevc & validate_flag && autoselect_hevc & validate_flag); - } + for (auto [validate_flag, encoder_flag] : packet_deficiencies) { + encoder.hevc[encoder_flag] = (max_ref_frames_hevc & validate_flag && autoselect_hevc & validate_flag); + } - encoder.hevc[encoder_t::REF_FRAMES_RESTRICT] = max_ref_frames_hevc >= 0; - encoder.hevc[encoder_t::PASSED] = max_ref_frames_hevc >= 0 || autoselect_hevc >= 0; + encoder.hevc[encoder_t::REF_FRAMES_RESTRICT] = max_ref_frames_hevc >= 0; + encoder.hevc[encoder_t::PASSED] = max_ref_frames_hevc >= 0 || autoselect_hevc >= 0; + } + else { + BOOST_LOG(info) << "Encoder ["sv << encoder.hevc.name << "] is not supported on this GPU"sv; + encoder.hevc.capabilities.reset(); + } } else { // Clear all cap bits for HEVC if we didn't probe it @@ -2323,22 +2329,28 @@ namespace video { config_max_ref_frames.videoFormat = 2; config_autoselect.videoFormat = 2; - retry_av1: - auto max_ref_frames_av1 = validate_config(disp, encoder, config_max_ref_frames); - auto autoselect_av1 = max_ref_frames_av1 >= 0 ? max_ref_frames_av1 : validate_config(disp, encoder, config_autoselect); - if (autoselect_av1 < 0 && encoder.av1.qp && encoder.av1[encoder_t::CBR]) { - // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt - encoder.av1.capabilities.set(); - encoder.av1[encoder_t::CBR] = false; - goto retry_av1; - } + if (disp->is_codec_supported(encoder.av1.name, config_autoselect)) { + retry_av1: + auto max_ref_frames_av1 = validate_config(disp, encoder, config_max_ref_frames); + auto autoselect_av1 = max_ref_frames_av1 >= 0 ? max_ref_frames_av1 : validate_config(disp, encoder, config_autoselect); + if (autoselect_av1 < 0 && encoder.av1.qp && encoder.av1[encoder_t::CBR]) { + // It's possible the encoder isn't accepting Constant Bit Rate. Turn off CBR and make another attempt + encoder.av1.capabilities.set(); + encoder.av1[encoder_t::CBR] = false; + goto retry_av1; + } - for (auto [validate_flag, encoder_flag] : packet_deficiencies) { - encoder.av1[encoder_flag] = (max_ref_frames_av1 & validate_flag && autoselect_av1 & validate_flag); - } + for (auto [validate_flag, encoder_flag] : packet_deficiencies) { + encoder.av1[encoder_flag] = (max_ref_frames_av1 & validate_flag && autoselect_av1 & validate_flag); + } - encoder.av1[encoder_t::REF_FRAMES_RESTRICT] = max_ref_frames_av1 >= 0; - encoder.av1[encoder_t::PASSED] = max_ref_frames_av1 >= 0 || autoselect_av1 >= 0; + encoder.av1[encoder_t::REF_FRAMES_RESTRICT] = max_ref_frames_av1 >= 0; + encoder.av1[encoder_t::PASSED] = max_ref_frames_av1 >= 0 || autoselect_av1 >= 0; + } + else { + BOOST_LOG(info) << "Encoder ["sv << encoder.av1.name << "] is not supported on this GPU"sv; + encoder.av1.capabilities.reset(); + } } else { // Clear all cap bits for AV1 if we didn't probe it From 4a866d1ceb9a2577642f67e4b214d7ac7d83d5a2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 24 Aug 2023 23:06:59 -0500 Subject: [PATCH 098/576] Tweak wording for codec mode options to avoid users changing it --- docs/source/about/advanced_usage.rst | 4 ++-- src_assets/common/assets/web/config.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index 1d9b4c57ee2..d7f546e8603 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -796,7 +796,7 @@ hevc_mode ===== =========== Value Description ===== =========== - 0 advertise support for HEVC based on encoder + 0 advertise support for HEVC based on encoder capabilities (recommended) 1 do not advertise support for HEVC 2 advertise support for HEVC Main profile 3 advertise support for HEVC Main and Main10 (HDR) profiles @@ -827,7 +827,7 @@ av1_mode ===== =========== Value Description ===== =========== - 0 advertise support for AV1 based on encoder + 0 advertise support for AV1 based on encoder capabilities (recommended) 1 do not advertise support for AV1 2 advertise support for AV1 Main 8-bit profile 3 advertise support for AV1 Main 8-bit and 10-bit (HDR) profiles diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 9b32f01eaff..d1c9482fe29 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -674,7 +674,7 @@

Configuration

-
+
Configuration Disable if you encounter any VSync-related issues.
-
+
Date: Fri, 12 May 2023 16:46:05 +0300 Subject: [PATCH 101/576] Remove DwmFlush() --- docs/source/about/advanced_usage.rst | 21 --------------------- src/config.cpp | 2 -- src/config.h | 1 - src/platform/windows/display.h | 1 - src/platform/windows/display_base.cpp | 19 ------------------- src_assets/common/assets/web/config.html | 12 ------------ 6 files changed, 56 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index d7f546e8603..b8d15289c73 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -413,27 +413,6 @@ resolutions 3840x1600, ] -dwmflush -^^^^^^^^ - -**Description** - Invoke DwmFlush() to sync screen capture to the Windows presentation interval. - - .. Caution:: Applies to Windows only. Alleviates visual stuttering during mouse movement. - If enabled, this feature will automatically deactivate if the client framerate exceeds - the host monitor's current refresh rate. - - .. Note:: If you disable this option, you may see video stuttering during mouse movement in certain scenarios. - It is recommended to leave enabled when possible. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - dwmflush = enabled - Audio ----- diff --git a/src/config.cpp b/src/config.cpp index 8d02933e2a8..f15eacb4773 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -438,7 +438,6 @@ namespace config { {}, // encoder {}, // adapter_name {}, // output_name - true // dwmflush }; audio_t audio { @@ -1034,7 +1033,6 @@ namespace config { string_f(vars, "encoder", video.encoder); string_f(vars, "adapter_name", video.adapter_name); string_f(vars, "output_name", video.output_name); - bool_f(vars, "dwmflush", video.dwmflush); path_f(vars, "pkey", nvhttp.pkey); path_f(vars, "cert", nvhttp.cert); diff --git a/src/config.h b/src/config.h index a4bac3b684e..b23b59cc2a3 100644 --- a/src/config.h +++ b/src/config.h @@ -64,7 +64,6 @@ namespace config { std::string encoder; std::string adapter_name; std::string output_name; - bool dwmflush; }; struct audio_t { diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index 316a36f72ec..b50acc7725d 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -109,7 +109,6 @@ namespace platf::dxgi { public: dup_t dup; bool has_frame {}; - bool use_dwmflush {}; std::chrono::steady_clock::time_point last_protected_content_warning_time {}; capture_e diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 4fdf61b2d99..2324a8c305d 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -32,10 +32,6 @@ namespace platf::dxgi { return capture_status; } - if (use_dwmflush) { - DwmFlush(); - } - auto status = dup->AcquireNextFrame(timeout.count(), &frame_info, res_p); switch (status) { @@ -470,21 +466,6 @@ namespace platf::dxgi { << "Offset : "sv << offset_x << 'x' << offset_y << std::endl << "Virtual Desktop : "sv << env_width << 'x' << env_height; - // Enable DwmFlush() only if the current refresh rate can match the client framerate. - auto refresh_rate = config.framerate; - DWM_TIMING_INFO timing_info; - timing_info.cbSize = sizeof(timing_info); - - status = DwmGetCompositionTimingInfo(NULL, &timing_info); - if (FAILED(status)) { - BOOST_LOG(warning) << "Failed to detect active refresh rate."; - } - else { - refresh_rate = std::round((double) timing_info.rateRefresh.uiNumerator / (double) timing_info.rateRefresh.uiDenominator); - } - - dup.use_dwmflush = config::video.dwmflush && !(config.framerate > refresh_rate) ? true : false; - // Bump up thread priority { const DWORD flags = TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY; diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 02ee743403c..e0bb751d89e 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -582,18 +582,6 @@

Configuration

tools\dxgi-info.exe
- -
- - -
- Improves capture latency/smoothness during mouse movement.
- Disable if you encounter any VSync-related issues. -
-
Date: Fri, 12 May 2023 16:57:09 +0300 Subject: [PATCH 102/576] Add high_precision_sleep() method --- src/platform/windows/display.h | 5 +++ src/platform/windows/display_base.cpp | 57 +++++++++++++++++---------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index b50acc7725d..238a87c27ac 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -126,6 +126,9 @@ namespace platf::dxgi { int init(const ::video::config_t &config, const std::string &display_name); + void + high_precision_sleep(std::chrono::nanoseconds duration); + capture_e capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) override; @@ -141,6 +144,8 @@ namespace platf::dxgi { DXGI_FORMAT capture_format; D3D_FEATURE_LEVEL feature_level; + util::safe_ptr_v2, BOOL, CloseHandle> timer; + typedef enum _D3DKMT_SCHEDULINGPRIORITYCLASS { D3DKMT_SCHEDULINGPRIORITYCLASS_IDLE, D3DKMT_SCHEDULINGPRIORITYCLASS_BELOW_NORMAL, diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 2324a8c305d..c016514a144 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -95,24 +95,30 @@ namespace platf::dxgi { release_frame(); } - capture_e - display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { - auto next_frame = std::chrono::steady_clock::now(); - - // Use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION if supported (Windows 10 1809+) - HANDLE timer = CreateWaitableTimerEx(nullptr, nullptr, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS); + void + display_base_t::high_precision_sleep(std::chrono::nanoseconds duration) { if (!timer) { - timer = CreateWaitableTimerEx(nullptr, nullptr, 0, TIMER_ALL_ACCESS); - if (!timer) { - auto winerr = GetLastError(); - BOOST_LOG(error) << "Failed to create timer: "sv << winerr; - return capture_e::error; - } + BOOST_LOG(error) << "Attempting high_precision_sleep() with uninitialized timer"; + return; + } + if (duration < 0s) { + BOOST_LOG(error) << "Attempting high_precision_sleep() with negative duration"; + return; + } + if (duration > 5s) { + BOOST_LOG(error) << "Attempting high_precision_sleep() with unexpectedly large duration (>5s)"; + return; } - auto close_timer = util::fail_guard([timer]() { - CloseHandle(timer); - }); + LARGE_INTEGER due_time; + due_time.QuadPart = duration.count() / -100; + SetWaitableTimer(timer.get(), &due_time, 0, nullptr, nullptr, false); + WaitForSingleObject(timer.get(), INFINITE); + } + + capture_e + display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { + auto next_frame = std::chrono::steady_clock::now(); // Keep the display awake during capture. If the display goes to sleep during // capture, best case is that capture stops until it powers back on. However, @@ -131,13 +137,11 @@ namespace platf::dxgi { return platf::capture_e::reinit; } - // If the wait time is between 1 us and 1 second, wait the specified time + // If the wait time is positive and below 1 second, wait the specified time // and offset the next frame time from the exact current frame time target. - auto wait_time_us = std::chrono::duration_cast(next_frame - std::chrono::steady_clock::now()).count(); - if (wait_time_us > 0 && wait_time_us < 1000000) { - LARGE_INTEGER due_time { .QuadPart = -10LL * wait_time_us }; - SetWaitableTimer(timer, &due_time, 0, nullptr, nullptr, false); - WaitForSingleObject(timer, INFINITE); + auto wait_time = next_frame - std::chrono::steady_clock::now(); + if (wait_time > 0s && wait_time < 1s) { + high_precision_sleep(wait_time); next_frame += delay; } else { @@ -613,6 +617,17 @@ namespace platf::dxgi { // Capture format will be determined from the first call to AcquireNextFrame() capture_format = DXGI_FORMAT_UNKNOWN; + // Use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION if supported (Windows 10 1809+) + timer.reset(CreateWaitableTimerEx(nullptr, nullptr, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS)); + if (!timer) { + timer.reset(CreateWaitableTimerEx(nullptr, nullptr, 0, TIMER_ALL_ACCESS)); + if (!timer) { + auto winerr = GetLastError(); + BOOST_LOG(error) << "Failed to create timer: "sv << winerr; + return -1; + } + } + return 0; } From 78f8083f58b52ffb0333b3ea0df6e9a6d97391b9 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Sat, 26 Aug 2023 12:38:47 +0300 Subject: [PATCH 103/576] Don't check AccumulatedFrames AMF doesn't do it and MSDN is unclear about it. --- src/platform/windows/display_vram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 890c4bb6dd7..be009a3e14c 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -957,7 +957,7 @@ namespace platf::dxgi { } const bool mouse_update_flag = frame_info.LastMouseUpdateTime.QuadPart != 0 || frame_info.PointerShapeBufferSize > 0; - const bool frame_update_flag = frame_info.AccumulatedFrames != 0 || frame_info.LastPresentTime.QuadPart != 0; + const bool frame_update_flag = frame_info.LastPresentTime.QuadPart != 0; const bool update_flag = mouse_update_flag || frame_update_flag; if (!update_flag) { From f8667dee12375942b63a76e7fc75aabcfa18a413 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Fri, 12 May 2023 17:07:22 +0300 Subject: [PATCH 104/576] Move client frame interval to local variable --- src/platform/windows/display.h | 6 ++++-- src/platform/windows/display_base.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index 238a87c27ac..5c77aa0d834 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -132,14 +132,16 @@ namespace platf::dxgi { capture_e capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) override; - std::chrono::nanoseconds delay; - factory1_t factory; adapter_t adapter; output_t output; device_t device; device_ctx_t device_ctx; duplication_t dup; + DXGI_RATIONAL display_refresh_rate; + int display_refresh_rate_rounded; + + int client_frame_rate; DXGI_FORMAT capture_format; D3D_FEATURE_LEVEL feature_level; diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index c016514a144..4382ef0aff0 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -119,6 +119,7 @@ namespace platf::dxgi { capture_e display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { auto next_frame = std::chrono::steady_clock::now(); + const auto client_frame_interval = std::chrono::nanoseconds { 1s } / client_frame_rate; // Keep the display awake during capture. If the display goes to sleep during // capture, best case is that capture stops until it powers back on. However, @@ -142,14 +143,14 @@ namespace platf::dxgi { auto wait_time = next_frame - std::chrono::steady_clock::now(); if (wait_time > 0s && wait_time < 1s) { high_precision_sleep(wait_time); - next_frame += delay; + next_frame += client_frame_interval; } else { // If the wait time is negative (meaning the frame is past due) or the // computed wait time is beyond a second (meaning possible clock issues), // just capture the frame now and resynchronize the frame interval with // the current time. - next_frame = std::chrono::steady_clock::now() + delay; + next_frame = std::chrono::steady_clock::now() + client_frame_interval; } std::shared_ptr img_out; @@ -334,8 +335,6 @@ namespace platf::dxgi { // Ensure we can duplicate the current display syncThreadDesktop(); - delay = std::chrono::nanoseconds { 1s } / config.framerate; - // Get rectangle of full desktop for absolute mouse coordinates env_width = GetSystemMetrics(SM_CXVIRTUALSCREEN); env_height = GetSystemMetrics(SM_CYVIRTUALSCREEN); @@ -595,6 +594,13 @@ namespace platf::dxgi { BOOST_LOG(info) << "Desktop resolution ["sv << dup_desc.ModeDesc.Width << 'x' << dup_desc.ModeDesc.Height << ']'; BOOST_LOG(info) << "Desktop format ["sv << dxgi_format_to_string(dup_desc.ModeDesc.Format) << ']'; + display_refresh_rate = dup_desc.ModeDesc.RefreshRate; + display_refresh_rate_rounded = lround((double) display_refresh_rate.Numerator / display_refresh_rate.Denominator); + BOOST_LOG(info) << "Display refresh rate [" << display_refresh_rate_rounded << "Hz]"; + + client_frame_rate = config.framerate; + BOOST_LOG(info) << "Requested frame rate [" << client_frame_rate << "fps]"; + dxgi::output6_t output6 {}; status = output->QueryInterface(IID_IDXGIOutput6, (void **) &output6); if (SUCCEEDED(status)) { From 33b668eceb5fb48db5366c71765a32bcdd700d38 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Fri, 12 May 2023 17:34:50 +0300 Subject: [PATCH 105/576] Release duplication frame after snapshot --- src/platform/windows/display_base.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 4382ef0aff0..c5809a48391 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -74,19 +74,20 @@ namespace platf::dxgi { } auto status = dup->ReleaseFrame(); + has_frame = false; switch (status) { case S_OK: - has_frame = false; return capture_e::ok; - case DXGI_ERROR_WAIT_TIMEOUT: - return capture_e::timeout; - case WAIT_ABANDONED: + + case DXGI_ERROR_INVALID_CALL: + BOOST_LOG(warning) << "Duplication frame already released"; + return capture_e::ok; + case DXGI_ERROR_ACCESS_LOST: - case DXGI_ERROR_ACCESS_DENIED: - has_frame = false; return capture_e::reinit; + default: - BOOST_LOG(error) << "Couldn't release frame [0x"sv << util::hex(status).to_string_view(); + BOOST_LOG(error) << "Error while releasing duplication frame [0x"sv << util::hex(status).to_string_view(); return capture_e::error; } } @@ -174,6 +175,11 @@ namespace platf::dxgi { BOOST_LOG(error) << "Unrecognized capture status ["sv << (int) status << ']'; return status; } + + status = dup.release_frame(); + if (status != platf::capture_e::ok) { + return status; + } } return capture_e::ok; From 62ae2c4c4b45e2c41c75838ec999000c4df03cb9 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Fri, 12 May 2023 17:39:58 +0300 Subject: [PATCH 106/576] Rework capture sleeps for better frame stability --- src/platform/windows/display_base.cpp | 68 +++++++++++++++++++++------ src/stat_trackers.h | 2 +- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index c5809a48391..c9a0b9f31ef 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -17,6 +17,7 @@ typedef long NTSTATUS; #include "src/config.h" #include "src/main.h" #include "src/platform/common.h" +#include "src/stat_trackers.h" #include "src/video.h" namespace platf { @@ -119,8 +120,8 @@ namespace platf::dxgi { capture_e display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { - auto next_frame = std::chrono::steady_clock::now(); const auto client_frame_interval = std::chrono::nanoseconds { 1s } / client_frame_rate; + std::optional next_frame_time; // Keep the display awake during capture. If the display goes to sleep during // capture, best case is that capture stops until it powers back on. However, @@ -131,6 +132,8 @@ namespace platf::dxgi { SetThreadExecutionState(ES_CONTINUOUS); }); + stat_trackers::min_max_avg_tracker sleep_overshoot_tracker; + while (true) { // This will return false if the HDR state changes or for any number of other // display or GPU changes. We should reinit to examine the updated state of @@ -139,23 +142,58 @@ namespace platf::dxgi { return platf::capture_e::reinit; } - // If the wait time is positive and below 1 second, wait the specified time - // and offset the next frame time from the exact current frame time target. - auto wait_time = next_frame - std::chrono::steady_clock::now(); - if (wait_time > 0s && wait_time < 1s) { - high_precision_sleep(wait_time); - next_frame += client_frame_interval; + platf::capture_e status = capture_e::ok; + std::shared_ptr img_out; + + // Try to continue frame pacing group, snapshot() is called with zero timeout after waiting for client frame interval + if (next_frame_time) { + const auto sleep_period = *next_frame_time - std::chrono::steady_clock::now(); + + if (sleep_period <= 0ns) { + // We missed next frame time, invalidating current frame pacing group + next_frame_time = std::nullopt; + status = capture_e::timeout; + } + else { + high_precision_sleep(sleep_period); + + if (config::sunshine.min_log_level <= 1) { + // Print sleep overshoot stats to debug log every 20 seconds + auto print_info = [&](double min_overshoot, double max_overshoot, double avg_overshoot) { + auto f = stat_trackers::one_digit_after_decimal(); + BOOST_LOG(debug) << "Sleep overshoot (min/max/avg): " << f % min_overshoot << "ms/" << f % max_overshoot << "ms/" << f % avg_overshoot << "ms"; + }; + std::chrono::nanoseconds overshoot_ns = std::chrono::steady_clock::now() - *next_frame_time; + sleep_overshoot_tracker.collect_and_callback_on_interval(overshoot_ns.count() / 1000000., print_info, 20s); + } + + status = snapshot(pull_free_image_cb, img_out, 0ms, *cursor); + + if (status == capture_e::ok && img_out) { + *next_frame_time += client_frame_interval; + } + else { + next_frame_time = std::nullopt; + } + } } - else { - // If the wait time is negative (meaning the frame is past due) or the - // computed wait time is beyond a second (meaning possible clock issues), - // just capture the frame now and resynchronize the frame interval with - // the current time. - next_frame = std::chrono::steady_clock::now() + client_frame_interval; + + // Start new frame pacing group if necessary, snapshot() is called with non-zero timeout + if (status == capture_e::timeout || (status == capture_e::ok && !next_frame_time)) { + status = snapshot(pull_free_image_cb, img_out, 1000ms, *cursor); + + if (status == capture_e::ok && img_out) { + next_frame_time = img_out->frame_timestamp; + + if (!next_frame_time) { + BOOST_LOG(warning) << "snapshot() provided image without timestamp"; + next_frame_time = std::chrono::steady_clock::now(); + } + + *next_frame_time += client_frame_interval; + } } - std::shared_ptr img_out; - auto status = snapshot(pull_free_image_cb, img_out, 1000ms, *cursor); switch (status) { case platf::capture_e::reinit: case platf::capture_e::error: diff --git a/src/stat_trackers.h b/src/stat_trackers.h index 62df7778cc6..124b906472a 100644 --- a/src/stat_trackers.h +++ b/src/stat_trackers.h @@ -41,7 +41,7 @@ namespace stat_trackers { struct { std::chrono::steady_clock::steady_clock::time_point last_callback_time = std::chrono::steady_clock::now(); T stat_min = std::numeric_limits::max(); - T stat_max = 0; + T stat_max = std::numeric_limits::min(); double stat_total = 0; uint32_t calls = 0; } data; From 3c4c05359a9c4233270b08ded63f0abc9c4fb011 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Sat, 26 Aug 2023 17:27:36 +0300 Subject: [PATCH 107/576] Adjust capture rate to better match display --- src/platform/windows/display_base.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index c9a0b9f31ef..769903633f8 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -120,7 +120,28 @@ namespace platf::dxgi { capture_e display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { - const auto client_frame_interval = std::chrono::nanoseconds { 1s } / client_frame_rate; + auto calculate_client_frame_interval = [&]() -> std::chrono::nanoseconds { + double display_frame_rate = (double) display_refresh_rate.Numerator / display_refresh_rate.Denominator; + + double client_frame_rate_adjusted; + if (client_frame_rate >= display_frame_rate) { + client_frame_rate_adjusted = display_frame_rate * std::round(client_frame_rate / display_frame_rate); + } + else { + client_frame_rate_adjusted = display_frame_rate / std::round(display_frame_rate / client_frame_rate); + } + + // Adjust capture frame interval when display refresh rate is not integral but very close to requested fps. + // Can only decrease requested fps, otherwise client may start accumulating frames and suffer increased latency. + if (client_frame_rate > client_frame_rate_adjusted && client_frame_rate_adjusted / client_frame_rate > 0.99) { + BOOST_LOG(info) << "Adjusted capture rate to " << client_frame_rate_adjusted << "fps to better match display"; + return std::chrono::nanoseconds(std::llround(std::nano::den / client_frame_rate_adjusted)); + } + + return std::chrono::nanoseconds(1s) / client_frame_rate; + }; + + const auto client_frame_interval = calculate_client_frame_interval(); std::optional next_frame_time; // Keep the display awake during capture. If the display goes to sleep during From f50a9f15abca0eef8d40783df0184d56a5abece8 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Sun, 27 Aug 2023 19:13:21 +0300 Subject: [PATCH 108/576] Don't accumulate errors in capture frame pacing --- src/platform/windows/display_base.cpp | 66 +++++++++++++++------------ 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 769903633f8..09847a1d5b0 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -120,29 +120,30 @@ namespace platf::dxgi { capture_e display_base_t::capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) { - auto calculate_client_frame_interval = [&]() -> std::chrono::nanoseconds { - double display_frame_rate = (double) display_refresh_rate.Numerator / display_refresh_rate.Denominator; - - double client_frame_rate_adjusted; - if (client_frame_rate >= display_frame_rate) { - client_frame_rate_adjusted = display_frame_rate * std::round(client_frame_rate / display_frame_rate); - } - else { - client_frame_rate_adjusted = display_frame_rate / std::round(display_frame_rate / client_frame_rate); - } - + auto adjust_client_frame_rate = [&]() -> DXGI_RATIONAL { // Adjust capture frame interval when display refresh rate is not integral but very close to requested fps. - // Can only decrease requested fps, otherwise client may start accumulating frames and suffer increased latency. - if (client_frame_rate > client_frame_rate_adjusted && client_frame_rate_adjusted / client_frame_rate > 0.99) { - BOOST_LOG(info) << "Adjusted capture rate to " << client_frame_rate_adjusted << "fps to better match display"; - return std::chrono::nanoseconds(std::llround(std::nano::den / client_frame_rate_adjusted)); + if (display_refresh_rate.Denominator > 1) { + DXGI_RATIONAL candidate = display_refresh_rate; + if (client_frame_rate % display_refresh_rate_rounded == 0) { + candidate.Numerator *= client_frame_rate / display_refresh_rate_rounded; + } + else if (display_refresh_rate_rounded % client_frame_rate == 0) { + candidate.Denominator *= display_refresh_rate_rounded / client_frame_rate; + } + double candidate_rate = (double) candidate.Numerator / candidate.Denominator; + // Can only decrease requested fps, otherwise client may start accumulating frames and suffer increased latency. + if (client_frame_rate > candidate_rate && candidate_rate / client_frame_rate > 0.99) { + BOOST_LOG(info) << "Adjusted capture rate to " << candidate_rate << "fps to better match display"; + return candidate; + } } - return std::chrono::nanoseconds(1s) / client_frame_rate; + return { (uint32_t) client_frame_rate, 1 }; }; - const auto client_frame_interval = calculate_client_frame_interval(); - std::optional next_frame_time; + DXGI_RATIONAL client_frame_rate_adjusted = adjust_client_frame_rate(); + std::optional frame_pacing_group_start; + uint32_t frame_pacing_group_frames = 0; // Keep the display awake during capture. If the display goes to sleep during // capture, best case is that capture stops until it powers back on. However, @@ -167,12 +168,18 @@ namespace platf::dxgi { std::shared_ptr img_out; // Try to continue frame pacing group, snapshot() is called with zero timeout after waiting for client frame interval - if (next_frame_time) { - const auto sleep_period = *next_frame_time - std::chrono::steady_clock::now(); + if (frame_pacing_group_start) { + const uint32_t seconds = (uint64_t) frame_pacing_group_frames * client_frame_rate_adjusted.Denominator / client_frame_rate_adjusted.Numerator; + const uint32_t remainder = (uint64_t) frame_pacing_group_frames * client_frame_rate_adjusted.Denominator % client_frame_rate_adjusted.Numerator; + const auto sleep_target = *frame_pacing_group_start + + std::chrono::nanoseconds(1s) * seconds + + std::chrono::nanoseconds(1s) * remainder / client_frame_rate_adjusted.Numerator; + const auto sleep_period = sleep_target - std::chrono::steady_clock::now(); if (sleep_period <= 0ns) { // We missed next frame time, invalidating current frame pacing group - next_frame_time = std::nullopt; + frame_pacing_group_start = std::nullopt; + frame_pacing_group_frames = 0; status = capture_e::timeout; } else { @@ -184,34 +191,35 @@ namespace platf::dxgi { auto f = stat_trackers::one_digit_after_decimal(); BOOST_LOG(debug) << "Sleep overshoot (min/max/avg): " << f % min_overshoot << "ms/" << f % max_overshoot << "ms/" << f % avg_overshoot << "ms"; }; - std::chrono::nanoseconds overshoot_ns = std::chrono::steady_clock::now() - *next_frame_time; + std::chrono::nanoseconds overshoot_ns = std::chrono::steady_clock::now() - sleep_target; sleep_overshoot_tracker.collect_and_callback_on_interval(overshoot_ns.count() / 1000000., print_info, 20s); } status = snapshot(pull_free_image_cb, img_out, 0ms, *cursor); if (status == capture_e::ok && img_out) { - *next_frame_time += client_frame_interval; + frame_pacing_group_frames += 1; } else { - next_frame_time = std::nullopt; + frame_pacing_group_start = std::nullopt; + frame_pacing_group_frames = 0; } } } // Start new frame pacing group if necessary, snapshot() is called with non-zero timeout - if (status == capture_e::timeout || (status == capture_e::ok && !next_frame_time)) { + if (status == capture_e::timeout || (status == capture_e::ok && !frame_pacing_group_start)) { status = snapshot(pull_free_image_cb, img_out, 1000ms, *cursor); if (status == capture_e::ok && img_out) { - next_frame_time = img_out->frame_timestamp; + frame_pacing_group_start = img_out->frame_timestamp; - if (!next_frame_time) { + if (!frame_pacing_group_start) { BOOST_LOG(warning) << "snapshot() provided image without timestamp"; - next_frame_time = std::chrono::steady_clock::now(); + frame_pacing_group_start = std::chrono::steady_clock::now(); } - *next_frame_time += client_frame_interval; + frame_pacing_group_frames = 1; } } From bf536f72157fc24c3b500328746bc74b391f8408 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 26 Aug 2023 14:10:29 -0500 Subject: [PATCH 109/576] Implement IPv6 support --- docs/source/about/advanced_usage.rst | 24 +++++++ src/config.cpp | 5 +- src/config.h | 2 + src/confighttp.cpp | 9 +-- src/network.cpp | 90 +++++++++++++++++++++++- src/network.h | 43 ++++++++++- src/nvhttp.cpp | 30 ++++++-- src/rtsp.cpp | 8 +-- src/stream.cpp | 16 +++-- src_assets/common/assets/web/config.html | 14 ++++ 10 files changed, 214 insertions(+), 27 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index b8d15289c73..9730b37489c 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -557,6 +557,30 @@ port port = 47989 +address_family +^^^^^^^^^^^^^^ + +**Description** + Set the address family that Sunshine will use. + +.. table:: + :widths: auto + + ===== =========== + Value Description + ===== =========== + ipv4 IPv4 only + both IPv4+IPv6 + ===== =========== + +**Default** + ``ipv4`` + +**Example** + .. code-block:: text + + address_family = both + pkey ^^^^ diff --git a/src/config.cpp b/src/config.cpp index f15eacb4773..ecb3d2327fe 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -511,7 +511,8 @@ namespace config { {}, // Password Salt platf::appdata().string() + "/sunshine.conf", // config file {}, // cmd args - 47989, + 47989, // Base port number + "ipv4", // Address family platf::appdata().string() + "/sunshine.log", // log file {}, // prep commands }; @@ -1110,6 +1111,8 @@ namespace config { int_f(vars, "port"s, port); sunshine.port = (std::uint16_t) port; + string_restricted_f(vars, "address_family", sunshine.address_family, { "ipv4"sv, "both"sv }); + bool upnp = false; bool_f(vars, "upnp"s, upnp); diff --git a/src/config.h b/src/config.h index b23b59cc2a3..23673e1ef9c 100644 --- a/src/config.h +++ b/src/config.h @@ -155,6 +155,8 @@ namespace config { } cmd; std::uint16_t port; + std::string address_family; + std::string log_file; std::vector prep_cmds; diff --git a/src/confighttp.cpp b/src/confighttp.cpp index 6e8b2393730..ba7c21ee942 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -76,7 +76,7 @@ namespace confighttp { void send_unauthorized(resp_https_t response, req_https_t request) { - auto address = request->remote_endpoint().address().to_string(); + auto address = net::addr_to_normalized_string(request->remote_endpoint().address()); BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv; const SimpleWeb::CaseInsensitiveMultimap headers { { "WWW-Authenticate", R"(Basic realm="Sunshine Gamestream Host", charset="UTF-8")" } @@ -86,7 +86,7 @@ namespace confighttp { void send_redirect(resp_https_t response, req_https_t request, const char *path) { - auto address = request->remote_endpoint().address().to_string(); + auto address = net::addr_to_normalized_string(request->remote_endpoint().address()); BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv; const SimpleWeb::CaseInsensitiveMultimap headers { { "Location", path } @@ -96,7 +96,7 @@ namespace confighttp { bool authenticate(resp_https_t response, req_https_t request) { - auto address = request->remote_endpoint().address().to_string(); + auto address = net::addr_to_normalized_string(request->remote_endpoint().address()); auto ip_type = net::from_address(address); if (ip_type > http::origin_web_ui_allowed) { @@ -731,6 +731,7 @@ namespace confighttp { auto shutdown_event = mail::man->event(mail::shutdown); auto port_https = map_port(PORT_HTTPS); + auto address_family = net::af_from_enum_string(config::sunshine.address_family); https_server_t server { config::nvhttp.cert, config::nvhttp.pkey }; server.default_resource["GET"] = not_found; @@ -758,7 +759,7 @@ namespace confighttp { server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage; server.resource["^/node_modules\\/.+$"]["GET"] = getNodeModules; server.config.reuse_address = true; - server.config.address = "0.0.0.0"s; + server.config.address = net::af_to_any_address_string(address_family); server.config.port = port_https; auto accept_and_run = [&](auto *server) { diff --git a/src/network.cpp b/src/network.cpp index f530b0f3b24..87090015e65 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -102,12 +102,96 @@ namespace net { return "wan"sv; } + /** + * @brief Returns the `af_e` enum value for the `address_family` config option value. + * @param view The config option value. + * @return The `af_e` enum value. + */ + af_e + af_from_enum_string(const std::string_view &view) { + if (view == "ipv4") { + return IPV4; + } + if (view == "both") { + return BOTH; + } + + // avoid warning + return BOTH; + } + + /** + * @brief Returns the wildcard binding address for a given address family. + * @param af Address family. + * @return Normalized address. + */ + std::string_view + af_to_any_address_string(af_e af) { + switch (af) { + case IPV4: + return "0.0.0.0"sv; + case BOTH: + return "::"sv; + } + + // avoid warning + return "::"sv; + } + + /** + * @brief Converts an address to a normalized form. + * @details Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses. + * @param address The address to normalize. + * @return Normalized address. + */ + boost::asio::ip::address + normalize_address(boost::asio::ip::address address) { + // Convert IPv6-mapped IPv4 addresses into regular IPv4 addresses + if (address.is_v6()) { + auto v6 = address.to_v6(); + if (v6.is_v4_mapped()) { + return boost::asio::ip::make_address_v4(boost::asio::ip::v4_mapped, v6); + } + } + + return address; + } + + /** + * @brief Returns the given address in normalized string form. + * @details Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses. + * @param address The address to normalize. + * @return Normalized address in string form. + */ + std::string + addr_to_normalized_string(boost::asio::ip::address address) { + return normalize_address(address).to_string(); + } + + /** + * @brief Returns the given address in a normalized form for in the host portion of a URL. + * @details Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses. + * @param address The address to normalize and escape. + * @return Normalized address in URL-escaped string. + */ + std::string + addr_to_url_escaped_string(boost::asio::ip::address address) { + address = normalize_address(address); + if (address.is_v6()) { + return "["s + address.to_string() + ']'; + } + else { + return address.to_string(); + } + } + host_t - host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port) { - enet_address_set_host(&addr, "0.0.0.0"); + host_create(af_e af, ENetAddress &addr, std::size_t peers, std::uint16_t port) { + auto any_addr = net::af_to_any_address_string(af); + enet_address_set_host(&addr, any_addr.data()); enet_address_set_port(&addr, port); - return host_t { enet_host_create(AF_INET, &addr, peers, 0, 0, 0) }; + return host_t { enet_host_create(af == IPV4 ? AF_INET : AF_INET6, &addr, peers, 0, 0, 0) }; } void diff --git a/src/network.h b/src/network.h index e1ca36c7531..b54f63ce7ee 100644 --- a/src/network.h +++ b/src/network.h @@ -6,6 +6,8 @@ #include +#include + #include #include "utility.h" @@ -24,6 +26,11 @@ namespace net { WAN }; + enum af_e : int { + IPV4, + BOTH + }; + net_e from_enum_string(const std::string_view &view); std::string_view @@ -33,5 +40,39 @@ namespace net { from_address(const std::string_view &view); host_t - host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port); + host_create(af_e af, ENetAddress &addr, std::size_t peers, std::uint16_t port); + + /** + * @brief Returns the `af_e` enum value for the `address_family` config option value. + * @param view The config option value. + * @return The `af_e` enum value. + */ + af_e + af_from_enum_string(const std::string_view &view); + + /** + * @brief Returns the wildcard binding address for a given address family. + * @param af Address family. + * @return Normalized address. + */ + std::string_view + af_to_any_address_string(af_e af); + + /** + * @brief Returns the given address in normalized string form. + * @details Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses. + * @param address The address to normalize. + * @return Normalized address in string form. + */ + std::string + addr_to_normalized_string(boost::asio::ip::address address); + + /** + * @brief Returns the given address in a normalized form for in the host portion of a URL. + * @details Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses. + * @param address The address to normalize and escape. + * @return Normalized address in URL-escaped string. + */ + std::string + addr_to_url_escaped_string(boost::asio::ip::address address); } // namespace net diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index f52ddc07380..962310f3a79 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -591,7 +591,7 @@ namespace nvhttp { response->close_connection_after_response = true; - auto address = request->remote_endpoint().address().to_string(); + auto address = net::addr_to_normalized_string(request->remote_endpoint().address()); auto ip_type = net::from_address(address); if (ip_type > http::origin_pin_allowed) { BOOST_LOG(info) << "/pin: ["sv << address << "] -- denied"sv; @@ -639,9 +639,24 @@ namespace nvhttp { tree.put("root.uniqueid", http::unique_id); tree.put("root.HttpsPort", map_port(PORT_HTTPS)); tree.put("root.ExternalPort", map_port(PORT_HTTP)); - tree.put("root.mac", platf::get_mac_address(local_endpoint.address().to_string())); + tree.put("root.mac", platf::get_mac_address(net::addr_to_normalized_string(local_endpoint.address()))); tree.put("root.MaxLumaPixelsHEVC", video::active_hevc_mode > 1 ? "1869449984" : "0"); - tree.put("root.LocalIP", local_endpoint.address().to_string()); + + // Moonlight clients track LAN IPv6 addresses separately from LocalIP which is expected to + // always be an IPv4 address. If we return that same IPv6 address here, it will clobber the + // stored LAN IPv4 address. To avoid this, we need to return an IPv4 address in this field + // when we get a request over IPv6. + // + // HACK: We should return the IPv4 address of local interface here, but we don't currently + // have that implemented. For now, we will emulate the behavior of GFE+GS-IPv6-Forwarder, + // which returns 127.0.0.1 as LocalIP for IPv6 connections. Moonlight clients with IPv6 + // support know to ignore this bogus address. + if (local_endpoint.address().is_v6() && !local_endpoint.address().to_v6().is_v4_mapped()) { + tree.put("root.LocalIP", "127.0.0.1"); + } + else { + tree.put("root.LocalIP", net::addr_to_normalized_string(local_endpoint.address())); + } uint32_t codec_mode_flags = SCM_H264; if (video::active_hevc_mode >= 2) { @@ -800,7 +815,7 @@ namespace nvhttp { rtsp_stream::launch_session_raise(launch_session); tree.put("root..status_code", 200); - tree.put("root.sessionUrl0", "rtsp://"s + request->local_endpoint().address().to_string() + ':' + std::to_string(map_port(rtsp_stream::RTSP_SETUP_PORT))); + tree.put("root.sessionUrl0", "rtsp://"s + net::addr_to_url_escaped_string(request->local_endpoint().address()) + ':' + std::to_string(map_port(rtsp_stream::RTSP_SETUP_PORT))); tree.put("root.gamesession", 1); } @@ -871,7 +886,7 @@ namespace nvhttp { rtsp_stream::launch_session_raise(make_launch_session(host_audio, args)); tree.put("root..status_code", 200); - tree.put("root.sessionUrl0", "rtsp://"s + request->local_endpoint().address().to_string() + ':' + std::to_string(map_port(rtsp_stream::RTSP_SETUP_PORT))); + tree.put("root.sessionUrl0", "rtsp://"s + net::addr_to_url_escaped_string(request->local_endpoint().address()) + ':' + std::to_string(map_port(rtsp_stream::RTSP_SETUP_PORT))); tree.put("root.resume", 1); } @@ -934,6 +949,7 @@ namespace nvhttp { auto port_http = map_port(PORT_HTTP); auto port_https = map_port(PORT_HTTPS); + auto address_family = net::af_from_enum_string(config::sunshine.address_family); bool clean_slate = config::sunshine.flags[config::flag::FRESH_STATE]; @@ -1026,7 +1042,7 @@ namespace nvhttp { https_server.resource["^/cancel$"]["GET"] = cancel; https_server.config.reuse_address = true; - https_server.config.address = "0.0.0.0"s; + https_server.config.address = net::af_to_any_address_string(address_family); https_server.config.port = port_https; http_server.default_resource["GET"] = not_found; @@ -1035,7 +1051,7 @@ namespace nvhttp { http_server.resource["^/pin/([0-9]+)$"]["GET"] = pin; http_server.config.reuse_address = true; - http_server.config.address = "0.0.0.0"s; + http_server.config.address = net::af_to_any_address_string(address_family); http_server.config.port = port_http; auto accept_and_run = [&](auto *http_server) { diff --git a/src/rtsp.cpp b/src/rtsp.cpp index d0552fae362..6e06c1fd1f2 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -225,7 +225,7 @@ namespace rtsp_stream { } int - bind(std::uint16_t port, boost::system::error_code &ec) { + bind(net::af_e af, std::uint16_t port, boost::system::error_code &ec) { { auto lg = _session_slots.lock(); @@ -233,14 +233,14 @@ namespace rtsp_stream { _slot_count = config::stream.channels; } - acceptor.open(tcp::v4(), ec); + acceptor.open(af == net::IPV4 ? tcp::v4() : tcp::v6(), ec); if (ec) { return -1; } acceptor.set_option(boost::asio::socket_base::reuse_address { true }); - acceptor.bind(tcp::endpoint(tcp::v4(), port), ec); + acceptor.bind(tcp::endpoint(af == net::IPV4 ? tcp::v4() : tcp::v6(), port), ec); if (ec) { return -1; } @@ -766,7 +766,7 @@ namespace rtsp_stream { server.map("PLAY"sv, &cmd_play); boost::system::error_code ec; - if (server.bind(map_port(rtsp_stream::RTSP_SETUP_PORT), ec)) { + if (server.bind(net::af_from_enum_string(config::sunshine.address_family), map_port(rtsp_stream::RTSP_SETUP_PORT), ec)) { BOOST_LOG(fatal) << "Couldn't bind RTSP server to port ["sv << map_port(rtsp_stream::RTSP_SETUP_PORT) << "], " << ec.message(); shutdown_event->raise(true); diff --git a/src/stream.cpp b/src/stream.cpp index 036f635a73c..8b8497e28ca 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -257,8 +257,8 @@ namespace stream { class control_server_t { public: int - bind(std::uint16_t port) { - _host = net::host_create(_addr, config::stream.channels, port); + bind(net::af_e address_family, std::uint16_t port) { + _host = net::host_create(address_family, _addr, config::stream.channels, port); return !(bool) _host; } @@ -1442,39 +1442,41 @@ namespace stream { int start_broadcast(broadcast_ctx_t &ctx) { + auto address_family = net::af_from_enum_string(config::sunshine.address_family); + auto protocol = address_family == net::IPV4 ? udp::v4() : udp::v6(); auto control_port = map_port(CONTROL_PORT); auto video_port = map_port(VIDEO_STREAM_PORT); auto audio_port = map_port(AUDIO_STREAM_PORT); - if (ctx.control_server.bind(control_port)) { + if (ctx.control_server.bind(address_family, control_port)) { BOOST_LOG(error) << "Couldn't bind Control server to port ["sv << control_port << "], likely another process already bound to the port"sv; return -1; } boost::system::error_code ec; - ctx.video_sock.open(udp::v4(), ec); + ctx.video_sock.open(protocol, ec); if (ec) { BOOST_LOG(fatal) << "Couldn't open socket for Video server: "sv << ec.message(); return -1; } - ctx.video_sock.bind(udp::endpoint(udp::v4(), video_port), ec); + ctx.video_sock.bind(udp::endpoint(protocol, video_port), ec); if (ec) { BOOST_LOG(fatal) << "Couldn't bind Video server to port ["sv << video_port << "]: "sv << ec.message(); return -1; } - ctx.audio_sock.open(udp::v4(), ec); + ctx.audio_sock.open(protocol, ec); if (ec) { BOOST_LOG(fatal) << "Couldn't open socket for Audio server: "sv << ec.message(); return -1; } - ctx.audio_sock.bind(udp::endpoint(udp::v4(), audio_port), ec); + ctx.audio_sock.bind(udp::endpoint(protocol, audio_port), ec); if (ec) { BOOST_LOG(fatal) << "Couldn't bind Audio server to port ["sv << audio_port << "]: "sv << ec.message(); diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index e0bb751d89e..b4fc94bed8c 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -607,6 +607,19 @@

Configuration

+ +
+ + +
Set the address family used by Sunshine
+
@@ -1027,6 +1040,7 @@

Configuration

+ + + +
From 7ad4652b9c465dec1e1f038081436c35114ca3e9 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:07:47 -0400 Subject: [PATCH 137/576] fix: arch package version (#1628) --- docker/archlinux.dockerfile | 2 ++ packaging/linux/Arch/PKGBUILD | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docker/archlinux.dockerfile b/docker/archlinux.dockerfile index 8750b9527e1..15cb5d23685 100644 --- a/docker/archlinux.dockerfile +++ b/docker/archlinux.dockerfile @@ -71,6 +71,8 @@ cmake \ -DSUNSHINE_CONFIGURE_PKGBUILD=ON \ -DSUNSHINE_SUB_VERSION="${sub_version}" \ -DGITHUB_CLONE_URL="${CLONE_URL}" \ + -DGITHUB_BRANCH=${BRANCH} \ + -DGITHUB_BUILD_VERSION=${BUILD_VERSION} \ -DGITHUB_COMMIT="${COMMIT}" \ -DSUNSHINE_CONFIGURE_ONLY=ON \ /build/sunshine diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 02eaf0b5c33..1a85769d6ab 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -51,6 +51,10 @@ build() { npm install popd + export BRANCH=@GITHUB_BRANCH@ + export BUILD_VERSION=@GITHUB_BUILD_VERSION@ + export COMMIT=@GITHUB_COMMIT@ + export CFLAGS="${CFLAGS/-Werror=format-security/}" export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" From 9123ff7dac7e38483c56ac0c64e9796a51f298ea Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:09:09 -0400 Subject: [PATCH 138/576] ci: update global docker (#1630) --- .github/workflows/ci-docker.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index 79a5dc8ecea..edeeb2bd9b7 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -309,10 +309,10 @@ jobs: echo "tags=${TAGS}" >> $GITHUB_OUTPUT - name: Set Up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 id: buildx - name: Cache Docker Layers @@ -325,14 +325,14 @@ jobs: - name: Log in to Docker Hub if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Log in to the Container registry if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ secrets.GH_BOT_NAME }} @@ -341,7 +341,7 @@ jobs: - name: Build artifacts if: ${{ steps.prepare.outputs.artifacts == 'true' }} id: build_artifacts - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./ file: ${{ matrix.dockerfile }} @@ -363,7 +363,7 @@ jobs: - name: Build and push id: build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./ file: ${{ matrix.dockerfile }} From 4b91569bacee856d730cc933bd2936f06da3f9b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 08:41:54 -0400 Subject: [PATCH 139/576] build(deps): bump easimon/maximize-build-space from 7 to 8 (#1532) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 86c9380a921..290a978ab0a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -158,7 +158,7 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@v7 + uses: easimon/maximize-build-space@v8 with: root-reserve-mb: 10240 remove-dotnet: 'true' @@ -277,7 +277,7 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@v7 + uses: easimon/maximize-build-space@v8 with: root-reserve-mb: 20480 remove-dotnet: 'true' From 468177eeecac2d562c82bf7f425fd8ce85bb884b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 09:26:58 -0400 Subject: [PATCH 140/576] build(deps): bump furo from 2023.8.19 to 2023.9.10 (#1617) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 36e181c323c..b0de822839a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ breathe==4.35.0 -furo==2023.8.19 +furo==2023.9.10 m2r2==0.3.3.post2 rstcheck[sphinx]==6.1.2 rstfmt==0.0.14 From 5fe5c4c442e25ec01b74f9b5d6de6bb0928c9511 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:05:13 -0400 Subject: [PATCH 141/576] build(deps): bump rstcheck[sphinx] from 6.1.2 to 6.2.0 (#1618) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index b0de822839a..ca4a60b9ccf 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ breathe==4.35.0 furo==2023.9.10 m2r2==0.3.3.post2 -rstcheck[sphinx]==6.1.2 +rstcheck[sphinx]==6.2.0 rstfmt==0.0.14 Sphinx==7.2.5 sphinx-copybutton==0.5.2 From a3091182c75560d653bad6e7bd32b18745ccf7ef Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:34:26 +0300 Subject: [PATCH 142/576] Support capturing rotated displays on Windows (#1602) --- src/nvenc/nvenc_base.cpp | 7 +- src/platform/windows/display.h | 72 ++++++++++++++++--- src/platform/windows/display_base.cpp | 11 +++ src/platform/windows/display_vram.cpp | 63 ++++++++++++---- .../assets/shaders/directx/ConvertUVVS.hlsl | 47 ++++++++---- .../assets/shaders/directx/CursorVS.hlsl | 37 ++++++++++ .../assets/shaders/directx/SceneVS.hlsl | 39 ++++++---- 7 files changed, 222 insertions(+), 54 deletions(-) create mode 100644 src_assets/windows/assets/shaders/directx/CursorVS.hlsl diff --git a/src/nvenc/nvenc_base.cpp b/src/nvenc/nvenc_base.cpp index b3bc923b522..f305f7682ad 100644 --- a/src/nvenc/nvenc_base.cpp +++ b/src/nvenc/nvenc_base.cpp @@ -500,6 +500,8 @@ namespace nvenc { return true; } + encoder_state.rfi_needs_confirmation = true; + if (last_frame < first_frame) { BOOST_LOG(error) << "NvEnc: invaid rfi request " << first_frame << "-" << last_frame << ", generating IDR"; return false; @@ -508,14 +510,13 @@ namespace nvenc { BOOST_LOG(debug) << "NvEnc: rfi request " << first_frame << "-" << last_frame << " expanding to last encoded frame " << encoder_state.last_encoded_frame_index; last_frame = encoder_state.last_encoded_frame_index; + encoder_state.last_rfi_range = { first_frame, last_frame }; + if (last_frame - first_frame + 1 >= encoder_params.ref_frames_in_dpb) { BOOST_LOG(debug) << "NvEnc: rfi request too large, generating IDR"; return false; } - encoder_state.rfi_needs_confirmation = true; - encoder_state.last_rfi_range = { first_frame, last_frame }; - for (auto i = first_frame; i <= last_frame; i++) { if (nvenc_failed(nvenc->nvEncInvalidateRefFrames(encoder, i))) { BOOST_LOG(error) << "NvEncInvalidateRefFrames " << i << " failed: " << last_error_string; diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index cd21081221a..2d480c5954c 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -81,23 +81,71 @@ namespace platf::dxgi { public: gpu_cursor_t(): cursor_view { 0, 0, 0, 0, 0.0f, 1.0f } {}; - void - set_pos(LONG rel_x, LONG rel_y, bool visible) { - cursor_view.TopLeftX = rel_x; - cursor_view.TopLeftY = rel_y; + void + set_pos(LONG topleft_x, LONG topleft_y, LONG display_width, LONG display_height, DXGI_MODE_ROTATION display_rotation, bool visible) { + this->topleft_x = topleft_x; + this->topleft_y = topleft_y; + this->display_width = display_width; + this->display_height = display_height; + this->display_rotation = display_rotation; this->visible = visible; + update_viewport(); } void - set_texture(LONG width, LONG height, texture2d_t &&texture) { - cursor_view.Width = width; - cursor_view.Height = height; - + set_texture(LONG texture_width, LONG texture_height, texture2d_t &&texture) { this->texture = std::move(texture); + this->texture_width = texture_width; + this->texture_height = texture_height; + update_viewport(); + } + + void + update_viewport() { + switch (display_rotation) { + case DXGI_MODE_ROTATION_UNSPECIFIED: + case DXGI_MODE_ROTATION_IDENTITY: + cursor_view.TopLeftX = topleft_x; + cursor_view.TopLeftY = topleft_y; + cursor_view.Width = texture_width; + cursor_view.Height = texture_height; + break; + + case DXGI_MODE_ROTATION_ROTATE90: + cursor_view.TopLeftX = topleft_y; + cursor_view.TopLeftY = display_width - texture_width - topleft_x; + cursor_view.Width = texture_height; + cursor_view.Height = texture_width; + break; + + case DXGI_MODE_ROTATION_ROTATE180: + cursor_view.TopLeftX = display_width - texture_width - topleft_x; + cursor_view.TopLeftY = display_height - texture_height - topleft_y; + cursor_view.Width = texture_width; + cursor_view.Height = texture_height; + break; + + case DXGI_MODE_ROTATION_ROTATE270: + cursor_view.TopLeftX = display_height - texture_height - topleft_y; + cursor_view.TopLeftY = topleft_x; + cursor_view.Width = texture_height; + cursor_view.Height = texture_width; + break; + } } texture2d_t texture; + LONG texture_width; + LONG texture_height; + + LONG topleft_x; + LONG topleft_y; + + LONG display_width; + LONG display_height; + DXGI_MODE_ROTATION display_rotation; + shader_res_t input_res; D3D11_VIEWPORT cursor_view; @@ -141,6 +189,10 @@ namespace platf::dxgi { DXGI_RATIONAL display_refresh_rate; int display_refresh_rate_rounded; + DXGI_MODE_ROTATION display_rotation = DXGI_MODE_ROTATION_UNSPECIFIED; + int width_before_rotation; + int height_before_rotation; + int client_frame_rate; DXGI_FORMAT capture_format; @@ -277,8 +329,8 @@ namespace platf::dxgi { blend_t blend_invert; blend_t blend_disable; - ps_t scene_ps; - vs_t scene_vs; + ps_t cursor_ps; + vs_t cursor_vs; gpu_cursor_t cursor_alpha; gpu_cursor_t cursor_xor; diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 30f85224d78..50f72698859 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -461,6 +461,17 @@ namespace platf::dxgi { width = desc.DesktopCoordinates.right - offset_x; height = desc.DesktopCoordinates.bottom - offset_y; + display_rotation = desc.Rotation; + if (display_rotation == DXGI_MODE_ROTATION_ROTATE90 || + display_rotation == DXGI_MODE_ROTATION_ROTATE270) { + width_before_rotation = height; + height_before_rotation = width; + } + else { + width_before_rotation = width; + height_before_rotation = height; + } + // left and bottom may be negative, yet absolute mouse coordinates start at 0x0 // Ensure offset starts at 0x0 offset_x -= GetSystemMetrics(SM_XVIRTUALSCREEN); diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 5c0ead06ee1..bf8fb569160 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -107,6 +107,7 @@ namespace platf::dxgi { blob_t convert_UV_linear_ps_hlsl; blob_t convert_UV_PQ_ps_hlsl; blob_t scene_vs_hlsl; + blob_t cursor_vs_hlsl; blob_t convert_Y_ps_hlsl; blob_t convert_Y_linear_ps_hlsl; blob_t convert_Y_PQ_ps_hlsl; @@ -472,6 +473,17 @@ namespace platf::dxgi { } device_ctx->VSSetConstantBuffers(0, 1, &info_scene); + { + int32_t rotation_modifier = display->display_rotation == DXGI_MODE_ROTATION_UNSPECIFIED ? 0 : display->display_rotation - 1; + int32_t rotation_data[16 / sizeof(int32_t)] { -rotation_modifier }; // aligned to 16-byte + auto rotation = make_buffer(device.get(), rotation_data); + if (!rotation) { + BOOST_LOG(error) << "Failed to create display rotation vertex constant buffer"; + return -1; + } + device_ctx->VSSetConstantBuffers(1, 1, &rotation); + } + D3D11_RENDER_TARGET_VIEW_DESC nv12_rt_desc { format == DXGI_FORMAT_P010 ? DXGI_FORMAT_R16_UNORM : DXGI_FORMAT_R8_UNORM, D3D11_RTV_DIMENSION_TEXTURE2D @@ -618,7 +630,11 @@ namespace platf::dxgi { convert_UV_vs_hlsl->GetBufferPointer(), convert_UV_vs_hlsl->GetBufferSize(), &input_layout); - this->display = std::move(display); + this->display = std::dynamic_pointer_cast(display); + if (!this->display) { + return -1; + } + display = nullptr; blend_disable = make_blend(device.get(), false, false); if (!blend_disable) { @@ -735,7 +751,7 @@ namespace platf::dxgi { // amongst multiple hwdevice_t objects (and therefore multiple ID3D11Devices). std::map img_ctx_map; - std::shared_ptr display; + std::shared_ptr display; vs_t convert_UV_vs; ps_t convert_UV_ps; @@ -988,8 +1004,11 @@ namespace platf::dxgi { } if (frame_info.LastMouseUpdateTime.QuadPart) { - cursor_alpha.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y, frame_info.PointerPosition.Visible); - cursor_xor.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y, frame_info.PointerPosition.Visible); + cursor_alpha.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y, + width, height, display_rotation, frame_info.PointerPosition.Visible); + + cursor_xor.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y, + width, height, display_rotation, frame_info.PointerPosition.Visible); } const bool blend_mouse_cursor_flag = (cursor_alpha.visible || cursor_xor.visible) && cursor_visible; @@ -1008,7 +1027,7 @@ namespace platf::dxgi { // It's possible for our display enumeration to race with mode changes and result in // mismatched image pool and desktop texture sizes. If this happens, just reinit again. - if (desc.Width != width || desc.Height != height) { + if (desc.Width != width_before_rotation || desc.Height != height_before_rotation) { BOOST_LOG(info) << "Capture size changed ["sv << width << 'x' << height << " -> "sv << desc.Width << 'x' << desc.Height << ']'; return capture_e::reinit; } @@ -1109,8 +1128,8 @@ namespace platf::dxgi { // Otherwise create a new surface. D3D11_TEXTURE2D_DESC t {}; - t.Width = width; - t.Height = height; + t.Width = width_before_rotation; + t.Height = height_before_rotation; t.MipLevels = 1; t.ArraySize = 1; t.SampleDesc.Count = 1; @@ -1217,8 +1236,8 @@ namespace platf::dxgi { } auto blend_cursor = [&](img_d3d_t &d3d_img) { - device_ctx->VSSetShader(scene_vs.get(), nullptr, 0); - device_ctx->PSSetShader(scene_ps.get(), nullptr, 0); + device_ctx->VSSetShader(cursor_vs.get(), nullptr, 0); + device_ctx->PSSetShader(cursor_ps.get(), nullptr, 0); device_ctx->OMSetRenderTargets(1, &d3d_img.capture_rt, nullptr); if (cursor_alpha.texture.get()) { @@ -1338,15 +1357,26 @@ namespace platf::dxgi { return -1; } - status = device->CreateVertexShader(scene_vs_hlsl->GetBufferPointer(), scene_vs_hlsl->GetBufferSize(), nullptr, &scene_vs); + status = device->CreateVertexShader(cursor_vs_hlsl->GetBufferPointer(), cursor_vs_hlsl->GetBufferSize(), nullptr, &cursor_vs); if (status) { BOOST_LOG(error) << "Failed to create scene vertex shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } + { + int32_t rotation_modifier = display_rotation == DXGI_MODE_ROTATION_UNSPECIFIED ? 0 : display_rotation - 1; + int32_t rotation_data[16 / sizeof(int32_t)] { rotation_modifier }; // aligned to 16-byte + auto rotation = make_buffer(device.get(), rotation_data); + if (!rotation) { + BOOST_LOG(error) << "Failed to create display rotation vertex constant buffer"; + return -1; + } + device_ctx->VSSetConstantBuffers(2, 1, &rotation); + } + if (config.dynamicRange && is_hdr()) { // This shader will normalize scRGB white levels to a user-defined white level - status = device->CreatePixelShader(scene_NW_ps_hlsl->GetBufferPointer(), scene_NW_ps_hlsl->GetBufferSize(), nullptr, &scene_ps); + status = device->CreatePixelShader(scene_NW_ps_hlsl->GetBufferPointer(), scene_NW_ps_hlsl->GetBufferSize(), nullptr, &cursor_ps); if (status) { BOOST_LOG(error) << "Failed to create scene pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -1365,7 +1395,7 @@ namespace platf::dxgi { device_ctx->PSSetConstantBuffers(1, 1, &sdr_multiplier); } else { - status = device->CreatePixelShader(scene_ps_hlsl->GetBufferPointer(), scene_ps_hlsl->GetBufferSize(), nullptr, &scene_ps); + status = device->CreatePixelShader(scene_ps_hlsl->GetBufferPointer(), scene_ps_hlsl->GetBufferSize(), nullptr, &cursor_ps); if (status) { BOOST_LOG(error) << "Failed to create scene pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -1392,8 +1422,8 @@ namespace platf::dxgi { auto img = std::make_shared(); // Initialize format-independent fields - img->width = width; - img->height = height; + img->width = width_before_rotation; + img->height = height_before_rotation; img->id = next_image_id++; return img; @@ -1645,6 +1675,11 @@ namespace platf::dxgi { return -1; } + cursor_vs_hlsl = compile_vertex_shader(SUNSHINE_SHADERS_DIR "/CursorVS.hlsl"); + if (!cursor_vs_hlsl) { + return -1; + } + convert_Y_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertYPS.hlsl"); if (!convert_Y_ps_hlsl) { return -1; diff --git a/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl index 77ff38d7deb..f36128fefcd 100644 --- a/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl +++ b/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl @@ -1,10 +1,14 @@ struct VertTexPosWide { - float3 uuv : TEXCOORD; - float4 pos : SV_POSITION; + float3 uuv : TEXCOORD; + float4 pos : SV_POSITION; }; cbuffer info : register(b0) { - float width_i; + float width_i; +}; + +cbuffer rotation_info : register(b1) { + int rotation; }; //-------------------------------------------------------------------------------------- @@ -12,18 +16,31 @@ cbuffer info : register(b0) { //-------------------------------------------------------------------------------------- VertTexPosWide main_vs(uint vI : SV_VERTEXID) { - float idHigh = float(vI >> 1); - float idLow = float(vI & uint(1)); + VertTexPosWide output; + float2 tex; + + if (vI == 0) { + output.pos = float4(-1, -1, 0, 1); + tex = float2(0, 1); + } + else if (vI == 1) { + output.pos = float4(-1, 3, 0, 1); + tex = float2(0, -1); + } + else if (vI == 2) { + output.pos = float4(3, -1, 0, 1); + tex = float2(2, 1); + } - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; + if (rotation != 0) { + float rotation_radians = radians(90 * rotation); + float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), + sin(rotation_radians), cos(rotation_radians) }; + float2 rotation_center = { 0.5, 0.5 }; + tex = round(rotation_center + mul(rotation_matrix, tex - rotation_center)); + } - float u_right = idHigh * 2.0; - float u_left = u_right - width_i; - float v = 1.0 - idLow * 2.0; + output.uuv = float3(tex.x, tex.x - width_i, tex.y); - VertTexPosWide vert_out; - vert_out.uuv = float3(u_left, u_right, v); - vert_out.pos = float4(x, y, 0.0, 1.0); - return vert_out; -} \ No newline at end of file + return output; +} diff --git a/src_assets/windows/assets/shaders/directx/CursorVS.hlsl b/src_assets/windows/assets/shaders/directx/CursorVS.hlsl new file mode 100644 index 00000000000..a93935d7496 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/CursorVS.hlsl @@ -0,0 +1,37 @@ +struct PS_INPUT +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD; +}; + +cbuffer rotation_info : register(b2) { + int rotation; +}; + +PS_INPUT main_vs(uint vI : SV_VERTEXID) +{ + PS_INPUT output; + + if (vI == 0) { + output.pos = float4(-1, -1, 0, 1); + output.tex = float2(0, 1); + } + else if (vI == 1) { + output.pos = float4(-1, 3, 0, 1); + output.tex = float2(0, -1); + } + else if (vI == 2) { + output.pos = float4(3, -1, 0, 1); + output.tex = float2(2, 1); + } + + if (rotation != 0) { + float rotation_radians = radians(90 * rotation); + float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), + sin(rotation_radians), cos(rotation_radians) }; + float2 rotation_center = { 0.5, 0.5 }; + output.tex = round(rotation_center + mul(rotation_matrix, output.tex - rotation_center)); + } + + return output; +} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/SceneVS.hlsl b/src_assets/windows/assets/shaders/directx/SceneVS.hlsl index 3afaffc60f9..3e72aa0cd0d 100644 --- a/src_assets/windows/assets/shaders/directx/SceneVS.hlsl +++ b/src_assets/windows/assets/shaders/directx/SceneVS.hlsl @@ -1,22 +1,37 @@ struct PS_INPUT { - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; + float4 pos : SV_POSITION; + float2 tex : TEXCOORD; +}; + +cbuffer rotation_info : register(b1) { + int rotation; }; PS_INPUT main_vs(uint vI : SV_VERTEXID) { - float idHigh = float(vI >> 1); - float idLow = float(vI & uint(1)); + PS_INPUT output; - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; + if (vI == 0) { + output.pos = float4(-1, -1, 0, 1); + output.tex = float2(0, 1); + } + else if (vI == 1) { + output.pos = float4(-1, 3, 0, 1); + output.tex = float2(0, -1); + } + else if (vI == 2) { + output.pos = float4(3, -1, 0, 1); + output.tex = float2(2, 1); + } - float u = idHigh * 2.0; - float v = 1.0 - idLow * 2.0; + if (rotation != 0) { + float rotation_radians = radians(90 * rotation); + float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), + sin(rotation_radians), cos(rotation_radians) }; + float2 rotation_center = { 0.5, 0.5 }; + output.tex = round(rotation_center + mul(rotation_matrix, output.tex - rotation_center)); + } - PS_INPUT vert_out; - vert_out.pos = float4(x, y, 0.0, 1.0); - vert_out.tex = float2(u, v); - return vert_out; + return output; } \ No newline at end of file From 645147fb058b95a24979ca67b3fa0e69f25b34d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:25:10 -0400 Subject: [PATCH 143/576] build(deps): bump @fortawesome/fontawesome-free from 6.4.0 to 6.4.2 (#1496) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c47a364ca81..998af3ef849 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@fortawesome/fontawesome-free": "6.4.0", + "@fortawesome/fontawesome-free": "6.4.2", "bootstrap": "5.3.0", "vue": "2.6.12" } From 74cd8eebcedb041e14fe60c005986c59a0926885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:03:30 -0400 Subject: [PATCH 144/576] build(deps): bump bootstrap from 5.3.0 to 5.3.1 (#1472) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 998af3ef849..76e3bec701c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@fortawesome/fontawesome-free": "6.4.2", - "bootstrap": "5.3.0", + "bootstrap": "5.3.1", "vue": "2.6.12" } } From 5a4c9ebaaf555efda56cbf6ebde885fcad4849a8 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:01:59 -0400 Subject: [PATCH 145/576] ci(flatpak): fix boost url (#1637) --- packaging/linux/Arch/PKGBUILD | 6 +++--- packaging/linux/flatpak/dev.lizardbyte.sunshine.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 1a85769d6ab..e078c0cc09a 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -51,9 +51,9 @@ build() { npm install popd - export BRANCH=@GITHUB_BRANCH@ - export BUILD_VERSION=@GITHUB_BUILD_VERSION@ - export COMMIT=@GITHUB_COMMIT@ + export BRANCH="@GITHUB_BRANCH@" + export BUILD_VERSION="@GITHUB_BUILD_VERSION@" + export COMMIT="@GITHUB_COMMIT@" export CFLAGS="${CFLAGS/-Werror=format-security/}" export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}" diff --git a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml index 35f9a52c245..4528e7def9a 100644 --- a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml +++ b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml @@ -41,8 +41,8 @@ modules: url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0.orig.tar.xz sha256: 2467be4af625b5ae4b3c93fc7af196a09eba39c11a7338cd9e8b356fa44d2f45 - type: archive - url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0-17ubuntu1.debian.tar.xz - sha256: 22e623d98c84eb3fec57e19ea371157a5bc8225ba4c5907f7e5155072317a31d + url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0-18.1ubuntu3.debian.tar.xz + sha256: d5660bdce3ea4ac66194b0c4bc6dc3b9d43d41cc16af8bc6024980d965e40ae2 - type: shell commands: - for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done From 8f43c1c9f0047f174947cbb4cfd63cf32021fa3b Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Thu, 14 Sep 2023 13:42:35 -0400 Subject: [PATCH 146/576] Documentation Update: Add linux ssh guide (#1527) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .rstcheck.cfg | 1 + docs/requirements.txt | 1 + docs/source/about/advanced_usage.rst | 12 +- .../about/{ => guides}/app_examples.rst | 44 +- docs/source/about/guides/guides.rst | 10 + .../about/guides/linux/headless_ssh.rst | 526 ++++++++++++++++++ docs/source/about/guides/linux/linux.rst | 9 + docs/source/about/usage.rst | 37 +- docs/source/conf.py | 1 + docs/source/contributing/testing.rst | 5 + docs/source/toc.rst | 2 +- docs/source/troubleshooting/linux.rst | 2 +- src_assets/common/assets/web/apps.html | 4 +- 13 files changed, 636 insertions(+), 18 deletions(-) rename docs/source/about/{ => guides}/app_examples.rst (90%) create mode 100644 docs/source/about/guides/guides.rst create mode 100644 docs/source/about/guides/linux/headless_ssh.rst create mode 100644 docs/source/about/guides/linux/linux.rst diff --git a/.rstcheck.cfg b/.rstcheck.cfg index 861085875ad..ca6beba81ae 100644 --- a/.rstcheck.cfg +++ b/.rstcheck.cfg @@ -6,4 +6,5 @@ ignore_directives = doxygenfile, include, mdinclude, + tab, todo, diff --git a/docs/requirements.txt b/docs/requirements.txt index ca4a60b9ccf..65b30e453ee 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,3 +5,4 @@ rstcheck[sphinx]==6.2.0 rstfmt==0.0.14 Sphinx==7.2.5 sphinx-copybutton==0.5.2 +sphinx_inline_tabs==2023.4.21 diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index 8c2dc3c60a1..c433a7cae09 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -866,10 +866,10 @@ capture or `nvlax `__. wlr Capture for wlroots based Wayland compositors via DMA-BUF. kms DRM/KMS screen capture from the kernel. This requires that sunshine has cap_sys_admin capability. - See :ref:`Linux Setup `. + See :ref:`Linux Setup `. x11 Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible. ========= =========== - + **Default** Automatic. Sunshine will use the first capture method available in the order of the table above. @@ -877,7 +877,7 @@ capture .. code-block:: text capture = kms - + encoder ^^^^^^^ @@ -992,7 +992,7 @@ nvenc_preset **Description** NVENC encoder performance preset. Higher numbers improve compression (quality at given bitrate) at the cost of increased encoding latency. - Recommended to change only when limited by network or decoder, otherwise similar effect can be accomplished by increasing bitrate. + Recommended to change only when limited by network or decoder, otherwise similar effect can be accomplished by increasing bitrate. .. Note:: This option only applies when using NVENC `encoder`_. @@ -1027,7 +1027,7 @@ nvenc_twopass **Description** Enable two-pass mode in NVENC encoder. This allows to detect more motion vectors, better distribute bitrate across the frame and more strictly adhere to bitrate limits. - Disabling it is not recommended since this can lead to occasional bitrate overshoot and subsequent packet loss. + Disabling it is not recommended since this can lead to occasional bitrate overshoot and subsequent packet loss. .. Note:: This option only applies when using NVENC `encoder`_. @@ -1058,7 +1058,7 @@ nvenc_realtime_hags **Description** Use realtime gpu scheduling priority in NVENC when hardware accelerated gpu scheduling (HAGS) is enabled in Windows. Currently NVIDIA drivers may freeze in encoder when HAGS is enabled, realtime priority is used and VRAM utilization is close to maximum. - Disabling this option lowers the priority to high, sidestepping the freeze at the cost of reduced capture performance when the GPU is heavily loaded. + Disabling this option lowers the priority to high, sidestepping the freeze at the cost of reduced capture performance when the GPU is heavily loaded. .. Note:: This option only applies when using NVENC `encoder`_. diff --git a/docs/source/about/app_examples.rst b/docs/source/about/guides/app_examples.rst similarity index 90% rename from docs/source/about/app_examples.rst rename to docs/source/about/guides/app_examples.rst index b2fea331c17..4cb45b7d5c1 100644 --- a/docs/source/about/app_examples.rst +++ b/docs/source/about/guides/app_examples.rst @@ -128,11 +128,53 @@ Changing Resolution and Refresh Rate (Linux - X11) +----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | **Field** | **Value** | +----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ -| Command Preparations | Do: ``sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --range ${SUNSHINE_CLIENT_FPS}"`` | +| Command Preparations | Do: ``sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --rate ${SUNSHINE_CLIENT_FPS}"`` | | +---------------------------------------------------------------------------------------------------------------------------------------+ | | Undo: ``xrandr --output HDMI-1 --mode 3840x2160 --rate 120`` | +----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ +.. hint:: + The above only works if the xrandr mode already exists. You will need to create new modes to stream to macOS and iOS devices, since they use non standard resolutions. + + You can update the ``Do`` command to this: + .. code-block:: bash + + bash -c "${HOME}/scripts/set-custom-res.sh \"${SUNSHINE_CLIENT_WIDTH}\" \"${SUNSHINE_CLIENT_HEIGHT}\" \"${SUNSHINE_CLIENT_FPS}\"" + + The ``set-custom-res.sh`` will have this content: + .. code-block:: bash + + #!/bin/bash + + # Get params and set any defaults + width=${1:-1920} + height=${2:-1080} + refresh_rate=${3:-60} + + # You may need to adjust the scaling differently so the UI/text isn't too small / big + scale=${4:-0.55} + + # Get the name of the active display + display_output=$(xrandr | grep " connected" | awk '{ print $1 }') + + # Get the modeline info from the 2nd row in the cvt output + modeline=$(cvt ${width} ${height} ${refresh_rate} | awk 'FNR == 2') + xrandr_mode_str=${modeline//Modeline \"*\" /} + mode_alias="${width}x${height}" + + echo "xrandr setting new mode ${mode_alias} ${xrandr_mode_str}" + xrandr --newmode ${mode_alias} ${xrandr_mode_str} + xrandr --addmode ${display_output} ${mode_alias} + + # Reset scaling + xrandr --output ${display_output} --scale 1 + + # Apply new xrandr mode + xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rotate normal --scale ${scale} + + # Optional reset your wallpaper to fit to new resolution + # xwallpaper --zoom /path/to/wallpaper.png + Changing Resolution and Refresh Rate (Linux - Wayland) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/about/guides/guides.rst b/docs/source/about/guides/guides.rst new file mode 100644 index 00000000000..3bda39ede6d --- /dev/null +++ b/docs/source/about/guides/guides.rst @@ -0,0 +1,10 @@ +Guides +====== + +Collection of guides written by the community! + +.. toctree:: + :maxdepth: 2 + + app_examples + linux/linux diff --git a/docs/source/about/guides/linux/headless_ssh.rst b/docs/source/about/guides/linux/headless_ssh.rst new file mode 100644 index 00000000000..1a4e9439b3e --- /dev/null +++ b/docs/source/about/guides/linux/headless_ssh.rst @@ -0,0 +1,526 @@ +Remote SSH Headless Setup +========================= + +.. csv-table:: Remote SSH Headless Setup + :header-rows: 0 + :stub-columns: 1 + + Author, `Eric Dong `__ + Difficulty, Intermediate + +This is a guide to setup remote SSH into host to startup X server and sunshine without physical login and dummy plug. +The virtual display is accelerated by the NVidia GPU using the TwinView configuration. + +.. attention:: + This guide is specific for Xorg and NVidia GPUs. I start the X server using the ``startx`` command. + I also only tested this on an Artix runit init system on LAN. + I didn't have to do anything special with pulseaudio (pipewire untested). + + Keep your monitors plugged in until the `Checkpoint`_ step + +.. tip:: + Prior to editing any system configurations, you should make a copy of the original file. + This will allow you to use it for reference or revert your changes easily. + +The Big Picture +--------------- +Once you are done, you will need to perform these 3 steps: + +#. Turn on the host machine +#. Start sunshine on remote host with a script that: + + - Edits permissions of ``/dev/uinput`` (added sudo config to execute script with no password prompt) + - Starts X server with ``startx`` on virtual display + - Starts ``Sunshine`` + +#. Startup Moonlight on the client of interest and connect to host + +.. hint:: + + As an alternative to SSH... + + **Step 2** can be replaced with autologin and starting sunshine as a service or putting + ``sunshine &`` in your ``.xinitrc`` file if you start your X server with ``startx``. + In this case, the workaround for ``/dev/uinput`` permissions is not needed because the udev rule would be triggered + for "physical" login. See :ref:`Linux Setup `. I personally think autologin compromises the + security of the PC, so I went with the remote SSH route. I use the PC more than for gaming, so I don't need a + virtual display everytime I turn on the PC (E.g running updates, config changes, file/media server). + +First we will setup the host and then the SSH Client (Which may not be the same as the machine running the +moonlight client) + +Host Setup +---------- + +We will be setting up: + +#. `Static IP Setup`_ +#. `SSH Server Setup`_ +#. `Virtual Display Setup`_ +#. `Uinput Permissions Workaround`_ +#. `Stream Launcher Script`_ + + +Static IP Setup +^^^^^^^^^^^^^^^ +Setup static IP Address for host. For LAN connections you can use DHCP reservation within your assigned range. +e.g. 192.168.x.x. This will allow you to ssh to the host consistently, so the assigned IP address does +not change. It is preferred to set this through your router config. + + +SSH Server Setup +^^^^^^^^^^^^^^^^ + +.. note:: + Most distros have OpenSSH already installed. If it is not present, install OpenSSH using your package manager. + +.. tab:: Debian/Ubuntu + + .. code-block:: bash + + sudo apt update + sudo apt install openssh-server + +.. tab:: Arch/Artix + + .. code-block:: bash + + sudo pacman -S openssh + # Install openssh- if you are not using SystemD + # e.g. sudo pacman -S openssh-runit + +.. tab:: Alpine + + .. code-block:: bash + + sudo apk update + sudo apk add openssh + +.. tab:: CentOS/RHEL/Fedora + + **CentOS/RHEL 7** + .. code-block:: bash + + sudo yum install openssh-server + + **CentOS/Fedora/RHEL 8** + .. code-block:: bash + + sudo dnf install openssh-server + +Next make sure the OpenSSH daemon is enabled to run when the system starts. + +.. tab:: SystemD + + .. code-block:: bash + + sudo systemctl enable sshd.service + sudo systemctl start sshd.service # Starts the service now + sudo systemctl status sshd.service # See if the service is running + +.. tab:: Runit + + .. code-block:: bash + + sudo ln -s /etc/runit/sv/sshd /run/runit/service # Enables the OpenSSH daemon to run when system starts + sudo sv start sshd # Starts the service now + sudo sv status sshd # See if the service is running + +.. tab:: OpenRC + + .. code-block:: bash + + rc-update add sshd # Enables service + rc-status # List services to verify sshd is enabled + rc-service sshd start # Starts the service now + +**Disabling PAM in sshd** + +I noticed when the ssh session is disconnected for any reason, ``pulseaudio`` would disconnect. +This is due to PAM handling sessions. When running ``dmesg``, I noticed ``elogind`` would say removed user session. +In this `Gentoo Forums post `__, +someone had a similar issue. Starting the X server in the background and exiting out of the console would cause your +session to be removed. + +.. caution:: + According to this `article `__ + disabling PAM increases security, but reduces certain functionality in terms of session handling. + *Do so at your own risk!* + +Edit the ``sshd_config`` file with the following to disable PAM. + +.. code-block:: text + + usePAM no + +After making changes to the ``sshd_config``, restart the sshd service for changes to take effect. + +.. tip:: + Run the command to check the ssh configuration prior to restarting the sshd service. + + .. code-block:: bash + + sudo sshd -t -f /etc/ssh/sshd_config + + An incorrect configuration will prevent the sshd service from starting, which might mean + losing SSH access to the server. + +.. tab:: SystemD + + .. code-block:: bash + + sudo systemctl restart sshd.service + +.. tab:: Runit + + .. code-block:: bash + + sudo sv restart sshd + +.. tab:: OpenRC + + .. code-block:: bash + + sudo rc-service sshd restart + + +Virtual Display Setup +^^^^^^^^^^^^^^^^^^^^^ + +As an alternative to a dummy dongle, you can use this config to create a virtual display. + +.. important:: + This is only available for NVidia GPUs using Xorg. + +.. hint:: + Use ``xrandr`` to see name of your active display output. Usually it starts with ``DP`` or ``HDMI``. For me, it is ``DP-0``. + Put this name for the ``ConnectedMonitor`` option under the ``Device`` section. + + .. code-block:: bash + + xrandr | grep " connected" | awk '{ print $1 }' + + +.. code-block:: xorg.conf + + Section "ServerLayout" + Identifier "TwinLayout" + Screen 0 "metaScreen" 0 0 + EndSection + + Section "Monitor" + Identifier "Monitor0" + Option "Enable" "true" + EndSection + + Section "Device" + Identifier "Card0" + Driver "nvidia" + VendorName "NVIDIA Corporation" + Option "MetaModes" "1920x1080" + Option "ConnectedMonitor" "DP-0" + Option "ModeValidation" "NoDFPNativeResolutionCheck,NoVirtualSizeCheck,NoMaxPClkCheck,NoHorizSyncCheck,NoVertRefreshCheck,NoWidthAlignmentCheck" + EndSection + + Section "Screen" + Identifier "metaScreen" + Device "Card0" + Monitor "Monitor0" + DefaultDepth 24 + Option "TwinView" "True" + SubSection "Display" + Modes "1920x1080" + EndSubSection + EndSection + +.. note:: + The ``ConnectedMonitor`` tricks the GPU into thinking a monitor is connected, + even if there is none actually connected! This allows a virtual display to be created that is accelerated with + your GPU! The ``ModeValidation`` option disables valid resolution checks, so you can choose any + resolution on the host! + + **References** + + - `issue comment on virtual-display-linux + `__ + - `Nvidia Documentation on Configuring TwinView + `__ + - `Arch Wiki Nvidia#TwinView `__ + - `Unix Stack Exchange - How to add virtual display monitor with Nvidia proprietary driver + `__ + + +Uinput Permissions Workaround +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**Steps** + +We can use ``chown`` to change the permissions from a script. Since this requires ``sudo``, +we will need to update the sudo configuration to execute this without being prompted for a password. + +#. Create a ``sunshine-setup.sh`` script to update permissions on ``/dev/uinput``. Since we aren't logged into the host, + the udev rule doesn't apply. +#. Update user sudo configuration ``/etc/sudoers.d/`` to allow the ``sunshine-setup.sh`` + script to be executed with ``sudo``. + +.. note:: + After I setup the :ref:`udev rule ` to get access to ``/dev/uinput``, + I noticed when I sshed into the host without physical login, the ACL permissions on ``/dev/uinput`` were not changed. + So I asked `reddit + `__. + I discovered that SSH sessions are not the same as a physical login. + I suppose it's not possible for SSH to trigger a udev rule or create a physical login session. + +**Setup Script** + +This script will take care of any precondtions prior to starting up sunshine. + +Run the following to create a script named something like ``sunshine-setup.sh``: + .. code-block:: bash + + echo "chown $(id -un):$(id -gn) /dev/uinput" > sunshine-setup.sh &&\ + chmod +x sunshine-setup.sh + +(**Optional**) To Ensure ethernet is being used for streaming, +you can block WiFi with ``rfkill``. + +Run this command to append the rfkill block command to the script: + .. code-block:: bash + + echo "rfkill block $(rfkill list | grep "Wireless LAN" \ + | sed 's/^\([[:digit:]]\).*/\1/')" >> sunshine-setup.sh + +**Sudo Configuration** + +We will manually change the permissions of ``/dev/uinput`` using ``chown``. +You need to use ``sudo`` to make this change, so add/update the entry in ``/etc/sudoers.d/${USER}`` + +.. danger:: + Do so at your own risk! It is more secure to give sudo and no password prompt to a single script, + than a generic executable like chown. + +.. warning:: + Be very careful of messing this config up. If you make a typo, *YOU LOSE THE ABILITY TO USE SUDO*. + Fortunately, your system is not borked, you will need to login as root to fix the config. + You may want to setup a backup user / SSH into the host as root to fix the config if this happens. + Otherwise you will need to plug your machine back into a monitor and login as root to fix this. + To enable root login over SSH edit your SSHD config, and add ``PermitRootLogin yes``, and restart the SSH server. + +#. First make a backup of your ``/etc/sudoers.d/${USER}`` file. + + .. code-block:: bash + + sudo cp /etc/sudoers.d/${USER} /etc/sudoers.d/${USER}.backup + +#. ``cd`` to the parent dir of the ``sunshine-setup.sh`` script. +#. Execute the following to update your sudoer config file. + + .. code-block:: bash + + echo "${USER} ALL=(ALL:ALL) ALL, NOPASSWD: $(pwd)/sunshine-setup.sh" \ + | sudo tee /etc/sudoers.d/${USER} + +These changes allow the script to use sudo without being prompted with a password. + +e.g. ``sudo $(pwd)/sunshine-setup.sh`` + + +Stream Launcher Script +^^^^^^^^^^^^^^^^^^^^^^ + +This is the main entrypoint script that will run the ``sunshine-setup.sh`` script, start up X server, and Sunshine. +The client will call this script that runs on the host via ssh. + + +**Sunshine Startup Script** + +This guide will refer to this script as ``~/scripts/sunshine.sh``. +The setup script will be referred as ``~/scripts/sunshine-setup.sh`` + +.. code-block:: bash + + #!/bin/bash + + export DISPLAY=:0 + + # Check existing X server + ps -e | grep X >/dev/null + [[ ${?} -ne 0 ]] && { + echo "Starting X server" + startx &>/dev/null & + [[ ${?} -eq 0 ]] && { + echo "X server started successfully" + } || echo "X server failed to start" + } || echo "X server already running" + + # Check if sunshine is already running + ps -e | grep -e .*sunshine$ >/dev/null + [[ ${?} -ne 0 ]] && { + sudo ~/scripts/sunshine-setup.sh + echo "Starting Sunshine!" + sunshine > /dev/null & + [[ ${?} -eq 0 ]] && { + echo "Sunshine started successfully" + } || echo "Sunshine failed to start" + } || echo "Sunshine is already running" + + # Add any other Programs that you want to startup automatically + # e.g. + # steam &> /dev/null & + # firefox &> /dev/null & + # kdeconnect-app &> /dev/null & + +---- + +SSH Client Setup +---------------- + +We will be setting up: + +#. `SSH Key Authentication Setup`_ +#. `SSH Client Script (Optional)`_ + +SSH Key Authentication Setup +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. Setup your SSH keys with ``ssh-keygen`` and use ``ssh-copy-id`` to authorize remote login to your host. + Run ``ssh @`` to login to your host. + SSH keys automate login so you don't need to input your password! +#. Optionally setup a ``~/.ssh/config`` file to simplify the ``ssh`` command + + .. code-block:: text + + Host + Hostname + User + IdentityFile ~/.ssh/ + + Now you can use ``ssh ``. + ``ssh `` will execute the command or script on the remote host. + +Checkpoint +^^^^^^^^^^ + +As a sanity check, let's make sure your setup is working so far! + +**Test Steps** + +With your monitor still plugged into your Sunshine host PC: + +#. ``ssh `` +#. ``~/scripts/sunshine.sh`` +#. ``nvidia-smi`` + + You should see the sunshine and Xorg processing running: + + .. code-block:: bash + + nvidia-smi + + *Output:* + + .. code-block:: console + + +---------------------------------------------------------------------------------------+ + | NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 | + |-----------------------------------------+----------------------+----------------------+ + | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | + | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | + | | | MIG M. | + |=========================================+======================+======================| + | 0 NVIDIA GeForce RTX 3070 Off | 00000000:01:00.0 On | N/A | + | 30% 46C P2 45W / 220W | 549MiB / 8192MiB | 2% Default | + | | | N/A | + +-----------------------------------------+----------------------+----------------------+ + + +---------------------------------------------------------------------------------------+ + | Processes: | + | GPU GI CI PID Type Process name GPU Memory | + | ID ID Usage | + |=======================================================================================| + | 0 N/A N/A 1393 G /usr/lib/Xorg 86MiB | + | 0 N/A N/A 1440 C+G sunshine 293MiB | + +---------------------------------------------------------------------------------------+ + +#. Check ``/dev/uinput`` permissions + + .. code-block:: bash + + ls -l /dev/uinput + + *Output:* + + .. code-block:: console + + crw------- 1 10, 223 Aug 29 17:31 /dev/uinput + +#. Connect to Sunshine host from a moonlight client + +Now kill X and sunshine by running ``pkill X`` on the host, +unplug your monitors from your GPU, and repeat steps 1 - 5. +You should get the same result. +With this setup you don't need to modify the Xorg config regardless if monitors are plugged in or not. + +.. code-block:: bash + + pkill X + + +SSH Client Script (Optional) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +At this point you have a working setup! For convenience I created this bash script to automate the +startup of the X server and Sunshine on the host. +This can be run on Unix systems, or on Windows using the ``git-bash`` or any bash shell. + +For Android/iOS you can install Linux emulators, e.g. ``Userland`` for Android and ``ISH`` for iOS. +The neat part is that you can execute one script to launch Sunshine from your phone or tablet! + +.. code-block:: bash + + #!/bin/bash + + ssh_args="@192.168.X.X" # Or use alias set in ~/.ssh/config + + check_ssh(){ + result=1 + # Note this checks infinitely, you could update this to have a max # of retries + while [[ $result -ne 0 ]] + do + echo "checking host..." + ssh $ssh_args "exit 0" 2>/dev/null + result=$? + [[ $result -ne 0 ]] && { + echo "Failed to ssh to $ssh_args, with exit code $result" + } + sleep 3 + done + echo "Host is ready for streaming!" + } + + start_stream(){ + echo "Starting sunshine server on host..." + echo "Start moonlight on your client of choice" + # -f runs ssh in the background + ssh -f $ssh_args "~/scripts/sunshine.sh &" + } + + check_ssh + start_stream + exit_code=${?} + + sleep 3 + exit ${exit_code} + +Next Steps +---------- + +Congrats you can now stream your desktop headless! When trying this the first time, +keep your monitors close by incase something isn't working right. + +If you have any feedback and any suggestions, feel free to make a post on Discord! + +.. seealso:: + Now that you have a virtual display, you may want to automate changing the resolution + and refresh rate prior to connecting to an app. See :ref:`Changing Resolution and + Refresh Rate ` for more information. diff --git a/docs/source/about/guides/linux/linux.rst b/docs/source/about/guides/linux/linux.rst new file mode 100644 index 00000000000..4af2a8c1aa2 --- /dev/null +++ b/docs/source/about/guides/linux/linux.rst @@ -0,0 +1,9 @@ +Linux +====== + +Collection of Sunshine Linux host guides. + +.. toctree:: + :maxdepth: 1 + + headless_ssh diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 705abd4c395..9967b453e30 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -22,13 +22,29 @@ Usage .. Attention:: The configuration file specified will be created if it doesn't exist. **Start Sunshine over SSH (Linux/X11)** + Assuming you are already logged into the host, you can use this command + + .. code-block:: bash + + ssh @ 'export DISPLAY=:0; sunshine' + + If you are logged into the host with only a tty (teletypewriter), you can use ``startx`` to start the + X server prior to executing sunshine. + You nay need to add ``sleep`` between ``startx`` and ``sunshine`` to allow more time for the display to be ready. + .. code-block:: bash - ssh -t @ 'startx &; export DISPLAY=:0; sunshine' + ssh @ 'startx &; export DISPLAY=:0; sunshine' - .. Note:: You could also utilize the ``~/.bash_profile`` or ``~/.bashrc`` files to setup the ``DISPLAY`` + .. tip:: You could also utilize the ``~/.bash_profile`` or ``~/.bashrc`` files to setup the ``DISPLAY`` variable. + .. seealso:: + + See :ref:`Remote SSH Headless Setup + ` on + how to setup a headless streaming server without autologin and dummy plugs (X11 + NVidia GPUs) + #. Configure Sunshine in the web ui The web ui is available on `https://localhost:47990 `__ by default. You may replace @@ -251,7 +267,7 @@ Application List - ``working-dir`` - The working directory to use. If not specified, Sunshine will use the application directory. -- For more examples see :ref:`app examples `. +- For more examples see :ref:`app examples `. Considerations -------------- @@ -281,10 +297,17 @@ You must have an HDR-capable display or EDID emulator dongle connected to your h - Older games that use NVIDIA-specific NVAPI HDR rather than native Windows 10 OS HDR support may not display in HDR. - Some GPUs can produce lower image quality or encoding performance when streaming in HDR compared to SDR. -Tutorials ---------- -Tutorial videos are available `here `__. +.. seealso:: + `Arch wiki on HDR Support for Linux `__ and + `Reddit Guide for HDR Support for AMD GPUs + `__ + +Tutorials and Guides +-------------------- +Tutorial videos are available `here `_. + +Guides are available :doc:`here <./guides/guides>`. .. admonition:: Community! - Tutorials are community generated. Want to contribute? Reach out to us on our discord server. + Tutorials and Guides are community generated. Want to contribute? Reach out to us on our discord server. diff --git a/docs/source/conf.py b/docs/source/conf.py index e581783865f..08a03759994 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -51,6 +51,7 @@ 'sphinx.ext.graphviz', # enable graphs for breathe 'sphinx.ext.viewcode', # add links to view source code 'sphinx_copybutton', # add a copy button to code blocks + 'sphinx_inline_tabs', # add tabs ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/contributing/testing.rst b/docs/source/contributing/testing.rst index 716e21ce260..e3ed073447a 100644 --- a/docs/source/contributing/testing.rst +++ b/docs/source/contributing/testing.rst @@ -20,6 +20,11 @@ sphinx docs. Installation and setup of python will not be covered here. Doxygen is used to generate the XML files required by Sphinx. Doxygen can be obtained from `Doxygen downloads `__. Ensure that the `doxygen` executable is in your path. +.. seealso:: + Sphinx is configured to use the graphviz extension. To obtain the dot executable from the Graphviz library, + see the `library’s downloads section `__. + + The config file for Sphinx is `docs/source/conf.py`. This is already included in the repo and should not be modified. The config file for Doxygen is `docs/Doxyfile`. This is already included in the repo and should not be modified. diff --git a/docs/source/toc.rst b/docs/source/toc.rst index e4c4398bda6..6121e4402e3 100644 --- a/docs/source/toc.rst +++ b/docs/source/toc.rst @@ -7,7 +7,7 @@ about/docker about/third_party_packages about/usage - about/app_examples + about/guides/guides about/advanced_usage about/changelog diff --git a/docs/source/troubleshooting/linux.rst b/docs/source/troubleshooting/linux.rst index 5646a1d2f2a..7458aa587d2 100644 --- a/docs/source/troubleshooting/linux.rst +++ b/docs/source/troubleshooting/linux.rst @@ -32,4 +32,4 @@ If screencasting fails with KMS, you may need to run the following to force unpr Gamescope compatibility ----------------------- -Some users have reported stuttering issues when streaming games running within Gamescope. +Some users have reported stuttering issues when streaming games running within Gamescope. diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 760a00074f6..f8257ccaf5b 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -318,9 +318,9 @@ SUNSHINE_CLIENT_AUDIO_CONFIGURATIONThe Audio Configuration requested by the client (2.0/5.1/7.1)
Example - QRes for Resolution Automation:
cmd /C <qres path>\QRes.exe /X:%SUNSHINE_CLIENT_WIDTH% /Y:%SUNSHINE_CLIENT_HEIGHT%
-
Example - Xrandr for Resolution Automation:
sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --range 60"
+
Example - Xrandr for Resolution Automation:
sh -c "xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}\" --rate 60"
Example - displayplacer for Resolution Automation:
sh -c "displayplacer "id: res:${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} hz:60 scaling:on origin:(0,0) degree:0""
- +
From 42dfe9ab4e5ec16aa1e010fcd26f979374231236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:24:07 -0400 Subject: [PATCH 147/576] build(deps): bump sphinx from 7.2.5 to 7.2.6 (#1636) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 65b30e453ee..ecdb40c475f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,6 +3,6 @@ furo==2023.9.10 m2r2==0.3.3.post2 rstcheck[sphinx]==6.2.0 rstfmt==0.0.14 -Sphinx==7.2.5 +Sphinx==7.2.6 sphinx-copybutton==0.5.2 sphinx_inline_tabs==2023.4.21 From 457c58d6f37f6d99198f64488db9c67e864920c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:44:07 -0400 Subject: [PATCH 148/576] build(deps): bump bootstrap from 5.3.1 to 5.3.2 (#1642) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76e3bec701c..f5152b6a54a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@fortawesome/fontawesome-free": "6.4.2", - "bootstrap": "5.3.1", + "bootstrap": "5.3.2", "vue": "2.6.12" } } From 4cd78d56291a60a309289c70905dd9f14768067e Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Sat, 16 Sep 2023 00:48:51 +0000 Subject: [PATCH 149/576] Event Ballons and Tray Icon improvements (#1561) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .gitmodules | 2 +- cmake/compile_definitions/linux.cmake | 10 +- cmake/packaging/linux.cmake | 9 +- src/main.cpp | 14 +++ src/main.h | 2 + src/nvhttp.cpp | 5 +- src/process.cpp | 17 ++- src/process.h | 3 +- src/stream.cpp | 9 ++ src/system_tray.cpp | 97 ++++++++++++++++++ src/system_tray.h | 8 ++ .../assets/web/images/sunshine-locked-16.png | Bin 0 -> 737 bytes .../assets/web/images/sunshine-locked-45.png | Bin 0 -> 2345 bytes .../assets/web/images/sunshine-locked.ico | Bin 0 -> 50366 bytes .../assets/web/images/sunshine-locked.png | Bin 0 -> 15989 bytes .../assets/web/images/sunshine-locked.svg | 75 ++++++++++++++ .../assets/web/images/sunshine-pausing-16.png | Bin 0 -> 756 bytes .../assets/web/images/sunshine-pausing-45.png | Bin 0 -> 2169 bytes .../assets/web/images/sunshine-pausing.ico | Bin 0 -> 48209 bytes .../assets/web/images/sunshine-pausing.png | Bin 0 -> 13435 bytes .../assets/web/images/sunshine-pausing.svg | 84 +++++++++++++++ .../assets/web/images/sunshine-playing-16.png | Bin 0 -> 779 bytes .../assets/web/images/sunshine-playing-45.png | Bin 0 -> 2386 bytes .../assets/web/images/sunshine-playing.ico | Bin 0 -> 50975 bytes .../assets/web/images/sunshine-playing.png | Bin 0 -> 16123 bytes .../assets/web/images/sunshine-playing.svg | 89 ++++++++++++++++ third-party/tray | 2 +- 27 files changed, 415 insertions(+), 11 deletions(-) create mode 100644 src_assets/common/assets/web/images/sunshine-locked-16.png create mode 100644 src_assets/common/assets/web/images/sunshine-locked-45.png create mode 100644 src_assets/common/assets/web/images/sunshine-locked.ico create mode 100644 src_assets/common/assets/web/images/sunshine-locked.png create mode 100644 src_assets/common/assets/web/images/sunshine-locked.svg create mode 100644 src_assets/common/assets/web/images/sunshine-pausing-16.png create mode 100644 src_assets/common/assets/web/images/sunshine-pausing-45.png create mode 100644 src_assets/common/assets/web/images/sunshine-pausing.ico create mode 100644 src_assets/common/assets/web/images/sunshine-pausing.png create mode 100644 src_assets/common/assets/web/images/sunshine-pausing.svg create mode 100644 src_assets/common/assets/web/images/sunshine-playing-16.png create mode 100644 src_assets/common/assets/web/images/sunshine-playing-45.png create mode 100644 src_assets/common/assets/web/images/sunshine-playing.ico create mode 100644 src_assets/common/assets/web/images/sunshine-playing.png create mode 100644 src_assets/common/assets/web/images/sunshine-playing.svg diff --git a/.gitmodules b/.gitmodules index dc00523bac2..bbb705eecb1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,7 +48,7 @@ branch = master [submodule "third-party/tray"] path = third-party/tray - url = https://github.com/dmikushin/tray + url = https://github.com/LizardByte/tray branch = master [submodule "third-party/nvapi-open-source-sdk"] path = third-party/nvapi-open-source-sdk diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index 4663e1d0a57..c88b62b2beb 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -157,14 +157,18 @@ endif() if(${SUNSHINE_ENABLE_TRAY}) pkg_check_modules(APPINDICATOR appindicator3-0.1) if(NOT APPINDICATOR_FOUND) + pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1) + endif() + pkg_check_modules(LIBNOTIFY libnotify) + if(NOT APPINDICATOR_FOUND OR NOT LIBNOTIFY_FOUND) message(WARNING "Missing appindicator, disabling tray icon") set(SUNSHINE_TRAY 0) else() - include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS}) - link_directories(${APPINDICATOR_LIBRARY_DIRS}) + include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS}) + link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS}) list(APPEND PLATFORM_TARGET_FILES third-party/tray/tray_linux.c) - list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${APPINDICATOR_LIBRARIES}) + list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${APPINDICATOR_LIBRARIES} ${LIBNOTIFY_LIBRARIES}) endif() else() set(SUNSHINE_TRAY 0) diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index 7935f9a99c4..99a9c9ef8be 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -69,7 +69,14 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # tray icon if(${SUNSHINE_TRAY} STREQUAL 1) - install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-playing.svg" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-pausing.svg" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-locked.svg" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ ${CPACK_DEBIAN_PACKAGE_DEPENDS}, \ diff --git a/src/main.cpp b/src/main.cpp index e5352d1bf8f..c04e5dcd0e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -390,6 +390,20 @@ launch_ui() { platf::open_url(url); } +/** + * @brief Launch the Web UI at a specific endpoint. + * + * EXAMPLES: + * ```cpp + * launch_ui_with_path("/pin"); + * ``` + */ +void +launch_ui_with_path(std::string path) { + std::string url = "https://localhost:" + std::to_string(map_port(confighttp::PORT_HTTPS)) + path; + platf::open_url(url); +} + /** * @brief Flush the log. * diff --git a/src/main.h b/src/main.h index a47976621d8..8eb3e7ee277 100644 --- a/src/main.h +++ b/src/main.h @@ -48,6 +48,8 @@ std::uint16_t map_port(int port); void launch_ui(); +void +launch_ui_with_path(std::string path); // namespaces namespace mail { diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index 962310f3a79..50819e8e706 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -29,6 +29,7 @@ #include "platform/common.h" #include "process.h" #include "rtsp.h" +#include "system_tray.h" #include "utility.h" #include "uuid.h" #include "video.h" @@ -507,7 +508,6 @@ namespace nvhttp { auto ptr = map_id_sess.emplace(sess.client.uniqueID, std::move(sess)).first; ptr->second.async_insert_pin.salt = std::move(get_arg(args, "salt")); - if (config::sunshine.flags[config::flag::PIN_STDIN]) { std::string pin; @@ -517,6 +517,9 @@ namespace nvhttp { getservercert(ptr->second, tree, pin); } else { +#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1 + system_tray::update_tray_require_pin(); +#endif ptr->second.async_insert_pin.response = std::move(response); fg.disable(); diff --git a/src/process.cpp b/src/process.cpp index 83ada3469b2..d018f4753ed 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -24,6 +24,7 @@ #include "crypto.h" #include "main.h" #include "platform/common.h" +#include "system_tray.h" #include "utility.h" #ifdef _WIN32 @@ -116,7 +117,6 @@ namespace proc { _app_id = app_id; _app = *iter; - _app_prep_begin = std::begin(_app.prep_cmds); _app_prep_it = _app_prep_begin; @@ -244,9 +244,8 @@ namespace proc { void proc_t::terminate() { + bool has_run = _app_id > 0; std::error_code ec; - - // Ensure child process is terminated placebo = false; process_end(_process, _process_handle); _process = bp::child(); @@ -279,6 +278,13 @@ namespace proc { } _pipe.reset(); +#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1 + // Only show the Stopped notification if we actually have an app to stop + // Since terminate() is always run when a new app has started + if (proc::proc.get_last_run_app_name().length() > 0 && has_run) { + system_tray::update_tray_stopped(proc::proc.get_last_run_app_name()); + } +#endif } const std::vector & @@ -304,6 +310,11 @@ namespace proc { return validate_app_image_path(app_image_path); } + std::string + proc_t::get_last_run_app_name() { + return _app.name; + } + proc_t::~proc_t() { // It's not safe to call terminate() here because our proc_t is a static variable // that may be destroyed after the Boost loggers have been destroyed. Instead, diff --git a/src/process.h b/src/process.h index 25aa1714e26..5e658146db5 100644 --- a/src/process.h +++ b/src/process.h @@ -82,7 +82,8 @@ namespace proc { get_apps(); std::string get_app_image(int app_id); - + std::string + get_last_run_app_name(); void terminate(); diff --git a/src/stream.cpp b/src/stream.cpp index 8b8497e28ca..c212b255f8c 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -25,6 +25,7 @@ extern "C" { #include "stat_trackers.h" #include "stream.h" #include "sync.h" +#include "system_tray.h" #include "thread_safe.h" #include "utility.h" @@ -1732,6 +1733,11 @@ namespace stream { // If this is the last session, invoke the platform callbacks if (--running_sessions == 0) { +#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1 + if (proc::proc.running()) { + system_tray::update_tray_pausing(proc::proc.get_last_run_app_name()); + } +#endif platf::streaming_will_stop(); } @@ -1776,6 +1782,9 @@ namespace stream { // If this is the first session, invoke the platform callbacks if (++running_sessions == 1) { platf::streaming_will_start(); +#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1 + system_tray::update_tray_playing(proc::proc.get_last_run_app_name()); +#endif } return 0; diff --git a/src/system_tray.cpp b/src/system_tray.cpp index bc082f158cb..99a30222fbd 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -10,10 +10,19 @@ #include #include #define TRAY_ICON WEB_DIR "images/favicon.ico" + #define TRAY_ICON_PLAYING WEB_DIR "images/sunshine-playing.ico" + #define TRAY_ICON_PAUSING WEB_DIR "images/sunshine-pausing.ico" + #define TRAY_ICON_LOCKED WEB_DIR "images/sunshine-locked.ico" #elif defined(__linux__) || defined(linux) || defined(__linux) #define TRAY_ICON "sunshine" + #define TRAY_ICON_PLAYING "sunshine-playing" + #define TRAY_ICON_PAUSING "sunshine-pausing" + #define TRAY_ICON_LOCKED "sunshine-locked" #elif defined(__APPLE__) || defined(__MACH__) #define TRAY_ICON WEB_DIR "images/logo-sunshine-16.png" + #define TRAY_ICON_PLAYING WEB_DIR "images/sunshine-playing-16.png" + #define TRAY_ICON_PAUSING WEB_DIR "images/sunshine-pausing-16.png" + #define TRAY_ICON_LOCKED WEB_DIR "images/sunshine-locked-16.png" #include #endif @@ -268,5 +277,93 @@ namespace system_tray { return 0; } + /** + * @brief Sets the tray icon in playing mode and spawns the appropriate notification + * @param app_name The started application name + */ + void + update_tray_playing(std::string app_name) { + tray.notification_title = NULL; + tray.notification_text = NULL; + tray.notification_cb = NULL; + tray.notification_icon = NULL; + tray.icon = TRAY_ICON_PLAYING; + tray_update(&tray); + tray.icon = TRAY_ICON_PLAYING; + tray.notification_title = "Stream Started"; + char msg[256]; + sprintf(msg, "Streaming started for %s", app_name.c_str()); + tray.notification_text = msg; + tray.tooltip = msg; + tray.notification_icon = TRAY_ICON_PLAYING; + tray_update(&tray); + } + + /** + * @brief Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification + * @param app_name The paused application name + */ + void + update_tray_pausing(std::string app_name) { + tray.notification_title = NULL; + tray.notification_text = NULL; + tray.notification_cb = NULL; + tray.notification_icon = NULL; + tray.icon = TRAY_ICON_PAUSING; + tray_update(&tray); + char msg[256]; + sprintf(msg, "Streaming paused for %s", app_name.c_str()); + tray.icon = TRAY_ICON_PAUSING; + tray.notification_title = "Stream Paused"; + tray.notification_text = msg; + tray.tooltip = msg; + tray.notification_icon = TRAY_ICON_PAUSING; + tray_update(&tray); + } + + /** + * @brief Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification + * @param app_name The started application name + */ + void + update_tray_stopped(std::string app_name) { + tray.notification_title = NULL; + tray.notification_text = NULL; + tray.notification_cb = NULL; + tray.notification_icon = NULL; + tray.icon = TRAY_ICON; + tray_update(&tray); + char msg[256]; + sprintf(msg, "Application %s successfully stopped", app_name.c_str()); + tray.icon = TRAY_ICON; + tray.notification_icon = TRAY_ICON; + tray.notification_title = "Application Stopped"; + tray.notification_text = msg; + tray.tooltip = "Sunshine"; + tray_update(&tray); + } + + /** + * @brief Spawns a notification for PIN Pairing. Clicking it opens the PIN Web UI Page + */ + void + update_tray_require_pin() { + tray.notification_title = NULL; + tray.notification_text = NULL; + tray.notification_cb = NULL; + tray.notification_icon = NULL; + tray.icon = TRAY_ICON; + tray_update(&tray); + tray.icon = TRAY_ICON; + tray.notification_title = "Incoming Pairing Request"; + tray.notification_text = "Click here to complete the pairing process"; + tray.notification_icon = TRAY_ICON_LOCKED; + tray.tooltip = "Sunshine"; + tray.notification_cb = []() { + launch_ui_with_path("/pin"); + }; + tray_update(&tray); + } + } // namespace system_tray #endif diff --git a/src/system_tray.h b/src/system_tray.h index 18e3445f6bc..f824c8a13be 100644 --- a/src/system_tray.h +++ b/src/system_tray.h @@ -27,5 +27,13 @@ namespace system_tray { run_tray(); int end_tray(); + void + update_tray_playing(std::string app_name); + void + update_tray_pausing(std::string app_name); + void + update_tray_stopped(std::string app_name); + void + update_tray_require_pin(); } // namespace system_tray diff --git a/src_assets/common/assets/web/images/sunshine-locked-16.png b/src_assets/common/assets/web/images/sunshine-locked-16.png new file mode 100644 index 0000000000000000000000000000000000000000..a7a3e88d0c684369cbb4ca6d0740fbf2f33e3015 GIT binary patch literal 737 zcmV<70v`Q|P)$`&HpD9FBu+;!dtuH^&Q=R$M* zVd`A`JrRMg9WOT+y=sJW3E8ytwBV!s4a3LZAcuJBQl%{bApNYg#4J%AMo2Yn1p@$U zP%(_LFe9T%0DuI4VnnlxXvqA`2XuCJwn-`PanAi(t&F!@V$Onc3_&(W&wj}mYh*$d zf@>|y>XA~GYOPm7A-i?JIoiT}Y>~jGxns=Kf+$EpdEWaP#%0qqi_+=z_2lsf=l$8Q zZqBrebCw|j6%}Kgv?@i8NdWcu=-Ia(P9~FkT-QBCL^;c&Za*J7{b_bNNK8uatD?r4 zE*#{76XvzzCZ#;kw$sOly=`b%{R{v?h~8K%7H5nh6bc<)MjYFGf8_H)yGGB>c5oSq zi~?9t<3X2JjVjGBLL=TmJ#2N`zU7^avAmNoO_OV_;~Zy49R~J@94_3Eh^r<7hMMu7 z&{NhONp5JXkqQ9tO#bN3mQ|F4(5|Pge??LS+HV%%KDlNhadT;R<^$iZc5wki&2jA% z8y7_p?0lf>x&&Zq!*858ROz)fI|9KEKx%V%N1gv&G*P!Ay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LyVUexJ=|-*UqZH{_KZ*BO8j&?ZdBAD6vW)x29gIYTYWNvqL}6u)Gt2NF|=3K9c} z0dXBO^y#sZ27Xa?B3a2NKFTqLxxKfy_aisncw^q7?alxMpzWPUG#D>?sWrUb7?vwk z!|e6{oT{QeEuF z=@>uzfRC+Px9&URy^u2id9d%TM^+?^|3(|JXXEh_@uY#M&cPd@ds;w26+}VJkcU37 zg{iP)fgQj$U>hpWTF*Y#nk{|eYYX4fOFiQsp+;7S$Wm)qEJo+zQ6*>$Bc7n1n!Nn+R)iLm7C~B2Jpj^TjkX9pCo0>r z*56jWY+183Juqszm@BWmvLqIZT?||boLKDV=E%uzRs9xl)B5%6cNOx&&HxmV1Mgi~ z8INX5vnEz5;u}@(V5nCtOS-o#)idyW)xzi7`_h>emTRuL=2+kN-vqo0IEnsk#*U)W z4Lqf)_Zwq=xn;|i`|r8uo(W0p=nR145E>gBYgBb9P$42NdBEh61v;&@d)KdD-&|~A s91e%W;cz${4u`|xa5x+e#|+{B1Dve16V&x$qW}N^07*qoM6N<$g8qsg0{{R3 literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-locked.png b/src_assets/common/assets/web/images/sunshine-locked.png new file mode 100644 index 0000000000000000000000000000000000000000..e18daef050168b63c7a72348bc01a8f7b6904837 GIT binary patch literal 15989 zcmYjYWmFtZu${#v1a}Q?f#9w|1Hs+hEw}_&ASAfEyDSM#aF*aM2@>2rxU04D@Rku1)O+_9HgA4-z04zlX84Umc!5={Y8VdYo)!t^(4cFD6?~A?Q&!JY)78e)$K2f-@bU5Cuy=9vurznG=5Tel%{~z&0{|L8QASG3 zH|IFlFT+SX^F`vcwdrPcA^jwQuqTeam>Z+d*fT|4N@j-%ZGS(4uDFEU%|b*PPwLaM zToR63AC?vcr7eYk8j6f;A{gxpyVV@nOgU~6Dg(Sbj zp*o07rDQRau&F2+&ThyAQYGpkfd1E$X&vDk?oDL9eE8F09r<5QNWcsi%t6?)y#*H8 zr4d|x5JdG)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o}pyM&R`_Jeg+iD`~^7@ zECa6C^$hgq?Mlhl&XbeFIFGMaHgh>WI)V-DNxa;L8ZZ3-?h3Xj2jB9k>|#uw`CIB0 zseNNBB29=XB30AvMl>>cT;h~|Vf|7F4a0t>B-{UMjw4T#(_Xx{DOnLmt()H;qGoK4 zrN@Ye8WL;(U-jlF=OGM95QYEI$YI8(wf*o8ZNUy13jGgyw(C|0c~k`j7)1qTP$;$e z8Jed3Fwh=C+5K88@0{Xv`loXLmT5M;efkd+le=bHwJC;=#Vjo1JBw9UJ{B9mP_p+! zX|L@4gc9WzRh3*?Nq6=a ziRa6dUeUy-=Hr3IU!z;$y-%C)P9*nrjP=G)iCXK9zvU1gkf|P=l(;N)`imh+Y9BZm zm1QTWnaGuhfjeIzEN|3FOR5o=I=uSpWqx91_E#1{Z^6#`!%>aIu-D3Eh%Ts{$8GGd zhK@fNT5%XSkYVby^z*o@{j@7U89~GVR7)Z2;o;E<;Xr`M_Mu>tNN`K0@A;w5)tEwU zJE$CxyDc&Yl!dSb;n6nr|2te=_rGVZpCz<0CRV+7?fBtG#sNiH6`5*jv(Wzm{E7^z literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-locked.svg b/src_assets/common/assets/web/images/sunshine-locked.svg new file mode 100644 index 00000000000..6a5078658c5 --- /dev/null +++ b/src_assets/common/assets/web/images/sunshine-locked.svg @@ -0,0 +1,75 @@ + + + + diff --git a/src_assets/common/assets/web/images/sunshine-pausing-16.png b/src_assets/common/assets/web/images/sunshine-pausing-16.png new file mode 100644 index 0000000000000000000000000000000000000000..af4e455179388bac7087c08ec17afb5be3fdb6fe GIT binary patch literal 756 zcmVL?KzwqM(J*s+L6r(aue- zgdUp$Hz|Tb)S@;L5-ki-2MH2KG#wLX<~rj{&b{}$r-cqUKJdWVoOAxa^I}AV!z_KZ zKFYaW#b7IJOH@cV?0~@r@%eY5Si=qi6kgOcnxHdmK^ybDi?0^rdPjX1e0apXcE5jU zei#5iL?v#GhPsWf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assets/web/images/sunshine-pausing.ico new file mode 100644 index 0000000000000000000000000000000000000000..6d459a744efbaeecf95a3d80e3cf6ac5201953b6 GIT binary patch literal 48209 zcmeEv2{=_<_xLf-Lz!pyULh)Jl4K}^2Bi$COev)lO=vJRDHWBHDTy*ADW%LxhRj6f zDUu3zFx|`L{P(%JUU`XB-}n8V=YKrgy62p|*IsL%z4uvrt+m&IAR34f;^u|`l!W%v zLy!#wL4tzc&o8k+P%*eBDf#_83gk29grLQXN6+U$(1umt6}%5n2ENI1qg2 zmV@#aAxIXSgQDQd_v-*a5Ww3B0Fov1Qod3l%-wUe+{+_Be3{8ax<$$dT7m+RNY)TU#G z;Tj0W7I6?iBw-e`z2!?r&XLsgS}>GS-W{eF3ncoB1`^@%X@2n6p@tms0VMC2eBKfL zhJRKb3N*RLZyc&Wrv7Mxv+<7BN{;opqK~3|5{^U5# z&hh2tV_-&5wp%!qG{pLj3^SDt6Pe0J;+ac_FNqenKddgmkdgcyg}m@q`&aj$M(GcY zFE1Q0xCE)2<29vhJyR(xO>L9%=i+lZ3%J{n{9j6VN7Ta0I#Z%Gzx_}?kf#52uq>NA)@iA-BaQVdYlb+YXoMIjWerSFC0NT1&6UieG*26#N)nGGADJ(K+ znF$wBjy*PLecUj{0yoxPyiW#g*x!&JOvpOvsgw?3Gui;xEoq5GhRE14CxPV5{&sNx z*o7&6pjENg(8jpJ$!_z-lMT622KPcSFx_PLrBu4)(R#R#C{vvFWcQJ4BJMA_6nOEiO% zOpx41698a#f*>&EKwz4oq4`G`002Q? z4%reJlJidz^+M3pri&h~ zOBbyeOKGCz$h=)*e<2b`Oa^n<9Wj@_QySZg ze9K?SQRY4BSgTH#tU_?i1V6x|BN{~fjLa*OrA2o?4phCK*H6Wbz_fUEGRl&mIvsxD z!2VSL=ip>`sn-_WZG}rR7mT$5f9F#Fpfc;53ixa9SZ__N}adoa2*E@mnnE(P=UKymiMAL!3ZS^5n;|AM;#*6`H$i7^O%!Eh4HTr!Fm;A1Kq(uE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Xg#??s}Do%y)d*3*_g zsZbKB#f`{UH=nw6$5>^iyvjKy#xV~)6y4ocagJE?Pl!!~ZBHOXS{3>4EvFs!KwhtV zt9nh-p1x)vyVSz4-3*8YHVAUvrqh;OkGP-`4u`|xa5x+ehhsngAN&|)>GyFA!2kdN M07*qoM6N<$f=q9vAOHXW literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-pausing.png b/src_assets/common/assets/web/images/sunshine-pausing.png new file mode 100644 index 0000000000000000000000000000000000000000..4e158195712b01c441dd4c37611555ffb5bf3e4d GIT binary patch literal 13435 zcmV->G=$5EP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H1AOJ~3 zK~#90?Y((?-Bq3c|9qd%-LfYwbWOUK7A&m`jtJONL{N}%8}NsUvK16p9M|tKV&^+5 zIylbgD0ZRn6CD*49TyZ7$|55w2($%(E-6i0D1~NE?)EwF?;lA@l6!A*Z*sRJ=lOV~ zP0r_>^LgLozV11nbKd9u7FEUJ=v}w8F=_1rQJHH+XA3k5%v7NPr5>mUsRym-Z&Cq7 z`oC`nEYJb!gLDZb6uL!;so@ZCP~o7ldO(eN&iDNT^)-R#_~y=73104mMx1D;5EqEo zS+j772rDgSm8dQUmI^FUs2r)OAPH+VAr`Bs94%Lgt04@kA`%b*g%E;_)ZZWuBRr+b zb_3g0WP8%n9Ss|Hw~yzgPG+2FCo!#8E}j=m$m`YU>rg#ekX6IPY4N3t1aVDhfP_@5 zPk^MNN$DFqE#Qyg=BEEEpok}6KmtHWApjD>$HN<;hi8H93Xd4kd#WqFKex95AU@t0r z5&JC2Uf;;GKFPhuZf$;kOg4#_7f)R_%LM&-o=+oU7b|iCa02M@AXQ`Pmp;L21(-^p zTKlHhsdTI8uSCs{YpnkpZfcH>^?nlpC)$a?1>&{WEPSI;c{jp4fCenB+RG8!!5n&| zV)!&yAu7l=LH~;ISA70j*BaT*jvbjLT_D?A4=+AmR9~wquR}Oplx1V>PAWjE6{-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cEJD`yHkiyLi>tk_$x)G*Xr9rTDY3qqt#kLz`Iy7mzY#`Aci6vj+su%L= z&DHkCMe{Xb&J%bW0ZtdRB6T>5Km?$|g}+2Krgle70?RZ?~*o z@&Ll!V$B1!y|sVk;R2kaytuh7+!y|}Bwjeroiw+yvLBd7hvcD4R@1$o^lEou=?Q{*%hP{jaks~5*)&5}Ke?gH7P zA}iS2)X?^!Cz#SZpJTPH=cWeK*oZNeY@VR=qi+3aFHDyQ;Z2G+5sBw+r7R1{$1}E0>=U01bRnnGiec!2uLX% zH62A`!isi)y8E7LuD@^B#{)?gi1HcWnNr(S3`BrR#T=`c`HE>&q+--&j!8iIFGOWY z^@F=!0R9b;>)X~WK3y#9RCp(aS+pt*L68cNN{~vO1RuGMu`p>wdlXfzhpoWYBPTDd zm54o8;GMu*P^l`ldD$XD|HhIc5rK#zlkczP7z2~~Z7}VjogMTan(ugX(=?Te^YQFE z#Bh=(nXYk#L>X+R20=nV2qXv+RtPa@pEo}X<+Bg%%}YO%3D5dWKk{6u%@{%?HuCb! zq!#U9YJb~u1lRyG}PU(b2oikN8dbJC?ehGFIwT_ooKBtGXY&F zqH{4a6HlirREcOn!~`rF5R%g~hsYx9B?HzeegCd9W z+h3{4*XxnqN#sD+>qMJRu2owHtw3ujwoDVzo~@xso-)0++_bDs{oj~bS#20jr2KavS=_fp&&z|S~?&&$k*sqH6RwiDSiYVwGv3$Py dtP}q9{{V|QE-F@c4@&?5002ovPDHLkV1kRuB_sd< literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-pausing.svg b/src_assets/common/assets/web/images/sunshine-pausing.svg new file mode 100644 index 00000000000..0826be1d2eb --- /dev/null +++ b/src_assets/common/assets/web/images/sunshine-pausing.svg @@ -0,0 +1,84 @@ + + + + diff --git a/src_assets/common/assets/web/images/sunshine-playing-16.png b/src_assets/common/assets/web/images/sunshine-playing-16.png new file mode 100644 index 0000000000000000000000000000000000000000..8c59b5cb96ad269df183aa49c9c163b60e4d97e0 GIT binary patch literal 779 zcmV+m1N8ifP)le zK~y-6g_BEcj8PQF|L5NO%}m>AXAB*U=~p`X2(45+7Sa$TB!tBKu@Vc96~abDh_H}| z#6m(?Sg_HE2#M!{h(shJXrk4YRwo#=({I|+e&2le9-9u@5+^yEbMNne&;R5eVrKj+ z`c_rd3t^@ZjHF>TSr@`YJ-Uk9?QZ@K{Y}6&!MisqoPZl>3rQ;ShW_#*h^t^ zHq!L|8UTQqN2PzGbc6RGvV)r-$DT1WdK;_ioE6D#XKUp$W*#lz-kNaGdlKILH}KEw zTbMlUY)U?7W{7-yxf`WBWh7T`H4dEr=TJsM7K+EnA?a+dj4A*ayj&I!#`Pgtq8tAQ z0{}JX$!Mhrv79adz=Aj@OWl4n{P_4^x`Rqokw2RNPbrQHT$pDO(E?I>9BjX_V|IuA zEZLT9$k+V#*a5Fo87icH27M8p{8|gES`!xp`p+oVrF<3D-JXGIEZ}_9|jfr3R)mNWaXC5 z&#CrAALYSqx3PbzK2K;8W_PJH;*sW0(0-@cWq{$V1Kr5R$$`_4`== zuqrsy)!luZ7qdTNab%h5>jML`e{2&8JyR%1-7CzytgzRgaMox`>$0Bki%hs^)!Ul4 zJ%3smwT)d%Dnn62%b~;~SSI+n9L~ml{yNRPrDayCdHk;eega+`OBZ#pnD77q002ov JPDHLkV1oDLU+@3` literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-playing-45.png b/src_assets/common/assets/web/images/sunshine-playing-45.png new file mode 100644 index 0000000000000000000000000000000000000000..40698ddac722f9e8bd5452a2bb63546cb76d284c GIT binary patch literal 2386 zcmV-Y39a^tP)d1Z`E)erQ!ul#+-?DWoOp0~HC{LV@s5%R}HKjYEy?m||m-*sQ(Y_ue`Eu-=Vd zNgQKG>R-Cj-8nPo{_feMxie=(Rr!CDJ5!DaZfs~I=3GpMrQ*qKMJjR@wPGZOt1;u# z1KDE!6583`c{09bIwKwZ`jVwOA;0e>r~_k3^it+ zM)1p@%l)Bm@awlT(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|S44Mq8IQ5TWfQU1P|dD(2X zHQW;3DlbbRz$2zSULNHj<&bSJ8|ycSu-z^R?6Z4|Zl}4VcEYEBAc2tDimAfq^SwLV zEy?0!Iq-{yxed+X1L1RFMBO8?v#!pl90Eo~(bObx>W6YGt%=pC&}o!@grGt-uxO(@ zJMenY(lftjs_X!`8JFr0t8vpVC{J}P>$tWM^5UC5`Y5%d{yAV&MaO7=4elqV>VyY9Exe3H~ zoT`*(&_N#>bRamj^;YR%DV3j8dTz!w2!9ZjyV{o>ExeB_i=`i~e?o;#$8#zrStOVR z*CLLho3n@`zj4PG{#4Pe zsiMRxkkgOlT;nbppT3h1C+iS89HJ~zrU*ww8zO?<}V*$f44vLCyI@B?=y?Tw$@jV7yHWeThl;g}f zrGurM)>DaiF2FO^wRd(d>TI8k?-Q1K(>v-mT9La%IeU`4-6&74TJ2ui7fPNvHm7|l zAG3RAQ4}x6QEl^(Z+0x}cz%+;ffF3b^{zjov^W*$D6eW?o&HkYaz!sz*!aZ$=J0H}GGgu4lvS;n>+3N=avO>`| zN1Si9Ep2=Dv%*dpda??)gujYXRZ8jh{mb^Jr_=ZU038*h>6~iWGynhq07*qoM6N<$ Ef(m|$U;qFB literal 0 HcmV?d00001 diff --git a/src_assets/common/assets/web/images/sunshine-playing.ico b/src_assets/common/assets/web/images/sunshine-playing.ico new file mode 100644 index 0000000000000000000000000000000000000000..9ee524727faed2a511d713473180c78d25e386e9 GIT binary patch literal 50975 zcmeEvbzD^4^Y8^ERZ2QHz`*W60RGJR z*ZF)%7{k)x9f8pK91Zc7ielKfab3^q7{*e;Fdd!F=izfOEK&~;zz^Xw(Sh^_F>E+I zLsEFt`5pj<0p1z_=<4Z5&?yljYEc)F=TLo!^QfnY4*C0(b4KPVWe*?SQ+)1sBS+!_ z#1)LyDmxoasJJ(sBskXll9p#)lYCF^5c^1IQ%sxoYUtacQru~}?a zo9kj3Q=(k88N)H0kI9Eiza36jDJJZ}k`O2V{FDP*ccFBOK`qQ7H`|zEa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ju$e_jUyzgvSbbrH&LCzrf{3CrDAxQ>YrBAEM4M6BDk@K?*eA;uHE-ia zwGEpaeypNz&Y}G+2p?!(*8J;y85~d;rq`OUP^j8Uc!1QOqjX=gbQTGFwsklehdP7> zBFt0642+bEp$KCgLEPY-uE2g@|>R5(d3wjrm~Nm41I1|Vr{x8fWPQ4_)rBy6}lWaGW1J*7vu zJ3qdubzAH15tX-is1g^IuS=2K9E6RTUIZg#l>awQu`LK6Xj#@0tYfD!)Aq_^KswFKntzY5Hp}Zal + + + diff --git a/third-party/tray b/third-party/tray index 75106962a8e..2921d9628e1 160000 --- a/third-party/tray +++ b/third-party/tray @@ -1 +1 @@ -Subproject commit 75106962a8ec5abb86157908d12cb799147babb4 +Subproject commit 2921d9628e150c29f6e9f2ad86fd48b842aad5ca From ac0a3266ff1b99dcd35f744ca8fedc7911fc846b Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Sat, 16 Sep 2023 18:53:38 +0000 Subject: [PATCH 150/576] Show Fatal Logs in Web UI (#1648) --- src_assets/common/assets/web/index.html | 36 ++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src_assets/common/assets/web/index.html b/src_assets/common/assets/web/index.html index e83d43ee351..2fe713e63e8 100644 --- a/src_assets/common/assets/web/index.html +++ b/src_assets/common/assets/web/index.html @@ -1,6 +1,16 @@

Hello, Sunshine!

Sunshine is a self-hosted game stream host for Moonlight.

+
+
+ + Attention! Sunshine detected these errors during startup. These errors MUST be fixed before using + Sunshine.
+
+
    +
  • {{v.value}}
  • +
+
@@ -21,7 +31,8 @@

Version {{version}}

{{nightlyData.head_sha}}
{{nightlyData.display_title}}
@@ -83,6 +94,7 @@

Legal

githubVersion: null, nightlyData: null, loading: true, + logs: null, } }, async created() { @@ -92,7 +104,12 @@

Legal

if (this.buildVersionIsNightly) { this.nightlyData = (await fetch("https://api.github.com/repos/LizardByte/Sunshine/actions/workflows/CI.yml/runs?branch=nightly&event=push&exclude_pull_requests=true&per_page=1").then((r) => r.json())).workflow_runs[0]; } - } catch(e){ + } catch (e) { + } + try { + this.logs = (await fetch("/api/logs").then(r => r.text())) + } catch (e) { + console.error(e); } this.loading = false; }, @@ -125,15 +142,26 @@

Legal

// return true if the commit hash is different, otherwise false return this.nightlyData.head_sha.indexOf(commit) !== 0; }, - buildVersionIsDirty() { + buildVersionIsDirty() { return this.version?.split(".").length === 5 && this.version.indexOf("dirty") !== -1 }, - buildVersionIsNightly() { + buildVersionIsNightly() { return this.version?.split(".").length === 4 }, buildVersionIsStable() { return this.version?.split(".").length === 3 + }, + /** Parse the text errors, calculating the text, the timestamp and the level */ + fancyLogs() { + if (!this.logs) return []; + let regex = /(\[\d{4}:\d{2}:\d{2}:\d{2}:\d{2}:\d{2}\]):\s/g; + let rawLogLines = (this.logs.split(regex)).splice(1); + let logLines = [] + for (let i = 0; i < rawLogLines.length; i += 2) { + logLines.push({ timestamp: rawLogLines[i], level: rawLogLines[i + 1].split(":")[0], value: rawLogLines[i + 1] }); + } + return logLines; } } }); From 27196d829b03f5d45fa533ba652f402be8022605 Mon Sep 17 00:00:00 2001 From: Chase Payne Date: Sun, 17 Sep 2023 14:36:04 -0500 Subject: [PATCH 151/576] Allow Desktop Streams if Prep Commands fail due to user not being logged in (#1207) --- src/process.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index d018f4753ed..77105801d39 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -180,14 +180,19 @@ namespace proc { auto child = platf::run_command(cmd.elevated, true, cmd.do_cmd, working_dir, _env, _pipe.get(), ec, nullptr); if (ec) { - BOOST_LOG(error) << "Couldn't run ["sv << cmd.do_cmd << "]: System: "sv << ec.message(); - return -1; + auto msg = ec == std::errc::no_such_process ? "no active user sessions available" : ec.message(); + BOOST_LOG(error) << "Couldn't run ["sv << cmd.do_cmd << "]: System: "sv << msg; + // We don't want any prep commands failing launch of the desktop. + // This is to prevent the issue where users reboot their PC and need to log in with Sunshine. + // no_such_process is returned when the impersonation fails, which is typically when there is no user session active. + if (!(_app.cmd.empty() && ec == std::errc::no_such_process)) { + return -1; + } } child.wait(); auto ret = child.exit_code(); - - if (ret != 0) { + if (ret != 0 && ec != std::errc::no_such_process) { BOOST_LOG(error) << '[' << cmd.do_cmd << "] failed with code ["sv << ret << ']'; return -1; } From 3378959e18d5330d9a08f3f2b25c59387b97748a Mon Sep 17 00:00:00 2001 From: Chase Payne Date: Mon, 18 Sep 2023 09:29:34 -0500 Subject: [PATCH 152/576] Fix Command Failure on cold starts with Desktop (#1652) --- src/process.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index 77105801d39..8e8d2b35e2c 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -180,19 +180,18 @@ namespace proc { auto child = platf::run_command(cmd.elevated, true, cmd.do_cmd, working_dir, _env, _pipe.get(), ec, nullptr); if (ec) { - auto msg = ec == std::errc::no_such_process ? "no active user sessions available" : ec.message(); - BOOST_LOG(error) << "Couldn't run ["sv << cmd.do_cmd << "]: System: "sv << msg; + BOOST_LOG(error) << "Couldn't run ["sv << cmd.do_cmd << "]: System: "sv << ec.message(); // We don't want any prep commands failing launch of the desktop. // This is to prevent the issue where users reboot their PC and need to log in with Sunshine. - // no_such_process is returned when the impersonation fails, which is typically when there is no user session active. - if (!(_app.cmd.empty() && ec == std::errc::no_such_process)) { + // permission_denied is typically returned when the user impersonation fails, which can happen when user is not signed in yet. + if (!(_app.cmd.empty() && ec == std::errc::permission_denied)) { return -1; } } child.wait(); auto ret = child.exit_code(); - if (ret != 0 && ec != std::errc::no_such_process) { + if (ret != 0 && ec != std::errc::permission_denied) { BOOST_LOG(error) << '[' << cmd.do_cmd << "] failed with code ["sv << ret << ']'; return -1; } From 9e6f2fb8987909d2dde1ca4f807ed0c8df983cce Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:14:53 -0400 Subject: [PATCH 153/576] ci: fix linux tray (#1650) --- .codeql-prebuild-cpp.sh | 3 +- .github/workflows/CI.yml | 10 +- cmake/compile_definitions/linux.cmake | 16 ++- cmake/prep/options.cmake | 1 + docker/debian-bookworm.dockerfile | 2 + docker/debian-bullseye.dockerfile | 2 + docker/fedora-37.dockerfile | 1 + docker/fedora-38.dockerfile | 1 + docker/ubuntu-20.04.dockerfile | 3 +- docker/ubuntu-22.04.dockerfile | 3 +- docs/source/building/linux.rst | 7 +- packaging/linux/Arch/PKGBUILD | 27 ++++- .../linux/flatpak/dev.lizardbyte.sunshine.yml | 102 ++++++++++++++++++ third-party/tray | 2 +- 14 files changed, 170 insertions(+), 10 deletions(-) diff --git a/.codeql-prebuild-cpp.sh b/.codeql-prebuild-cpp.sh index b4461a201b9..ba4e4016e0e 100644 --- a/.codeql-prebuild-cpp.sh +++ b/.codeql-prebuild-cpp.sh @@ -5,7 +5,7 @@ sudo apt-get install -y \ build-essential \ gcc-10 \ g++-10 \ - libappindicator3-dev \ + libayatana-appindicator3-dev \ libavdevice-dev \ libboost-filesystem-dev \ libboost-locale-dev \ @@ -16,6 +16,7 @@ sudo apt-get install -y \ libdrm-dev \ libevdev-dev \ libmfx-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 290a978ab0a..542f9f9719d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -170,6 +170,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Checkout Flathub Shared Modules + uses: actions/checkout@v4 + with: + repository: flathub/shared-modules + path: build/shared-modules + - name: Setup Dependencies Linux Flatpak run: | PLATFORM_VERSION=22.08 @@ -186,6 +192,7 @@ jobs: org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \ org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \ org.freedesktop.Sdk.Extension.node18/${{ matrix.arch }}/${PLATFORM_VERSION} \ + org.freedesktop.Sdk.Extension.vala/${{ matrix.arch }}/${PLATFORM_VERSION} \ " - name: Cache Flatpak build @@ -337,13 +344,14 @@ jobs: build-essential \ gcc-10 \ g++-10 \ - libappindicator3-dev \ + libayatana-appindicator3-dev \ libavdevice-dev \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ libmfx-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index c88b62b2beb..4f414745a03 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -156,13 +156,20 @@ endif() # tray icon if(${SUNSHINE_ENABLE_TRAY}) pkg_check_modules(APPINDICATOR appindicator3-0.1) - if(NOT APPINDICATOR_FOUND) + if(APPINDICATOR_FOUND) + list(APPEND SUNSHINE_DEFINITIONS TRAY_LEGACY_APPINDICATOR=1) + else() pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1) + if(APPINDICATOR_FOUND) + list(APPEND SUNSHINE_DEFINITIONS TRAY_AYATANA_APPINDICATOR=1) + endif () endif() pkg_check_modules(LIBNOTIFY libnotify) if(NOT APPINDICATOR_FOUND OR NOT LIBNOTIFY_FOUND) - message(WARNING "Missing appindicator, disabling tray icon") set(SUNSHINE_TRAY 0) + message(WARNING "Missing appindicator or libnotify, disabling tray icon") + message(STATUS "APPINDICATOR_FOUND: ${APPINDICATOR_FOUND}") + message(STATUS "LIBNOTIFY_FOUND: ${LIBNOTIFY_FOUND}") else() include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS}) link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS}) @@ -172,6 +179,11 @@ if(${SUNSHINE_ENABLE_TRAY}) endif() else() set(SUNSHINE_TRAY 0) + message(STATUS "Tray icon disabled") +endif() + +if (${SUNSHINE_TRAY} EQUAL 0 AND SUNSHINE_REQUIRE_TRAY) + message(FATAL_ERROR "Tray icon is required") endif() list(APPEND PLATFORM_TARGET_FILES diff --git a/cmake/prep/options.cmake b/cmake/prep/options.cmake index 4cb2ef117b6..1a216d263c8 100644 --- a/cmake/prep/options.cmake +++ b/cmake/prep/options.cmake @@ -2,6 +2,7 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignored on macOS." ON) +option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON) if(APPLE) option(SUNSHINE_CONFIGURE_PORTFILE diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile index f8ccc23d215..1172d35a5e9 100644 --- a/docker/debian-bookworm.dockerfile +++ b/docker/debian-bookworm.dockerfile @@ -34,6 +34,7 @@ apt-get install -y --no-install-recommends \ cmake=3.25.* \ git \ libavdevice-dev \ + libayatana-appindicator3-dev \ libboost-filesystem-dev=1.74.* \ libboost-locale-dev=1.74.* \ libboost-log-dev=1.74.* \ @@ -42,6 +43,7 @@ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/docker/debian-bullseye.dockerfile b/docker/debian-bullseye.dockerfile index 0ba3fdf0ce5..6d7ebdd30af 100644 --- a/docker/debian-bullseye.dockerfile +++ b/docker/debian-bullseye.dockerfile @@ -34,6 +34,7 @@ apt-get install -y --no-install-recommends \ cmake=3.18.* \ git \ libavdevice-dev \ + libayatana-appindicator3-dev \ libboost-filesystem-dev=1.74.* \ libboost-locale-dev=1.74.* \ libboost-log-dev=1.74.* \ @@ -42,6 +43,7 @@ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/docker/fedora-37.dockerfile b/docker/fedora-37.dockerfile index 5a94623caf8..c6aa0593a6b 100644 --- a/docker/fedora-37.dockerfile +++ b/docker/fedora-37.dockerfile @@ -40,6 +40,7 @@ dnf -y install \ libcurl-devel \ libdrm-devel \ libevdev-devel \ + libnotify-devel \ libva-devel \ libvdpau-devel \ libX11-devel \ diff --git a/docker/fedora-38.dockerfile b/docker/fedora-38.dockerfile index 8df4207c635..2245ba9b9aa 100644 --- a/docker/fedora-38.dockerfile +++ b/docker/fedora-38.dockerfile @@ -40,6 +40,7 @@ dnf -y install \ libcurl-devel \ libdrm-devel \ libevdev-devel \ + libnotify-devel \ libva-devel \ libvdpau-devel \ libX11-devel \ diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile index 1dfb69ccf0e..5634d48e0c0 100644 --- a/docker/ubuntu-20.04.dockerfile +++ b/docker/ubuntu-20.04.dockerfile @@ -34,7 +34,7 @@ apt-get install -y --no-install-recommends \ gcc-10=10.5.* \ g++-10=10.5.* \ git \ - libappindicator3-dev \ + libayatana-appindicator3-dev \ libavdevice-dev \ libboost-filesystem-dev=1.71.* \ libboost-locale-dev=1.71.* \ @@ -44,6 +44,7 @@ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index f007f26725f..c9c6b70db89 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -33,7 +33,7 @@ apt-get install -y --no-install-recommends \ build-essential \ cmake=3.22.* \ git \ - libappindicator3-dev \ + libayatana-appindicator3-dev \ libavdevice-dev \ libboost-filesystem-dev=1.74.* \ libboost-locale-dev=1.74.* \ @@ -43,6 +43,7 @@ apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst index 3099cda4375..82a3ed17462 100644 --- a/docs/source/building/linux.rst +++ b/docs/source/building/linux.rst @@ -16,6 +16,7 @@ Install Requirements build-essential \ cmake \ libavdevice-dev \ + libayatana-appindicator3-dev \ libboost-filesystem-dev \ libboost-locale-dev \ libboost-log-dev \ @@ -25,6 +26,7 @@ Install Requirements libdrm-dev \ # KMS libevdev-dev \ libmfx-dev \ # x86_64 only + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ @@ -63,6 +65,7 @@ Install Requirements libcurl-devel \ libdrm-devel \ libevdev-devel \ + libnotify-devel \ libva-devel \ libvdpau-devel \ libX11-devel \ # X11 @@ -94,7 +97,7 @@ Install Requirements build-essential \ cmake \ g++-10 \ - libappindicator3-dev \ + libayatana-appindicator3-dev \ libavdevice-dev \ libboost-filesystem-dev \ libboost-locale-dev \ @@ -104,6 +107,7 @@ Install Requirements libdrm-dev \ # KMS libevdev-dev \ libmfx-dev \ # x86_64 only + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ @@ -152,6 +156,7 @@ Install Requirements libdrm-dev \ # KMS libevdev-dev \ libmfx-dev \ # x86_64 only + libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index e078c0cc09a..11b699823b0 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -9,8 +9,31 @@ arch=('x86_64' 'aarch64') url=@PROJECT_HOMEPAGE_URL@ license=('GPL3') -depends=('avahi' 'boost-libs' 'curl' 'libappindicator-gtk3' 'libevdev' 'libmfx' 'libpulse' 'libva' 'libvdpau' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'numactl' 'openssl' 'opus' 'udev') -makedepends=('boost' 'cmake' 'git' 'make' 'nodejs' 'npm') +depends=('avahi' + 'boost-libs' + 'curl' + 'libayatana-appindicator' + 'libevdev' + 'libmfx' + 'libnotify' + 'libpulse' + 'libva' + 'libvdpau' + 'libx11' + 'libxcb' + 'libxfixes' + 'libxrandr' + 'libxtst' + 'numactl' + 'openssl' + 'opus' + 'udev') +makedepends=('boost' + 'cmake' + 'git' + 'make' + 'nodejs' + 'npm') optdepends=('cuda: NvFBC capture support' 'libcap' 'libdrm') diff --git a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml index 4528e7def9a..be1ae8adbf2 100644 --- a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml +++ b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml @@ -5,6 +5,7 @@ runtime-version: "22.08" sdk: org.freedesktop.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.node18 + - org.freedesktop.Sdk.Extension.vala command: sunshine separate-locales: false finish-args: @@ -27,6 +28,10 @@ cleanup: - /lib/*.a - /share/man +build-options: + append-path: /usr/lib/sdk/vala/bin + prepend-ld-library-path: /usr/lib/sdk/vala/lib + modules: - name: boost disabled: false @@ -88,6 +93,79 @@ modules: - for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done - autoreconf -ivf + # yamllint disable-line rule:line-length + # https://github.com/flathub/org.localsend.localsend_app/blob/7465669c22a2a4fc35e707e1e4e7e882772adc0e/org.localsend.localsend_app.yml#L27-L106 + # https://github.com/flathub/app.vup.Vup/blob/8c5073c7c5b8f24805013abc85a0860ca2439396/app.vup.Vup.yaml#L30-L78 + - name: libayatana-appindicator + buildsystem: cmake-ninja + config-opts: + - -DENABLE_BINDINGS_MONO=NO + - -DENABLE_BINDINGS_VALA=NO + modules: + - shared-modules/intltool/intltool-0.51.json + - name: libdbusmenu-gtk3 # Dependency of libayatana-appindicator + buildsystem: autotools + build-options: + cflags: -Wno-error + env: + HAVE_VALGRIND_FALSE: '#' + HAVE_VALGRIND_TRUE: '' + config-opts: + - --with-gtk=3 + - --disable-dumper + - --disable-static + - --disable-tests + - --disable-gtk-doc + - --enable-introspection=no + - --disable-vala + sources: + - type: archive + url: https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz + sha256: b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a + cleanup: + - /include + - /libexec + - /lib/pkgconfig + - /lib/*.la + - /share/doc + - /share/libdbusmenu + - /share/gtk-doc + - /share/gir-1.0 + - name: ayatana-ido + buildsystem: cmake-ninja + sources: + - type: git + url: https://github.com/AyatanaIndicators/ayatana-ido.git + tag: 0.10.1 + commit: 13402a2cc4616b4b5f4244413599e635fcfc1401 + x-checker-data: + type: anitya + project-id: 18445 + tag-template: $version + stable-only: true + - name: libayatana-indicator + buildsystem: cmake-ninja + sources: + - type: git + url: https://github.com/AyatanaIndicators/libayatana-indicator.git + tag: 0.9.3 + commit: a62e8ca13040554a8fc2536ce7e6aa888c5729d9 + x-checker-data: + type: anitya + project-id: 18447 + tag-template: $version + stable-only: true + sources: + - type: git + url: https://github.com/AyatanaIndicators/libayatana-appindicator.git + tag: 0.5.92 + commit: d214fe3e7a6b1ba8faea68d70586310b34dc643c + x-checker-data: + type: anitya + project-id: 18446 + tag-template: $version + stable-only: true + - name: libevdev disabled: false buildsystem: meson @@ -107,6 +185,30 @@ modules: commands: - for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done + - name: libnotify + buildsystem: meson + config-opts: + - -Dtests=false + - -Dintrospection=disabled + - -Dman=false + - -Dgtk_doc=false + - -Ddocbook_docs=disabled + sources: + - type: archive + url: https://download.gnome.org/sources/libnotify/0.8/libnotify-0.8.2.tar.xz + sha256: c5f4ed3d1f86e5b118c76415aacb861873ed3e6f0c6b3181b828cf584fc5c616 + x-checker-data: + type: gnome + name: libnotify + stable-only: true + - type: archive + url: https://download.gnome.org/sources/gnome-common/3.18/gnome-common-3.18.0.tar.xz + sha256: 22569e370ae755e04527b76328befc4c73b62bfd4a572499fde116b8318af8cf + x-checker-data: + type: gnome + name: gnome-common + stable-only: true + - name: intel-mediasdk disabled: false buildsystem: cmake diff --git a/third-party/tray b/third-party/tray index 2921d9628e1..0b1aa15dbc7 160000 --- a/third-party/tray +++ b/third-party/tray @@ -1 +1 @@ -Subproject commit 2921d9628e150c29f6e9f2ad86fd48b842aad5ca +Subproject commit 0b1aa15dbc7bdfaeb2c3a7551e0117f603fa4d0f From 9c473245e63d2caba6f226cdee4f51320b0a5662 Mon Sep 17 00:00:00 2001 From: Arthur Kasimov Date: Fri, 22 Sep 2023 09:16:23 +0600 Subject: [PATCH 154/576] Disable installation of enet headers and libraries (#1663) --- cmake/dependencies/common.cmake | 1 + third-party/moonlight-common-c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 33372c2e991..ca4752c218e 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -3,6 +3,7 @@ # submodules # moonlight common library +set(ENET_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for enet") add_subdirectory(third-party/moonlight-common-c/enet) # web server diff --git a/third-party/moonlight-common-c b/third-party/moonlight-common-c index 0f17b4d0c5f..7a6d12fc4e3 160000 --- a/third-party/moonlight-common-c +++ b/third-party/moonlight-common-c @@ -1 +1 @@ -Subproject commit 0f17b4d0c5f40842bb81fec0f2f6b5afbf182d04 +Subproject commit 7a6d12fc4e36a0b450dfbf1be85b250824c7a0d7 From 61e7647b8c3bb23712ac64bfb01106a64d4ab951 Mon Sep 17 00:00:00 2001 From: Arthur Kasimov Date: Sun, 24 Sep 2023 09:20:46 +0600 Subject: [PATCH 155/576] Install icons to hicolor theme on Linux (#1669) --- cmake/packaging/linux.cmake | 13 +++++++++---- src/system_tray.cpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index 99a9c9ef8be..acdf41c17cc 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -67,16 +67,21 @@ set(CPACK_RPM_PACKAGE_REQUIRES "\ # This should automatically figure out dependencies, doesn't work with the current config set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) +# application icon +install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps") + # tray icon if(${SUNSHINE_TRAY} STREQUAL 1) install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status" + RENAME "sunshine-tray.svg") install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-playing.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-pausing.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-locked.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons") + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ ${CPACK_DEBIAN_PACKAGE_DEPENDS}, \ diff --git a/src/system_tray.cpp b/src/system_tray.cpp index 99a30222fbd..cab3ee9b72f 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -14,7 +14,7 @@ #define TRAY_ICON_PAUSING WEB_DIR "images/sunshine-pausing.ico" #define TRAY_ICON_LOCKED WEB_DIR "images/sunshine-locked.ico" #elif defined(__linux__) || defined(linux) || defined(__linux) - #define TRAY_ICON "sunshine" + #define TRAY_ICON "sunshine-tray" #define TRAY_ICON_PLAYING "sunshine-playing" #define TRAY_ICON_PAUSING "sunshine-pausing" #define TRAY_ICON_LOCKED "sunshine-locked" From 5117cd23b4c8423f2e37b5fbd06199c0dbe5de9c Mon Sep 17 00:00:00 2001 From: Reece Humphreys Date: Sat, 30 Sep 2023 09:30:08 -0400 Subject: [PATCH 156/576] Updated Homebrew build requirements to include `pkg-config` (#1684) --- docs/source/building/macos.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/building/macos.rst b/docs/source/building/macos.rst index 40cc53a91fb..2d39ec17951 100644 --- a/docs/source/building/macos.rst +++ b/docs/source/building/macos.rst @@ -19,7 +19,7 @@ Homebrew Install Requirements .. code-block:: bash - brew install boost cmake node opus + brew install boost cmake node opus pkg-config # if there are issues with an SSL header that is not found: cd /usr/local/include ln -s ../opt/openssl/include/openssl . From 9993ab7f3d3e5693cb8e74bbe0440bb63b69f920 Mon Sep 17 00:00:00 2001 From: Reece Humphreys Date: Sat, 30 Sep 2023 12:39:58 -0400 Subject: [PATCH 157/576] Link the `/opt/homebrew/lib` directory on macOS (#1685) --- cmake/compile_definitions/macos.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/compile_definitions/macos.cmake b/cmake/compile_definitions/macos.cmake index 2e3b73f1c64..3bcf9528361 100644 --- a/cmake/compile_definitions/macos.cmake +++ b/cmake/compile_definitions/macos.cmake @@ -4,6 +4,7 @@ add_compile_definitions(SUNSHINE_PLATFORM="macos") link_directories(/opt/local/lib) link_directories(/usr/local/lib) +link_directories(/opt/homebrew/lib) ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) list(APPEND SUNSHINE_EXTERNAL_LIBRARIES From 0b25f8ea43fe432e26556a771cfee90b1d84ecc5 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:52:56 -0400 Subject: [PATCH 158/576] feat(ui): add port mapping table (#1681) --- docs/source/about/advanced_usage.rst | 3 + src/config.cpp | 4 +- src/main.cpp | 12 ++- src_assets/common/assets/web/config.html | 94 ++++++++++++++++++++++-- 4 files changed, 105 insertions(+), 8 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index c433a7cae09..dfc86454738 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -552,6 +552,9 @@ port **Default** ``47989`` +**Range** + ``1029-65514`` + **Example** .. code-block:: text diff --git a/src/config.cpp b/src/config.cpp index 7c73867959c..94657a49e9b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -16,6 +16,8 @@ #include "config.h" #include "main.h" +#include "nvhttp.h" +#include "rtsp.h" #include "utility.h" #include "platform/common.h" @@ -1049,7 +1051,7 @@ namespace config { bool_f(vars, "always_send_scancodes", input.always_send_scancodes); int port = sunshine.port; - int_f(vars, "port"s, port); + int_between_f(vars, "port"s, port, { 1024 + nvhttp::PORT_HTTPS, 65535 - rtsp_stream::RTSP_SETUP_PORT }); sunshine.port = (std::uint16_t) port; string_restricted_f(vars, "address_family", sunshine.address_family, { "ipv4"sv, "both"sv }); diff --git a/src/main.cpp b/src/main.cpp index c04e5dcd0e6..a2aee13f197 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -836,7 +836,15 @@ write_file(const char *path, const std::string_view &contents) { */ std::uint16_t map_port(int port) { - // TODO: Ensure port is in the range of 21-65535 + // calculate the port from the config port + auto mapped_port = (std::uint16_t)((int) config::sunshine.port + port); + + // Ensure port is in the range of 1024-65535 + if (mapped_port < 1024 || mapped_port > 65535) { + BOOST_LOG(warning) << "Port out of range: "sv << mapped_port; + } + // TODO: Ensure port is not already in use by another application - return (std::uint16_t)((int) config::sunshine.port + port); + + return mapped_port; } diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index d85004cdbcd..d2a8f4c322f 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -72,6 +72,7 @@

Configuration

id="origin_web_ui_allowed" class="form-select" v-model="config.origin_web_ui_allowed" + @change="forceUpdate" > @@ -80,6 +81,10 @@

Configuration

The origin of the remote endpoint address that is not denied access to Web UI
+ +
+ Exposing the Web UI to the internet is a security risk! Proceed at your own risk! +
@@ -625,14 +630,79 @@

Configuration

Set the family of ports used by Sunshine
+ +
+ Sunshine cannot use ports below 1024! +
+ +
+ Ports above 65535 are not available! +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProtocolPortNote
TCP{{+effectivePort - 5}}
TCP{{+effectivePort}} + +
TCP{{+effectivePort + 1}}Web UI
TCP{{+effectivePort + 21}}
UDP{{+effectivePort + 9}} - {{+effectivePort + 11}}
+ +
+ Exposing the Web UI to the internet is a security risk! + Proceed at your own risk! +
@@ -1058,10 +1128,11 @@

- Success! Click 'Apply' to restart Sunshine and apply changes. This will terminate any running sessions. + Click 'Apply' to restart Sunshine and apply changes. + This will terminate any running sessions.
-
- Success! Sunshine is restarting to apply changes. +
+ Sunshine is restarting to apply changes.
@@ -1223,6 +1294,9 @@

}); }, methods: { + forceUpdate() { + this.$forceUpdate() + }, serialize() { let nl = this.config === "windows" ? "\r\n" : "\n"; this.config.resolutions = @@ -1309,6 +1383,16 @@

this.global_prep_cmd.push(template); }, }, + computed: { + effectivePort() { + // Convert config.port to a number. + const port = +this.config?.port + + // Check if port is NaN or a falsy value (like 0, empty string, etc.). + // If so, default to config port. Otherwise, use the value of port. + return port ? port : 47989 + }, + } }); From 7a364e6ad1352026169273f39b90ed053a22adc6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Oct 2023 23:29:00 -0500 Subject: [PATCH 159/576] Fix crash during UDP segmentation due to stack garbage CMSG_NXTHDR() tries to read the _next_ message to check if it fits in the provided control buffer length. If that part of the stack has some large value stored in the uninitialized cmsg_len there, CMSG_NXTHDR() will return NULL and we will crash. --- src/platform/linux/misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux/misc.cpp b/src/platform/linux/misc.cpp index 6c8e391fe3b..aee35b9e28a 100644 --- a/src/platform/linux/misc.cpp +++ b/src/platform/linux/misc.cpp @@ -301,7 +301,7 @@ namespace platf { char buf[CMSG_SPACE(sizeof(uint16_t)) + std::max(CMSG_SPACE(sizeof(struct in_pktinfo)), CMSG_SPACE(sizeof(struct in6_pktinfo)))]; struct cmsghdr alignment; - } cmbuf; + } cmbuf = {}; // Must be zeroed for CMSG_NXTHDR() socklen_t cmbuflen = 0; msg.msg_control = cmbuf.buf; From 1e04df1585e1bccac26dede9ed1eae1ac18c1e8d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 2 Oct 2023 00:10:33 -0500 Subject: [PATCH 160/576] Use a render node to create our VADisplay Since libva 2.20, vaInitialize() will fail if we pass a primary node and lack permission to authenticate. Since we don't actually need to have a primary node fd to encode, let's use a render node instead. --- src/platform/linux/kmsgrab.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/platform/linux/kmsgrab.cpp b/src/platform/linux/kmsgrab.cpp index f608d950c4e..bfbe3935c1d 100644 --- a/src/platform/linux/kmsgrab.cpp +++ b/src/platform/linux/kmsgrab.cpp @@ -242,6 +242,23 @@ namespace platf { return -1; } + // Open the render node for this card to share with libva. + // If it fails, we'll just share the primary node instead. + char *rendernode_path = drmGetRenderDeviceNameFromFd(fd.el); + if (rendernode_path) { + BOOST_LOG(debug) << "Opening render node: "sv << rendernode_path; + render_fd.el = open(rendernode_path, O_RDWR); + if (render_fd.el < 0) { + BOOST_LOG(warning) << "Couldn't open render node: "sv << rendernode_path << ": "sv << strerror(errno); + render_fd.el = dup(fd.el); + } + free(rendernode_path); + } + else { + BOOST_LOG(warning) << "No render device name for: "sv << path; + render_fd.el = dup(fd.el); + } + if (drmSetClientCap(fd.el, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) { BOOST_LOG(error) << "Couldn't expose some/all drm planes for card: "sv << path; return -1; @@ -423,6 +440,7 @@ namespace platf { } file_t fd; + file_t render_fd; plane_res_t plane_res; }; @@ -846,7 +864,7 @@ namespace platf { std::unique_ptr make_avcodec_encode_device(pix_fmt_e pix_fmt) override { if (mem_type == mem_type_e::vaapi) { - return va::make_avcodec_encode_device(width, height, dup(card.fd.el), img_offset_x, img_offset_y, true); + return va::make_avcodec_encode_device(width, height, dup(card.render_fd.el), img_offset_x, img_offset_y, true); } BOOST_LOG(error) << "Unsupported pixel format for egl::display_vram_t: "sv << platf::from_pix_fmt(pix_fmt); @@ -966,7 +984,7 @@ namespace platf { return -1; } - if (!va::validate(card.fd.el)) { + if (!va::validate(card.render_fd.el)) { BOOST_LOG(warning) << "Monitor "sv << display_name << " doesn't support hardware encoding. Reverting back to GPU -> RAM -> GPU"sv; return -1; } From 0910ad7bc105d3a03a57761cfca4a7c67a130899 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Mon, 2 Oct 2023 01:16:29 +0000 Subject: [PATCH 161/576] Bump ffmpeg --- third-party/ffmpeg-linux-aarch64 | 2 +- third-party/ffmpeg-linux-powerpc64le | 2 +- third-party/ffmpeg-linux-x86_64 | 2 +- third-party/ffmpeg-macos-aarch64 | 2 +- third-party/ffmpeg-macos-x86_64 | 2 +- third-party/ffmpeg-windows-x86_64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/third-party/ffmpeg-linux-aarch64 b/third-party/ffmpeg-linux-aarch64 index cbcbeafafd3..8b8848d40df 160000 --- a/third-party/ffmpeg-linux-aarch64 +++ b/third-party/ffmpeg-linux-aarch64 @@ -1 +1 @@ -Subproject commit cbcbeafafd30ee15e8610480f37e9c1c80fd21ff +Subproject commit 8b8848d40df336cb290e58b7e57c396009100595 diff --git a/third-party/ffmpeg-linux-powerpc64le b/third-party/ffmpeg-linux-powerpc64le index a3450a8392c..9dadebb470b 160000 --- a/third-party/ffmpeg-linux-powerpc64le +++ b/third-party/ffmpeg-linux-powerpc64le @@ -1 +1 @@ -Subproject commit a3450a8392cdd0f03212b444fa0a897f4837b7e1 +Subproject commit 9dadebb470b99483ab7a5c9d5ac52f299bae42f7 diff --git a/third-party/ffmpeg-linux-x86_64 b/third-party/ffmpeg-linux-x86_64 index 6deb7d7366f..e0169be4b69 160000 --- a/third-party/ffmpeg-linux-x86_64 +++ b/third-party/ffmpeg-linux-x86_64 @@ -1 +1 @@ -Subproject commit 6deb7d7366fc6e09afb3cb235cab6780bfa550b9 +Subproject commit e0169be4b6929ca8ed0068ea25db3d62baa1335d diff --git a/third-party/ffmpeg-macos-aarch64 b/third-party/ffmpeg-macos-aarch64 index edd5c4af619..4537513b457 160000 --- a/third-party/ffmpeg-macos-aarch64 +++ b/third-party/ffmpeg-macos-aarch64 @@ -1 +1 @@ -Subproject commit edd5c4af61971a9c726e12bc3fd06dc41ec51a65 +Subproject commit 4537513b457ec50926d5ef81c579504364d0fa21 diff --git a/third-party/ffmpeg-macos-x86_64 b/third-party/ffmpeg-macos-x86_64 index 8d2aadfcb4a..7057139d873 160000 --- a/third-party/ffmpeg-macos-x86_64 +++ b/third-party/ffmpeg-macos-x86_64 @@ -1 +1 @@ -Subproject commit 8d2aadfcb4ada918dd572227d9db59cafe34c94b +Subproject commit 7057139d8731cfb577859f832ff59402137fdff2 diff --git a/third-party/ffmpeg-windows-x86_64 b/third-party/ffmpeg-windows-x86_64 index 211737ba888..bbf911e6b2a 160000 --- a/third-party/ffmpeg-windows-x86_64 +++ b/third-party/ffmpeg-windows-x86_64 @@ -1 +1 @@ -Subproject commit 211737ba888e533554d963f963cab7bdf407ccc8 +Subproject commit bbf911e6b2a2f3c2c0ca1675a11ed3e1bdd36e9a From 5afec970641e660b157a329b1d1095f63d90cadf Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Oct 2023 18:36:01 -0500 Subject: [PATCH 162/576] Remove usage of deprecated AVFrame key_frame field --- src/video.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 421e58ff550..c6adea241c8 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -435,7 +435,7 @@ namespace video { if (device && device->frame) { auto &frame = device->frame; frame->pict_type = AV_PICTURE_TYPE_I; - frame->key_frame = 1; + frame->flags |= AV_FRAME_FLAG_KEY; } } @@ -444,7 +444,7 @@ namespace video { if (device && device->frame) { auto &frame = device->frame; frame->pict_type = AV_PICTURE_TYPE_NONE; - frame->key_frame = 0; + frame->flags &= ~AV_FRAME_FLAG_KEY; } } @@ -1295,7 +1295,7 @@ namespace video { return ret; } - if (frame->key_frame && !(av_packet->flags & AV_PKT_FLAG_KEY)) { + if ((frame->flags & AV_FRAME_FLAG_KEY) && !(av_packet->flags & AV_PKT_FLAG_KEY)) { BOOST_LOG(error) << "Encoder did not produce IDR frame when requested!"sv; } From 0cff0dd2b35c7fd6d54f0acba5710d8e6a87ab27 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Oct 2023 18:37:23 -0500 Subject: [PATCH 163/576] AMF 'preanalysis' property is now named 'preencode' See https://github.com/FFmpeg/FFmpeg/commit/f593dc98bfe4196ad60510008d43764e526d8cb9 --- src/video.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index c6adea241c8..6cbcf8cdb34 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -765,7 +765,7 @@ namespace video { { { "filler_data"s, false }, { "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } }, - { "preanalysis"s, &config::video.amd.amd_preanalysis }, + { "preencode"s, &config::video.amd.amd_preanalysis }, { "quality"s, &config::video.amd.amd_quality_av1 }, { "rc"s, &config::video.amd.amd_rc_av1 }, { "usage"s, &config::video.amd.amd_usage_av1 }, @@ -782,7 +782,7 @@ namespace video { { "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } }, { "gops_per_idr"s, 1 }, { "header_insertion_mode"s, "idr"s }, - { "preanalysis"s, &config::video.amd.amd_preanalysis }, + { "preencode"s, &config::video.amd.amd_preanalysis }, { "qmax"s, 51 }, { "qmin"s, 0 }, { "quality"s, &config::video.amd.amd_quality_hevc }, @@ -800,7 +800,7 @@ namespace video { { { "filler_data"s, false }, { "log_to_dbg"s, []() { return config::sunshine.min_log_level < 2 ? 1 : 0; } }, - { "preanalysis"s, &config::video.amd.amd_preanalysis }, + { "preencode"s, &config::video.amd.amd_preanalysis }, { "qmax"s, 51 }, { "qmin"s, 0 }, { "quality"s, &config::video.amd.amd_quality_h264 }, From 0c45be28669c0d3c0021aa29e6050ecfea91e499 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Oct 2023 18:37:58 -0500 Subject: [PATCH 164/576] Use new 'remotegaming' scenario setting for QSV --- src/video.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index 6cbcf8cdb34..ffd82c98c60 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -694,6 +694,7 @@ namespace video { // Common options { { "preset"s, &config::video.qsv.qsv_preset }, + { "scenario"s, "remotegaming"s }, { "forced_idr"s, 1 }, { "async_depth"s, 1 }, { "low_delay_brc"s, 1 }, @@ -710,6 +711,7 @@ namespace video { // Common options { { "preset"s, &config::video.qsv.qsv_preset }, + { "scenario"s, "remotegaming"s }, { "forced_idr"s, 1 }, { "async_depth"s, 1 }, { "low_delay_brc"s, 1 }, @@ -733,6 +735,7 @@ namespace video { { { "preset"s, &config::video.qsv.qsv_preset }, { "cavlc"s, &config::video.qsv.qsv_cavlc }, + { "scenario"s, "remotegaming"s }, { "forced_idr"s, 1 }, { "async_depth"s, 1 }, { "low_delay_brc"s, 1 }, From 015335bc1bfbff52b539de6ab4c67f05487cfeae Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Oct 2023 18:40:38 -0500 Subject: [PATCH 165/576] Use oneVPL instead of legacy MFX library on Windows --- .github/workflows/CI.yml | 2 +- cmake/dependencies/common.cmake | 2 +- docs/source/building/windows.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 542f9f9719d..8f23856d371 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -715,7 +715,7 @@ jobs: mingw-w64-x86_64-boost mingw-w64-x86_64-cmake mingw-w64-x86_64-curl - mingw-w64-x86_64-libmfx + mingw-w64-x86_64-onevpl mingw-w64-x86_64-nsis mingw-w64-x86_64-openssl mingw-w64-x86_64-opus diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index ca4752c218e..9bc7c56ceee 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -22,7 +22,7 @@ if(WIN32) if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64") message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) endif() - set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid mfx) + set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl) set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64") elseif(APPLE) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") diff --git a/docs/source/building/windows.rst b/docs/source/building/windows.rst index a51b6485372..623bd16a409 100644 --- a/docs/source/building/windows.rst +++ b/docs/source/building/windows.rst @@ -16,7 +16,7 @@ Install dependencies: pacman -S base-devel cmake diffutils gcc git make mingw-w64-x86_64-binutils \ mingw-w64-x86_64-boost mingw-w64-x86_64-cmake mingw-w64-x86_64-curl \ - mingw-w64-x86_64-libmfx mingw-w64-x86_64-openssl mingw-w64-x86_64-opus \ + mingw-w64-x86_64-onevpl mingw-w64-x86_64-openssl mingw-w64-x86_64-opus \ mingw-w64-x86_64-toolchain npm dependencies From 21e4116dfe4f60bee59fc0b6d3b30232337fb35e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 2 Oct 2023 22:10:56 -0400 Subject: [PATCH 166/576] fix(installer): update vigembus (#1670) --- .gitmodules | 2 +- cmake/packaging/windows.cmake | 22 +++++++++---------- docs/source/about/usage.rst | 2 +- docs/source/troubleshooting/windows.rst | 2 +- .../install-gamepad.bat} | 12 +++++----- .../uninstall-gamepad.bat} | 2 +- third-party/ViGEmClient | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) rename src_assets/windows/misc/{vigembus/install-vigembus.bat => gamepad/install-gamepad.bat} (77%) rename src_assets/windows/misc/{vigembus/uninstall-vigembus.bat => gamepad/uninstall-gamepad.bat} (57%) diff --git a/.gitmodules b/.gitmodules index bbb705eecb1..615b2175e67 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ branch = master [submodule "third-party/ViGEmClient"] path = third-party/ViGEmClient - url = https://github.com/ViGEm/ViGEmClient + url = https://github.com/nefarius/ViGEmClient branch = master [submodule "third-party/miniupnp"] path = third-party/miniupnp diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 78f0a0e32c0..0d4f1dd9cce 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -31,9 +31,9 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/autostart/" install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/" DESTINATION "scripts" COMPONENT firewall) -install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/vigembus/" +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/gamepad/" DESTINATION "scripts" - COMPONENT vigembus) + COMPONENT gamepad) # Sunshine assets install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" @@ -61,7 +61,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-vigembus.bat\\\"' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"' NoController: ") @@ -74,10 +74,10 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\sunshine.exe\\\" --restore-nvprefs-undo' MessageBox MB_YESNO|MB_ICONQUESTION \ - 'Do you want to remove ViGEmBus)?' \ - /SD IDNO IDNO NoVigem - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-vigembus.bat\\\"'; skipped if no - NoVigem: + 'Do you want to remove Virtual Gamepad)?' \ + /SD IDNO IDNO NoGamepad + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.bat\\\"'; skipped if no + NoGamepad: MessageBox MB_YESNO|MB_ICONQUESTION \ 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ /SD IDNO IDNO NoDelete @@ -149,7 +149,7 @@ set(CPACK_COMPONENT_FIREWALL_DISPLAY_NAME "Add Firewall Exclusions") set(CPACK_COMPONENT_FIREWALL_DESCRIPTION "Scripts to enable or disable firewall rules.") set(CPACK_COMPONENT_FIREWALL_GROUP "Scripts") -# vigembus scripts -set(CPACK_COMPONENT_VIGEMBUS_DISPLAY_NAME "Virtual Gamepad Support") -set(CPACK_COMPONENT_VIGEMBUS_DESCRIPTION "Scripts to install and uninstall ViGEmBus for virtual gamepad support.") -set(CPACK_COMPONENT_VIGEMBUS_GROUP "Scripts") +# gamepad scripts +set(CPACK_COMPONENT_GAMEPAD_DISPLAY_NAME "Virtual Gamepad") +set(CPACK_COMPONENT_GAMEPAD_DESCRIPTION "Scripts to install and uninstall Virtual Gamepad.") +set(CPACK_COMPONENT_GAMEPAD_GROUP "Scripts") diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 9967b453e30..80d66a03932 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -179,7 +179,7 @@ Configure autostart service Windows ^^^^^^^ -For gamepad support, install `ViGEmBus `__ +For gamepad support, install `Nefarius Virtual Gamepad `__ Sunshine firewall **Add rule** diff --git a/docs/source/troubleshooting/windows.rst b/docs/source/troubleshooting/windows.rst index a1e08c7a64b..9190fc300f7 100644 --- a/docs/source/troubleshooting/windows.rst +++ b/docs/source/troubleshooting/windows.rst @@ -3,4 +3,4 @@ Windows No gamepad detected ------------------- -#. Verify that you've installed `ViGEmBus `__. +#. Verify that you've installed `Nefarius Virtual Gamepad `__. diff --git a/src_assets/windows/misc/vigembus/install-vigembus.bat b/src_assets/windows/misc/gamepad/install-gamepad.bat similarity index 77% rename from src_assets/windows/misc/vigembus/install-vigembus.bat rename to src_assets/windows/misc/gamepad/install-gamepad.bat index bd62a7883d0..b4b63ca5d42 100644 --- a/src_assets/windows/misc/vigembus/install-vigembus.bat +++ b/src_assets/windows/misc/gamepad/install-gamepad.bat @@ -15,7 +15,7 @@ for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVer if !ProxyEnable! equ 0x1 ( for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^| find /i "ProxyServer"') do ( set proxy=%%a - echo Using system proxy !proxy! to download ViGEmBus + echo Using system proxy !proxy! to download Virtual Gamepad set proxy=-x !proxy! ) ) else ( @@ -23,8 +23,8 @@ for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVer ) ) -rem get browser_download_url from asset 0 of https://api.github.com/repos/vigem/vigembus/releases/latest -set latest_release_url=https://api.github.com/repos/vigem/vigembus/releases/latest +rem get browser_download_url from asset 0 of https://api.github.com/repos/nefarius/vigembus/releases/latest +set latest_release_url=https://api.github.com/repos/nefarius/vigembus/releases/latest rem Use curl to get the api response, and find the browser_download_url for /F "tokens=* USEBACKQ" %%F in (`curl -s !proxy! -L %latest_release_url% ^| findstr browser_download_url`) do ( @@ -40,10 +40,10 @@ set browser_download_url=%browser_download_url:browser_download_url: =% echo %browser_download_url% rem Download the exe -curl -s -L !proxy! -o "%temp_dir%\vigembus.exe" %browser_download_url% +curl -s -L !proxy! -o "%temp_dir%\virtual_gamepad.exe" %browser_download_url% -rem Install vigembus -%temp_dir%\vigembus.exe /passive /promptrestart +rem Install Virtual Gamepad +%temp_dir%\virtual_gamepad.exe /passive /promptrestart rem Delete temp directory rmdir /S /Q "%temp_dir%" diff --git a/src_assets/windows/misc/vigembus/uninstall-vigembus.bat b/src_assets/windows/misc/gamepad/uninstall-gamepad.bat similarity index 57% rename from src_assets/windows/misc/vigembus/uninstall-vigembus.bat rename to src_assets/windows/misc/gamepad/uninstall-gamepad.bat index 27fde2e6832..07204c8a064 100644 --- a/src_assets/windows/misc/vigembus/uninstall-vigembus.bat +++ b/src_assets/windows/misc/gamepad/uninstall-gamepad.bat @@ -1,4 +1,4 @@ @echo off -rem Use wmic to get the uninstall ViGEmBus +rem Use wmic to get the uninstall Virtual Gamepad wmic product where name="ViGEm Bus Driver" call uninstall diff --git a/third-party/ViGEmClient b/third-party/ViGEmClient index 9e842ba1c3a..b66d02d57e3 160000 --- a/third-party/ViGEmClient +++ b/third-party/ViGEmClient @@ -1 +1 @@ -Subproject commit 9e842ba1c3a6efbb90d9b7e9346a55b1a3d10494 +Subproject commit b66d02d57e32cc8595369c53418b843e958649b4 From eedad3b6e0e0ac26df5af704281e120bc8207f0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:23:31 -0400 Subject: [PATCH 167/576] build(deps): bump babel from 2.12.1 to 2.13.0 (#1697) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/requirements.txt b/scripts/requirements.txt index c3bc8a72530..4cb6e551faf 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1 +1 @@ -Babel==2.12.1 +Babel==2.13.0 From 0f734c3d9e4226ab80189ae754972135513d607e Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Wed, 4 Oct 2023 15:25:38 +0000 Subject: [PATCH 168/576] Fix shutdown when called from tray callback (#1691) --- src/system_tray.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system_tray.cpp b/src/system_tray.cpp index cab3ee9b72f..95eb9a7e41f 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -115,11 +115,12 @@ namespace system_tray { // If we're running in a service, return a special status to // tell it to terminate too, otherwise it will just respawn us. if (GetConsoleWindow() == NULL) { - lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, false); + lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, true); + return; } #endif - lifetime::exit_sunshine(0, false); + lifetime::exit_sunshine(0, true); } // Tray menu From 59210a3e35df51da425b44bf6e1847d3dd4ed8dc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 23:14:41 -0500 Subject: [PATCH 169/576] Automatically treat launcher-type apps as detached --- docs/source/about/usage.rst | 1 + src/process.cpp | 12 ++++++++++++ src/process.h | 2 ++ src_assets/common/assets/web/apps.html | 23 +++++++++++++++++++++++ 4 files changed, 38 insertions(+) diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 80d66a03932..b59df1281d3 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -254,6 +254,7 @@ Application List - ``image-path`` - The full path to the cover art image to use. - ``name`` - The name of the application/game - ``output`` - The file where the output of the command is stored + - ``auto-detach`` - Specifies whether the app should be treated as detached if it exits quickly - ``prep-cmd`` - A list of commands to be run before/after the application - If any of the prep-commands fail, starting the application is aborted diff --git a/src/process.cpp b/src/process.cpp index 8e8d2b35e2c..227c6fda148 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -227,6 +227,8 @@ namespace proc { } } + _app_launch_time = std::chrono::steady_clock::now(); + fg.disable(); return 0; @@ -237,9 +239,17 @@ namespace proc { if (placebo || _process.running()) { return _app_id; } + else if (_app.auto_detach && _process.native_exit_code() == 0 && + std::chrono::steady_clock::now() - _app_launch_time < 5s) { + BOOST_LOG(info) << "App exited gracefully within 5 seconds of launch. Treating the app as a detached command."sv; + BOOST_LOG(info) << "Adjust this behavior in the Applications tab or apps.json if this is not what you want."sv; + placebo = true; + return _app_id; + } // Perform cleanup actions now if needed if (_process) { + BOOST_LOG(info) << "App exited with code ["sv << _process.native_exit_code() << ']'; terminate(); } @@ -548,6 +558,7 @@ namespace proc { auto image_path = app_node.get_optional("image-path"s); auto working_dir = app_node.get_optional("working-dir"s); auto elevated = app_node.get_optional("elevated"s); + auto auto_detach = app_node.get_optional("auto-detach"s); std::vector prep_cmds; if (!exclude_global_prep.value_or(false)) { @@ -606,6 +617,7 @@ namespace proc { } ctx.elevated = elevated.value_or(false); + ctx.auto_detach = auto_detach.value_or(true); auto possible_ids = calculate_app_id(name, ctx.image_path, i++); if (ids.count(std::get<0>(possible_ids)) == 0) { diff --git a/src/process.h b/src/process.h index 5e658146db5..c1ff28afd5b 100644 --- a/src/process.h +++ b/src/process.h @@ -52,6 +52,7 @@ namespace proc { std::string image_path; std::string id; bool elevated; + bool auto_detach; }; class proc_t { @@ -93,6 +94,7 @@ namespace proc { boost::process::environment _env; std::vector _apps; ctx_t _app; + std::chrono::steady_clock::time_point _app_launch_time; // If no command associated with _app_id, yet it's still running bool placebo {}; diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index f8257ccaf5b..bd09051d669 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -229,6 +229,25 @@

Applications

permissions to run properly.

+ +
+ + +
+ This will attempt to automatically detect launcher-type apps that close + quickly after launching another program or instance of themselves. When + a launcher-type app is detected, it is treated as a detached app. +
+
@@ -379,6 +398,7 @@ index: -1, "exclude-global-prep-cmd": false, elevated: false, + "auto-detach": true, "prep-cmd": [], detached: [], "image-path": "" @@ -398,6 +418,9 @@ if(this.editForm["elevated"] === undefined && this.platform === 'windows'){ this.$set(this.editForm, "elevated", false); } + if(this.editForm["auto-detach"] === undefined){ + this.$set(this.editForm, "auto-detach", true); + } this.showEditForm = true; }, showDeleteForm(id) { From c4f8b6fdc216c70099e8c78480b452e3a223d5d7 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:26:09 -0400 Subject: [PATCH 170/576] fix(cmake): fix appimage assets directory (#1703) --- cmake/compile_definitions/linux.cmake | 6 ++++++ cmake/packaging/linux.cmake | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index 4f414745a03..97bd7eb5d00 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -2,6 +2,12 @@ add_compile_definitions(SUNSHINE_PLATFORM="linux") +# AppImage +if(${SUNSHINE_BUILD_APPIMAGE}) + # use relative assets path for AppImage + string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR}) +endif() + if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) set(SUNSHINE_EXECUTABLE_PATH "sunshine") endif() diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index acdf41c17cc..c36c7c0e0e0 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -1,11 +1,5 @@ # linux specific packaging -# AppImage -if(${SUNSHINE_BUILD_APPIMAGE}) - # use relative assets path for AppImage - string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR}) -endif() - install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK}) From 2865d3734f1d2d97763887f756921330c845e34a Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:55:57 -0400 Subject: [PATCH 171/576] docs: update localization (#1699) --- README.rst | 4 ---- docs/source/contributing/localization.rst | 16 +++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 929eba478fd..41ae6d8488e 100644 --- a/README.rst +++ b/README.rst @@ -96,10 +96,6 @@ Integrations :alt: Read the Docs :target: http://sunshinestream.readthedocs.io/ -.. image:: https://img.shields.io/badge/dynamic/json.svg?color=blue&label=localized&style=for-the-badge&query=%24.progress..data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json&logo=crowdin - :alt: CrowdIn - :target: https://crowdin.com/project/sunshinestream - Support ------- diff --git a/docs/source/contributing/localization.rst b/docs/source/contributing/localization.rst index 5ea262b89d7..ec6a43a5daf 100644 --- a/docs/source/contributing/localization.rst +++ b/docs/source/contributing/localization.rst @@ -1,19 +1,9 @@ Localization ============ Sunshine and related LizardByte projects are being localized into various languages. The default language is -`en` (English) and is highlighted green. - -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=de&style=for-the-badge&query=%24.progress.0.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=green&label=en&style=for-the-badge&query=%24.progress.1.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-GB&style=for-the-badge&query=%24.progress.2.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-US&style=for-the-badge&query=%24.progress.3.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=es-ES&style=for-the-badge&query=%24.progress.4.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=fr&style=for-the-badge&query=%24.progress.5.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=it&style=for-the-badge&query=%24.progress.6.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json -.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=ru&style=for-the-badge&query=%24.progress.7.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-606145.json - -Graph - .. image:: https://badges.awesome-crowdin.com/translation-15178612-606145.png +`en` (English). + + .. image:: https://badges.awesome-crowdin.com/translation-15178612-606145.png CrowdIn ------- From 3bf5efa08cec6f2f87b447e69fea06cf345e43f6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:07:49 -0500 Subject: [PATCH 172/576] Populate color properties on the AVFrame VideoToolbox reads them from the AVFrame instead of the AVCodecContext. --- src/video.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index ffd82c98c60..15acc9ee1dc 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1601,6 +1601,11 @@ namespace video { frame->format = ctx->pix_fmt; frame->width = ctx->width; frame->height = ctx->height; + frame->color_range = ctx->color_range; + frame->color_primaries = ctx->color_primaries; + frame->color_trc = ctx->color_trc; + frame->colorspace = ctx->colorspace; + frame->chroma_location = ctx->chroma_sample_location; // Attach HDR metadata to the AVFrame if (colorspace_is_hdr(colorspace)) { From 33b5ebb451e8b8aadcee64a2cf231d48ffce4cb4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:09:00 -0500 Subject: [PATCH 173/576] Fix loading dummy image in the sync encoding path --- src/video.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index 15acc9ee1dc..a6083f56a5a 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1880,6 +1880,12 @@ namespace video { return std::nullopt; } + // Load the initial image to prepare for encoding + if (session->convert(img)) { + BOOST_LOG(error) << "Could not convert initial image"sv; + return std::nullopt; + } + encode_session.session = std::move(session); return encode_session; From 0eba76fec4326b9e303db08ee1e83bb89dc3c51a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:09:41 -0500 Subject: [PATCH 174/576] Fix only capturing a single frame on macOS --- src/platform/macos/display.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/macos/display.mm b/src/platform/macos/display.mm index 4d45f6666da..639204a0b5d 100644 --- a/src/platform/macos/display.mm +++ b/src/platform/macos/display.mm @@ -74,7 +74,7 @@ img_out->row_pitch = CVPixelBufferGetBytesPerRow(pixelBuffer); img_out->pixel_pitch = img_out->row_pitch / img_out->width; - if (!push_captured_image_cb(std::move(img_out), false)) { + if (!push_captured_image_cb(std::move(img_out), true)) { // got interrupt signal // returning false here stops capture backend return false; From 8fd21bae5fe124bf9af13f2bf08a227ee3015f44 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:44:17 -0500 Subject: [PATCH 175/576] Use AVVideoScalingModeResizeAspect instead of abusing extended pixels This not only eliminates the hand-rolled aspect ratio correction (which didn't actually handle scaling), but it also avoids us having to write to the GPU frames to add padding which improves performance. --- src/platform/macos/av_video.h | 5 --- src/platform/macos/av_video.m | 52 +------------------------ src/platform/macos/display.mm | 12 ++---- src/platform/macos/nv12_zero_device.cpp | 34 +++------------- 4 files changed, 12 insertions(+), 91 deletions(-) diff --git a/src/platform/macos/av_video.h b/src/platform/macos/av_video.h index 83eabb8ebd4..4bfa00ac006 100644 --- a/src/platform/macos/av_video.h +++ b/src/platform/macos/av_video.h @@ -20,11 +20,6 @@ struct CaptureSession { @property (nonatomic, assign) OSType pixelFormat; @property (nonatomic, assign) int frameWidth; @property (nonatomic, assign) int frameHeight; -@property (nonatomic, assign) float scaling; -@property (nonatomic, assign) int paddingLeft; -@property (nonatomic, assign) int paddingRight; -@property (nonatomic, assign) int paddingTop; -@property (nonatomic, assign) int paddingBottom; typedef bool (^FrameCallbackBlock)(CMSampleBufferRef); diff --git a/src/platform/macos/av_video.m b/src/platform/macos/av_video.m index 6e3a9f81f66..c64597656cc 100644 --- a/src/platform/macos/av_video.m +++ b/src/platform/macos/av_video.m @@ -39,11 +39,6 @@ - (id)initWithDisplay:(CGDirectDisplayID)displayID frameRate:(int)frameRate { self.pixelFormat = kCVPixelFormatType_32BGRA; self.frameWidth = CGDisplayModeGetPixelWidth(mode); self.frameHeight = CGDisplayModeGetPixelHeight(mode); - self.scaling = CGDisplayPixelsWide(displayID) / CGDisplayModeGetPixelWidth(mode); - self.paddingLeft = 0; - self.paddingRight = 0; - self.paddingTop = 0; - self.paddingBottom = 0; self.minFrameDuration = CMTimeMake(1, frameRate); self.session = [[AVCaptureSession alloc] init]; self.videoOutputs = [[NSMapTable alloc] init]; @@ -77,48 +72,8 @@ - (void)dealloc { } - (void)setFrameWidth:(int)frameWidth frameHeight:(int)frameHeight { - CGImageRef screenshot = CGDisplayCreateImage(self.displayID); - self.frameWidth = frameWidth; self.frameHeight = frameHeight; - - double screenRatio = (double) CGImageGetWidth(screenshot) / (double) CGImageGetHeight(screenshot); - double streamRatio = (double) frameWidth / (double) frameHeight; - - if (screenRatio < streamRatio) { - int padding = frameWidth - (frameHeight * screenRatio); - self.paddingLeft = padding / 2; - self.paddingRight = padding - self.paddingLeft; - self.paddingTop = 0; - self.paddingBottom = 0; - } - else { - int padding = frameHeight - (frameWidth / screenRatio); - self.paddingLeft = 0; - self.paddingRight = 0; - self.paddingTop = padding / 2; - self.paddingBottom = padding - self.paddingTop; - } - - // XXX: if the streamed image is larger than the native resolution, we add a black box around - // the frame. Instead the frame should be resized entirely. - int delta_width = frameWidth - (CGImageGetWidth(screenshot) + self.paddingLeft + self.paddingRight); - if (delta_width > 0) { - int adjust_left = delta_width / 2; - int adjust_right = delta_width - adjust_left; - self.paddingLeft += adjust_left; - self.paddingRight += adjust_right; - } - - int delta_height = frameHeight - (CGImageGetHeight(screenshot) + self.paddingTop + self.paddingBottom); - if (delta_height > 0) { - int adjust_top = delta_height / 2; - int adjust_bottom = delta_height - adjust_top; - self.paddingTop += adjust_top; - self.paddingBottom += adjust_bottom; - } - - CFRelease(screenshot); } - (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback { @@ -128,11 +83,8 @@ - (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback { [videoOutput setVideoSettings:@{ (NSString *) kCVPixelBufferPixelFormatTypeKey: [NSNumber numberWithUnsignedInt:self.pixelFormat], (NSString *) kCVPixelBufferWidthKey: [NSNumber numberWithInt:self.frameWidth], - (NSString *) kCVPixelBufferExtendedPixelsRightKey: [NSNumber numberWithInt:self.paddingRight], - (NSString *) kCVPixelBufferExtendedPixelsLeftKey: [NSNumber numberWithInt:self.paddingLeft], - (NSString *) kCVPixelBufferExtendedPixelsTopKey: [NSNumber numberWithInt:self.paddingTop], - (NSString *) kCVPixelBufferExtendedPixelsBottomKey: [NSNumber numberWithInt:self.paddingBottom], - (NSString *) kCVPixelBufferHeightKey: [NSNumber numberWithInt:self.frameHeight] + (NSString *) kCVPixelBufferHeightKey: [NSNumber numberWithInt:self.frameHeight], + (NSString *) AVVideoScalingModeKey: AVVideoScalingModeResizeAspect, }]; dispatch_queue_attr_t qos = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, diff --git a/src/platform/macos/display.mm b/src/platform/macos/display.mm index 639204a0b5d..60591ba31a5 100644 --- a/src/platform/macos/display.mm +++ b/src/platform/macos/display.mm @@ -66,11 +66,9 @@ av_img->pixel_buffer = pixelBuffer; img_out->data = (uint8_t *) CVPixelBufferGetBaseAddress(pixelBuffer); - size_t extraPixels[4]; - CVPixelBufferGetExtendedPixels(pixelBuffer, &extraPixels[0], &extraPixels[1], &extraPixels[2], &extraPixels[3]); - img_out->width = CVPixelBufferGetWidth(pixelBuffer) + extraPixels[0] + extraPixels[1]; - img_out->height = CVPixelBufferGetHeight(pixelBuffer) + extraPixels[2] + extraPixels[3]; + img_out->width = CVPixelBufferGetWidth(pixelBuffer); + img_out->height = CVPixelBufferGetHeight(pixelBuffer); img_out->row_pitch = CVPixelBufferGetBytesPerRow(pixelBuffer); img_out->pixel_pitch = img_out->row_pitch / img_out->width; @@ -136,11 +134,9 @@ av_img->pixel_buffer = pixelBuffer; img->data = (uint8_t *) CVPixelBufferGetBaseAddress(pixelBuffer); - size_t extraPixels[4]; - CVPixelBufferGetExtendedPixels(pixelBuffer, &extraPixels[0], &extraPixels[1], &extraPixels[2], &extraPixels[3]); - img->width = CVPixelBufferGetWidth(pixelBuffer) + extraPixels[0] + extraPixels[1]; - img->height = CVPixelBufferGetHeight(pixelBuffer) + extraPixels[2] + extraPixels[3]; + img->width = CVPixelBufferGetWidth(pixelBuffer); + img->height = CVPixelBufferGetHeight(pixelBuffer); img->row_pitch = CVPixelBufferGetBytesPerRow(pixelBuffer); img->pixel_pitch = img->row_pitch / img->width; diff --git a/src/platform/macos/nv12_zero_device.cpp b/src/platform/macos/nv12_zero_device.cpp index 318f7bf0187..8ffbb712399 100644 --- a/src/platform/macos/nv12_zero_device.cpp +++ b/src/platform/macos/nv12_zero_device.cpp @@ -26,37 +26,15 @@ namespace platf { av_img_t *av_img = (av_img_t *) &img; - size_t left_pad, right_pad, top_pad, bottom_pad; - CVPixelBufferGetExtendedPixels(av_img->pixel_buffer, &left_pad, &right_pad, &top_pad, &bottom_pad); - - const uint8_t *data = (const uint8_t *) CVPixelBufferGetBaseAddressOfPlane(av_img->pixel_buffer, 0) - left_pad - (top_pad * img.width); - - int result = av_image_fill_arrays(av_frame->data, av_frame->linesize, data, (AVPixelFormat) av_frame->format, img.width, img.height, 32); - - // We will create the black bars for the padding top/bottom or left/right here in very cheap way. - // The luminance is 0, therefore, we simply need to set the chroma values to 128 for each pixel - // for black bars (instead of green with chroma 0). However, this only works 100% correct, when - // the resolution is devisable by 32. This could be improved by calculating the chroma values for - // the outer content pixels, which should introduce only a minor performance hit. - // - // XXX: Improve the algorithm to take into account the outer pixels - - size_t uv_plane_height = CVPixelBufferGetHeightOfPlane(av_img->pixel_buffer, 1); - - if (left_pad || right_pad) { - for (int l = 0; l < uv_plane_height + (top_pad / 2); l++) { - int line = l * av_frame->linesize[1]; - memset((void *) &av_frame->data[1][line], 128, (size_t) left_pad); - memset((void *) &av_frame->data[1][line + img.width - right_pad], 128, right_pad); - } + // Set up the data fields in the AVFrame to point into the mapped CVPixelBuffer + int planes = CVPixelBufferGetPlaneCount(av_img->pixel_buffer->buf); + for (int i = 0; i < planes; i++) { + av_frame->linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(av_img->pixel_buffer->buf, i); + av_frame->data[i] = (uint8_t *) CVPixelBufferGetBaseAddressOfPlane(av_img->pixel_buffer->buf, i); } - if (top_pad || bottom_pad) { - memset((void *) &av_frame->data[1][0], 128, (top_pad / 2) * av_frame->linesize[1]); - memset((void *) &av_frame->data[1][((top_pad / 2) + uv_plane_height) * av_frame->linesize[1]], 128, bottom_pad / 2 * av_frame->linesize[1]); - } - return result > 0 ? 0 : -1; + return 0; } int From a88f246a211d64ec6c79d2636315767b0e6b8fc9 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:48:04 -0500 Subject: [PATCH 176/576] Fix CVPixelBuffer/CMSampleBuffer ownership issues --- src/platform/macos/av_img_t.h | 41 ++++++++++++++++++--- src/platform/macos/display.mm | 48 ++++--------------------- src/platform/macos/nv12_zero_device.cpp | 7 ++-- src/platform/macos/nv12_zero_device.h | 9 +++++ 4 files changed, 57 insertions(+), 48 deletions(-) diff --git a/src/platform/macos/av_img_t.h b/src/platform/macos/av_img_t.h index f42f9ceb12e..6002bdcb221 100644 --- a/src/platform/macos/av_img_t.h +++ b/src/platform/macos/av_img_t.h @@ -10,10 +10,43 @@ #include namespace platf { - struct av_img_t: public img_t { - CVPixelBufferRef pixel_buffer = nullptr; - CMSampleBufferRef sample_buffer = nullptr; + struct av_sample_buf_t { + av_sample_buf_t(CMSampleBufferRef buf): + buf((CMSampleBufferRef) CFRetain(buf)) {} + + ~av_sample_buf_t() { + CFRelease(buf); + } + + CMSampleBufferRef buf; + }; + + struct av_pixel_buf_t { + av_pixel_buf_t(CVPixelBufferRef buf): + buf((CVPixelBufferRef) CFRetain(buf)), + locked(false) {} - ~av_img_t(); + uint8_t * + lock() { + if (!locked) { + CVPixelBufferLockBaseAddress(buf, kCVPixelBufferLock_ReadOnly); + } + return (uint8_t *) CVPixelBufferGetBaseAddress(buf); + } + + ~av_pixel_buf_t() { + if (locked) { + CVPixelBufferUnlockBaseAddress(buf, kCVPixelBufferLock_ReadOnly); + } + CFRelease(buf); + } + + CVPixelBufferRef buf; + bool locked; + }; + + struct av_img_t: public img_t { + std::shared_ptr sample_buffer; + std::shared_ptr pixel_buffer; }; } // namespace platf diff --git a/src/platform/macos/display.mm b/src/platform/macos/display.mm index 60591ba31a5..194848fcaa7 100644 --- a/src/platform/macos/display.mm +++ b/src/platform/macos/display.mm @@ -20,18 +20,6 @@ namespace platf { using namespace std::literals; - av_img_t::~av_img_t() { - if (pixel_buffer != NULL) { - CVPixelBufferUnlockBaseAddress(pixel_buffer, 0); - } - - if (sample_buffer != nullptr) { - CFRelease(sample_buffer); - } - - data = nullptr; - } - struct av_display_t: public display_t { AVVideo *av_capture; CGDirectDisplayID display_id; @@ -43,11 +31,6 @@ capture_e capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor) override { auto signal = [av_capture capture:^(CMSampleBufferRef sampleBuffer) { - CFRetain(sampleBuffer); - - CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); - CVPixelBufferLockBaseAddress(pixelBuffer, kCVPixelBufferLock_ReadOnly); - std::shared_ptr img_out; if (!pull_free_image_cb(img_out)) { // got interrupt signal @@ -56,16 +39,11 @@ } auto av_img = std::static_pointer_cast(img_out); - if (av_img->pixel_buffer != nullptr) - CVPixelBufferUnlockBaseAddress(av_img->pixel_buffer, 0); - - if (av_img->sample_buffer != nullptr) - CFRelease(av_img->sample_buffer); - - av_img->sample_buffer = sampleBuffer; - av_img->pixel_buffer = pixelBuffer; - img_out->data = (uint8_t *) CVPixelBufferGetBaseAddress(pixelBuffer); + CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); + av_img->sample_buffer = std::make_shared(sampleBuffer); + av_img->pixel_buffer = std::make_shared(pixelBuffer); + img_out->data = av_img->pixel_buffer->lock(); img_out->width = CVPixelBufferGetWidth(pixelBuffer); img_out->height = CVPixelBufferGetHeight(pixelBuffer); @@ -117,23 +95,11 @@ auto signal = [av_capture capture:^(CMSampleBufferRef sampleBuffer) { auto av_img = (av_img_t *) img; - CFRetain(sampleBuffer); - CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); - CVPixelBufferLockBaseAddress(pixelBuffer, kCVPixelBufferLock_ReadOnly); - - // XXX: next_img->img should be moved to a smart pointer with - // the CFRelease as custom deallocator - if (av_img->pixel_buffer != nullptr) - CVPixelBufferUnlockBaseAddress(((av_img_t *) img)->pixel_buffer, 0); - - if (av_img->sample_buffer != nullptr) - CFRelease(av_img->sample_buffer); - - av_img->sample_buffer = sampleBuffer; - av_img->pixel_buffer = pixelBuffer; - img->data = (uint8_t *) CVPixelBufferGetBaseAddress(pixelBuffer); + av_img->sample_buffer = std::make_shared(sampleBuffer); + av_img->pixel_buffer = std::make_shared(pixelBuffer); + img->data = av_img->pixel_buffer->lock(); img->width = CVPixelBufferGetWidth(pixelBuffer); img->height = CVPixelBufferGetHeight(pixelBuffer); diff --git a/src/platform/macos/nv12_zero_device.cpp b/src/platform/macos/nv12_zero_device.cpp index 8ffbb712399..a8b7520272e 100644 --- a/src/platform/macos/nv12_zero_device.cpp +++ b/src/platform/macos/nv12_zero_device.cpp @@ -3,7 +3,6 @@ * @brief todo */ #include "src/platform/macos/nv12_zero_device.h" -#include "src/platform/macos/av_img_t.h" #include "src/video.h" @@ -18,8 +17,6 @@ namespace platf { av_frame_free(&frame); } - util::safe_ptr av_frame; - int nv12_zero_device::convert(platf::img_t &img) { av_frame_make_writable(av_frame.get()); @@ -33,6 +30,10 @@ namespace platf { av_frame->data[i] = (uint8_t *) CVPixelBufferGetBaseAddressOfPlane(av_img->pixel_buffer->buf, i); } + // We just set data pointers to point into our CVPixelBuffer above, so we have to hold + // a reference to these buffers to keep them around until the AVFrame is done using them. + backing_img.sample_buffer = av_img->sample_buffer; + backing_img.pixel_buffer = av_img->pixel_buffer; return 0; } diff --git a/src/platform/macos/nv12_zero_device.h b/src/platform/macos/nv12_zero_device.h index 53b211d4c17..574da984d85 100644 --- a/src/platform/macos/nv12_zero_device.h +++ b/src/platform/macos/nv12_zero_device.h @@ -5,8 +5,13 @@ #pragma once #include "src/platform/common.h" +#include "src/platform/macos/av_img_t.h" + +struct AVFrame; namespace platf { + void + free_frame(AVFrame *frame); class nv12_zero_device: public avcodec_encode_device_t { // display holds a pointer to an av_video object. Since the namespaces of AVFoundation @@ -27,6 +32,10 @@ namespace platf { convert(img_t &img); int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx); + + private: + util::safe_ptr av_frame; + av_img_t backing_img; }; } // namespace platf From 4848e5a595eb3565324fc8ddff7fe7180712d6d3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 20:55:50 -0500 Subject: [PATCH 177/576] Implement zero-copy 8/10 bit encoding for macOS --- src/platform/common.h | 1 + src/platform/macos/display.mm | 6 +++--- src/platform/macos/nv12_zero_device.cpp | 26 ++++++++++++------------- src/platform/macos/nv12_zero_device.h | 3 +-- src/video.cpp | 24 ++++++++++++++++++++--- 5 files changed, 38 insertions(+), 22 deletions(-) diff --git a/src/platform/common.h b/src/platform/common.h index 651e4d13c32..3301803a916 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -187,6 +187,7 @@ namespace platf { vaapi, dxgi, cuda, + videotoolbox, unknown }; diff --git a/src/platform/macos/display.mm b/src/platform/macos/display.mm index 194848fcaa7..f424cf4ece2 100644 --- a/src/platform/macos/display.mm +++ b/src/platform/macos/display.mm @@ -77,10 +77,10 @@ return std::make_unique(); } - else if (pix_fmt == pix_fmt_e::nv12) { + else if (pix_fmt == pix_fmt_e::nv12 || pix_fmt == pix_fmt_e::p010) { auto device = std::make_unique(); - device->init(static_cast(av_capture), setResolution, setPixelFormat); + device->init(static_cast(av_capture), pix_fmt, setResolution, setPixelFormat); return device; } @@ -135,7 +135,7 @@ std::shared_ptr display(platf::mem_type_e hwdevice_type, const std::string &display_name, const video::config_t &config) { - if (hwdevice_type != platf::mem_type_e::system) { + if (hwdevice_type != platf::mem_type_e::system && hwdevice_type != platf::mem_type_e::videotoolbox) { BOOST_LOG(error) << "Could not initialize display with the given hw device type."sv; return nullptr; } diff --git a/src/platform/macos/nv12_zero_device.cpp b/src/platform/macos/nv12_zero_device.cpp index a8b7520272e..881c86aa692 100644 --- a/src/platform/macos/nv12_zero_device.cpp +++ b/src/platform/macos/nv12_zero_device.cpp @@ -17,23 +17,19 @@ namespace platf { av_frame_free(&frame); } + void + free_buffer(void *opaque, uint8_t *data) { + CVPixelBufferRelease((CVPixelBufferRef) data); + } + int nv12_zero_device::convert(platf::img_t &img) { - av_frame_make_writable(av_frame.get()); - av_img_t *av_img = (av_img_t *) &img; - // Set up the data fields in the AVFrame to point into the mapped CVPixelBuffer - int planes = CVPixelBufferGetPlaneCount(av_img->pixel_buffer->buf); - for (int i = 0; i < planes; i++) { - av_frame->linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(av_img->pixel_buffer->buf, i); - av_frame->data[i] = (uint8_t *) CVPixelBufferGetBaseAddressOfPlane(av_img->pixel_buffer->buf, i); - } + av_buffer_unref(&av_frame->buf[0]); - // We just set data pointers to point into our CVPixelBuffer above, so we have to hold - // a reference to these buffers to keep them around until the AVFrame is done using them. - backing_img.sample_buffer = av_img->sample_buffer; - backing_img.pixel_buffer = av_img->pixel_buffer; + av_frame->buf[0] = av_buffer_create((uint8_t *) CFRetain(av_img->pixel_buffer->buf), 0, free_buffer, NULL, 0); + av_frame->data[3] = (uint8_t *) av_img->pixel_buffer->buf; return 0; } @@ -50,8 +46,10 @@ namespace platf { } int - nv12_zero_device::init(void *display, resolution_fn_t resolution_fn, pixel_format_fn_t pixel_format_fn) { - pixel_format_fn(display, '420v'); + nv12_zero_device::init(void *display, pix_fmt_e pix_fmt, resolution_fn_t resolution_fn, pixel_format_fn_t pixel_format_fn) { + pixel_format_fn(display, pix_fmt == pix_fmt_e::nv12 ? + kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange : + kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange); this->display = display; this->resolution_fn = resolution_fn; diff --git a/src/platform/macos/nv12_zero_device.h b/src/platform/macos/nv12_zero_device.h index 574da984d85..f1ee2702aad 100644 --- a/src/platform/macos/nv12_zero_device.h +++ b/src/platform/macos/nv12_zero_device.h @@ -26,7 +26,7 @@ namespace platf { using pixel_format_fn_t = std::function; int - init(void *display, resolution_fn_t resolution_fn, pixel_format_fn_t pixel_format_fn); + init(void *display, pix_fmt_e pix_fmt, resolution_fn_t resolution_fn, pixel_format_fn_t pixel_format_fn); int convert(img_t &img); @@ -35,7 +35,6 @@ namespace platf { private: util::safe_ptr av_frame; - av_img_t backing_img; }; } // namespace platf diff --git a/src/video.cpp b/src/video.cpp index a6083f56a5a..52d454f468a 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -94,6 +94,8 @@ namespace video { vaapi_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); util::Either cuda_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); + util::Either + vt_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); class avcodec_software_encode_device_t: public platf::avcodec_encode_device_t { public: @@ -930,10 +932,10 @@ namespace video { static encoder_t videotoolbox { "videotoolbox"sv, std::make_unique( - AV_HWDEVICE_TYPE_NONE, AV_HWDEVICE_TYPE_NONE, + AV_HWDEVICE_TYPE_VIDEOTOOLBOX, AV_HWDEVICE_TYPE_NONE, AV_PIX_FMT_VIDEOTOOLBOX, - AV_PIX_FMT_NV12, AV_PIX_FMT_NV12, - nullptr), + AV_PIX_FMT_NV12, AV_PIX_FMT_P010, + vt_init_avcodec_hardware_input_buffer), { // Common options { @@ -2634,6 +2636,20 @@ namespace video { return hw_device_buf; } + util::Either + vt_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *encode_device) { + avcodec_buffer_t hw_device_buf; + + auto status = av_hwdevice_ctx_create(&hw_device_buf, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, nullptr, nullptr, 0); + if (status < 0) { + char string[AV_ERROR_MAX_STRING_SIZE]; + BOOST_LOG(error) << "Failed to create a VideoToolbox device: "sv << av_make_error_string(string, AV_ERROR_MAX_STRING_SIZE, status); + return -1; + } + + return hw_device_buf; + } + #ifdef _WIN32 } @@ -2712,6 +2728,8 @@ namespace video { return platf::mem_type_e::cuda; case AV_HWDEVICE_TYPE_NONE: return platf::mem_type_e::system; + case AV_HWDEVICE_TYPE_VIDEOTOOLBOX: + return platf::mem_type_e::videotoolbox; default: return platf::mem_type_e::unknown; } From 6656c67f243ee4bf32b99a9440650b2196480f22 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 20:57:00 -0500 Subject: [PATCH 178/576] Set prio_speed=1 on VideoToolbox encoder This can massively improve encoding performance. See https://github.com/FFmpeg/FFmpeg/commit/b67572c7c707d508b15ce0543519208cf5d1fcfb --- src/video.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index 52d454f468a..a0ab84c6549 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -942,6 +942,7 @@ namespace video { { "allow_sw"s, &config::video.vt.vt_allow_sw }, { "require_sw"s, &config::video.vt.vt_require_sw }, { "realtime"s, &config::video.vt.vt_realtime }, + { "prio_speed"s, 1 }, }, {}, // SDR-specific options {}, // HDR-specific options @@ -954,6 +955,7 @@ namespace video { { "allow_sw"s, &config::video.vt.vt_allow_sw }, { "require_sw"s, &config::video.vt.vt_require_sw }, { "realtime"s, &config::video.vt.vt_realtime }, + { "prio_speed"s, 1 }, }, {}, // SDR-specific options {}, // HDR-specific options @@ -966,6 +968,7 @@ namespace video { { "allow_sw"s, &config::video.vt.vt_allow_sw }, { "require_sw"s, &config::video.vt.vt_require_sw }, { "realtime"s, &config::video.vt.vt_realtime }, + { "prio_speed"s, 1 }, }, {}, // SDR-specific options {}, // HDR-specific options From e0d70ec35b261a58bdaacdb702636d11e437ecf8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 4 Oct 2023 19:45:35 -0500 Subject: [PATCH 179/576] Add comments clarifying AVBufferRef usage and ownership --- src/platform/macos/nv12_zero_device.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/macos/nv12_zero_device.cpp b/src/platform/macos/nv12_zero_device.cpp index 881c86aa692..f376bdcd413 100644 --- a/src/platform/macos/nv12_zero_device.cpp +++ b/src/platform/macos/nv12_zero_device.cpp @@ -26,9 +26,17 @@ namespace platf { nv12_zero_device::convert(platf::img_t &img) { av_img_t *av_img = (av_img_t *) &img; + // Release any existing CVPixelBuffer previously retained for encoding av_buffer_unref(&av_frame->buf[0]); + // Attach an AVBufferRef to this frame which will retain ownership of the CVPixelBuffer + // until av_buffer_unref() is called (above) or the frame is freed with av_frame_free(). + // + // The presence of the AVBufferRef allows FFmpeg to simply add a reference to the buffer + // rather than having to perform a deep copy of the data buffers in avcodec_send_frame(). av_frame->buf[0] = av_buffer_create((uint8_t *) CFRetain(av_img->pixel_buffer->buf), 0, free_buffer, NULL, 0); + + // Place a CVPixelBufferRef at data[3] as required by AV_PIX_FMT_VIDEOTOOLBOX av_frame->data[3] = (uint8_t *) av_img->pixel_buffer->buf; return 0; From 44d654ae6ac5b4ed833a141829f7f04a129f1bcb Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:24:58 -0400 Subject: [PATCH 180/576] ci: update global workflows (#1705) --- .github/dependabot.yml | 6 -- .github/workflows/autoupdate-labeler.yml | 72 ------------------------ .github/workflows/autoupdate.yml | 51 ----------------- .github/workflows/issues-stale.yml | 12 ++-- .github/workflows/pull-requests.yml | 32 ----------- 5 files changed, 7 insertions(+), 166 deletions(-) delete mode 100644 .github/workflows/autoupdate-labeler.yml delete mode 100644 .github/workflows/autoupdate.yml delete mode 100644 .github/workflows/pull-requests.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 88c8339c68f..6eb0cda2bd1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,6 @@ updates: schedule: interval: "daily" time: "08:00" - target-branch: "nightly" open-pull-requests-limit: 10 - package-ecosystem: "github-actions" @@ -18,7 +17,6 @@ updates: schedule: interval: "daily" time: "08:30" - target-branch: "nightly" open-pull-requests-limit: 10 - package-ecosystem: "npm" @@ -26,7 +24,6 @@ updates: schedule: interval: "daily" time: "09:00" - target-branch: "nightly" open-pull-requests-limit: 10 - package-ecosystem: "nuget" @@ -34,7 +31,6 @@ updates: schedule: interval: "daily" time: "09:30" - target-branch: "nightly" open-pull-requests-limit: 10 - package-ecosystem: "pip" @@ -42,7 +38,6 @@ updates: schedule: interval: "daily" time: "10:00" - target-branch: "nightly" open-pull-requests-limit: 10 - package-ecosystem: "gitsubmodule" @@ -50,5 +45,4 @@ updates: schedule: interval: "daily" time: "10:30" - target-branch: "nightly" open-pull-requests-limit: 10 diff --git a/.github/workflows/autoupdate-labeler.yml b/.github/workflows/autoupdate-labeler.yml deleted file mode 100644 index 974c9fa7fd1..00000000000 --- a/.github/workflows/autoupdate-labeler.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Label PRs with `autoupdate` if various conditions are met, otherwise, remove the label. - -name: Label PR autoupdate - -on: - pull_request_target: - types: - - edited - - opened - - reopened - - synchronize - -jobs: - label_pr: - if: >- - startsWith(github.repository, 'LizardByte/') && - contains(github.event.pull_request.body, fromJSON('"] I want maintainers to keep my branch updated"')) - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - steps: - - name: Check if member - id: org_member - run: | - status="true" - gh api \ - -H "Accept: application/vnd.github+json" \ - /orgs/${{ github.repository_owner }}/members/${{ github.actor }} || status="false" - - echo "result=${status}" >> $GITHUB_OUTPUT - - - name: Label autoupdate - if: >- - steps.org_member.outputs.result == 'true' && - contains(github.event.pull_request.labels.*.name, 'autoupdate') == false && - contains(github.event.pull_request.body, - fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == true - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GH_BOT_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['autoupdate'] - }) - - - name: Unlabel autoupdate - if: >- - contains(github.event.pull_request.labels.*.name, 'autoupdate') && - ( - (github.event.action == 'synchronize' && steps.org_member.outputs.result == 'false') || - (contains(github.event.pull_request.body, - fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == false - ) - ) - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GH_BOT_TOKEN }} - script: | - github.rest.issues.removeLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: ['autoupdate'] - }) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml deleted file mode 100644 index 83f4e161824..00000000000 --- a/.github/workflows/autoupdate.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow is designed to work with the following workflows: -# - automerge -# - autoupdate-labeler - -# It uses an action that auto-updates pull requests branches, when changes are pushed to their destination branch. -# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks. -# Dependabot PRs are updated by an action that comments `@depdenabot rebase` on dependabot PRs. (disabled) - -name: autoupdate - -on: - push: - branches: - - 'nightly' - -jobs: - autoupdate: - name: Autoupdate autoapproved PR created in the upstream - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - name: Update - uses: docker://chinthakagodawita/autoupdate-action:v1 - env: - EXCLUDED_LABELS: "central_dependency,dependencies" - GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}' - PR_FILTER: "labelled" - PR_LABELS: "autoupdate" - PR_READY_STATE: "all" - MERGE_CONFLICT_ACTION: "fail" - -# Disabled due to: -# - no major version tag, resulting in constant nagging to update this action -# - additionally, the code is sketchy, 16k+ lines of code? -# https://github.com/bbeesley/gha-auto-dependabot-rebase/blob/main/dist/main.cjs -# -# dependabot-rebase: -# name: Dependabot Rebase -# if: >- -# startsWith(github.repository, 'LizardByte/') -# runs-on: ubuntu-latest -# steps: -# - name: rebase -# uses: "bbeesley/gha-auto-dependabot-rebase@v1.3.18" -# env: -# GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/issues-stale.yml b/.github/workflows/issues-stale.yml index c168034ee3b..3ba3886160f 100644 --- a/.github/workflows/issues-stale.yml +++ b/.github/workflows/issues-stale.yml @@ -31,12 +31,15 @@ jobs: exempt-pr-labels: 'dependencies,l10n' stale-issue-label: 'stale' stale-issue-message: > - This issue is stale because it has been open for 90 days with no activity. - Comment or remove the stale label, otherwise this will be closed in 10 days. + :wave: @{issue-author}, It seems this issue hasn't had any activity in the past 90 days. + If it's still something you'd like addressed, please let us know by leaving a comment. + Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks! stale-pr-label: 'stale' stale-pr-message: > - This PR is stale because it has been open for 90 days with no activity. - Comment or remove the stale label, otherwise this will be closed in 10 days. + :wave: @{issue-author}, It looks like this PR has been idle for 90 days. + If it's still something you're working on or would like to pursue, + please leave a comment or update your branch. + Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! repo-token: ${{ secrets.GH_BOT_TOKEN }} - name: Invalid Template @@ -48,7 +51,6 @@ jobs: This PR was closed because the the template was not completed after 5 days. days-before-stale: 0 days-before-close: 5 - exempt-pr-labels: 'dependencies,l10n' only-labels: 'invalid:template-incomplete' stale-issue-label: 'invalid:template-incomplete' stale-issue-message: > diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml deleted file mode 100644 index 58243872498..00000000000 --- a/.github/workflows/pull-requests.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Ensure PRs are made against `nightly` branch. - -name: Pull Requests - -on: - pull_request_target: - types: [opened, synchronize, edited, reopened] - -# no concurrency for pull_request_target events - -jobs: - check-pull-request: - name: Check Pull Request - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - uses: Vankka/pr-target-branch-action@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - target: master - exclude: nightly # Don't prevent going from nightly -> master - change-to: nightly - comment: | - Your PR was set to `master`, PRs should be sent to `nightly`. - The base branch of this PR has been automatically changed to `nightly`. - Please check that there are no merge conflicts From 62e3dab968465fb136044817a6a928a2f7a91226 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 4 Oct 2023 21:55:32 -0500 Subject: [PATCH 181/576] Don't start the session monitor window when launched in command mode --- src/main.cpp | 84 ++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a2aee13f197..6d761b22f00 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -489,48 +489,6 @@ main(int argc, char *argv[]) { #ifdef _WIN32 // Switch default C standard library locale to UTF-8 on Windows 10 1803+ setlocale(LC_ALL, ".UTF-8"); - - // Wait as long as possible to terminate Sunshine.exe during logoff/shutdown - SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); - - // We must create a hidden window to receive shutdown notifications since we load gdi32.dll - std::thread window_thread([]() { - WNDCLASSA wnd_class {}; - wnd_class.lpszClassName = "SunshineSessionMonitorClass"; - wnd_class.lpfnWndProc = SessionMonitorWindowProc; - if (!RegisterClassA(&wnd_class)) { - std::cout << "Failed to register session monitor window class"sv << std::endl; - return; - } - - auto wnd = CreateWindowExA( - 0, - wnd_class.lpszClassName, - "Sunshine Session Monitor Window", - 0, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - nullptr, - nullptr, - nullptr, - nullptr); - if (!wnd) { - std::cout << "Failed to create session monitor window"sv << std::endl; - return; - } - - ShowWindow(wnd, SW_HIDE); - - // Run the message loop for our window - MSG msg {}; - while (GetMessage(&msg, nullptr, 0, 0) > 0) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - }); - window_thread.detach(); #endif // Use UTF-8 conversion for the default C++ locale (used by boost::log) @@ -650,6 +608,48 @@ main(int argc, char *argv[]) { // Unload dynamic library to survive driver reinstallation nvprefs_instance.unload(); } + + // Wait as long as possible to terminate Sunshine.exe during logoff/shutdown + SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); + + // We must create a hidden window to receive shutdown notifications since we load gdi32.dll + std::thread window_thread([]() { + WNDCLASSA wnd_class {}; + wnd_class.lpszClassName = "SunshineSessionMonitorClass"; + wnd_class.lpfnWndProc = SessionMonitorWindowProc; + if (!RegisterClassA(&wnd_class)) { + BOOST_LOG(error) << "Failed to register session monitor window class"sv << std::endl; + return; + } + + auto wnd = CreateWindowExA( + 0, + wnd_class.lpszClassName, + "Sunshine Session Monitor Window", + 0, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + nullptr, + nullptr, + nullptr, + nullptr); + if (!wnd) { + BOOST_LOG(error) << "Failed to create session monitor window"sv << std::endl; + return; + } + + ShowWindow(wnd, SW_HIDE); + + // Run the message loop for our window + MSG msg {}; + while (GetMessage(&msg, nullptr, 0, 0) > 0) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + }); + window_thread.detach(); #endif BOOST_LOG(info) << PROJECT_NAME << " version: " << PROJECT_VER << std::endl; From de183034bbfee3acafbfd83d982801db891b14ee Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Sun, 10 Sep 2023 12:35:31 +0300 Subject: [PATCH 182/576] Support #include in dx shader compiler --- src/platform/windows/display_vram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index bf8fb569160..5cd6efc14f1 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -345,7 +345,7 @@ namespace platf::dxgi { std::wstring_convert, wchar_t> converter; auto wFile = converter.from_bytes(file); - auto status = D3DCompileFromFile(wFile.c_str(), nullptr, nullptr, entrypoint, shader_model, flags, 0, &compiled_p, &msg_p); + auto status = D3DCompileFromFile(wFile.c_str(), nullptr, D3D_COMPILE_STANDARD_FILE_INCLUDE, entrypoint, shader_model, flags, 0, &compiled_p, &msg_p); if (msg_p) { BOOST_LOG(warning) << std::string_view { (const char *) msg_p->GetBufferPointer(), msg_p->GetBufferSize() - 1 }; From d606dfde4af78024e6a480b1b9bcd31cd8623260 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Sun, 10 Sep 2023 12:36:08 +0300 Subject: [PATCH 183/576] Refactor shaders --- src/platform/windows/display_vram.cpp | 139 +++++++----------- .../assets/shaders/directx/ConvertUVPS.hlsl | 33 ----- .../shaders/directx/ConvertUVPS_Linear.hlsl | 36 ----- .../shaders/directx/ConvertUVPS_PQ.hlsl | 69 --------- .../assets/shaders/directx/ConvertUVVS.hlsl | 46 ------ .../assets/shaders/directx/ConvertYPS.hlsl | 25 ---- .../shaders/directx/ConvertYPS_Linear.hlsl | 31 ---- .../assets/shaders/directx/CursorVS.hlsl | 37 ----- .../assets/shaders/directx/ScenePS.hlsl | 14 -- .../assets/shaders/directx/ScenePS_NW.hlsl | 22 --- .../assets/shaders/directx/SceneVS.hlsl | 37 ----- .../convert_yuv420_packed_uv_type0_ps.hlsl | 5 + ...vert_yuv420_packed_uv_type0_ps_linear.hlsl | 5 + ...cked_uv_type0_ps_perceptual_quantizer.hlsl | 5 + .../convert_yuv420_packed_uv_type0_vs.hlsl | 15 ++ .../directx/convert_yuv420_planar_y_ps.hlsl | 3 + .../convert_yuv420_planar_y_ps_linear.hlsl | 3 + ...v420_planar_y_ps_perceptual_quantizer.hlsl | 3 + .../directx/convert_yuv420_planar_y_vs.hlsl | 10 ++ .../assets/shaders/directx/cursor_ps.hlsl | 9 ++ .../directx/cursor_ps_normalize_white.hlsl | 17 +++ .../assets/shaders/directx/cursor_vs.hlsl | 10 ++ .../shaders/directx/include/base_vs.hlsl | 45 ++++++ .../directx/include/base_vs_types.hlsl | 12 ++ .../common.hlsl} | 103 ++++++------- .../shaders/directx/include/convert_base.hlsl | 1 + .../directx/include/convert_linear_base.hlsl | 6 + .../convert_perceptual_quantizer_base.hlsl | 3 + .../convert_yuv420_packed_uv_ps_base.hlsl | 35 +++++ .../convert_yuv420_planar_y_ps_base.hlsl | 21 +++ 30 files changed, 302 insertions(+), 498 deletions(-) delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertUVPS_Linear.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertUVPS_PQ.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ConvertYPS_Linear.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/CursorVS.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ScenePS.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/ScenePS_NW.hlsl delete mode 100644 src_assets/windows/assets/shaders/directx/SceneVS.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_linear.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_perceptual_quantizer.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_linear.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_perceptual_quantizer.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/cursor_ps.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/cursor_ps_normalize_white.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/cursor_vs.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/base_vs.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl rename src_assets/windows/assets/shaders/directx/{ConvertYPS_PQ.hlsl => include/common.hlsl} (65%) create mode 100644 src_assets/windows/assets/shaders/directx/include/convert_base.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/convert_linear_base.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/convert_perceptual_quantizer_base.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/convert_yuv420_packed_uv_ps_base.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/include/convert_yuv420_planar_y_ps_base.hlsl diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 5cd6efc14f1..a0dd4dbc57e 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -102,17 +102,17 @@ namespace platf::dxgi { return blend; } - blob_t convert_UV_vs_hlsl; - blob_t convert_UV_ps_hlsl; - blob_t convert_UV_linear_ps_hlsl; - blob_t convert_UV_PQ_ps_hlsl; - blob_t scene_vs_hlsl; + blob_t convert_yuv420_packed_uv_type0_ps_hlsl; + blob_t convert_yuv420_packed_uv_type0_ps_linear_hlsl; + blob_t convert_yuv420_packed_uv_type0_ps_perceptual_quantizer_hlsl; + blob_t convert_yuv420_packed_uv_type0_vs_hlsl; + blob_t convert_yuv420_planar_y_ps_hlsl; + blob_t convert_yuv420_planar_y_ps_linear_hlsl; + blob_t convert_yuv420_planar_y_ps_perceptual_quantizer_hlsl; + blob_t convert_yuv420_planar_y_vs_hlsl; + blob_t cursor_ps_hlsl; + blob_t cursor_ps_normalize_white_hlsl; blob_t cursor_vs_hlsl; - blob_t convert_Y_ps_hlsl; - blob_t convert_Y_linear_ps_hlsl; - blob_t convert_Y_PQ_ps_hlsl; - blob_t scene_ps_hlsl; - blob_t scene_NW_ps_hlsl; struct img_d3d_t: public platf::img_t { // These objects are owned by the display_t's ID3D11Device @@ -464,14 +464,14 @@ namespace platf::dxgi { outY_view = D3D11_VIEWPORT { offsetX, offsetY, out_width_f, out_height_f, 0.0f, 1.0f }; outUV_view = D3D11_VIEWPORT { offsetX / 2, offsetY / 2, out_width_f / 2, out_height_f / 2, 0.0f, 1.0f }; - float info_in[16 / sizeof(float)] { 1.0f / (float) out_width_f }; // aligned to 16-byte - info_scene = make_buffer(device.get(), info_in); + float subsample_offset_in[16 / sizeof(float)] { 1.0f / (float) out_width_f, 1.0f / (float) out_height_f }; // aligned to 16-byte + subsample_offset = make_buffer(device.get(), subsample_offset_in); - if (!info_scene) { - BOOST_LOG(error) << "Failed to create info scene buffer"sv; + if (!subsample_offset) { + BOOST_LOG(error) << "Failed to create subsample offset vertex constant buffer"; return -1; } - device_ctx->VSSetConstantBuffers(0, 1, &info_scene); + device_ctx->VSSetConstantBuffers(0, 1, &subsample_offset); { int32_t rotation_modifier = display->display_rotation == DXGI_MODE_ROTATION_UNSPECIFIED ? 0 : display->display_rotation - 1; @@ -553,13 +553,13 @@ namespace platf::dxgi { } format = (pix_fmt == pix_fmt_e::nv12 ? DXGI_FORMAT_NV12 : DXGI_FORMAT_P010); - status = device->CreateVertexShader(scene_vs_hlsl->GetBufferPointer(), scene_vs_hlsl->GetBufferSize(), nullptr, &scene_vs); + status = device->CreateVertexShader(convert_yuv420_planar_y_vs_hlsl->GetBufferPointer(), convert_yuv420_planar_y_vs_hlsl->GetBufferSize(), nullptr, &scene_vs); if (status) { BOOST_LOG(error) << "Failed to create scene vertex shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } - status = device->CreateVertexShader(convert_UV_vs_hlsl->GetBufferPointer(), convert_UV_vs_hlsl->GetBufferSize(), nullptr, &convert_UV_vs); + status = device->CreateVertexShader(convert_yuv420_packed_uv_type0_vs_hlsl->GetBufferPointer(), convert_yuv420_packed_uv_type0_vs_hlsl->GetBufferSize(), nullptr, &convert_UV_vs); if (status) { BOOST_LOG(error) << "Failed to create convertUV vertex shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -567,13 +567,13 @@ namespace platf::dxgi { // If the display is in HDR and we're streaming HDR, we'll be converting scRGB to SMPTE 2084 PQ. if (format == DXGI_FORMAT_P010 && display->is_hdr()) { - status = device->CreatePixelShader(convert_Y_PQ_ps_hlsl->GetBufferPointer(), convert_Y_PQ_ps_hlsl->GetBufferSize(), nullptr, &convert_Y_fp16_ps); + status = device->CreatePixelShader(convert_yuv420_planar_y_ps_perceptual_quantizer_hlsl->GetBufferPointer(), convert_yuv420_planar_y_ps_perceptual_quantizer_hlsl->GetBufferSize(), nullptr, &convert_Y_fp16_ps); if (status) { BOOST_LOG(error) << "Failed to create convertY pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } - status = device->CreatePixelShader(convert_UV_PQ_ps_hlsl->GetBufferPointer(), convert_UV_PQ_ps_hlsl->GetBufferSize(), nullptr, &convert_UV_fp16_ps); + status = device->CreatePixelShader(convert_yuv420_packed_uv_type0_ps_perceptual_quantizer_hlsl->GetBufferPointer(), convert_yuv420_packed_uv_type0_ps_perceptual_quantizer_hlsl->GetBufferSize(), nullptr, &convert_UV_fp16_ps); if (status) { BOOST_LOG(error) << "Failed to create convertUV pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -582,13 +582,13 @@ namespace platf::dxgi { else { // If the display is in Advanced Color mode, the desktop format will be scRGB FP16. // scRGB uses linear gamma, so we must use our linear to sRGB conversion shaders. - status = device->CreatePixelShader(convert_Y_linear_ps_hlsl->GetBufferPointer(), convert_Y_linear_ps_hlsl->GetBufferSize(), nullptr, &convert_Y_fp16_ps); + status = device->CreatePixelShader(convert_yuv420_planar_y_ps_linear_hlsl->GetBufferPointer(), convert_yuv420_planar_y_ps_linear_hlsl->GetBufferSize(), nullptr, &convert_Y_fp16_ps); if (status) { BOOST_LOG(error) << "Failed to create convertY pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } - status = device->CreatePixelShader(convert_UV_linear_ps_hlsl->GetBufferPointer(), convert_UV_linear_ps_hlsl->GetBufferSize(), nullptr, &convert_UV_fp16_ps); + status = device->CreatePixelShader(convert_yuv420_packed_uv_type0_ps_linear_hlsl->GetBufferPointer(), convert_yuv420_packed_uv_type0_ps_linear_hlsl->GetBufferSize(), nullptr, &convert_UV_fp16_ps); if (status) { BOOST_LOG(error) << "Failed to create convertUV pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -596,13 +596,13 @@ namespace platf::dxgi { } // These shaders consume standard 8-bit sRGB input - status = device->CreatePixelShader(convert_Y_ps_hlsl->GetBufferPointer(), convert_Y_ps_hlsl->GetBufferSize(), nullptr, &convert_Y_ps); + status = device->CreatePixelShader(convert_yuv420_planar_y_ps_hlsl->GetBufferPointer(), convert_yuv420_planar_y_ps_hlsl->GetBufferSize(), nullptr, &convert_Y_ps); if (status) { BOOST_LOG(error) << "Failed to create convertY pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } - status = device->CreatePixelShader(convert_UV_ps_hlsl->GetBufferPointer(), convert_UV_ps_hlsl->GetBufferSize(), nullptr, &convert_UV_ps); + status = device->CreatePixelShader(convert_yuv420_packed_uv_type0_ps_hlsl->GetBufferPointer(), convert_yuv420_packed_uv_type0_ps_hlsl->GetBufferSize(), nullptr, &convert_UV_ps); if (status) { BOOST_LOG(error) << "Failed to create convertUV pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; @@ -627,7 +627,7 @@ namespace platf::dxgi { status = device->CreateInputLayout( &layout_desc, 1, - convert_UV_vs_hlsl->GetBufferPointer(), convert_UV_vs_hlsl->GetBufferSize(), + convert_yuv420_chroma_vs_type0_hlsl->GetBufferPointer(), convert_yuv420_chroma_vs_type0_hlsl->GetBufferSize(), &input_layout); this->display = std::dynamic_pointer_cast(display); @@ -734,7 +734,7 @@ namespace platf::dxgi { ::video::color_t *color_p; - buf_t info_scene; + buf_t subsample_offset; buf_t color_matrix; input_layout_t input_layout; @@ -1376,28 +1376,28 @@ namespace platf::dxgi { if (config.dynamicRange && is_hdr()) { // This shader will normalize scRGB white levels to a user-defined white level - status = device->CreatePixelShader(scene_NW_ps_hlsl->GetBufferPointer(), scene_NW_ps_hlsl->GetBufferSize(), nullptr, &cursor_ps); + status = device->CreatePixelShader(cursor_ps_normalize_white_hlsl->GetBufferPointer(), cursor_ps_normalize_white_hlsl->GetBufferSize(), nullptr, &cursor_ps); if (status) { - BOOST_LOG(error) << "Failed to create scene pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; + BOOST_LOG(error) << "Failed to create cursor blending (normalized white) pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } // Use a 300 nit target for the mouse cursor. We should really get // the user's SDR white level in nits, but there is no API that // provides that information to Win32 apps. - float sdr_multiplier_data[16 / sizeof(float)] { 300.0f / 80.f }; // aligned to 16-byte - auto sdr_multiplier = make_buffer(device.get(), sdr_multiplier_data); - if (!sdr_multiplier) { - BOOST_LOG(warning) << "Failed to create SDR multiplier"sv; + float white_multiplier_data[16 / sizeof(float)] { 300.0f / 80.f }; // aligned to 16-byte + auto white_multiplier = make_buffer(device.get(), white_multiplier_data); + if (!white_multiplier) { + BOOST_LOG(warning) << "Failed to create cursor blending (normalized white) white multiplier constant buffer"; return -1; } - device_ctx->PSSetConstantBuffers(1, 1, &sdr_multiplier); + device_ctx->PSSetConstantBuffers(1, 1, &white_multiplier); } else { - status = device->CreatePixelShader(scene_ps_hlsl->GetBufferPointer(), scene_ps_hlsl->GetBufferSize(), nullptr, &cursor_ps); + status = device->CreatePixelShader(cursor_ps_hlsl->GetBufferPointer(), cursor_ps_hlsl->GetBufferSize(), nullptr, &cursor_ps); if (status) { - BOOST_LOG(error) << "Failed to create scene pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; + BOOST_LOG(error) << "Failed to create cursor blending pixel shader [0x"sv << util::hex(status).to_string_view() << ']'; return -1; } } @@ -1670,62 +1670,29 @@ namespace platf::dxgi { int init() { BOOST_LOG(info) << "Compiling shaders..."sv; - scene_vs_hlsl = compile_vertex_shader(SUNSHINE_SHADERS_DIR "/SceneVS.hlsl"); - if (!scene_vs_hlsl) { - return -1; - } - - cursor_vs_hlsl = compile_vertex_shader(SUNSHINE_SHADERS_DIR "/CursorVS.hlsl"); - if (!cursor_vs_hlsl) { - return -1; - } - - convert_Y_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertYPS.hlsl"); - if (!convert_Y_ps_hlsl) { - return -1; - } - convert_Y_PQ_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertYPS_PQ.hlsl"); - if (!convert_Y_PQ_ps_hlsl) { - return -1; - } - - convert_Y_linear_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertYPS_Linear.hlsl"); - if (!convert_Y_linear_ps_hlsl) { - return -1; - } - - convert_UV_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertUVPS.hlsl"); - if (!convert_UV_ps_hlsl) { - return -1; - } +#define compile_vertex_shader_helper(x) \ + if (!(x##_hlsl = compile_vertex_shader(SUNSHINE_SHADERS_DIR "/" #x ".hlsl"))) return -1; +#define compile_pixel_shader_helper(x) \ + if (!(x##_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/" #x ".hlsl"))) return -1; + + compile_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps); + compile_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_linear); + compile_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_perceptual_quantizer); + compile_vertex_shader_helper(convert_yuv420_packed_uv_type0_vs); + compile_pixel_shader_helper(convert_yuv420_planar_y_ps); + compile_pixel_shader_helper(convert_yuv420_planar_y_ps_linear); + compile_pixel_shader_helper(convert_yuv420_planar_y_ps_perceptual_quantizer); + compile_vertex_shader_helper(convert_yuv420_planar_y_vs); + compile_pixel_shader_helper(cursor_ps); + compile_pixel_shader_helper(cursor_ps_normalize_white); + compile_vertex_shader_helper(cursor_vs); - convert_UV_PQ_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertUVPS_PQ.hlsl"); - if (!convert_UV_PQ_ps_hlsl) { - return -1; - } - - convert_UV_linear_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ConvertUVPS_Linear.hlsl"); - if (!convert_UV_linear_ps_hlsl) { - return -1; - } - - convert_UV_vs_hlsl = compile_vertex_shader(SUNSHINE_SHADERS_DIR "/ConvertUVVS.hlsl"); - if (!convert_UV_vs_hlsl) { - return -1; - } - - scene_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ScenePS.hlsl"); - if (!scene_ps_hlsl) { - return -1; - } - - scene_NW_ps_hlsl = compile_pixel_shader(SUNSHINE_SHADERS_DIR "/ScenePS_NW.hlsl"); - if (!scene_NW_ps_hlsl) { - return -1; - } BOOST_LOG(info) << "Compiled shaders"sv; +#undef compile_vertex_shader_helper +#undef compile_pixel_shader_helper + return 0; } } // namespace platf::dxgi diff --git a/src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl deleted file mode 100644 index 2c4431889b9..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl +++ /dev/null @@ -1,33 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct FragTexWide { - float3 uuv : TEXCOORD0; -}; - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -//-------------------------------------------------------------------------------------- -// Pixel Shader -//-------------------------------------------------------------------------------------- -float2 main_ps(FragTexWide input) : SV_Target -{ - float3 rgb_left = saturate(image.Sample(def_sampler, input.uuv.xz)).rgb; - float3 rgb_right = saturate(image.Sample(def_sampler, input.uuv.yz)).rgb; - float3 rgb = (rgb_left + rgb_right) * 0.5; - - float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; - float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; - - u = u * range_uv.x + range_uv.y; - v = v * range_uv.x + range_uv.y; - - return float2(u, v); -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/ConvertUVPS_Linear.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVPS_Linear.hlsl deleted file mode 100644 index 209f3bf713c..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertUVPS_Linear.hlsl +++ /dev/null @@ -1,36 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct FragTexWide { - float3 uuv : TEXCOORD0; -}; - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -// This is a fast sRGB approximation from Microsoft's ColorSpaceUtility.hlsli -float3 ApplySRGBCurve(float3 x) -{ - return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719; -} - -float2 main_ps(FragTexWide input) : SV_Target -{ - float3 rgb_left = ApplySRGBCurve(saturate(image.Sample(def_sampler, input.uuv.xz)).rgb); - float3 rgb_right = ApplySRGBCurve(saturate(image.Sample(def_sampler, input.uuv.yz)).rgb); - float3 rgb = (rgb_left + rgb_right) * 0.5; - - float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; - float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; - - u = u * range_uv.x + range_uv.y; - v = v * range_uv.x + range_uv.y; - - return float2(u, v); -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/ConvertUVPS_PQ.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVPS_PQ.hlsl deleted file mode 100644 index 3ae0fb1dd19..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertUVPS_PQ.hlsl +++ /dev/null @@ -1,69 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct FragTexWide { - float3 uuv : TEXCOORD0; -}; - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -float3 NitsToPQ(float3 L) -{ - // Constants from SMPTE 2084 PQ - static const float m1 = 2610.0 / 4096.0 / 4; - static const float m2 = 2523.0 / 4096.0 * 128; - static const float c1 = 3424.0 / 4096.0; - static const float c2 = 2413.0 / 4096.0 * 32; - static const float c3 = 2392.0 / 4096.0 * 32; - - float3 Lp = pow(saturate(L / 10000.0), m1); - return pow((c1 + c2 * Lp) / (1 + c3 * Lp), m2); -} - -float3 Rec709toRec2020(float3 rec709) -{ - static const float3x3 ConvMat = - { - 0.627402, 0.329292, 0.043306, - 0.069095, 0.919544, 0.011360, - 0.016394, 0.088028, 0.895578 - }; - return mul(ConvMat, rec709); -} - -float3 scRGBTo2100PQ(float3 rgb) -{ - // Convert from Rec 709 primaries (used by scRGB) to Rec 2020 primaries (used by Rec 2100) - rgb = Rec709toRec2020(rgb); - - // 1.0f is defined as 80 nits in the scRGB colorspace - rgb *= 80; - - // Apply the PQ transfer function on the raw color values in nits - return NitsToPQ(rgb); -} - -//-------------------------------------------------------------------------------------- -// Pixel Shader -//-------------------------------------------------------------------------------------- -float2 main_ps(FragTexWide input) : SV_Target -{ - float3 rgb_left = scRGBTo2100PQ(image.Sample(def_sampler, input.uuv.xz).rgb); - float3 rgb_right = scRGBTo2100PQ(image.Sample(def_sampler, input.uuv.yz).rgb); - float3 rgb = (rgb_left + rgb_right) * 0.5; - - float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; - float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; - - u = u * range_uv.x + range_uv.y; - v = v * range_uv.x + range_uv.y; - - return float2(u, v); -} diff --git a/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl deleted file mode 100644 index f36128fefcd..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl +++ /dev/null @@ -1,46 +0,0 @@ -struct VertTexPosWide { - float3 uuv : TEXCOORD; - float4 pos : SV_POSITION; -}; - -cbuffer info : register(b0) { - float width_i; -}; - -cbuffer rotation_info : register(b1) { - int rotation; -}; - -//-------------------------------------------------------------------------------------- -// Vertex Shader -//-------------------------------------------------------------------------------------- -VertTexPosWide main_vs(uint vI : SV_VERTEXID) -{ - VertTexPosWide output; - float2 tex; - - if (vI == 0) { - output.pos = float4(-1, -1, 0, 1); - tex = float2(0, 1); - } - else if (vI == 1) { - output.pos = float4(-1, 3, 0, 1); - tex = float2(0, -1); - } - else if (vI == 2) { - output.pos = float4(3, -1, 0, 1); - tex = float2(2, 1); - } - - if (rotation != 0) { - float rotation_radians = radians(90 * rotation); - float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), - sin(rotation_radians), cos(rotation_radians) }; - float2 rotation_center = { 0.5, 0.5 }; - tex = round(rotation_center + mul(rotation_matrix, tex - rotation_center)); - } - - output.uuv = float3(tex.x, tex.x - width_i, tex.y); - - return output; -} diff --git a/src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl deleted file mode 100644 index aad74f318b9..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl +++ /dev/null @@ -1,25 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -float main_ps(PS_INPUT frag_in) : SV_Target -{ - float3 rgb = saturate(image.Sample(def_sampler, frag_in.tex, 0)).rgb; - float y = dot(color_vec_y.xyz, rgb) + color_vec_y.w; - - return y * range_y.x + range_y.y; -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/ConvertYPS_Linear.hlsl b/src_assets/windows/assets/shaders/directx/ConvertYPS_Linear.hlsl deleted file mode 100644 index a7e91dc16dd..00000000000 --- a/src_assets/windows/assets/shaders/directx/ConvertYPS_Linear.hlsl +++ /dev/null @@ -1,31 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -// This is a fast sRGB approximation from Microsoft's ColorSpaceUtility.hlsli -float3 ApplySRGBCurve(float3 x) -{ - return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719; -} - -float main_ps(PS_INPUT frag_in) : SV_Target -{ - float3 rgb = ApplySRGBCurve(saturate(image.Sample(def_sampler, frag_in.tex, 0)).rgb); - float y = dot(color_vec_y.xyz, rgb) + color_vec_y.w; - - return y * range_y.x + range_y.y; -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/CursorVS.hlsl b/src_assets/windows/assets/shaders/directx/CursorVS.hlsl deleted file mode 100644 index a93935d7496..00000000000 --- a/src_assets/windows/assets/shaders/directx/CursorVS.hlsl +++ /dev/null @@ -1,37 +0,0 @@ -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -cbuffer rotation_info : register(b2) { - int rotation; -}; - -PS_INPUT main_vs(uint vI : SV_VERTEXID) -{ - PS_INPUT output; - - if (vI == 0) { - output.pos = float4(-1, -1, 0, 1); - output.tex = float2(0, 1); - } - else if (vI == 1) { - output.pos = float4(-1, 3, 0, 1); - output.tex = float2(0, -1); - } - else if (vI == 2) { - output.pos = float4(3, -1, 0, 1); - output.tex = float2(2, 1); - } - - if (rotation != 0) { - float rotation_radians = radians(90 * rotation); - float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), - sin(rotation_radians), cos(rotation_radians) }; - float2 rotation_center = { 0.5, 0.5 }; - output.tex = round(rotation_center + mul(rotation_matrix, output.tex - rotation_center)); - } - - return output; -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/ScenePS.hlsl b/src_assets/windows/assets/shaders/directx/ScenePS.hlsl deleted file mode 100644 index 53a9bc8dc2f..00000000000 --- a/src_assets/windows/assets/shaders/directx/ScenePS.hlsl +++ /dev/null @@ -1,14 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -float4 main_ps(PS_INPUT frag_in) : SV_Target -{ - return image.Sample(def_sampler, frag_in.tex, 0); -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/ScenePS_NW.hlsl b/src_assets/windows/assets/shaders/directx/ScenePS_NW.hlsl deleted file mode 100644 index 9553b698966..00000000000 --- a/src_assets/windows/assets/shaders/directx/ScenePS_NW.hlsl +++ /dev/null @@ -1,22 +0,0 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -cbuffer SdrScaling : register(b1) { - float scale_factor; -}; - -float4 main_ps(PS_INPUT frag_in) : SV_Target -{ - float4 rgba = image.Sample(def_sampler, frag_in.tex, 0); - - rgba.rgb = rgba.rgb * scale_factor; - - return rgba; -} diff --git a/src_assets/windows/assets/shaders/directx/SceneVS.hlsl b/src_assets/windows/assets/shaders/directx/SceneVS.hlsl deleted file mode 100644 index 3e72aa0cd0d..00000000000 --- a/src_assets/windows/assets/shaders/directx/SceneVS.hlsl +++ /dev/null @@ -1,37 +0,0 @@ -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -cbuffer rotation_info : register(b1) { - int rotation; -}; - -PS_INPUT main_vs(uint vI : SV_VERTEXID) -{ - PS_INPUT output; - - if (vI == 0) { - output.pos = float4(-1, -1, 0, 1); - output.tex = float2(0, 1); - } - else if (vI == 1) { - output.pos = float4(-1, 3, 0, 1); - output.tex = float2(0, -1); - } - else if (vI == 2) { - output.pos = float4(3, -1, 0, 1); - output.tex = float2(2, 1); - } - - if (rotation != 0) { - float rotation_radians = radians(90 * rotation); - float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), - sin(rotation_radians), cos(rotation_radians) }; - float2 rotation_center = { 0.5, 0.5 }; - output.tex = round(rotation_center + mul(rotation_matrix, output.tex - rotation_center)); - } - - return output; -} \ No newline at end of file diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps.hlsl new file mode 100644 index 00000000000..2e67d258fd3 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_base.hlsl" + +#define LEFT_SUBSAMPLING + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_linear.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_linear.hlsl new file mode 100644 index 00000000000..17957b09f6e --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_linear.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_linear_base.hlsl" + +#define LEFT_SUBSAMPLING + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_perceptual_quantizer.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_perceptual_quantizer.hlsl new file mode 100644 index 00000000000..66ffb7464ca --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps_perceptual_quantizer.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_perceptual_quantizer_base.hlsl" + +#define LEFT_SUBSAMPLING + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl new file mode 100644 index 00000000000..eb9068b4187 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl @@ -0,0 +1,15 @@ +cbuffer subsample_offset_cbuffer : register(b0) { + float2 subsample_offset; +}; + +cbuffer rotate_texture_steps_cbuffer : register(b1) { + int rotate_texture_steps; +}; + +#define LEFT_SUBSAMPLING +#include "include/base_vs.hlsl" + +vertex_t main_vs(uint vertex_id : SV_VertexID) +{ + return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset.x, rotate_texture_steps); +} diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps.hlsl new file mode 100644 index 00000000000..7576fb64540 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps.hlsl @@ -0,0 +1,3 @@ +#include "include/convert_base.hlsl" + +#include "include/convert_yuv420_planar_y_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_linear.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_linear.hlsl new file mode 100644 index 00000000000..7c22cc42250 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_linear.hlsl @@ -0,0 +1,3 @@ +#include "include/convert_linear_base.hlsl" + +#include "include/convert_yuv420_planar_y_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_perceptual_quantizer.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_perceptual_quantizer.hlsl new file mode 100644 index 00000000000..2b42c8ad318 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_ps_perceptual_quantizer.hlsl @@ -0,0 +1,3 @@ +#include "include/convert_perceptual_quantizer_base.hlsl" + +#include "include/convert_yuv420_planar_y_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl new file mode 100644 index 00000000000..33e481453ed --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl @@ -0,0 +1,10 @@ +cbuffer rotate_texture_steps_cbuffer : register(b1) { + int rotate_texture_steps; +}; + +#include "include/base_vs.hlsl" + +vertex_t main_vs(uint vertex_id : SV_VertexID) +{ + return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); +} diff --git a/src_assets/windows/assets/shaders/directx/cursor_ps.hlsl b/src_assets/windows/assets/shaders/directx/cursor_ps.hlsl new file mode 100644 index 00000000000..682e13c2538 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/cursor_ps.hlsl @@ -0,0 +1,9 @@ +Texture2D cursor : register(t0); +SamplerState def_sampler : register(s0); + +#include "include/base_vs_types.hlsl" + +float4 main_ps(vertex_t input) : SV_Target +{ + return cursor.Sample(def_sampler, input.tex_coord, 0); +} diff --git a/src_assets/windows/assets/shaders/directx/cursor_ps_normalize_white.hlsl b/src_assets/windows/assets/shaders/directx/cursor_ps_normalize_white.hlsl new file mode 100644 index 00000000000..fdc7ff17091 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/cursor_ps_normalize_white.hlsl @@ -0,0 +1,17 @@ +Texture2D cursor : register(t0); +SamplerState def_sampler : register(s0); + +cbuffer normalize_white_cbuffer : register(b1) { + float white_multiplier; +}; + +#include "include/base_vs_types.hlsl" + +float4 main_ps(vertex_t input) : SV_Target +{ + float4 output = cursor.Sample(def_sampler, input.tex_coord, 0); + + output.rgb = output.rgb * white_multiplier; + + return output; +} diff --git a/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl new file mode 100644 index 00000000000..cf737ede7e4 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl @@ -0,0 +1,10 @@ +cbuffer rotate_texture_steps_cbuffer : register(b2) { + int rotate_texture_steps; +}; + +#include "include/base_vs.hlsl" + +vertex_t main_vs(uint vertex_id : SV_VertexID) +{ + return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); +} diff --git a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl new file mode 100644 index 00000000000..5fc9226bd4f --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl @@ -0,0 +1,45 @@ +#include "include/base_vs_types.hlsl" + +#if defined(LEFT_SUBSAMPLING) +vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float subsample_offset, int rotate_texture_steps) +#elif defined (TOPLEFT_SUBSAMPLING) +vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float2 subsample_offset, int rotate_texture_steps) +#else +vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_steps) +#endif +{ + vertex_t output; + float2 tex_coord; + + if (vertex_id == 0) { + output.viewpoint_pos = float4(-1, -1, 0, 1); + tex_coord = float2(0, 1); + } + else if (vertex_id == 1) { + output.viewpoint_pos = float4(-1, 3, 0, 1); + tex_coord = float2(0, -1); + } + else if (vertex_id == 2) { + output.viewpoint_pos = float4(3, -1, 0, 1); + tex_coord = float2(2, 1); + } + + if (rotate_texture_steps != 0) { + float rotation_radians = radians(90 * rotate_texture_steps); + float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), + sin(rotation_radians), cos(rotation_radians) }; + float2 rotation_center = { 0.5, 0.5 }; + tex_coord = round(tex_coord + mul(rotation_matrix, tex_coord - rotation_center)); + } + +#if defined(LEFT_SUBSAMPLING) + output.tex_right_left_center = float3(tex_coord.x, tex_coord.x - subsample_offset, tex_coord.y); +#elif defined (TOPLEFT_SUBSAMPLING) + output.tex_right_left_top = float3(tex_coord.x, tex_coord.x - subsample_offset.x, tex_coord.y - subsample_offset.y); + output.tex_right_left_bottom = float3(tex_coord.x, tex_coord.x - subsample_offset.x, tex_coord.y); +#else + output.tex_coord = tex_coord; +#endif + + return output; +} diff --git a/src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl b/src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl new file mode 100644 index 00000000000..9e4b28f18fb --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl @@ -0,0 +1,12 @@ +struct vertex_t +{ + float4 viewpoint_pos : SV_Position; +#if defined(LEFT_SUBSAMPLING) + float3 tex_right_left_center : TEXCOORD; +#elif defined (TOPLEFT_SUBSAMPLING) + float3 tex_right_left_top : TEXCOORD; + float3 tex_right_left_bottom : TEXCOORD; +#else + float2 tex_coord : TEXCOORD; +#endif +}; diff --git a/src_assets/windows/assets/shaders/directx/ConvertYPS_PQ.hlsl b/src_assets/windows/assets/shaders/directx/include/common.hlsl similarity index 65% rename from src_assets/windows/assets/shaders/directx/ConvertYPS_PQ.hlsl rename to src_assets/windows/assets/shaders/directx/include/common.hlsl index cc3054e8350..8398c7000a1 100644 --- a/src_assets/windows/assets/shaders/directx/ConvertYPS_PQ.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/common.hlsl @@ -1,62 +1,41 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -float3 NitsToPQ(float3 L) -{ - // Constants from SMPTE 2084 PQ - static const float m1 = 2610.0 / 4096.0 / 4; - static const float m2 = 2523.0 / 4096.0 * 128; - static const float c1 = 3424.0 / 4096.0; - static const float c2 = 2413.0 / 4096.0 * 32; - static const float c3 = 2392.0 / 4096.0 * 32; - - float3 Lp = pow(saturate(L / 10000.0), m1); - return pow((c1 + c2 * Lp) / (1 + c3 * Lp), m2); -} - -float3 Rec709toRec2020(float3 rec709) -{ - static const float3x3 ConvMat = - { - 0.627402, 0.329292, 0.043306, - 0.069095, 0.919544, 0.011360, - 0.016394, 0.088028, 0.895578 - }; - return mul(ConvMat, rec709); -} - -float3 scRGBTo2100PQ(float3 rgb) -{ - // Convert from Rec 709 primaries (used by scRGB) to Rec 2020 primaries (used by Rec 2100) - rgb = Rec709toRec2020(rgb); - - // 1.0f is defined as 80 nits in the scRGB colorspace - rgb *= 80; - - // Apply the PQ transfer function on the raw color values in nits - return NitsToPQ(rgb); -} - -float main_ps(PS_INPUT frag_in) : SV_Target -{ - float3 rgb = scRGBTo2100PQ(image.Sample(def_sampler, frag_in.tex, 0).rgb); - - float y = dot(color_vec_y.xyz, rgb) + color_vec_y.w; - - return y * range_y.x + range_y.y; -} +// This is a fast sRGB approximation from Microsoft's ColorSpaceUtility.hlsli +float3 ApplySRGBCurve(float3 x) +{ + return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719; +} + +float3 NitsToPQ(float3 L) +{ + // Constants from SMPTE 2084 PQ + static const float m1 = 2610.0 / 4096.0 / 4; + static const float m2 = 2523.0 / 4096.0 * 128; + static const float c1 = 3424.0 / 4096.0; + static const float c2 = 2413.0 / 4096.0 * 32; + static const float c3 = 2392.0 / 4096.0 * 32; + + float3 Lp = pow(saturate(L / 10000.0), m1); + return pow((c1 + c2 * Lp) / (1 + c3 * Lp), m2); +} + +float3 Rec709toRec2020(float3 rec709) +{ + static const float3x3 ConvMat = + { + 0.627402, 0.329292, 0.043306, + 0.069095, 0.919544, 0.011360, + 0.016394, 0.088028, 0.895578 + }; + return mul(ConvMat, rec709); +} + +float3 scRGBTo2100PQ(float3 rgb) +{ + // Convert from Rec 709 primaries (used by scRGB) to Rec 2020 primaries (used by Rec 2100) + rgb = Rec709toRec2020(rgb); + + // 1.0f is defined as 80 nits in the scRGB colorspace + rgb *= 80; + + // Apply the PQ transfer function on the raw color values in nits + return NitsToPQ(rgb); +} diff --git a/src_assets/windows/assets/shaders/directx/include/convert_base.hlsl b/src_assets/windows/assets/shaders/directx/include/convert_base.hlsl new file mode 100644 index 00000000000..6d0c1e5943e --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/convert_base.hlsl @@ -0,0 +1 @@ +#define CONVERT_FUNCTION saturate diff --git a/src_assets/windows/assets/shaders/directx/include/convert_linear_base.hlsl b/src_assets/windows/assets/shaders/directx/include/convert_linear_base.hlsl new file mode 100644 index 00000000000..8599318cc52 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/convert_linear_base.hlsl @@ -0,0 +1,6 @@ +#include "include/common.hlsl" + +float3 CONVERT_FUNCTION(float3 input) +{ + return ApplySRGBCurve(saturate(input)); +} diff --git a/src_assets/windows/assets/shaders/directx/include/convert_perceptual_quantizer_base.hlsl b/src_assets/windows/assets/shaders/directx/include/convert_perceptual_quantizer_base.hlsl new file mode 100644 index 00000000000..7a0df8ad9e8 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/convert_perceptual_quantizer_base.hlsl @@ -0,0 +1,3 @@ +#include "include/common.hlsl" + +#define CONVERT_FUNCTION scRGBTo2100PQ diff --git a/src_assets/windows/assets/shaders/directx/include/convert_yuv420_packed_uv_ps_base.hlsl b/src_assets/windows/assets/shaders/directx/include/convert_yuv420_packed_uv_ps_base.hlsl new file mode 100644 index 00000000000..c21dccd7ed2 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/convert_yuv420_packed_uv_ps_base.hlsl @@ -0,0 +1,35 @@ +Texture2D image : register(t0); +SamplerState def_sampler : register(s0); + +cbuffer color_matrix_cbuffer : register(b0) { + float4 color_vec_y; + float4 color_vec_u; + float4 color_vec_v; + float2 range_y; + float2 range_uv; +}; + +#include "include/base_vs_types.hlsl" + +float2 main_ps(vertex_t input) : SV_Target +{ +#if defined(LEFT_SUBSAMPLING) + float3 rgb_left = image.Sample(def_sampler, input.tex_right_left_center.xz).rgb; + float3 rgb_right = image.Sample(def_sampler, input.tex_right_left_center.yz).rgb; + float3 rgb = CONVERT_FUNCTION((rgb_left + rgb_right) * 0.5); +#elif defined(TOPLEFT_SUBSAMPLING) + float3 rgb_top_left = image.Sample(def_sampler, input.tex_right_left_top.xz).rgb; + float3 rgb_top_right = image.Sample(def_sampler, input.tex_right_left_top.yz).rgb; + float3 rgb_bottom_left = image.Sample(def_sampler, input.tex_right_left_bottom.xz).rgb; + float3 rgb_bottom_right = image.Sample(def_sampler, input.tex_right_left_bottom.yz).rgb; + float3 rgb = CONVERT_FUNCTION((rgb_top_left + rgb_top_right + rgb_bottom_left + rgb_bottom_right) * 0.25); +#endif + + float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; + float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; + + u = u * range_uv.x + range_uv.y; + v = v * range_uv.x + range_uv.y; + + return float2(u, v); +} diff --git a/src_assets/windows/assets/shaders/directx/include/convert_yuv420_planar_y_ps_base.hlsl b/src_assets/windows/assets/shaders/directx/include/convert_yuv420_planar_y_ps_base.hlsl new file mode 100644 index 00000000000..7742e61c2c5 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/include/convert_yuv420_planar_y_ps_base.hlsl @@ -0,0 +1,21 @@ +Texture2D image : register(t0); +SamplerState def_sampler : register(s0); + +cbuffer color_matrix_cbuffer : register(b0) { + float4 color_vec_y; + float4 color_vec_u; + float4 color_vec_v; + float2 range_y; + float2 range_uv; +}; + +#include "include/base_vs_types.hlsl" + +float main_ps(vertex_t input) : SV_Target +{ + float3 rgb = CONVERT_FUNCTION(image.Sample(def_sampler, input.tex_coord, 0).rgb); + + float y = dot(color_vec_y.xyz, rgb) + color_vec_y.w; + + return y * range_y.x + range_y.y; +} From 679ef10e4676d975a12b913694925980649cadec Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:00:29 +0300 Subject: [PATCH 184/576] Remove unused shader input layout We don't use SV_Position in our vertex shaders. --- src/platform/windows/display_vram.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index a0dd4dbc57e..71310c90c16 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -621,15 +621,6 @@ namespace platf::dxgi { } device_ctx->PSSetConstantBuffers(0, 1, &color_matrix); - D3D11_INPUT_ELEMENT_DESC layout_desc { - "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 - }; - - status = device->CreateInputLayout( - &layout_desc, 1, - convert_yuv420_chroma_vs_type0_hlsl->GetBufferPointer(), convert_yuv420_chroma_vs_type0_hlsl->GetBufferSize(), - &input_layout); - this->display = std::dynamic_pointer_cast(display); if (!this->display) { return -1; @@ -656,8 +647,6 @@ namespace platf::dxgi { return -1; } - device_ctx->IASetInputLayout(input_layout.get()); - device_ctx->OMSetBlendState(blend_disable.get(), nullptr, 0xFFFFFFFFu); device_ctx->PSSetSamplers(0, 1, &sampler_linear); device_ctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); @@ -737,8 +726,6 @@ namespace platf::dxgi { buf_t subsample_offset; buf_t color_matrix; - input_layout_t input_layout; - blend_t blend_disable; sampler_state_t sampler_linear; From 6f26f713b44408b286251aaa84e726427af82d41 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 6 Oct 2023 10:08:18 -0500 Subject: [PATCH 185/576] Use the linuxdeploy GTK plugin to correctly deploy GTK3 dependencies (#1708) --- .github/workflows/CI.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8f23856d371..254a1940dd5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -452,14 +452,18 @@ jobs: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage + # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk + sudo apt-get install libgtk-3-dev librsvg2-dev -y + wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh + chmod +x linuxdeploy-plugin-gtk.sh + export DEPLOY_GTK_VERSION=3 + ./linuxdeploy-x86_64.AppImage \ --appdir ./AppDir \ + --plugin gtk \ --executable ./sunshine \ --icon-file "../$ICON_FILE" \ --desktop-file "./$DESKTOP_FILE" \ - --library /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \ - --library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ - --library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ --output appimage # move From 4aa06c8baadcb156738c7559e1999c21a0ed7d07 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 5 Oct 2023 20:34:23 -0500 Subject: [PATCH 186/576] Allow the Misc button to work as Guide on emulated Xbox 360 controllers It isn't physically present on Xbox 360 controllers, so we may as well use it for something. --- src/platform/linux/input.cpp | 2 +- src/platform/windows/input.cpp | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/platform/linux/input.cpp b/src/platform/linux/input.cpp index 8d951c6d47d..bccbf8ad8d2 100644 --- a/src/platform/linux/input.cpp +++ b/src/platform/linux/input.cpp @@ -1532,7 +1532,7 @@ namespace platf { if (RIGHT_STICK & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_THUMBR, bf_new & RIGHT_STICK ? 1 : 0); if (LEFT_BUTTON & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_TL, bf_new & LEFT_BUTTON ? 1 : 0); if (RIGHT_BUTTON & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_TR, bf_new & RIGHT_BUTTON ? 1 : 0); - if (HOME & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_MODE, bf_new & HOME ? 1 : 0); + if ((HOME | MISC_BUTTON) & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_MODE, bf_new & (HOME | MISC_BUTTON) ? 1 : 0); if (A & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_SOUTH, bf_new & A ? 1 : 0); if (B & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_EAST, bf_new & B ? 1 : 0); if (X & bf) libevdev_uinput_write_event(uinput.get(), EV_KEY, BTN_NORTH, bf_new & X ? 1 : 0); diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 2bdf421d415..a3d737fbb3e 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -1231,21 +1231,21 @@ namespace platf { auto flags = gamepad_state.buttonFlags; // clang-format off - if(flags & DPAD_UP) buttons |= XUSB_GAMEPAD_DPAD_UP; - if(flags & DPAD_DOWN) buttons |= XUSB_GAMEPAD_DPAD_DOWN; - if(flags & DPAD_LEFT) buttons |= XUSB_GAMEPAD_DPAD_LEFT; - if(flags & DPAD_RIGHT) buttons |= XUSB_GAMEPAD_DPAD_RIGHT; - if(flags & START) buttons |= XUSB_GAMEPAD_START; - if(flags & BACK) buttons |= XUSB_GAMEPAD_BACK; - if(flags & LEFT_STICK) buttons |= XUSB_GAMEPAD_LEFT_THUMB; - if(flags & RIGHT_STICK) buttons |= XUSB_GAMEPAD_RIGHT_THUMB; - if(flags & LEFT_BUTTON) buttons |= XUSB_GAMEPAD_LEFT_SHOULDER; - if(flags & RIGHT_BUTTON) buttons |= XUSB_GAMEPAD_RIGHT_SHOULDER; - if(flags & HOME) buttons |= XUSB_GAMEPAD_GUIDE; - if(flags & A) buttons |= XUSB_GAMEPAD_A; - if(flags & B) buttons |= XUSB_GAMEPAD_B; - if(flags & X) buttons |= XUSB_GAMEPAD_X; - if(flags & Y) buttons |= XUSB_GAMEPAD_Y; + if(flags & DPAD_UP) buttons |= XUSB_GAMEPAD_DPAD_UP; + if(flags & DPAD_DOWN) buttons |= XUSB_GAMEPAD_DPAD_DOWN; + if(flags & DPAD_LEFT) buttons |= XUSB_GAMEPAD_DPAD_LEFT; + if(flags & DPAD_RIGHT) buttons |= XUSB_GAMEPAD_DPAD_RIGHT; + if(flags & START) buttons |= XUSB_GAMEPAD_START; + if(flags & BACK) buttons |= XUSB_GAMEPAD_BACK; + if(flags & LEFT_STICK) buttons |= XUSB_GAMEPAD_LEFT_THUMB; + if(flags & RIGHT_STICK) buttons |= XUSB_GAMEPAD_RIGHT_THUMB; + if(flags & LEFT_BUTTON) buttons |= XUSB_GAMEPAD_LEFT_SHOULDER; + if(flags & RIGHT_BUTTON) buttons |= XUSB_GAMEPAD_RIGHT_SHOULDER; + if(flags & (HOME | MISC_BUTTON)) buttons |= XUSB_GAMEPAD_GUIDE; + if(flags & A) buttons |= XUSB_GAMEPAD_A; + if(flags & B) buttons |= XUSB_GAMEPAD_B; + if(flags & X) buttons |= XUSB_GAMEPAD_X; + if(flags & Y) buttons |= XUSB_GAMEPAD_Y; // clang-format on return (XUSB_BUTTON) buttons; From 234686cbc44c8020ca56803c49bd8ff54f3f810f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 6 Oct 2023 17:31:36 -0500 Subject: [PATCH 187/576] Remove clang-format suppressions --- src/platform/windows/input.cpp | 60 ++++++++++++++++------------------ 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index a3d737fbb3e..9d27fc3bba9 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -1230,23 +1230,21 @@ namespace platf { int buttons {}; auto flags = gamepad_state.buttonFlags; - // clang-format off - if(flags & DPAD_UP) buttons |= XUSB_GAMEPAD_DPAD_UP; - if(flags & DPAD_DOWN) buttons |= XUSB_GAMEPAD_DPAD_DOWN; - if(flags & DPAD_LEFT) buttons |= XUSB_GAMEPAD_DPAD_LEFT; - if(flags & DPAD_RIGHT) buttons |= XUSB_GAMEPAD_DPAD_RIGHT; - if(flags & START) buttons |= XUSB_GAMEPAD_START; - if(flags & BACK) buttons |= XUSB_GAMEPAD_BACK; - if(flags & LEFT_STICK) buttons |= XUSB_GAMEPAD_LEFT_THUMB; - if(flags & RIGHT_STICK) buttons |= XUSB_GAMEPAD_RIGHT_THUMB; - if(flags & LEFT_BUTTON) buttons |= XUSB_GAMEPAD_LEFT_SHOULDER; - if(flags & RIGHT_BUTTON) buttons |= XUSB_GAMEPAD_RIGHT_SHOULDER; - if(flags & (HOME | MISC_BUTTON)) buttons |= XUSB_GAMEPAD_GUIDE; - if(flags & A) buttons |= XUSB_GAMEPAD_A; - if(flags & B) buttons |= XUSB_GAMEPAD_B; - if(flags & X) buttons |= XUSB_GAMEPAD_X; - if(flags & Y) buttons |= XUSB_GAMEPAD_Y; - // clang-format on + if (flags & DPAD_UP) buttons |= XUSB_GAMEPAD_DPAD_UP; + if (flags & DPAD_DOWN) buttons |= XUSB_GAMEPAD_DPAD_DOWN; + if (flags & DPAD_LEFT) buttons |= XUSB_GAMEPAD_DPAD_LEFT; + if (flags & DPAD_RIGHT) buttons |= XUSB_GAMEPAD_DPAD_RIGHT; + if (flags & START) buttons |= XUSB_GAMEPAD_START; + if (flags & BACK) buttons |= XUSB_GAMEPAD_BACK; + if (flags & LEFT_STICK) buttons |= XUSB_GAMEPAD_LEFT_THUMB; + if (flags & RIGHT_STICK) buttons |= XUSB_GAMEPAD_RIGHT_THUMB; + if (flags & LEFT_BUTTON) buttons |= XUSB_GAMEPAD_LEFT_SHOULDER; + if (flags & RIGHT_BUTTON) buttons |= XUSB_GAMEPAD_RIGHT_SHOULDER; + if (flags & (HOME | MISC_BUTTON)) buttons |= XUSB_GAMEPAD_GUIDE; + if (flags & A) buttons |= XUSB_GAMEPAD_A; + if (flags & B) buttons |= XUSB_GAMEPAD_B; + if (flags & X) buttons |= XUSB_GAMEPAD_X; + if (flags & Y) buttons |= XUSB_GAMEPAD_Y; return (XUSB_BUTTON) buttons; } @@ -1317,21 +1315,19 @@ namespace platf { int buttons {}; auto flags = gamepad_state.buttonFlags; - // clang-format off - if(flags & LEFT_STICK) buttons |= DS4_BUTTON_THUMB_LEFT; - if(flags & RIGHT_STICK) buttons |= DS4_BUTTON_THUMB_RIGHT; - if(flags & LEFT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_LEFT; - if(flags & RIGHT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_RIGHT; - if(flags & START) buttons |= DS4_BUTTON_OPTIONS; - if(flags & BACK) buttons |= DS4_BUTTON_SHARE; - if(flags & A) buttons |= DS4_BUTTON_CROSS; - if(flags & B) buttons |= DS4_BUTTON_CIRCLE; - if(flags & X) buttons |= DS4_BUTTON_SQUARE; - if(flags & Y) buttons |= DS4_BUTTON_TRIANGLE; - - if(gamepad_state.lt > 0) buttons |= DS4_BUTTON_TRIGGER_LEFT; - if(gamepad_state.rt > 0) buttons |= DS4_BUTTON_TRIGGER_RIGHT; - // clang-format on + if (flags & LEFT_STICK) buttons |= DS4_BUTTON_THUMB_LEFT; + if (flags & RIGHT_STICK) buttons |= DS4_BUTTON_THUMB_RIGHT; + if (flags & LEFT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_LEFT; + if (flags & RIGHT_BUTTON) buttons |= DS4_BUTTON_SHOULDER_RIGHT; + if (flags & START) buttons |= DS4_BUTTON_OPTIONS; + if (flags & BACK) buttons |= DS4_BUTTON_SHARE; + if (flags & A) buttons |= DS4_BUTTON_CROSS; + if (flags & B) buttons |= DS4_BUTTON_CIRCLE; + if (flags & X) buttons |= DS4_BUTTON_SQUARE; + if (flags & Y) buttons |= DS4_BUTTON_TRIANGLE; + + if (gamepad_state.lt > 0) buttons |= DS4_BUTTON_TRIGGER_LEFT; + if (gamepad_state.rt > 0) buttons |= DS4_BUTTON_TRIGGER_RIGHT; return (DS4_BUTTONS) buttons; } From 36ab1c165a6a53b92af15d12d833fa71d260150d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 6 Oct 2023 18:32:09 -0500 Subject: [PATCH 188/576] Fix missing newline in SDP response --- src/rtsp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtsp.cpp b/src/rtsp.cpp index 6e06c1fd1f2..5a12253de17 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -494,7 +494,7 @@ namespace rtsp_stream { std::stringstream ss; // Tell the client about our supported features - ss << "a=x-ss-general.featureFlags: " << (uint32_t) platf::get_capabilities(); + ss << "a=x-ss-general.featureFlags: " << (uint32_t) platf::get_capabilities() << std::endl; if (video::active_hevc_mode != 1) { ss << "sprop-parameter-sets=AAAAAU"sv << std::endl; From 20e35a4594f6e6930f32c83efe1d88b6d5407e44 Mon Sep 17 00:00:00 2001 From: Zack Elia Date: Sat, 7 Oct 2023 10:11:19 -0400 Subject: [PATCH 189/576] Add missing dependencies for tray icon support (#1712) --- cmake/packaging/linux.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index c36c7c0e0e0..aee40cb7f1b 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -79,7 +79,8 @@ if(${SUNSHINE_TRAY} STREQUAL 1) set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ ${CPACK_DEBIAN_PACKAGE_DEPENDS}, \ - libappindicator3-1") + libayatana-appindicator3-1, \ + libnotify4") set(CPACK_RPM_PACKAGE_REQUIRES "\ ${CPACK_RPM_PACKAGE_REQUIRES}, \ libappindicator-gtk3 >= 12.10.0") From 5a63e910a4fc0e2658c167d6be7f4e52e7de16d1 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 7 Oct 2023 11:28:42 -0400 Subject: [PATCH 190/576] ci(codeql): fix build space issue (#1714) --- .github/workflows/codeql.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bedd996cc5f..731091589e6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -99,6 +99,16 @@ jobs: matrix: ${{ fromJson(needs.languages.outputs.matrix) }} steps: + - name: Maximize build space + uses: easimon/maximize-build-space@v8 + with: + root-reserve-mb: 20480 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'false' + remove-docker-images: 'true' + - name: Checkout repository uses: actions/checkout@v4 with: From eb01848195a823ba3b297ad35b11e7fdaf168753 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 8 Oct 2023 13:04:49 -0500 Subject: [PATCH 191/576] Use our own keycode mapping instead of relying on Windows Loading the US English layout causes user-visible side effects. --- src/platform/windows/input.cpp | 26 +-- src/platform/windows/keylayout.h | 271 +++++++++++++++++++++++++++++++ 2 files changed, 275 insertions(+), 22 deletions(-) create mode 100644 src/platform/windows/keylayout.h diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 9d27fc3bba9..425c269b7c0 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -9,6 +9,7 @@ #include +#include "keylayout.h" #include "misc.h" #include "src/config.h" #include "src/main.h" @@ -399,8 +400,6 @@ namespace platf { } vigem_t *vigem; - HKL keyboard_layout; - HKL active_layout; decltype(CreateSyntheticPointerDevice) *fnCreateSyntheticPointerDevice; decltype(InjectSyntheticPointerInput) *fnInjectSyntheticPointerInput; @@ -418,21 +417,6 @@ namespace platf { raw.vigem = nullptr; } - // Moonlight currently sends keys normalized to the US English layout. - // We need to use that layout when converting to scancodes. - raw.keyboard_layout = LoadKeyboardLayoutA("00000409", 0); - if (!raw.keyboard_layout || LOWORD(raw.keyboard_layout) != 0x409) { - BOOST_LOG(warning) << "Unable to load US English keyboard layout for scancode translation. Keyboard input may not work in games."sv; - raw.keyboard_layout = NULL; - } - - // Activate layout for current process only - raw.active_layout = ActivateKeyboardLayout(raw.keyboard_layout, KLF_SETFORPROCESS); - if (!raw.active_layout) { - BOOST_LOG(warning) << "Unable to activate US English keyboard layout for scancode translation. Keyboard input may not work in games."sv; - raw.keyboard_layout = NULL; - } - // Get pointers to virtual touch/pen input functions (Win10 1809+) raw.fnCreateSyntheticPointerDevice = (decltype(CreateSyntheticPointerDevice) *) GetProcAddress(GetModuleHandleA("user32.dll"), "CreateSyntheticPointerDevice"); raw.fnInjectSyntheticPointerInput = (decltype(InjectSyntheticPointerInput) *) GetProcAddress(GetModuleHandleA("user32.dll"), "InjectSyntheticPointerInput"); @@ -575,8 +559,6 @@ namespace platf { void keyboard(input_t &input, uint16_t modcode, bool release, uint8_t flags) { - auto raw = (input_raw_t *) input.get(); - INPUT i {}; i.type = INPUT_KEYBOARD; auto &ki = i.ki; @@ -584,9 +566,9 @@ namespace platf { // If the client did not normalize this VK code to a US English layout, we can't accurately convert it to a scancode. bool send_scancode = !(flags & SS_KBE_FLAG_NON_NORMALIZED) || config::input.always_send_scancodes; - if (send_scancode && modcode != VK_LWIN && modcode != VK_RWIN && modcode != VK_PAUSE && raw->keyboard_layout != NULL) { - // For some reason, MapVirtualKey(VK_LWIN, MAPVK_VK_TO_VSC) doesn't seem to work :/ - ki.wScan = MapVirtualKeyEx(modcode, MAPVK_VK_TO_VSC, raw->keyboard_layout); + if (send_scancode) { + // Mask off the extended key byte + ki.wScan = VK_TO_SCANCODE_MAP[modcode & 0xFF]; } // If we can map this to a scancode, send it as a scancode for maximum game compatibility. diff --git a/src/platform/windows/keylayout.h b/src/platform/windows/keylayout.h new file mode 100644 index 00000000000..55dfa284e91 --- /dev/null +++ b/src/platform/windows/keylayout.h @@ -0,0 +1,271 @@ +/** + * @file src/platform/windows/keylayout.h + * @brief Keyboard layout mapping for scancode translation + */ +#pragma once + +#include +#include + +namespace platf { + // Virtual Key to Scan Code mapping for the US English layout (00000409). + // GameStream uses this as the canonical key layout for scancode conversion. + constexpr std::array::max() + 1> VK_TO_SCANCODE_MAP { + 0, /* 0x00 */ + 0, /* 0x01 */ + 0, /* 0x02 */ + 70, /* 0x03 */ + 0, /* 0x04 */ + 0, /* 0x05 */ + 0, /* 0x06 */ + 0, /* 0x07 */ + 14, /* 0x08 */ + 15, /* 0x09 */ + 0, /* 0x0a */ + 0, /* 0x0b */ + 76, /* 0x0c */ + 28, /* 0x0d */ + 0, /* 0x0e */ + 0, /* 0x0f */ + 42, /* 0x10 */ + 29, /* 0x11 */ + 56, /* 0x12 */ + 0, /* 0x13 */ + 58, /* 0x14 */ + 0, /* 0x15 */ + 0, /* 0x16 */ + 0, /* 0x17 */ + 0, /* 0x18 */ + 0, /* 0x19 */ + 0, /* 0x1a */ + 1, /* 0x1b */ + 0, /* 0x1c */ + 0, /* 0x1d */ + 0, /* 0x1e */ + 0, /* 0x1f */ + 57, /* 0x20 */ + 73, /* 0x21 */ + 81, /* 0x22 */ + 79, /* 0x23 */ + 71, /* 0x24 */ + 75, /* 0x25 */ + 72, /* 0x26 */ + 77, /* 0x27 */ + 80, /* 0x28 */ + 0, /* 0x29 */ + 0, /* 0x2a */ + 0, /* 0x2b */ + 84, /* 0x2c */ + 82, /* 0x2d */ + 83, /* 0x2e */ + 99, /* 0x2f */ + 11, /* 0x30 */ + 2, /* 0x31 */ + 3, /* 0x32 */ + 4, /* 0x33 */ + 5, /* 0x34 */ + 6, /* 0x35 */ + 7, /* 0x36 */ + 8, /* 0x37 */ + 9, /* 0x38 */ + 10, /* 0x39 */ + 0, /* 0x3a */ + 0, /* 0x3b */ + 0, /* 0x3c */ + 0, /* 0x3d */ + 0, /* 0x3e */ + 0, /* 0x3f */ + 0, /* 0x40 */ + 30, /* 0x41 */ + 48, /* 0x42 */ + 46, /* 0x43 */ + 32, /* 0x44 */ + 18, /* 0x45 */ + 33, /* 0x46 */ + 34, /* 0x47 */ + 35, /* 0x48 */ + 23, /* 0x49 */ + 36, /* 0x4a */ + 37, /* 0x4b */ + 38, /* 0x4c */ + 50, /* 0x4d */ + 49, /* 0x4e */ + 24, /* 0x4f */ + 25, /* 0x50 */ + 16, /* 0x51 */ + 19, /* 0x52 */ + 31, /* 0x53 */ + 20, /* 0x54 */ + 22, /* 0x55 */ + 47, /* 0x56 */ + 17, /* 0x57 */ + 45, /* 0x58 */ + 21, /* 0x59 */ + 44, /* 0x5a */ + 91, /* 0x5b */ + 92, /* 0x5c */ + 93, /* 0x5d */ + 0, /* 0x5e */ + 95, /* 0x5f */ + 82, /* 0x60 */ + 79, /* 0x61 */ + 80, /* 0x62 */ + 81, /* 0x63 */ + 75, /* 0x64 */ + 76, /* 0x65 */ + 77, /* 0x66 */ + 71, /* 0x67 */ + 72, /* 0x68 */ + 73, /* 0x69 */ + 55, /* 0x6a */ + 78, /* 0x6b */ + 0, /* 0x6c */ + 74, /* 0x6d */ + 83, /* 0x6e */ + 53, /* 0x6f */ + 59, /* 0x70 */ + 60, /* 0x71 */ + 61, /* 0x72 */ + 62, /* 0x73 */ + 63, /* 0x74 */ + 64, /* 0x75 */ + 65, /* 0x76 */ + 66, /* 0x77 */ + 67, /* 0x78 */ + 68, /* 0x79 */ + 87, /* 0x7a */ + 88, /* 0x7b */ + 100, /* 0x7c */ + 101, /* 0x7d */ + 102, /* 0x7e */ + 103, /* 0x7f */ + 104, /* 0x80 */ + 105, /* 0x81 */ + 106, /* 0x82 */ + 107, /* 0x83 */ + 108, /* 0x84 */ + 109, /* 0x85 */ + 110, /* 0x86 */ + 118, /* 0x87 */ + 0, /* 0x88 */ + 0, /* 0x89 */ + 0, /* 0x8a */ + 0, /* 0x8b */ + 0, /* 0x8c */ + 0, /* 0x8d */ + 0, /* 0x8e */ + 0, /* 0x8f */ + 69, /* 0x90 */ + 70, /* 0x91 */ + 0, /* 0x92 */ + 0, /* 0x93 */ + 0, /* 0x94 */ + 0, /* 0x95 */ + 0, /* 0x96 */ + 0, /* 0x97 */ + 0, /* 0x98 */ + 0, /* 0x99 */ + 0, /* 0x9a */ + 0, /* 0x9b */ + 0, /* 0x9c */ + 0, /* 0x9d */ + 0, /* 0x9e */ + 0, /* 0x9f */ + 42, /* 0xa0 */ + 54, /* 0xa1 */ + 29, /* 0xa2 */ + 29, /* 0xa3 */ + 56, /* 0xa4 */ + 56, /* 0xa5 */ + 106, /* 0xa6 */ + 105, /* 0xa7 */ + 103, /* 0xa8 */ + 104, /* 0xa9 */ + 101, /* 0xaa */ + 102, /* 0xab */ + 50, /* 0xac */ + 32, /* 0xad */ + 46, /* 0xae */ + 48, /* 0xaf */ + 25, /* 0xb0 */ + 16, /* 0xb1 */ + 36, /* 0xb2 */ + 34, /* 0xb3 */ + 108, /* 0xb4 */ + 109, /* 0xb5 */ + 107, /* 0xb6 */ + 33, /* 0xb7 */ + 0, /* 0xb8 */ + 0, /* 0xb9 */ + 39, /* 0xba */ + 13, /* 0xbb */ + 51, /* 0xbc */ + 12, /* 0xbd */ + 52, /* 0xbe */ + 53, /* 0xbf */ + 41, /* 0xc0 */ + 115, /* 0xc1 */ + 126, /* 0xc2 */ + 0, /* 0xc3 */ + 0, /* 0xc4 */ + 0, /* 0xc5 */ + 0, /* 0xc6 */ + 0, /* 0xc7 */ + 0, /* 0xc8 */ + 0, /* 0xc9 */ + 0, /* 0xca */ + 0, /* 0xcb */ + 0, /* 0xcc */ + 0, /* 0xcd */ + 0, /* 0xce */ + 0, /* 0xcf */ + 0, /* 0xd0 */ + 0, /* 0xd1 */ + 0, /* 0xd2 */ + 0, /* 0xd3 */ + 0, /* 0xd4 */ + 0, /* 0xd5 */ + 0, /* 0xd6 */ + 0, /* 0xd7 */ + 0, /* 0xd8 */ + 0, /* 0xd9 */ + 0, /* 0xda */ + 26, /* 0xdb */ + 43, /* 0xdc */ + 27, /* 0xdd */ + 40, /* 0xde */ + 0, /* 0xdf */ + 0, /* 0xe0 */ + 0, /* 0xe1 */ + 86, /* 0xe2 */ + 0, /* 0xe3 */ + 0, /* 0xe4 */ + 0, /* 0xe5 */ + 0, /* 0xe6 */ + 0, /* 0xe7 */ + 0, /* 0xe8 */ + 113, /* 0xe9 */ + 92, /* 0xea */ + 123, /* 0xeb */ + 0, /* 0xec */ + 111, /* 0xed */ + 90, /* 0xee */ + 0, /* 0xef */ + 0, /* 0xf0 */ + 91, /* 0xf1 */ + 0, /* 0xf2 */ + 95, /* 0xf3 */ + 0, /* 0xf4 */ + 94, /* 0xf5 */ + 0, /* 0xf6 */ + 0, /* 0xf7 */ + 0, /* 0xf8 */ + 93, /* 0xf9 */ + 0, /* 0xfa */ + 98, /* 0xfb */ + 0, /* 0xfc */ + 0, /* 0xfd */ + 0, /* 0xfe */ + 0, /* 0xff */ + }; +} // namespace platf From 13bacd367464e9c052b5ddcf90d973802748f488 Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Sun, 8 Oct 2023 13:53:42 +0000 Subject: [PATCH 192/576] Remove false positive FATAL log --- src/confighttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confighttp.cpp b/src/confighttp.cpp index ba7c21ee942..396cf63d166 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -368,7 +368,7 @@ namespace confighttp { pt::ptree inputTree, fileTree; - BOOST_LOG(fatal) << config::stream.file_apps; + BOOST_LOG(info) << config::stream.file_apps; try { // TODO: Input Validation pt::read_json(ss, inputTree); From 07be85152a017dfa3338b546475059f5dc2c44fb Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 9 Oct 2023 18:39:40 -0500 Subject: [PATCH 193/576] Fix Super key regression after 8a7111a (#1728) --- src/platform/windows/input.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 425c269b7c0..b5a5eccd952 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -582,6 +582,8 @@ namespace platf { // https://docs.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#keystroke-message-flags switch (modcode) { + case VK_LWIN: + case VK_RWIN: case VK_RMENU: case VK_RCONTROL: case VK_INSERT: From f7afa32f78716a3e6fca42dd57664cadd748bd50 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:13:52 -0400 Subject: [PATCH 194/576] build(deps): use submodules for wayland protocols (#1731) --- .gitmodules | 8 + .readthedocs.yaml | 1 + cmake/compile_definitions/linux.cmake | 4 +- cmake/macros/linux.cmake | 10 +- third-party/wayland-protocols | 1 + .../wlr-export-dmabuf-unstable-v1.xml | 203 ---------------- .../xdg-output-unstable-v1.xml | 220 ------------------ third-party/wlr-protocols | 1 + 8 files changed, 18 insertions(+), 430 deletions(-) create mode 160000 third-party/wayland-protocols delete mode 100644 third-party/wayland-protocols/wlr-export-dmabuf-unstable-v1.xml delete mode 100644 third-party/wayland-protocols/xdg-output-unstable-v1.xml create mode 160000 third-party/wlr-protocols diff --git a/.gitmodules b/.gitmodules index 615b2175e67..92820c24c47 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,3 +58,11 @@ path = third-party/ffmpeg-linux-powerpc64le url = https://github.com/LizardByte/build-deps branch = ffmpeg-linux-powerpc64le +[submodule "third-party/wayland-protocols"] + path = third-party/wayland-protocols + url = https://gitlab.freedesktop.org/wayland/wayland-protocols + branch = main +[submodule "third-party/wlr-protocols"] + path = third-party/wlr-protocols + url = https://gitlab.freedesktop.org/wlroots/wlr-protocols + branch = master diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5ae7e5a6114..4a6aefb36d5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -16,6 +16,7 @@ build: - libboost-locale-dev # required for rstcheck in cpp code block jobs: post_build: + - find ./third-party -iname "*.rst" -type f -delete # find and delete rst files in third-party - rstcheck -r . # lint rst files # - rstfmt --check --diff -w 120 . # check rst formatting diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index 97bd7eb5d00..f28152ee9bb 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -127,8 +127,8 @@ endif() if(WAYLAND_FOUND) add_compile_definitions(SUNSHINE_BUILD_WAYLAND) - GEN_WAYLAND(xdg-output-unstable-v1) - GEN_WAYLAND(wlr-export-dmabuf-unstable-v1) + GEN_WAYLAND("wayland-protocols" "unstable/xdg-output" xdg-output-unstable-v1) + GEN_WAYLAND("wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1) include_directories( SYSTEM diff --git a/cmake/macros/linux.cmake b/cmake/macros/linux.cmake index fea94fe870a..d84d0452568 100644 --- a/cmake/macros/linux.cmake +++ b/cmake/macros/linux.cmake @@ -1,21 +1,21 @@ # linux specific macros # GEN_WAYLAND: args = `filename` -macro(GEN_WAYLAND filename) +macro(GEN_WAYLAND wayland_directory subdirectory filename) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/generated-src) message("wayland-scanner private-code \ -${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml \ +${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \ ${CMAKE_BINARY_DIR}/generated-src/${filename}.c") message("wayland-scanner client-header \ -${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml \ +${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \ ${CMAKE_BINARY_DIR}/generated-src/${filename}.h") execute_process( COMMAND wayland-scanner private-code - ${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml + ${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml ${CMAKE_BINARY_DIR}/generated-src/${filename}.c COMMAND wayland-scanner client-header - ${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml + ${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml ${CMAKE_BINARY_DIR}/generated-src/${filename}.h RESULT_VARIABLE EXIT_INT diff --git a/third-party/wayland-protocols b/third-party/wayland-protocols new file mode 160000 index 00000000000..681c33c8547 --- /dev/null +++ b/third-party/wayland-protocols @@ -0,0 +1 @@ +Subproject commit 681c33c8547d6aefe24455ba2bffe1c5ae11fee5 diff --git a/third-party/wayland-protocols/wlr-export-dmabuf-unstable-v1.xml b/third-party/wayland-protocols/wlr-export-dmabuf-unstable-v1.xml deleted file mode 100644 index 751f7efbf39..00000000000 --- a/third-party/wayland-protocols/wlr-export-dmabuf-unstable-v1.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - Copyright © 2018 Rostislav Pehlivanov - - 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 (including the next - paragraph) 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. - - - - An interface to capture surfaces in an efficient way by exporting DMA-BUFs. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - This object is a manager with which to start capturing from sources. - - - - - Capture the next frame of a an entire output. - - - - - - - - - All objects created by the manager will still remain valid, until their - appropriate destroy request has been called. - - - - - - - This object represents a single DMA-BUF frame. - - If the capture is successful, the compositor will first send a "frame" - event, followed by one or several "object". When the frame is available - for readout, the "ready" event is sent. - - If the capture failed, the "cancel" event is sent. This can happen anytime - before the "ready" event. - - Once either a "ready" or a "cancel" event is received, the client should - destroy the frame. Once an "object" event is received, the client is - responsible for closing the associated file descriptor. - - All frames are read-only and may not be written into or altered. - - - - - Special flags that should be respected by the client. - - - - - - - Main event supplying the client with information about the frame. If the - capture didn't fail, this event is always emitted first before any other - events. - - This event is followed by a number of "object" as specified by the - "num_objects" argument. - - - - - - - - - - - - - - - - Event which serves to supply the client with the file descriptors - containing the data for each object. - - After receiving this event, the client must always close the file - descriptor as soon as they're done with it and even if the frame fails. - - - - - - - - - - - - This event is sent as soon as the frame is presented, indicating it is - available for reading. This event includes the time at which - presentation happened at. - - The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples, - each component being an unsigned 32-bit value. Whole seconds are in - tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo, - and the additional fractional part in tv_nsec as nanoseconds. Hence, - for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part - may have an arbitrary offset at start. - - After receiving this event, the client should destroy this object. - - - - - - - - - Indicates reason for cancelling the frame. - - - - - - - - - If the capture failed or if the frame is no longer valid after the - "frame" event has been emitted, this event will be used to inform the - client to scrap the frame. - - If the failure is temporary, the client may capture again the same - source. If the failure is permanent, any further attempts to capture the - same source will fail again. - - After receiving this event, the client should destroy this object. - - - - - - - Unreferences the frame. This request must be called as soon as its no - longer used. - - It can be called at any time by the client. The client will still have - to close any FDs it has been given. - - - - diff --git a/third-party/wayland-protocols/xdg-output-unstable-v1.xml b/third-party/wayland-protocols/xdg-output-unstable-v1.xml deleted file mode 100644 index 9a5b7900097..00000000000 --- a/third-party/wayland-protocols/xdg-output-unstable-v1.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Copyright © 2017 Red Hat Inc. - - 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 (including the next - paragraph) 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. - - - - This protocol aims at describing outputs in a way which is more in line - with the concept of an output on desktop oriented systems. - - Some information are more specific to the concept of an output for - a desktop oriented system and may not make sense in other applications, - such as IVI systems for example. - - Typically, the global compositor space on a desktop system is made of - a contiguous or overlapping set of rectangular regions. - - Some of the information provided in this protocol might be identical - to their counterparts already available from wl_output, in which case - the information provided by this protocol should be preferred to their - equivalent in wl_output. The goal is to move the desktop specific - concepts (such as output location within the global compositor space, - the connector name and types, etc.) out of the core wl_output protocol. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible - changes may be added together with the corresponding interface - version bump. - Backward incompatible changes are done by bumping the version - number in the protocol and interface names and resetting the - interface version. Once the protocol is to be declared stable, - the 'z' prefix and the version number in the protocol and - interface names are removed and the interface version number is - reset. - - - - - A global factory interface for xdg_output objects. - - - - - Using this request a client can tell the server that it is not - going to use the xdg_output_manager object anymore. - - Any objects already created through this instance are not affected. - - - - - - This creates a new xdg_output object for the given wl_output. - - - - - - - - - An xdg_output describes part of the compositor geometry. - - This typically corresponds to a monitor that displays part of the - compositor space. - - For objects version 3 onwards, after all xdg_output properties have been - sent (when the object is created and when properties are updated), a - wl_output.done event is sent. This allows changes to the output - properties to be seen as atomic, even if they happen via multiple events. - - - - - Using this request a client can tell the server that it is not - going to use the xdg_output object anymore. - - - - - - The position event describes the location of the wl_output within - the global compositor space. - - The logical_position event is sent after creating an xdg_output - (see xdg_output_manager.get_xdg_output) and whenever the location - of the output changes within the global compositor space. - - - - - - - - The logical_size event describes the size of the output in the - global compositor space. - - For example, a surface without any buffer scale, transformation - nor rotation set, with the size matching the logical_size will - have the same size as the corresponding output when displayed. - - Most regular Wayland clients should not pay attention to the - logical size and would rather rely on xdg_shell interfaces. - - Some clients such as Xwayland, however, need this to configure - their surfaces in the global compositor space as the compositor - may apply a different scale from what is advertised by the output - scaling property (to achieve fractional scaling, for example). - - For example, for a wl_output mode 3840×2160 and a scale factor 2: - - - A compositor not scaling the surface buffers will advertise a - logical size of 3840×2160, - - - A compositor automatically scaling the surface buffers will - advertise a logical size of 1920×1080, - - - A compositor using a fractional scale of 1.5 will advertise a - logical size of 2560×1440. - - For example, for a wl_output mode 1920×1080 and a 90 degree rotation, - the compositor will advertise a logical size of 1080x1920. - - The logical_size event is sent after creating an xdg_output - (see xdg_output_manager.get_xdg_output) and whenever the logical - size of the output changes, either as a result of a change in the - applied scale or because of a change in the corresponding output - mode(see wl_output.mode) or transform (see wl_output.transform). - - - - - - - - This event is sent after all other properties of an xdg_output - have been sent. - - This allows changes to the xdg_output properties to be seen as - atomic, even if they happen via multiple events. - - For objects version 3 onwards, this event is deprecated. Compositors - are not required to send it anymore and must send wl_output.done - instead. - - - - - - - - Many compositors will assign names to their outputs, show them to the - user, allow them to be configured by name, etc. The client may wish to - know this name as well to offer the user similar behaviors. - - The naming convention is compositor defined, but limited to - alphanumeric characters and dashes (-). Each name is unique among all - wl_output globals, but if a wl_output global is destroyed the same name - may be reused later. The names will also remain consistent across - sessions with the same hardware and software configuration. - - Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do - not assume that the name is a reflection of an underlying DRM - connector, X11 connection, etc. - - The name event is sent after creating an xdg_output (see - xdg_output_manager.get_xdg_output). This event is only sent once per - xdg_output, and the name does not change over the lifetime of the - wl_output global. - - - - - - - Many compositors can produce human-readable descriptions of their - outputs. The client may wish to know this description as well, to - communicate the user for various purposes. - - The description is a UTF-8 string with no convention defined for its - contents. Examples might include 'Foocorp 11" Display' or 'Virtual X11 - output via :1'. - - The description event is sent after creating an xdg_output (see - xdg_output_manager.get_xdg_output) and whenever the description - changes. The description is optional, and may not be sent at all. - - For objects of version 2 and lower, this event is only sent once per - xdg_output, and the description does not change over the lifetime of - the wl_output global. - - - - - - diff --git a/third-party/wlr-protocols b/third-party/wlr-protocols new file mode 160000 index 00000000000..4264185db3b --- /dev/null +++ b/third-party/wlr-protocols @@ -0,0 +1 @@ +Subproject commit 4264185db3b7e961e7f157e1cc4fd0ab75137568 From ed302f647b6a4af52708c304d9d0a9a0eb25c063 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:50:31 +0300 Subject: [PATCH 195/576] Properly join session monitor window thread --- src/main.cpp | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6d761b22f00..6cd3545ef4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -458,6 +458,12 @@ std::map
- -
- - -
- The origin of the remote endpoint address that is not denied for HTTP method /pin -
-
@@ -1168,7 +1150,6 @@

"nvenc_preset": "1", "nvenc_realtime_hags": "enabled", "nvenc_twopass": "quarter_res", - "origin_pin_allowed": "pc", "origin_web_ui_allowed": "lan", "qsv_coder": "auto", "qsv_preset": "medium", From 06f5a1a7b420a0d36284cca3563f6fe6faedf4b9 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 15 Oct 2023 17:57:07 -0400 Subject: [PATCH 205/576] docs: update changelog for v0.21.0 (#1629) Co-authored-by: Cameron Gutman --- CHANGELOG.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419e16025e0..bbeb4028382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,106 @@ # Changelog +## [0.21.0] - 2023-10-15 +**Added** +- (Input) Add support for automatically selecting the emulated controller type based on the physical controller connected to the client +- (Input/Windows) Add support for Applications (context menu) key +- (Input/Windows) Implement touchpad, motion sensors, battery state, and LED control for the emulated DualShock 4 controller +- (Input) Advertise support for new input features to clients +- (Linux/Debian) Added Debian Bookworm package +- (Prep-Commands) Expose connection environment variables +- (Input/Windows) Implement pen and touch support +- (Capture/Windows) Add standalone NVENC encoder +- (Capture) Implement AV1 encoding +- (Network) Implement IPv6 support +- (Capture/Windows) Add option to disable realtime hags +- (Graphics/NVIDIA) Add an option to decrease GPU scheduling priority to workaround HAGS video hang +- (Capture/Linux) Add FFmpeg powerpc64le architecture for self compiling Sunshine +- (Capture/Windows) Add support for capturing rotated displays +- (System Tray) Implement streaming event notifications +- (UI) Add port configuration table +- (Applications) Added option to automatically treat launcher type apps as detached commands +- (Input/Gamepad) Allow the Misc button to work as Guide on emulated Xbox 360 controllers + +**Changed** +- (Input) Reduce latency by implementing input batching +- (Logging) Move input packet debug prints off the control stream thread +- (Input) Refactor gamepad emulation code to use DS4 extended report format +- (Graphics/NVIDIA) Modify and restore NVIDIA control panel settings before and after stream, respectively +- (Graphics/NVIDIA) New config page for NVENC +- (Graphics/Windows) Refactor DX shaders +- (Input/Windows) Use our own keycode mapping to avoid installing the US English keyboard layout + +**Fixed** +- (UI) Fix update notifications +- (Dependencies/Linux) Replace libboost chrono and thread with standard chrono and thread +- (Input) Increase maximum gamepad limit to 16 +- (Network) Allow use of multiple ENet channels +- (Network) Consider link-local addresses on LAN +- (Input) Fixed issue where button may sometimes stick on Windows +- (Input) Fix "ControllerNumber not allocated" warning when a gamepad is removed +- (Input) Fix handling of gamepad feedback with multiple clients connected +- (Input) Fix clamping mouse position to aspect ratio adjusted viewport +- (Graphics/AMD) Fix crash during startup on some older AMD GPUs +- (Logging) Fix crash when non-ASCII characters are logged +- (Prep-Commands) Fix resource exhaustion bug which could occur when many prep commands were used +- (Subprocesses) Fix race condition when inserting new processes +- (Logging) Log error if encoder doesn't produce IDR frame on demand +- (Audio) Improve audio capture logic and logging +- (Logging) Fix AMF logging to match configured log level +- (Logging) Log FFmpeg to log file instead of stdout +- (Capture) Reject codecs that are not supported by display device +- (Capture) Add fallbacks for unsupported codec settings +- (Capture) Avoid probing HEVC or AV1 codecs in some cases +- (Caputre) Remove DwmFlush() +- (Capture/Windows) Improvements to capture sleeps for better frame stability +- (Capture/Windows) Adjust capture rate to better match with display +- (Linux/ArchLinux) Fix package version in PKGBUILD and precompiled package +- (UI) Highlight fatal log messages in web ui +- (Commands) Allow stream if prep command fails +- (Capture/Linux) Fix KMS grab VRAM capture with libva 2.20 +- (Capture/macOS) Fix video capture backend +- (Misc/Windows) Don't start the session monitor window when launched in command mode +- (Linux/AppImage) Use the linuxdeploy GTK plugin to correctly deploy GTK3 dependencies +- (Input/Windows) Fix reWASD not recognizing emulated DualShock 4 input + +**Dependencies** +- Bump bootstrap from 5.2.3 to 5.3.2 +- Bump third-party/moonlight-common-c from c9426a6 to 7a6d12f +- Bump gcc-10 in Ubuntu 20.04 docker image +- Bump furo from 2023.5.20 to 2023.9.10 +- Bump sphinx from 7.0.1 to 7.2.6 +- Bump cmake from 3.26 to 3.27 in Fedora docker images +- Move third-party/nv-codec-headers from sdk/11.1 branch to sdk/12.0 branch +- Automatic bump ffmpeg +- Bump actions/checkout from 3 to 4 +- Bump boost from 1.80 to 1.81 in Macport manifest +- Bump @fortawesome/fontawesome-free from 6.4.0 to 6.4.2 + +**Misc** +- (Docs) Force badges to use svg +- (Docs) Add Linux SSH example +- (Docs) Add information about mesa for Linux +- (CI) Free additional space on Docker, Flatpak, and AppImage builds due to internal changes on GitHub runners +- (Docs/Logging/UI) Corrected various typos +- (Docs) Add blurb about Gamescope compatibility +- (Installer/Windows) Use system proxy to download ViGEmBus +- (CI) Ignore third-party directory for clang-format +- (Docs/Linux) Add Plasma-Compatible resolution example +- (Docs) Add Sunshine website available at https://app.lizardbyte.dev/Sunshine +- (Build/Windows) Fix audio code build with new MinGW headers +- (Build/Windows) Fix QoS code build with new MinGW headers +- (CI/Windows) Prevent winget action from creating an update when running in a fork +- (CI/Windows) Change winget job to ubuntu-latest runner +- (CI) Add CodeQL analysis +- (CI/Docker) Fix ArchLinux image caching issue +- (Windows) Manifest improvements +- (CI/macOS) Simplify macport build +- (Docs) Remove deprecated options from readthedocs config +- (CI/Docs) Lint rst files +- (Docs) Update localization information (after consolidating Crowdin projects) +- (Cmake) Split CMakelists into modules +- (Docs) Add Linux Headless/SSH Guide + ## [0.20.0] - 2023-05-28 **Breaking** - (Windows) The Windows installer version of Sunshine is now always launched by the Sunshine Service. Manually launching Sunshine.exe from Program Files is no longer supported. This was necessary to address security issues caused by non-admin users having access to Sunshine's config data. If you have set up Task Scheduler or other mechanisms to launch Sunshine automatically, remove those from your system before updating. @@ -490,3 +591,4 @@ settings. In v0.17.0, games now run under your user account without elevated pri [0.19.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.19.0 [0.19.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.19.1 [0.20.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.20.0 +[0.21.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.21.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bd627cb52b..9c21b380ab9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.18) # todo - set this conditionally # todo - set version to 0.0.0 once confident in automated versioning -project(Sunshine VERSION 0.20.0 +project(Sunshine VERSION 0.21.0 DESCRIPTION "Sunshine is a self-hosted game stream host for Moonlight." HOMEPAGE_URL "https://app.lizardbyte.dev/Sunshine") From d8e2e4ba697669e222b65fd1ae17a53dd134e917 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:11:27 -0400 Subject: [PATCH 206/576] ci: update release notifier (#1755) --- .github/workflows/release-notifier.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml index 5161fc5f5d5..2827224b8bf 100644 --- a/.github/workflows/release-notifier.yml +++ b/.github/workflows/release-notifier.yml @@ -15,7 +15,7 @@ on: jobs: discord: if: >- - (github.repository, 'LizardByte/') and + startsWith(github.repository, 'LizardByte/') and not(github.event.release.prerelease) and not(github.event.release.draft) runs-on: ubuntu-latest @@ -34,7 +34,7 @@ jobs: facebook_group: if: >- - (github.repository, 'LizardByte/') and + startsWith(github.repository, 'LizardByte/') and not(github.event.release.prerelease) and not(github.event.release.draft) runs-on: ubuntu-latest @@ -51,7 +51,7 @@ jobs: facebook_page: if: >- - (github.repository, 'LizardByte/') and + startsWith(github.repository, 'LizardByte/') and not(github.event.release.prerelease) and not(github.event.release.draft) runs-on: ubuntu-latest @@ -68,7 +68,7 @@ jobs: reddit: if: >- - (github.repository, 'LizardByte/') and + startsWith(github.repository, 'LizardByte/') and not(github.event.release.prerelease) and not(github.event.release.draft) runs-on: ubuntu-latest @@ -88,7 +88,7 @@ jobs: twitter: if: >- - (github.repository, 'LizardByte/') and + startsWith(github.repository, 'LizardByte/') and not(github.event.release.prerelease) and not(github.event.release.draft) runs-on: ubuntu-latest From 864ff3d2fe1db0e724f1bd70189070abb9d0c45c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:10:29 -0400 Subject: [PATCH 207/576] build(deps): bump third-party/wayland-protocols from `681c33c` to `d70af2e` (#1753) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/wayland-protocols | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/wayland-protocols b/third-party/wayland-protocols index 681c33c8547..d70af2ea1e9 160000 --- a/third-party/wayland-protocols +++ b/third-party/wayland-protocols @@ -1 +1 @@ -Subproject commit 681c33c8547d6aefe24455ba2bffe1c5ae11fee5 +Subproject commit d70af2ea1e9892f16ec5d25fd04e36826b7e3aef From 83ceaab6243b752c51c4a1ad0dde3e36f0df6102 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 09:04:39 -0400 Subject: [PATCH 208/576] build(deps): bump third-party/nv-codec-headers from `9402b5a` to `22441b5` (#1725) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/nv-codec-headers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/nv-codec-headers b/third-party/nv-codec-headers index 9402b5a7693..22441b505d9 160000 --- a/third-party/nv-codec-headers +++ b/third-party/nv-codec-headers @@ -1 +1 @@ -Subproject commit 9402b5a7693e9841f8a4f4488cd2df21ac55c685 +Subproject commit 22441b505d9d9afc1e3002290820909846c24bdc From ae65bdb8f8e67810c0d94d1a225c320af40fc967 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 09:52:13 -0400 Subject: [PATCH 209/576] Bump third-party/nanors from `395e5ad` to `e9e242e` (#1090) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/nanors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/nanors b/third-party/nanors index 395e5ada44d..e9e242e98e2 160000 --- a/third-party/nanors +++ b/third-party/nanors @@ -1 +1 @@ -Subproject commit 395e5ada44dd8d5974eaf6bb6b17f23406e3ca72 +Subproject commit e9e242e98e27037830490b2a752895ca68f75f8b From 94110cc03f88bab37070b564484f16b92dfa7d9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:56:05 -0400 Subject: [PATCH 210/576] build(deps): bump third-party/Simple-Web-Server from `2f29926` to `27b41f5` (#1217) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/Simple-Web-Server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/Simple-Web-Server b/third-party/Simple-Web-Server index 2f29926dbbc..27b41f5ee15 160000 --- a/third-party/Simple-Web-Server +++ b/third-party/Simple-Web-Server @@ -1 +1 @@ -Subproject commit 2f29926dbbcd8a0425064d98c24f37ac50bd0b5b +Subproject commit 27b41f5ee154cca0fce4fe2955dd886d04e3a4ed From 5388f05635c0e0c15e34393ee1bf8a719adb1c70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:31:15 -0400 Subject: [PATCH 211/576] build(deps): bump third-party/miniupnp from `e439318` to `fb5c328` (#1511) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/miniupnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/miniupnp b/third-party/miniupnp index e439318cf78..fb5c328a5e8 160000 --- a/third-party/miniupnp +++ b/third-party/miniupnp @@ -1 +1 @@ -Subproject commit e439318cf782e30066d430f27a1365e013a5ab94 +Subproject commit fb5c328a5e8fd57a3ec0f5d33915377a5d3581f3 From 27c69db8fe1ec5d35f21ff7676078a0d63def322 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:16:05 -0400 Subject: [PATCH 212/576] Bump ffmpeg (#1717) --- third-party/ffmpeg-linux-aarch64 | 2 +- third-party/ffmpeg-linux-powerpc64le | 2 +- third-party/ffmpeg-linux-x86_64 | 2 +- third-party/ffmpeg-macos-aarch64 | 2 +- third-party/ffmpeg-macos-x86_64 | 2 +- third-party/ffmpeg-windows-x86_64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/third-party/ffmpeg-linux-aarch64 b/third-party/ffmpeg-linux-aarch64 index 8b8848d40df..315b077e231 160000 --- a/third-party/ffmpeg-linux-aarch64 +++ b/third-party/ffmpeg-linux-aarch64 @@ -1 +1 @@ -Subproject commit 8b8848d40df336cb290e58b7e57c396009100595 +Subproject commit 315b077e23127a4c0bf3cff3bb6576e64497ff29 diff --git a/third-party/ffmpeg-linux-powerpc64le b/third-party/ffmpeg-linux-powerpc64le index 9dadebb470b..4074d524629 160000 --- a/third-party/ffmpeg-linux-powerpc64le +++ b/third-party/ffmpeg-linux-powerpc64le @@ -1 +1 @@ -Subproject commit 9dadebb470b99483ab7a5c9d5ac52f299bae42f7 +Subproject commit 4074d524629ca53f8df2365be30ec93abe5439e9 diff --git a/third-party/ffmpeg-linux-x86_64 b/third-party/ffmpeg-linux-x86_64 index e0169be4b69..c887d24822c 160000 --- a/third-party/ffmpeg-linux-x86_64 +++ b/third-party/ffmpeg-linux-x86_64 @@ -1 +1 @@ -Subproject commit e0169be4b6929ca8ed0068ea25db3d62baa1335d +Subproject commit c887d24822cccbf1dc01a0cfacc977db46e318db diff --git a/third-party/ffmpeg-macos-aarch64 b/third-party/ffmpeg-macos-aarch64 index 4537513b457..fe12a607ed8 160000 --- a/third-party/ffmpeg-macos-aarch64 +++ b/third-party/ffmpeg-macos-aarch64 @@ -1 +1 @@ -Subproject commit 4537513b457ec50926d5ef81c579504364d0fa21 +Subproject commit fe12a607ed8357611ec2dabc7e31a6cc1557b003 diff --git a/third-party/ffmpeg-macos-x86_64 b/third-party/ffmpeg-macos-x86_64 index 7057139d873..97ff12c2282 160000 --- a/third-party/ffmpeg-macos-x86_64 +++ b/third-party/ffmpeg-macos-x86_64 @@ -1 +1 @@ -Subproject commit 7057139d8731cfb577859f832ff59402137fdff2 +Subproject commit 97ff12c22822bf33553be7789b6c5e152b00221a diff --git a/third-party/ffmpeg-windows-x86_64 b/third-party/ffmpeg-windows-x86_64 index bbf911e6b2a..9bebfe2cfab 160000 --- a/third-party/ffmpeg-windows-x86_64 +++ b/third-party/ffmpeg-windows-x86_64 @@ -1 +1 @@ -Subproject commit bbf911e6b2a2f3c2c0ca1675a11ed3e1bdd36e9a +Subproject commit 9bebfe2cfab475549bc2b700449586a4a458fce5 From 8b35b8dd118f062c0f12fd0cf1222d8970b368e5 Mon Sep 17 00:00:00 2001 From: Ehab Ajmal <33014707+ehabajmal@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:43:42 -0400 Subject: [PATCH 213/576] Add guide for setting custom res with nvidia on linux (#1767) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- docs/source/about/guides/app_examples.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/source/about/guides/app_examples.rst b/docs/source/about/guides/app_examples.rst index 4cb45b7d5c1..e0bc543253a 100644 --- a/docs/source/about/guides/app_examples.rst +++ b/docs/source/about/guides/app_examples.rst @@ -197,6 +197,28 @@ Changing Resolution and Refresh Rate (Linux - KDE Plasma - Wayland and X11) | | Undo: ``kscreen-doctor output.HDMI-A-1.mode.3840x2160@120`` | +----------------------+----------------------------------------------------------------------------------------------------------------------------------+ +Changing Resolution (Linux - NVIDIA) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+------------------------------------------------------------------------------------------------------+ +| **Field** | **Value** | ++----------------------+------------------------------------------------------------------------------------------------------+ +| Command Preparations | Do: ``sh -c "${HOME}/scripts/set-custom-res.sh ${SUNSHINE_CLIENT_WIDTH} ${SUNSHINE_CLIENT_HEIGHT}"`` | +| +------------------------------------------------------------------------------------------------------+ +| | Undo: ``sh -c "${HOME}/scripts/set-custom-res.sh 3840 2160"`` | ++----------------------+------------------------------------------------------------------------------------------------------+ + +The ``set-custom-res.sh`` will have this content: + .. code-block:: bash + + #!/bin/bash + + # Get params and set any defaults + width=${1:-1920} + height=${2:-1080} + output=${3:-HDMI-1} + nvidia-settings -a CurrentMetaMode="${output}: nvidia-auto-select { ViewPortIn=${width}x${height}, ViewPortOut=${width}x${height}+0+0 }" + Flatpak ^^^^^^^ From d45983811cfed7a8285d83de3dfcf098eb69333d Mon Sep 17 00:00:00 2001 From: Erick C Date: Sun, 22 Oct 2023 15:03:33 -0400 Subject: [PATCH 214/576] Manual DS4 mode: Allow Back/Select to trigger Touchpad click (#1772) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- docs/source/about/advanced_usage.rst | 17 +++++++++++++++++ src/config.cpp | 2 ++ src/config.h | 1 + src/platform/windows/input.cpp | 5 ++++- src_assets/common/assets/web/config.html | 24 ++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index e9bba6781f1..c9d9ebae3b4 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -152,6 +152,23 @@ gamepad .. code-block:: text gamepad = auto + +ds4_back_as_touchpad_click +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**Description** + .. Hint:: Only applies when gamepad is set to ds4 manually. Unused in other gamepad modes. + + Allow Select/Back inputs to also trigger DS4 touchpad click. Useful for clients looking to emulate touchpad click + on Xinput devices. + +**Default** + ``enabled`` + +**Example** + .. code-block:: text + + ds4_back_as_touchpad_click = enabled back_button_timeout ^^^^^^^^^^^^^^^^^^^ diff --git a/src/config.cpp b/src/config.cpp index 726f67f8ca7..d5932d62cfe 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -418,6 +418,7 @@ namespace config { platf::supported_gamepads().front().data(), platf::supported_gamepads().front().size(), }, // Default gamepad + true, // back as touchpad click enabled (manual DS4 only) true, // keyboard enabled true, // mouse enabled @@ -1041,6 +1042,7 @@ namespace config { } string_restricted_f(vars, "gamepad"s, input.gamepad, platf::supported_gamepads()); + bool_f(vars, "ds4_back_as_touchpad_click", input.ds4_back_as_touchpad_click); bool_f(vars, "mouse", input.mouse); bool_f(vars, "keyboard", input.keyboard); diff --git a/src/config.h b/src/config.h index 090e6b6864d..749a8556d11 100644 --- a/src/config.h +++ b/src/config.h @@ -112,6 +112,7 @@ namespace config { std::chrono::duration key_repeat_period; std::string gamepad; + bool ds4_back_as_touchpad_click; bool keyboard; bool mouse; diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index ca9cfba7b93..29dd758acc1 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -1174,7 +1174,7 @@ namespace platf { BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be Xbox 360 controller (manual selection)"sv; selectedGamepadType = Xbox360Wired; } - else if (config::input.gamepad == "ps4"sv || config::input.gamepad == "ds4"sv) { + else if (config::input.gamepad == "ds4"sv) { BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be DualShock 4 controller (manual selection)"sv; selectedGamepadType = DualShock4Wired; } @@ -1334,6 +1334,9 @@ namespace platf { // Allow either PS4/PS5 clickpad button or Xbox Series X share button to activate DS4 clickpad if (gamepad_state.buttonFlags & (TOUCHPAD_BUTTON | MISC_BUTTON)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD; + // Manual DS4 emulation: check if BACK button should also trigger DS4 touchpad click + if (config::input.gamepad == "ds4"sv && config::input.ds4_back_as_touchpad_click && (gamepad_state.buttonFlags & BACK)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD; + return (DS4_SPECIAL_BUTTONS) buttons; } diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 6f9e89de027..6e2b61b760c 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -105,6 +105,29 @@

Configuration

Choose which type of gamepad to emulate on the host

+
+
+

+ +

+
+
+
+ + +
When forcing DS4 emulation, map Back/Select to Touchpad Click
+
+
+
+
+
@@ -1136,6 +1159,7 @@

"capture": "", "controller": "enabled", "install_steam_audio_drivers": "enabled", + "ds4_back_as_touchpad_click": "enabled", "dwmflush": "enabled", "encoder": "", "fps": "[10,30,60,90,120]", From 079c7af11c9c364798290cfc820638901dbee476 Mon Sep 17 00:00:00 2001 From: detiam <44510779+detiam@users.noreply.github.com> Date: Thu, 26 Oct 2023 02:14:28 +0800 Subject: [PATCH 215/576] Update linux sunshine.desktop (#1768) --- cmake/packaging/linux.cmake | 7 ++++++- cmake/prep/special_package_configuration.cmake | 2 ++ packaging/linux/AppImage/sunshine.desktop | 3 ++- packaging/linux/flatpak/sunshine.desktop | 15 +++++++++++++-- packaging/linux/flatpak/sunshine_kms.desktop | 7 ++----- packaging/linux/sunshine.desktop | 12 +++++++++--- packaging/linux/sunshine_terminal.desktop | 6 ++++++ 7 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 packaging/linux/sunshine_terminal.desktop diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index aee40cb7f1b..842277b9d27 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -88,7 +88,12 @@ endif() # desktop file # todo - validate desktop files with `desktop-file-validate` -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +if(NOT ${SUNSHINE_BUILD_APPIMAGE}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") +endif() if(${SUNSHINE_BUILD_FLATPAK}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_kms.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") diff --git a/cmake/prep/special_package_configuration.cmake b/cmake/prep/special_package_configuration.cmake index cd285a65acc..3094c2399a5 100644 --- a/cmake/prep/special_package_configuration.cmake +++ b/cmake/prep/special_package_configuration.cmake @@ -9,8 +9,10 @@ elseif (UNIX) elseif(${SUNSHINE_BUILD_FLATPAK}) configure_file(packaging/linux/flatpak/sunshine.desktop sunshine.desktop @ONLY) configure_file(packaging/linux/flatpak/sunshine_kms.desktop sunshine_kms.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) else() configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) endif() # configure metadata file diff --git a/packaging/linux/AppImage/sunshine.desktop b/packaging/linux/AppImage/sunshine.desktop index a345e5dc467..911735c8c2f 100644 --- a/packaging/linux/AppImage/sunshine.desktop +++ b/packaging/linux/AppImage/sunshine.desktop @@ -5,7 +5,8 @@ Exec=sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; Terminal=true X-AppImage-Name=sunshine X-AppImage-Version=@PROJECT_VERSION@ diff --git a/packaging/linux/flatpak/sunshine.desktop b/packaging/linux/flatpak/sunshine.desktop index acfced8d7a6..33124ab842f 100644 --- a/packaging/linux/flatpak/sunshine.desktop +++ b/packaging/linux/flatpak/sunshine.desktop @@ -5,5 +5,16 @@ Exec=flatpak run dev.lizardbyte.sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; -Terminal=true +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; +Actions=RunInTerminal;KMS; + +[Desktop Action RunInTerminal] +Name=Run in Terminal +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop + +[Desktop Action KMS] +Name=Run in Terminal (KMS) +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_kms.desktop diff --git a/packaging/linux/flatpak/sunshine_kms.desktop b/packaging/linux/flatpak/sunshine_kms.desktop index 139fd0c4cb7..521f4b936ae 100644 --- a/packaging/linux/flatpak/sunshine_kms.desktop +++ b/packaging/linux/flatpak/sunshine_kms.desktop @@ -1,9 +1,6 @@ [Desktop Entry] -Type=Application Name=@PROJECT_NAME@ (KMS) Exec=sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.sunshine -Version=1.0 -Comment=@PROJECT_DESCRIPTION@ -Icon=sunshine -Categories=Utility; Terminal=true +Type=Application +NoDisplay=true diff --git a/packaging/linux/sunshine.desktop b/packaging/linux/sunshine.desktop index d5cf7c03f18..6bb8687fd1c 100644 --- a/packaging/linux/sunshine.desktop +++ b/packaging/linux/sunshine.desktop @@ -1,9 +1,15 @@ [Desktop Entry] Type=Application Name=@PROJECT_NAME@ -Exec=sunshine +Exec=/usr/bin/env systemctl start --u sunshine Version=1.0 Comment=@PROJECT_DESCRIPTION@ Icon=sunshine -Categories=Utility; -Terminal=true +Keywords=gamestream;stream;moonlight;remote play; +Categories=AudioVideo;Network;RemoteAccess; +Actions=RunInTerminal; + +[Desktop Action RunInTerminal] +Name=Run in Terminal +Icon=application-x-executable +Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop diff --git a/packaging/linux/sunshine_terminal.desktop b/packaging/linux/sunshine_terminal.desktop new file mode 100644 index 00000000000..c26889123cb --- /dev/null +++ b/packaging/linux/sunshine_terminal.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=@PROJECT_NAME@ +Exec=sunshine +Terminal=true +Type=Application +NoDisplay=true From f729a04f9a57c8e434bb7e23b5408929e46fcd69 Mon Sep 17 00:00:00 2001 From: everything411 Date: Fri, 27 Oct 2023 21:28:29 +0800 Subject: [PATCH 216/576] fix(audio:windows): set cbSize correctly (#1787) --- src/platform/windows/audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index c02f1626fd6..1311a694fd1 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -156,7 +156,7 @@ namespace platf::audio { wave_format.Format.wBitsPerSample = 16; wave_format.Format.nBlockAlign = wave_format.Format.nChannels * wave_format.Format.wBitsPerSample / 8; wave_format.Format.nAvgBytesPerSec = wave_format.Format.nSamplesPerSec * wave_format.Format.nBlockAlign; - wave_format.Format.cbSize = sizeof(wave_format); + wave_format.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); wave_format.Samples.wValidBitsPerSample = 16; wave_format.dwChannelMask = format.channel_mask; From e7d2e23f8cfe0715925dabd55f390d9ed9076276 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:29:04 -0400 Subject: [PATCH 217/576] build(deps): bump third-party/tray from `2664388` to `e08bdbe` (#1802) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/tray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/tray b/third-party/tray index 2664388b0ed..e08bdbe5aa7 160000 --- a/third-party/tray +++ b/third-party/tray @@ -1 +1 @@ -Subproject commit 2664388b0ed88234674a37f8cd569747522247b4 +Subproject commit e08bdbe5aa7de0ad9c0ce36257016e07c7e6e2c0 From 3b0a2ca9da191833ae569ac5bb09f6d3825d7c06 Mon Sep 17 00:00:00 2001 From: Timo Gurr Date: Sun, 5 Nov 2023 01:48:52 +0100 Subject: [PATCH 218/576] config: add 2K resolution (WQHD - 16:9) (#1816) --- src/config.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.cpp b/src/config.cpp index d5932d62cfe..c08f5a9c4eb 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -395,6 +395,7 @@ namespace config { "1280x720"s, "1920x1080"s, "2560x1080"s, + "2560x1440"s, "3440x1440"s, "1920x1200"s, "3840x2160"s, From 07bd9ab34a4e30e706af6cd1bbcbd2969e4837da Mon Sep 17 00:00:00 2001 From: Justin Dhillon Date: Sat, 4 Nov 2023 21:47:22 -0700 Subject: [PATCH 219/576] docs: fix broken links (#1813) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .github/workflows/CI.yml | 2 +- cmake/packaging/windows.cmake | 2 +- docs/source/about/third_party_packages.rst | 7 ------- packaging/linux/Arch/PKGBUILD | 2 +- src/platform/windows/PolicyConfig.h | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 254a1940dd5..b802e2346a9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -325,7 +325,7 @@ jobs: # install newer tar from focal... appimagelint fails on 18.04 without this echo "original tar version" tar --version - wget -O tar.deb http://security.ubuntu.com/ubuntu/pool/main/t/tar/tar_1.30+dfsg-7ubuntu0.20.04.2_amd64.deb + wget -O tar.deb http://security.ubuntu.com/ubuntu/pool/main/t/tar/tar_1.30+dfsg-7ubuntu0.20.04.3_amd64.deb sudo apt-get -y install -f ./tar.deb echo "new tar version" tar --version diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 0d4f1dd9cce..3231d761f8c 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -103,7 +103,7 @@ set(CPACK_NSIS_DELETE_ICONS_EXTRA # Checking for previous installed versions set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") -set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/about/installation.html") +set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/en/latest/about/installation.html") set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}") set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support") diff --git a/docs/source/about/third_party_packages.rst b/docs/source/about/third_party_packages.rst index 69204dc266e..d45188c4a0d 100644 --- a/docs/source/about/third_party_packages.rst +++ b/docs/source/about/third_party_packages.rst @@ -3,13 +3,6 @@ Third Party Packages .. Danger:: These packages are not maintained by LizardByte. Use at your own risk. -AOSC ----- - -.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=AOSC&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27aosc%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAMAAABPMuDPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAMAUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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hgS/5iHC+afEOnNCEcinM4gIdyPEZZE9BvkzPc/Umjzvy9uT3Rz0vyjUrwZYYp3SrI779P36d3HkxGwjPbldzF0C4xlhC6dByTyFTN59B7jzXQIGfm4P/3V4JM4OJ7pOOI5OpAqhHGJkbFMRxPPkeFxdJxFr95DI5gOKm79R/lzUwoeyYF9/JgOLZ6xoSHJRPbB3SsucEQ882hI54GDfZO90BWDT7fhIUMD/JhHTPxGjgkfFebvNc5xVkXukRAVHDJ4WKw38+iKp1/s6BFDwwNHxQTHJXZqkuFxvYeEJEWmDIuOcP7U/w+C7XCu0wHHigAAAABJRU5ErkJggg== - :alt: AOSC Version - :target: https://packages.aosc.io/packages/sunshine - AUR --- diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 11b699823b0..cfd760653df 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -1,4 +1,4 @@ -# Edit on github: https://github.com/LizardByte/Sunshine/tree/nightly/packaging/linux/aur/PKGBUILD +# Edit on github: https://github.com/LizardByte/Sunshine/blob/nightly/packaging/linux/Arch/PKGBUILD # Reference: https://wiki.archlinux.org/title/PKGBUILD pkgname='sunshine' diff --git a/src/platform/windows/PolicyConfig.h b/src/platform/windows/PolicyConfig.h index 21772227c19..087f85fa84f 100644 --- a/src/platform/windows/PolicyConfig.h +++ b/src/platform/windows/PolicyConfig.h @@ -3,7 +3,7 @@ * @brief Undocumented COM-interface IPolicyConfig. * @details Use for setting default audio render endpoint. * @author EreTIk - * @see http://eretik.omegahg.com/ + * @see https://kitere.github.io/ */ #pragma once From 66660da5770ba770b834cef0fd06fdc151e3f9f6 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:43:12 +0300 Subject: [PATCH 220/576] Fix incorrect portrait mode rotation center on Windows (#1851) --- .../windows/assets/shaders/directx/include/base_vs.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl index 5fc9226bd4f..c04fad39018 100644 --- a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl @@ -2,7 +2,7 @@ #if defined(LEFT_SUBSAMPLING) vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float subsample_offset, int rotate_texture_steps) -#elif defined (TOPLEFT_SUBSAMPLING) +#elif defined(TOPLEFT_SUBSAMPLING) vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float2 subsample_offset, int rotate_texture_steps) #else vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_steps) @@ -29,7 +29,7 @@ vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_ float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), sin(rotation_radians), cos(rotation_radians) }; float2 rotation_center = { 0.5, 0.5 }; - tex_coord = round(tex_coord + mul(rotation_matrix, tex_coord - rotation_center)); + tex_coord = round(rotation_center + mul(rotation_matrix, tex_coord - rotation_center)); } #if defined(LEFT_SUBSAMPLING) From dfb65b018fc33e7478cca4d005bf3625e251e791 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Thu, 23 Nov 2023 23:28:07 -0500 Subject: [PATCH 221/576] ci: update global workflows (#1863) --- .github/workflows/automerge.yml | 2 +- .github/workflows/codeql.yml | 4 ++-- .github/workflows/issues.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 49ddebf4ec1..733b4de8521 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -31,7 +31,7 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Label autoapproved - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GH_BOT_TOKEN }} script: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 95349bbc477..358ff9c99f6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: continue: ${{ steps.continue.outputs.result }} steps: - name: Get repo languages - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: lang with: script: | @@ -70,7 +70,7 @@ jobs: return matrix - name: Continue - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: continue with: script: | diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index d7a1025cdce..aec6006c870 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -20,6 +20,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Label Actions - uses: dessant/label-actions@v3 + uses: dessant/label-actions@v4 with: github-token: ${{ secrets.GH_BOT_TOKEN }} From 1491afed37a5ebc0a9fc24d9d0e388b07f2d6889 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 30 Nov 2023 23:51:45 -0600 Subject: [PATCH 222/576] Don't hardcode the signature length to RSA-2048 (#1872) --- docs/source/about/advanced_usage.rst | 8 ++++++-- src/config.h | 4 ++-- src/crypto.cpp | 9 +++++---- src/crypto.h | 1 - src/nvhttp.cpp | 10 +++++++--- src_assets/common/assets/web/config.html | 10 ++++++---- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index c9d9ebae3b4..0b4a687b6fe 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -605,7 +605,9 @@ pkey ^^^^ **Description** - The private key. This must be 2048 bits. + The private key used for the web UI and Moonlight client pairing. For best compatibility, this should be an RSA-2048 private key. + + .. Warning:: Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits. **Default** ``credentials/cakey.pem`` @@ -619,7 +621,9 @@ cert ^^^^ **Description** - The certificate. Must be signed with a 2048 bit key. + The certificate used for the web UI and Moonlight client pairing. For best compatibility, this should have an RSA-2048 public key. + + .. Warning:: Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits. **Default** ``credentials/cacert.pem`` diff --git a/src/config.h b/src/config.h index 749a8556d11..6e481a1f641 100644 --- a/src/config.h +++ b/src/config.h @@ -92,8 +92,8 @@ namespace config { // pc|lan|wan std::string origin_web_ui_allowed; - std::string pkey; // must be 2048 bits - std::string cert; // must be signed with a key of 2048 bits + std::string pkey; + std::string cert; std::string sunshine_name; diff --git a/src/crypto.cpp b/src/crypto.cpp index 5dec0f8dd57..26af3e7df47 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -409,11 +409,12 @@ namespace crypto { return {}; } - std::size_t slen = digest_size; - - std::vector digest; - digest.resize(slen); + std::size_t slen; + if (EVP_DigestSignFinal(ctx.get(), nullptr, &slen) != 1) { + return {}; + } + std::vector digest(slen); if (EVP_DigestSignFinal(ctx.get(), digest.data(), &slen) != 1) { return {}; } diff --git a/src/crypto.h b/src/crypto.h index d8d0a35a607..b75d013ca1c 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -17,7 +17,6 @@ namespace crypto { std::string x509; std::string pkey; }; - constexpr std::size_t digest_size = 256; void md_ctx_destroy(EVP_MD_CTX *); diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index 5bde7b079bc..fa7847c3fde 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -380,11 +380,15 @@ namespace nvhttp { auto &client = sess.client; auto pairingsecret = util::from_hex_vec(get_arg(args, "clientpairingsecret"), true); + if (pairingsecret.size() <= 16) { + tree.put("root.paired", 0); + tree.put("root..status_code", 400); + tree.put("root..status_message", "Clientpairingsecret too short"); + return; + } std::string_view secret { pairingsecret.data(), 16 }; - std::string_view sign { pairingsecret.data() + secret.size(), crypto::digest_size }; - - assert((secret.size() + sign.size()) == pairingsecret.size()); + std::string_view sign { pairingsecret.data() + secret.size(), pairingsecret.size() - secret.size() }; auto x509 = crypto::x509(client.cert); auto x509_sign = crypto::signature(x509); diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 6e2b61b760c..927ef945564 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -316,11 +316,13 @@

placeholder="/dir/pkey.pem" v-model="config.pkey" /> -
The private key must be 2048 bits
+
+ The private key used for the web UI and Moonlight client pairing. For best compatibility, this should be an RSA-2048 private key. +

- +
- + v-model="config.cert" />
- The certificate must be signed with a 2048 bit key + The certificate used for the web UI and Moonlight client pairing. For best compatibility, this should have an RSA-2048 public key.
From 68c443546fa1531ff9498423b1ef03cb0dc16ccc Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 3 Dec 2023 17:20:47 -0500 Subject: [PATCH 223/576] docs(windows): add drive permissions troubleshooting (#1883) --- docs/source/troubleshooting/windows.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/troubleshooting/windows.rst b/docs/source/troubleshooting/windows.rst index 9190fc300f7..313bef9a3ee 100644 --- a/docs/source/troubleshooting/windows.rst +++ b/docs/source/troubleshooting/windows.rst @@ -4,3 +4,11 @@ Windows No gamepad detected ------------------- #. Verify that you've installed `Nefarius Virtual Gamepad `__. + +Permission denied +----------------- +Since Sunshine runs as a service on Windows, it may not have the same level of access that your regular user account +has. You may get permission denied errors when attempting to launch a game or application from a non system drive. + +You will need to modify the security permissions on your disk. Ensure that user/principal SYSTEM has full +permissions on the disk. From 56071e702446be4b447024ad01f6d055948cb4d5 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:12:14 -0500 Subject: [PATCH 224/576] ci: update release notifier (#1891) --- .github/workflows/release-notifier.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml index 2827224b8bf..5735465e4a0 100644 --- a/.github/workflows/release-notifier.yml +++ b/.github/workflows/release-notifier.yml @@ -15,8 +15,8 @@ on: jobs: discord: if: >- - startsWith(github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and + startsWith(github.repository, 'LizardByte/') && + not(github.event.release.prerelease) && not(github.event.release.draft) runs-on: ubuntu-latest steps: @@ -34,8 +34,8 @@ jobs: facebook_group: if: >- - startsWith(github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and + startsWith(github.repository, 'LizardByte/') && + not(github.event.release.prerelease) && not(github.event.release.draft) runs-on: ubuntu-latest steps: @@ -51,8 +51,8 @@ jobs: facebook_page: if: >- - startsWith(github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and + startsWith(github.repository, 'LizardByte/') && + not(github.event.release.prerelease) && not(github.event.release.draft) runs-on: ubuntu-latest steps: @@ -68,8 +68,8 @@ jobs: reddit: if: >- - startsWith(github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and + startsWith(github.repository, 'LizardByte/') && + not(github.event.release.prerelease) && not(github.event.release.draft) runs-on: ubuntu-latest steps: @@ -88,8 +88,8 @@ jobs: twitter: if: >- - startsWith(github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and + startsWith(github.repository, 'LizardByte/') && + not(github.event.release.prerelease) && not(github.event.release.draft) runs-on: ubuntu-latest steps: From dd6012aeef0c7c65c63e7b7a197b3b506a566fba Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 3 Dec 2023 21:45:10 -0600 Subject: [PATCH 225/576] Fix discovery of Windows hosts by Apple devices --- src/platform/windows/publish.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/platform/windows/publish.cpp b/src/platform/windows/publish.cpp index 187868b6fa7..30aa30e24cb 100644 --- a/src/platform/windows/publish.cpp +++ b/src/platform/windows/publish.cpp @@ -119,6 +119,21 @@ namespace platf::publish { instance.wPort = map_port(nvhttp::PORT_HTTP); instance.pszHostName = host.data(); + // Setting these values ensures Windows mDNS answers comply with RFC 1035. + // If these are unset, Windows will send a TXT record that has zero strings, + // which is illegal. Setting them to a single empty value causes Windows to + // send a single empty string for the TXT record, which is the correct thing + // to do when advertising a service without any TXT strings. + // + // Most clients aren't strictly checking TXT record compliance with RFC 1035, + // but Apple's mDNS resolver does and rejects the entire answer if an invalid + // TXT record is present. + PWCHAR keys[] = { nullptr }; + PWCHAR values[] = { nullptr }; + instance.dwPropertyCount = 1; + instance.keys = keys; + instance.values = values; + DNS_SERVICE_REGISTER_REQUEST req {}; req.Version = DNS_QUERY_REQUEST_VERSION1; req.pQueryContext = alarm.get(); From d2efbd8d5016e901d19e7da330505d13dba7bb6f Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:48:02 -0500 Subject: [PATCH 226/576] ci: update global python (#1896) --- .github/workflows/cpp-lint.yml | 2 +- .github/workflows/python-flake8.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml index 86a2b8d686b..b5d4ff7765e 100644 --- a/.github/workflows/cpp-lint.yml +++ b/.github/workflows/cpp-lint.yml @@ -79,7 +79,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml index 4b0d30810da..e08ab10fcac 100644 --- a/.github/workflows/python-flake8.yml +++ b/.github/workflows/python-flake8.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 # https://github.com/actions/setup-python + uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: python-version: '3.10' From 53e8d4d7f23154eef2f5e532c1832866c263ee0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:07:08 -0500 Subject: [PATCH 227/576] build(deps): bump actions/setup-python from 4 to 5 (#1893) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/localize.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index eb7e77974a2..f9cd64859bb 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v4 - name: Install Python 3.9 - uses: actions/setup-python@v4 # https://github.com/actions/setup-python + uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: python-version: '3.9' From fcdf92147bd0373922d3b472ab159eb5eb4b2fee Mon Sep 17 00:00:00 2001 From: zoeyjodon <76182954+zoeyjodon@users.noreply.github.com> Date: Sat, 9 Dec 2023 09:31:04 -0500 Subject: [PATCH 228/576] Extend session timeout (#1890) --- src/rtsp.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/rtsp.cpp b/src/rtsp.cpp index 5a12253de17..9aa3ea1c220 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -307,6 +307,19 @@ namespace rtsp_stream { _map_cmd_cb.emplace(type, std::move(cb)); } + /** + * @brief Launch a new streaming session. + * @note If the client does not begin streaming within the ping_timeout, + * the session will be discarded. + * @param launch_session Streaming session information. + * + * EXAMPLES: + * ```cpp + * launch_session_t launch_session; + * rtsp_server_t server {}; + * server.session_raise(launch_session); + * ``` + */ void session_raise(rtsp_stream::launch_session_t launch_session) { auto now = std::chrono::steady_clock::now(); @@ -315,7 +328,7 @@ namespace rtsp_stream { if (raised_timeout > now && launch_event.peek()) { return; } - raised_timeout = now + 10s; + raised_timeout = now + config::stream.ping_timeout; --_slot_count; launch_event.raise(launch_session); @@ -328,12 +341,22 @@ namespace rtsp_stream { safe::event_t launch_event; + /** + * @brief Clear launch sessions. + * @param all If true, clear all sessions. Otherwise, only clear timed out and stopped sessions. + * + * EXAMPLES: + * ```cpp + * clear(false); + * ``` + */ void clear(bool all = true) { // if a launch event timed out --> Remove it. if (raised_timeout < std::chrono::steady_clock::now()) { auto discarded = launch_event.pop(0s); if (discarded) { + BOOST_LOG(debug) << "Event timeout: "sv << discarded->unique_id; ++_slot_count; } } From 64b696536775f0db459068d2f2fb073a98bc60b9 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:38:22 -0500 Subject: [PATCH 229/576] ci: update global workflows (#1904) --- .github/workflows/issues-stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issues-stale.yml b/.github/workflows/issues-stale.yml index aecc8243f34..deb3d74b961 100644 --- a/.github/workflows/issues-stale.yml +++ b/.github/workflows/issues-stale.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Stale - uses: actions/stale@v8 + uses: actions/stale@v9 with: close-issue-message: > This issue was closed because it has been stalled for 10 days with no activity. @@ -43,7 +43,7 @@ jobs: repo-token: ${{ secrets.GH_BOT_TOKEN }} - name: Invalid Template - uses: actions/stale@v8 + uses: actions/stale@v9 with: close-issue-message: > This issue was closed because the the template was not completed after 5 days. From 05c85744ff06d6eef115477e31bafe3f65d221d9 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:53:48 -0500 Subject: [PATCH 230/576] docs: fix failing images (#1903) --- docs/source/contributing/localization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/contributing/localization.rst b/docs/source/contributing/localization.rst index ec6a43a5daf..ef2c811c4a9 100644 --- a/docs/source/contributing/localization.rst +++ b/docs/source/contributing/localization.rst @@ -3,7 +3,7 @@ Localization Sunshine and related LizardByte projects are being localized into various languages. The default language is `en` (English). - .. image:: https://badges.awesome-crowdin.com/translation-15178612-606145.png + .. image:: https://app.lizardbyte.dev/uno/crowdin/LizardByte_graph.svg CrowdIn ------- From 85d58bc9b3e41fdc03a9e372fd589436f30992db Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Sat, 9 Dec 2023 19:06:42 -0500 Subject: [PATCH 231/576] ci: update global workflows (#1906) --- .github/workflows/ci-qodana.yml | 292 ------------------------------- .github/workflows/dispatcher.yml | 69 -------- 2 files changed, 361 deletions(-) delete mode 100644 .github/workflows/ci-qodana.yml delete mode 100644 .github/workflows/dispatcher.yml diff --git a/.github/workflows/ci-qodana.yml b/.github/workflows/ci-qodana.yml deleted file mode 100644 index efc56349b30..00000000000 --- a/.github/workflows/ci-qodana.yml +++ /dev/null @@ -1,292 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -name: Qodana - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - push: - branches: [master, nightly] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - qodana_initial_check: - name: Qodana Initial Check - permissions: - actions: write # required to use workflow dispatch on fork PRs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prepare - run: | - # check the branch variable - if [ "${{ github.event_name }}" == "push" ] - then - echo "This is a PUSH event" - # use the branch name - destination=${{ github.ref_name }} - target=${{ github.ref_name }} - else - echo "This is a PR event" - # use the PR number - destination=${{ github.event.pull_request.number }} - target=${{ github.event.pull_request.base.ref }} - fi - - echo "checkout_repo=$checkout_repo" >> $GITHUB_OUTPUT - echo "checkout_ref=$checkout_ref" >> $GITHUB_OUTPUT - echo "destination=$destination" >> $GITHUB_OUTPUT - echo "target=$target" >> $GITHUB_OUTPUT - - # prepare urls - base=https://${{ github.repository_owner }}.github.io - report_url=${base}/qodana-reports/${{ github.event.repository.name }}/${destination} - echo "report_url=$report_url" >> $GITHUB_OUTPUT - - # build matrix - files=$(find . -type f -iname "qodana*.yaml") - - echo "files: ${files}" - - # do not quote to keep this as a single line - echo files=${files} >> $GITHUB_OUTPUT - - MATRIX_COMBINATIONS="" - REPORTS_MARKDOWN="" - for FILE in ${files}; do - # extract the language from file name after `qodana-` and before `.yaml` - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(qodana.yaml)/default/gm') - if [[ $language != "default" ]]; then - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*qodana-(.*).yaml/\2/gm') - fi - MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"file\": \"$FILE\", \"language\": \"$language\"}," - REPORTS_MARKDOWN="$REPORTS_MARKDOWN
- [${language}](${report_url}/${language})" - done - - # removes the last character (i.e. comma) - MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1} - - # setup matrix for later jobs - matrix=$(( - echo "{ \"include\": [$MATRIX_COMBINATIONS] }" - ) | jq -c .) - - echo $matrix - echo $matrix | jq . - echo "matrix=$matrix" >> $GITHUB_OUTPUT - - echo "reports_markdown=$REPORTS_MARKDOWN" >> $GITHUB_OUTPUT - - - name: Setup initial notification inputs - id: inputs - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - run: | - # workflow logs - workflow_url_a=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} - workflow_url=${workflow_url_a}/actions/runs/${{ github.run_id }} - - # multiline message - message=$(cat <<- EOF - :warning: **Qodana is checking this PR** :warning: - Live results available [here](${workflow_url}) - EOF - ) - - # escape json control characters - message=$(jq -n --arg message "$message" '$message' | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - secondary_inputs=$(echo '{ - "issue_message": "'"${message}"'", - "issue_message_id": "'"qodana"'", - "issue_number": "'"${{ github.event.number }}"'", - "issue_repo_owner": "'"${{ github.repository_owner }}"'", - "issue_repo_name": "'"${{ github.event.repository.name }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - # secondary input as string, not JSON - # todo - change dispatch_ref to master instead of nightly - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/.github"'", - "dispatch_workflow": "'"dispatch-issue-comment.yml"'", - "dispatch_ref": "'"nightly"'", - "dispatch_inputs": "'"${secondary_inputs}"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we still want to run the next job - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} - - outputs: - destination: ${{ steps.prepare.outputs.destination }} - target: ${{ steps.prepare.outputs.target }} - files: ${{ steps.prepare.outputs.files }} - reports_markdown: ${{ steps.prepare.outputs.reports_markdown }} - matrix: ${{ steps.prepare.outputs.matrix }} - - qodana: - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - needs: [qodana_initial_check] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.qodana_initial_check.outputs.matrix) }} - name: Qodana-Scan-${{ matrix.language }} - continue-on-error: true - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Get baseline - id: baseline - run: | - # check if destination is not an integer - if ! [[ "${{ needs.qodana_initial_check.outputs.destination }}" =~ ^[0-9]+$ ]] - then - echo "Running for a branch update" - echo "baseline_args=" >> $GITHUB_OUTPUT - else - echo "Running for a PR" - - sarif_file=qodana.sarif.json - repo=${{ github.event.repository.name }} - target=${{ needs.qodana_initial_check.outputs.target }} - language=${{ matrix.language }} - - baseline_file="${repo}/${target}/${language}/results/${sarif_file}" - baseline_file_url="https://lizardbyte.github.io/qodana-reports/${baseline_file}" - - # don't fail if file does not exist - wget ${baseline_file_url} || true - - # check if file exists - if [ -f ${sarif_file} ] - then - echo "baseline exists" - echo "baseline_args=--baseline,${sarif_file}" >> $GITHUB_OUTPUT - else - echo "baseline does not exist" - echo "baseline_args=" >> $GITHUB_OUTPUT - fi - fi - - - name: Rename Qodana config file - id: rename - run: | - # rename the file - if [ "${{ matrix.file }}" != "./qodana.yaml" ] - then - mv -f ${{ matrix.file }} ./qodana.yaml - fi - - - name: Qodana - id: qodana - continue-on-error: true # ensure dispatch-qodana job is run - uses: JetBrains/qodana-action@v2023.2.6 - with: - additional-cache-hash: ${{ github.ref }}-${{ matrix.language }} - artifact-name: qodana-${{ matrix.language }} # yamllint disable-line rule:line-length - args: '--print-problems,${{ steps.baseline.outputs.baseline_args }}' - pr-mode: false - upload-result: true - use-caches: true - - - name: Set output status - id: status - run: | - # check if qodana failed - echo "qodana_status=${{ steps.qodana.outcome }}" >> $GITHUB_OUTPUT - - outputs: - qodana_status: ${{ steps.status.outputs.qodana_status }} - - dispatch-qodana: - # trigger qodana-reports to download artifacts from the matrix runs - needs: [qodana_initial_check, qodana] - runs-on: ubuntu-latest - name: Dispatch Qodana - permissions: - actions: write # required to use workflow dispatch on fork PRs - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - steps: - - name: Setup qodana publish inputs - id: inputs - run: | - # get the artifacts - artifacts=${{ toJson(steps.artifacts.outputs.result) }} - artifacts=$(echo $artifacts | jq -c .) - - # get the target branch - target=${{ needs.qodana_initial_check.outputs.target }} - - # get the destination branch - destination=${{ needs.qodana_initial_check.outputs.destination }} - - # client payload - secondary_inputs=$(echo '{ - "destination": "'"${destination}"'", - "ref": "'"${{ github.ref }}"'", - "repo": "'"${{ github.repository }}"'", - "repo_name": "'"${{ github.event.repository.name }}"'", - "run_id": "'"${{ github.run_id }}"'", - "reports_markdown": "'"${{ needs.qodana_initial_check.outputs.reports_markdown }}"'", - "status": "'"${{ needs.qodana.outputs.qodana_status }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/qodana-reports"'", - "dispatch_workflow": "'"dispatch-qodana.yml"'", - "dispatch_ref": "'"master"'", - "dispatch_inputs": "'"$secondary_inputs"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we don't want to fail the workflow - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml deleted file mode 100644 index c83a233ecea..00000000000 --- a/.github/workflows/dispatcher.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This action receives a dispatch event and passes it through to another repo. This is a workaround to avoid issues -# where fork PRs do not have access to secrets. - -name: Dispatcher - -on: - workflow_dispatch: - inputs: - dispatch_repository: - description: 'Repository to dispatch to' - required: true - dispatch_workflow: - description: 'Workflow to dispatch to' - required: true - dispatch_ref: - description: 'Ref/branch to dispatch to' - required: true - dispatch_inputs: - description: 'Inputs to send' - required: true - -jobs: - dispatcher: - name: Repository Dispatch - runs-on: ubuntu-latest - steps: - - name: Unescape JSON control characters - id: inputs - run: | - # get the inputs - dispatch_inputs=${{ github.event.inputs.dispatch_inputs }} - echo "$dispatch_inputs" - - # temporarily replace newlines with a placeholder - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\\\n/_!new_line!_/g') - - # remove newline characters - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\n//g') - - # replace placeholder with newline - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/_!new_line!_/\\n/g') - - # replace escaped quotes with unescaped quotes - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\"//g') - - # debug echo - echo "$dispatch_inputs" - - # parse as JSON - dispatch_inputs=$(echo "$dispatch_inputs" | jq -c .) - - # debug echo - echo "$dispatch_inputs" - - echo "dispatch_inputs=$dispatch_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - repo: ${{ github.event.inputs.dispatch_repository }} - ref: ${{ github.event.inputs.dispatch_ref || 'master' }} # default to master if not specified - workflow: ${{ github.event.inputs.dispatch_workflow }} - inputs: ${{ steps.inputs.outputs.dispatch_inputs }} - token: ${{ secrets.GH_BOT_TOKEN || github.token }} # fallback to default token if not specified From 531ca24893a7e231bf32290a29e7df0fc8d66821 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Sun, 10 Dec 2023 10:01:58 -0500 Subject: [PATCH 232/576] ci: update global workflows (#1907) --- qodana-js.yaml | 21 --------------------- qodana-python.yaml | 29 ----------------------------- 2 files changed, 50 deletions(-) delete mode 100644 qodana-js.yaml delete mode 100644 qodana-python.yaml diff --git a/qodana-js.yaml b/qodana-js.yaml deleted file mode 100644 index d130951323f..00000000000 --- a/qodana-js.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -version: "1.0" -linter: jetbrains/qodana-js:2023.1-eap - -bootstrap: | - # install npm dependencies - npm install - -exclude: - - name: All - paths: - - gh-pages - - third-party - -failThreshold: 100 - -include: - - name: CheckDependencyLicenses - -profile: - name: qodana.recommended diff --git a/qodana-python.yaml b/qodana-python.yaml deleted file mode 100644 index efbf876ee3d..00000000000 --- a/qodana-python.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -version: "1.0" -linter: jetbrains/qodana-python:2023.1-eap - -bootstrap: | - # setup python - - python3 -m venv /data/cache/venv - source /data/cache/venv/bin/activate - python3 -m pip install -r /data/project/docs/requirements.txt - python3 -m pip install -r /data/project/scripts/requirements.txt - - # remove idea directory (No Python interpreter configured for the project) - # https://github.com/JetBrains/Qodana/discussions/134#discussioncomment-4329981 - rm -rf .idea - -exclude: - - name: All - paths: - - gh-pages - - third-party - -failThreshold: 100 - -include: - - name: CheckDependencyLicenses - -profile: - name: qodana.recommended From 90479dd941629baf8674ec961f472d29c3ec0efa Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:53:32 -0500 Subject: [PATCH 233/576] build(docker): add fedora 39 and drop fedora 37 (#1827) --- ...ora-37.dockerfile => fedora-39.dockerfile} | 56 ++++++++++--------- docs/source/about/installation.rst | 2 +- docs/source/building/linux.rst | 2 +- 3 files changed, 31 insertions(+), 29 deletions(-) rename docker/{fedora-37.dockerfile => fedora-39.dockerfile} (72%) diff --git a/docker/fedora-37.dockerfile b/docker/fedora-39.dockerfile similarity index 72% rename from docker/fedora-37.dockerfile rename to docker/fedora-39.dockerfile index c6aa0593a6b..6c6db891bbf 100644 --- a/docker/fedora-37.dockerfile +++ b/docker/fedora-39.dockerfile @@ -4,7 +4,7 @@ # platforms_pr: linux/amd64 # no-cache-filters: sunshine-base,artifacts,sunshine ARG BASE=fedora -ARG TAG=37 +ARG TAG=39 FROM ${BASE}:${TAG} AS sunshine-base FROM sunshine-base as sunshine-build @@ -30,10 +30,10 @@ set -e dnf -y update dnf -y group install "Development Tools" dnf -y install \ - boost-devel-1.78.* \ + boost-devel-1.81.0* \ cmake-3.27.* \ - gcc-12.2.* \ - gcc-c++-12.2.* \ + gcc-13.2.* \ + gcc-c++-13.2.* \ git \ libappindicator-gtk3-devel \ libcap-devel \ @@ -67,27 +67,28 @@ dnf clean all rm -rf /var/cache/yum _DEPS -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.0.0" -ENV CUDA_BUILD="525.60.13" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA +# todo - enable cuda once it's supported for gcc 13 and fedora 39 +## install cuda +#WORKDIR /build/cuda +## versions: https://developer.nvidia.com/cuda-toolkit-archive +#ENV CUDA_VERSION="12.0.0" +#ENV CUDA_BUILD="525.60.13" +## hadolint ignore=SC3010 +#RUN <<_INSTALL_CUDA +##!/bin/bash +#set -e +#cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" +#cuda_suffix="" +#if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then +# cuda_suffix="_sbsa" +#fi +#url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" +#echo "cuda url: ${url}" +#wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run +#chmod a+x ./cuda.run +#./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm +#rm ./cuda.run +#_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ @@ -100,11 +101,12 @@ RUN npm install WORKDIR /build/sunshine/build # cmake and cpack +# todo - add cmake argument back in for cuda support "-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \" +# todo - re-enable "DSUNSHINE_ENABLE_CUDA" RUN <<_MAKE #!/bin/bash set -e cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSUNSHINE_ASSETS_DIR=share/sunshine \ @@ -112,7 +114,7 @@ cmake \ -DSUNSHINE_ENABLE_WAYLAND=ON \ -DSUNSHINE_ENABLE_X11=ON \ -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ + -DSUNSHINE_ENABLE_CUDA=OFF \ /build/sunshine make -j "$(nproc)" cpack -G RPM diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 3d20a020b30..be7510ad7ec 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -41,8 +41,8 @@ CUDA is used for NVFBC capture. sunshine_{arch}.flatpak 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90 sunshine-debian-bookworm-{arch}.deb 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90 sunshine-debian-bullseye-{arch}.deb 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 - sunshine-fedora-37-{arch}.rpm 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90 sunshine-fedora-38-{arch}.rpm unavailable unavailable none + sunshine-fedora-39-{arch}.rpm unavailable unavailable none sunshine-ubuntu-20.04-{arch}.deb 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 sunshine-ubuntu-22.04-{arch}.deb 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 =========================================== ============== ============== ================================ diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst index 82a3ed17462..0ac90079e39 100644 --- a/docs/source/building/linux.rst +++ b/docs/source/building/linux.rst @@ -46,7 +46,7 @@ Install Requirements nvidia-cuda-dev \ # Cuda, NvFBC nvidia-cuda-toolkit # Cuda, NvFBC -Fedora 37, 38 +Fedora 38, 39 ^^^^^^^^^^^^^ Install Requirements From ae4759e93dc61d454090ff5529636861b0207ca8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:50:06 -0500 Subject: [PATCH 234/576] build(deps): bump actions/upload-artifact from 3 to 4 (#1915) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/CI.yml | 10 +++++----- .github/workflows/ci-docker.yml | 2 +- .github/workflows/cpp-lint.yml | 2 +- .github/workflows/update-pages.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b802e2346a9..8eadad4140c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -251,7 +251,7 @@ jobs: ../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak dev.lizardbyte.sunshine.Debug' - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-linux-flatpak-${{ matrix.arch }} path: artifacts/ @@ -483,7 +483,7 @@ jobs: ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }} path: artifacts/ @@ -551,7 +551,7 @@ jobs: # mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-bundle.dmg - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-macos path: artifacts/ @@ -676,7 +676,7 @@ jobs: echo "::endgroup::" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-macports path: artifacts/ @@ -771,7 +771,7 @@ jobs: a "../artifacts/sunshine-debuginfo-win32.zip" "*.exe" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-windows path: artifacts/ diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index edeeb2bd9b7..70e940d68d9 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -395,7 +395,7 @@ jobs: - name: Upload Artifacts if: ${{ steps.prepare.outputs.artifacts == 'true' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Docker${{ matrix.tag }} path: artifacts/ diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml index b5d4ff7765e..921641c593e 100644 --- a/.github/workflows/cpp-lint.yml +++ b/.github/workflows/cpp-lint.yml @@ -65,7 +65,7 @@ jobs: - name: Upload Artifacts if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: clang-format-fixes path: ${{ steps.find_files.outputs.found_files }} diff --git a/.github/workflows/update-pages.yml b/.github/workflows/update-pages.yml index 5fbbf97f9f4..5fb435d1602 100644 --- a/.github/workflows/update-pages.yml +++ b/.github/workflows/update-pages.yml @@ -39,7 +39,7 @@ jobs: - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: gh-pages if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` From db562b9acb050db57fdfbcf6577cda63529c62cf Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 17 Dec 2023 10:37:54 -0500 Subject: [PATCH 235/576] docs: use glob pattern to match source code docs (#1918) --- docs/source/source/src/platform.rst | 10 --- docs/source/source/src/platform/linux.rst | 12 ---- docs/source/source/src/platform/macos.rst | 11 ---- docs/source/source/src/platform/windows.rst | 9 --- .../src.rst => source_code/source_code.rst} | 65 ++++++++++--------- .../{source => source_code}/src/audio.rst | 0 .../{source => source_code}/src/cbs.rst | 0 .../{source => source_code}/src/config.rst | 0 .../src/confighttp.rst | 0 .../{source => source_code}/src/crypto.rst | 0 .../src/httpcommon.rst | 0 .../{source => source_code}/src/input.rst | 0 .../{source => source_code}/src/main.rst | 0 .../src/move_by_copy.rst | 0 .../{source => source_code}/src/network.rst | 0 .../{source => source_code}/src/nvhttp.rst | 0 .../src/platform/common.rst | 0 .../src/platform/linux/cuda.rst | 0 .../src/platform/linux/graphics.rst | 0 .../src/platform/linux/misc.rst | 0 .../src/platform/linux/vaapi.rst | 0 .../src/platform/linux/wayland.rst | 0 .../src/platform/linux/x11grab.rst | 0 .../src/platform/macos/av_audio.rst | 0 .../src/platform/macos/av_img_t.rst | 0 .../src/platform/macos/av_video.rst | 0 .../src/platform/macos/misc.rst | 0 .../src/platform/macos/nv12_zero_device.rst | 0 .../src/platform/windows/PolicyConfig.rst | 0 .../src/platform/windows/display.rst | 0 .../src/platform/windows/misc.rst | 0 .../{source => source_code}/src/process.rst | 0 .../src/round_robin.rst | 0 .../{source => source_code}/src/rtsp.rst | 0 .../{source => source_code}/src/stream.rst | 0 .../{source => source_code}/src/sync.rst | 0 .../src/system_tray.rst | 0 .../{source => source_code}/src/task_pool.rst | 0 .../src/thread_pool.rst | 0 .../src/thread_safe.rst | 0 .../{source => source_code}/src/upnp.rst | 0 .../{source => source_code}/src/utility.rst | 0 .../{source => source_code}/src/uuid.rst | 0 .../{source => source_code}/src/video.rst | 0 docs/source/toc.rst | 2 +- 45 files changed, 36 insertions(+), 73 deletions(-) delete mode 100644 docs/source/source/src/platform.rst delete mode 100644 docs/source/source/src/platform/linux.rst delete mode 100644 docs/source/source/src/platform/macos.rst delete mode 100644 docs/source/source/src/platform/windows.rst rename docs/source/{source/src.rst => source_code/source_code.rst} (73%) rename docs/source/{source => source_code}/src/audio.rst (100%) rename docs/source/{source => source_code}/src/cbs.rst (100%) rename docs/source/{source => source_code}/src/config.rst (100%) rename docs/source/{source => source_code}/src/confighttp.rst (100%) rename docs/source/{source => source_code}/src/crypto.rst (100%) rename docs/source/{source => source_code}/src/httpcommon.rst (100%) rename docs/source/{source => source_code}/src/input.rst (100%) rename docs/source/{source => source_code}/src/main.rst (100%) rename docs/source/{source => source_code}/src/move_by_copy.rst (100%) rename docs/source/{source => source_code}/src/network.rst (100%) rename docs/source/{source => source_code}/src/nvhttp.rst (100%) rename docs/source/{source => source_code}/src/platform/common.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/cuda.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/graphics.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/misc.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/vaapi.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/wayland.rst (100%) rename docs/source/{source => source_code}/src/platform/linux/x11grab.rst (100%) rename docs/source/{source => source_code}/src/platform/macos/av_audio.rst (100%) rename docs/source/{source => source_code}/src/platform/macos/av_img_t.rst (100%) rename docs/source/{source => source_code}/src/platform/macos/av_video.rst (100%) rename docs/source/{source => source_code}/src/platform/macos/misc.rst (100%) rename docs/source/{source => source_code}/src/platform/macos/nv12_zero_device.rst (100%) rename docs/source/{source => source_code}/src/platform/windows/PolicyConfig.rst (100%) rename docs/source/{source => source_code}/src/platform/windows/display.rst (100%) rename docs/source/{source => source_code}/src/platform/windows/misc.rst (100%) rename docs/source/{source => source_code}/src/process.rst (100%) rename docs/source/{source => source_code}/src/round_robin.rst (100%) rename docs/source/{source => source_code}/src/rtsp.rst (100%) rename docs/source/{source => source_code}/src/stream.rst (100%) rename docs/source/{source => source_code}/src/sync.rst (100%) rename docs/source/{source => source_code}/src/system_tray.rst (100%) rename docs/source/{source => source_code}/src/task_pool.rst (100%) rename docs/source/{source => source_code}/src/thread_pool.rst (100%) rename docs/source/{source => source_code}/src/thread_safe.rst (100%) rename docs/source/{source => source_code}/src/upnp.rst (100%) rename docs/source/{source => source_code}/src/utility.rst (100%) rename docs/source/{source => source_code}/src/uuid.rst (100%) rename docs/source/{source => source_code}/src/video.rst (100%) diff --git a/docs/source/source/src/platform.rst b/docs/source/source/src/platform.rst deleted file mode 100644 index ca74092992e..00000000000 --- a/docs/source/source/src/platform.rst +++ /dev/null @@ -1,10 +0,0 @@ -platform -======== - -.. toctree:: - :maxdepth: 1 - - platform/common - platform/linux - platform/macos - platform/windows diff --git a/docs/source/source/src/platform/linux.rst b/docs/source/source/src/platform/linux.rst deleted file mode 100644 index f67235b6438..00000000000 --- a/docs/source/source/src/platform/linux.rst +++ /dev/null @@ -1,12 +0,0 @@ -linux -===== - -.. toctree:: - :maxdepth: 1 - - linux/cuda - linux/graphics - linux/misc - linux/vaapi - linux/wayland - linux/x11grab diff --git a/docs/source/source/src/platform/macos.rst b/docs/source/source/src/platform/macos.rst deleted file mode 100644 index 1031eb63551..00000000000 --- a/docs/source/source/src/platform/macos.rst +++ /dev/null @@ -1,11 +0,0 @@ -macos -===== - -.. toctree:: - :maxdepth: 1 - - macos/av_audio - macos/av_img_t - macos/av_video - macos/misc - macos/nv12_zero_device diff --git a/docs/source/source/src/platform/windows.rst b/docs/source/source/src/platform/windows.rst deleted file mode 100644 index 9bcece68c3a..00000000000 --- a/docs/source/source/src/platform/windows.rst +++ /dev/null @@ -1,9 +0,0 @@ -windows -======= - -.. toctree:: - :maxdepth: 1 - - windows/display - windows/misc - windows/PolicyConfig diff --git a/docs/source/source/src.rst b/docs/source/source_code/source_code.rst similarity index 73% rename from docs/source/source/src.rst rename to docs/source/source_code/source_code.rst index bdba0c359c4..fecc6801c92 100644 --- a/docs/source/source/src.rst +++ b/docs/source/source_code/source_code.rst @@ -1,5 +1,5 @@ -src -=== +Source Code +=========== We are in process of improving the source code documentation. Code should be documented using Doxygen syntax. Some examples exist in `main.h` and `main.cpp`. In order for documentation within the code to appear in the rendered docs, the definition of the object must be in a header file, although the documentation itself can (and @@ -52,35 +52,40 @@ Example Documentation Blocks // do stuff } -Code ----- +Source +------ .. toctree:: - :maxdepth: 2 :caption: src + :maxdepth: 1 + :glob: - src/main - src/audio - src/cbs - src/config - src/confighttp - src/crypto - src/httpcommon - src/input - src/move_by_copy - src/network - src/nvhttp - src/process - src/round_robin - src/rtsp - src/stream - src/sync - src/system_tray - src/task_pool - src/thread_pool - src/thread_safe - src/upnp - src/utility - src/uuid - src/video - src/platform + src/* + +.. toctree:: + :caption: src/platform + :maxdepth: 1 + :glob: + + src/platform/* + +.. toctree:: + :caption: src/platform/linux + :maxdepth: 1 + :glob: + + src/platform/linux/* + +.. toctree:: + :caption: src/platform/macos + :maxdepth: 1 + :glob: + + src/platform/macos/* + +.. toctree:: + :caption: src/platform/windows + :maxdepth: 1 + :glob: + + src/platform/windows/* diff --git a/docs/source/source/src/audio.rst b/docs/source/source_code/src/audio.rst similarity index 100% rename from docs/source/source/src/audio.rst rename to docs/source/source_code/src/audio.rst diff --git a/docs/source/source/src/cbs.rst b/docs/source/source_code/src/cbs.rst similarity index 100% rename from docs/source/source/src/cbs.rst rename to docs/source/source_code/src/cbs.rst diff --git a/docs/source/source/src/config.rst b/docs/source/source_code/src/config.rst similarity index 100% rename from docs/source/source/src/config.rst rename to docs/source/source_code/src/config.rst diff --git a/docs/source/source/src/confighttp.rst b/docs/source/source_code/src/confighttp.rst similarity index 100% rename from docs/source/source/src/confighttp.rst rename to docs/source/source_code/src/confighttp.rst diff --git a/docs/source/source/src/crypto.rst b/docs/source/source_code/src/crypto.rst similarity index 100% rename from docs/source/source/src/crypto.rst rename to docs/source/source_code/src/crypto.rst diff --git a/docs/source/source/src/httpcommon.rst b/docs/source/source_code/src/httpcommon.rst similarity index 100% rename from docs/source/source/src/httpcommon.rst rename to docs/source/source_code/src/httpcommon.rst diff --git a/docs/source/source/src/input.rst b/docs/source/source_code/src/input.rst similarity index 100% rename from docs/source/source/src/input.rst rename to docs/source/source_code/src/input.rst diff --git a/docs/source/source/src/main.rst b/docs/source/source_code/src/main.rst similarity index 100% rename from docs/source/source/src/main.rst rename to docs/source/source_code/src/main.rst diff --git a/docs/source/source/src/move_by_copy.rst b/docs/source/source_code/src/move_by_copy.rst similarity index 100% rename from docs/source/source/src/move_by_copy.rst rename to docs/source/source_code/src/move_by_copy.rst diff --git a/docs/source/source/src/network.rst b/docs/source/source_code/src/network.rst similarity index 100% rename from docs/source/source/src/network.rst rename to docs/source/source_code/src/network.rst diff --git a/docs/source/source/src/nvhttp.rst b/docs/source/source_code/src/nvhttp.rst similarity index 100% rename from docs/source/source/src/nvhttp.rst rename to docs/source/source_code/src/nvhttp.rst diff --git a/docs/source/source/src/platform/common.rst b/docs/source/source_code/src/platform/common.rst similarity index 100% rename from docs/source/source/src/platform/common.rst rename to docs/source/source_code/src/platform/common.rst diff --git a/docs/source/source/src/platform/linux/cuda.rst b/docs/source/source_code/src/platform/linux/cuda.rst similarity index 100% rename from docs/source/source/src/platform/linux/cuda.rst rename to docs/source/source_code/src/platform/linux/cuda.rst diff --git a/docs/source/source/src/platform/linux/graphics.rst b/docs/source/source_code/src/platform/linux/graphics.rst similarity index 100% rename from docs/source/source/src/platform/linux/graphics.rst rename to docs/source/source_code/src/platform/linux/graphics.rst diff --git a/docs/source/source/src/platform/linux/misc.rst b/docs/source/source_code/src/platform/linux/misc.rst similarity index 100% rename from docs/source/source/src/platform/linux/misc.rst rename to docs/source/source_code/src/platform/linux/misc.rst diff --git a/docs/source/source/src/platform/linux/vaapi.rst b/docs/source/source_code/src/platform/linux/vaapi.rst similarity index 100% rename from docs/source/source/src/platform/linux/vaapi.rst rename to docs/source/source_code/src/platform/linux/vaapi.rst diff --git a/docs/source/source/src/platform/linux/wayland.rst b/docs/source/source_code/src/platform/linux/wayland.rst similarity index 100% rename from docs/source/source/src/platform/linux/wayland.rst rename to docs/source/source_code/src/platform/linux/wayland.rst diff --git a/docs/source/source/src/platform/linux/x11grab.rst b/docs/source/source_code/src/platform/linux/x11grab.rst similarity index 100% rename from docs/source/source/src/platform/linux/x11grab.rst rename to docs/source/source_code/src/platform/linux/x11grab.rst diff --git a/docs/source/source/src/platform/macos/av_audio.rst b/docs/source/source_code/src/platform/macos/av_audio.rst similarity index 100% rename from docs/source/source/src/platform/macos/av_audio.rst rename to docs/source/source_code/src/platform/macos/av_audio.rst diff --git a/docs/source/source/src/platform/macos/av_img_t.rst b/docs/source/source_code/src/platform/macos/av_img_t.rst similarity index 100% rename from docs/source/source/src/platform/macos/av_img_t.rst rename to docs/source/source_code/src/platform/macos/av_img_t.rst diff --git a/docs/source/source/src/platform/macos/av_video.rst b/docs/source/source_code/src/platform/macos/av_video.rst similarity index 100% rename from docs/source/source/src/platform/macos/av_video.rst rename to docs/source/source_code/src/platform/macos/av_video.rst diff --git a/docs/source/source/src/platform/macos/misc.rst b/docs/source/source_code/src/platform/macos/misc.rst similarity index 100% rename from docs/source/source/src/platform/macos/misc.rst rename to docs/source/source_code/src/platform/macos/misc.rst diff --git a/docs/source/source/src/platform/macos/nv12_zero_device.rst b/docs/source/source_code/src/platform/macos/nv12_zero_device.rst similarity index 100% rename from docs/source/source/src/platform/macos/nv12_zero_device.rst rename to docs/source/source_code/src/platform/macos/nv12_zero_device.rst diff --git a/docs/source/source/src/platform/windows/PolicyConfig.rst b/docs/source/source_code/src/platform/windows/PolicyConfig.rst similarity index 100% rename from docs/source/source/src/platform/windows/PolicyConfig.rst rename to docs/source/source_code/src/platform/windows/PolicyConfig.rst diff --git a/docs/source/source/src/platform/windows/display.rst b/docs/source/source_code/src/platform/windows/display.rst similarity index 100% rename from docs/source/source/src/platform/windows/display.rst rename to docs/source/source_code/src/platform/windows/display.rst diff --git a/docs/source/source/src/platform/windows/misc.rst b/docs/source/source_code/src/platform/windows/misc.rst similarity index 100% rename from docs/source/source/src/platform/windows/misc.rst rename to docs/source/source_code/src/platform/windows/misc.rst diff --git a/docs/source/source/src/process.rst b/docs/source/source_code/src/process.rst similarity index 100% rename from docs/source/source/src/process.rst rename to docs/source/source_code/src/process.rst diff --git a/docs/source/source/src/round_robin.rst b/docs/source/source_code/src/round_robin.rst similarity index 100% rename from docs/source/source/src/round_robin.rst rename to docs/source/source_code/src/round_robin.rst diff --git a/docs/source/source/src/rtsp.rst b/docs/source/source_code/src/rtsp.rst similarity index 100% rename from docs/source/source/src/rtsp.rst rename to docs/source/source_code/src/rtsp.rst diff --git a/docs/source/source/src/stream.rst b/docs/source/source_code/src/stream.rst similarity index 100% rename from docs/source/source/src/stream.rst rename to docs/source/source_code/src/stream.rst diff --git a/docs/source/source/src/sync.rst b/docs/source/source_code/src/sync.rst similarity index 100% rename from docs/source/source/src/sync.rst rename to docs/source/source_code/src/sync.rst diff --git a/docs/source/source/src/system_tray.rst b/docs/source/source_code/src/system_tray.rst similarity index 100% rename from docs/source/source/src/system_tray.rst rename to docs/source/source_code/src/system_tray.rst diff --git a/docs/source/source/src/task_pool.rst b/docs/source/source_code/src/task_pool.rst similarity index 100% rename from docs/source/source/src/task_pool.rst rename to docs/source/source_code/src/task_pool.rst diff --git a/docs/source/source/src/thread_pool.rst b/docs/source/source_code/src/thread_pool.rst similarity index 100% rename from docs/source/source/src/thread_pool.rst rename to docs/source/source_code/src/thread_pool.rst diff --git a/docs/source/source/src/thread_safe.rst b/docs/source/source_code/src/thread_safe.rst similarity index 100% rename from docs/source/source/src/thread_safe.rst rename to docs/source/source_code/src/thread_safe.rst diff --git a/docs/source/source/src/upnp.rst b/docs/source/source_code/src/upnp.rst similarity index 100% rename from docs/source/source/src/upnp.rst rename to docs/source/source_code/src/upnp.rst diff --git a/docs/source/source/src/utility.rst b/docs/source/source_code/src/utility.rst similarity index 100% rename from docs/source/source/src/utility.rst rename to docs/source/source_code/src/utility.rst diff --git a/docs/source/source/src/uuid.rst b/docs/source/source_code/src/uuid.rst similarity index 100% rename from docs/source/source/src/uuid.rst rename to docs/source/source_code/src/uuid.rst diff --git a/docs/source/source/src/video.rst b/docs/source/source_code/src/video.rst similarity index 100% rename from docs/source/source/src/video.rst rename to docs/source/source_code/src/video.rst diff --git a/docs/source/toc.rst b/docs/source/toc.rst index 6121e4402e3..7b182a2c91d 100644 --- a/docs/source/toc.rst +++ b/docs/source/toc.rst @@ -53,4 +53,4 @@ :maxdepth: 2 :caption: source - source/src + source_code/source_code From a679242c894687900284ff36b5b9d4a28edfa453 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:41:03 -0500 Subject: [PATCH 236/576] chore: update global workflows (#1921) --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 358ff9c99f6..ae5248763ec 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -116,7 +116,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -139,9 +139,9 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" From b0b291228e04e2fbc3e8efb72d46e00278fa3dd6 Mon Sep 17 00:00:00 2001 From: TheElixZammuto Date: Thu, 28 Dec 2023 01:25:49 +0100 Subject: [PATCH 237/576] Web UI migration to Vite and Vue3 and improvements to the UX (#1673) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .github/workflows/CI.yml | 11 +- cmake/dependencies/common.cmake | 1 + cmake/packaging/common.cmake | 11 +- cmake/packaging/linux.cmake | 6 +- cmake/packaging/macos.cmake | 2 - cmake/packaging/unix.cmake | 3 - cmake/packaging/windows.cmake | 3 - cmake/targets/common.cmake | 6 + docker/debian-bookworm.dockerfile | 3 - docker/debian-bullseye.dockerfile | 21 +- docker/fedora-38.dockerfile | 5 +- docker/fedora-39.dockerfile | 5 +- docker/ubuntu-20.04.dockerfile | 21 +- docker/ubuntu-22.04.dockerfile | 22 +- docs/source/building/linux.rst | 7 - docs/source/building/macos.rst | 7 - docs/source/building/windows.rst | 13 +- docs/source/conf.py | 2 +- docs/source/contributing/contributing.rst | 20 + package.json | 10 +- packaging/linux/Arch/PKGBUILD | 4 - .../linux/flatpak/dev.lizardbyte.sunshine.yml | 3 - packaging/macos/Portfile | 4 - scripts/icons/convert_and_pack.sh | 6 +- src/confighttp.cpp | 32 +- src_assets/common/assets/web/Navbar.vue | 60 + src_assets/common/assets/web/ResourceCard.vue | 36 + src_assets/common/assets/web/apps.html | 812 ++++---- src_assets/common/assets/web/clients.html | 3 - src_assets/common/assets/web/config.html | 1828 +++++++---------- .../common/assets/web/header-no-nav.html | 14 - src_assets/common/assets/web/header.html | 83 - src_assets/common/assets/web/index.html | 147 +- src_assets/common/assets/web/password.html | 164 +- src_assets/common/assets/web/pin.html | 56 +- .../{ => public}/images/logo-sunshine-16.png | Bin .../{ => public}/images/logo-sunshine-45.png | Bin .../images/sunshine-locked-16.png | Bin .../images/sunshine-locked-45.png | Bin .../{ => public}/images/sunshine-locked.ico | Bin .../{ => public}/images/sunshine-locked.png | Bin .../{ => public}/images/sunshine-locked.svg | 0 .../images/sunshine-pausing-16.png | Bin .../images/sunshine-pausing-45.png | Bin .../{ => public}/images/sunshine-pausing.ico | Bin .../{ => public}/images/sunshine-pausing.png | Bin .../{ => public}/images/sunshine-pausing.svg | 0 .../images/sunshine-playing-16.png | Bin .../images/sunshine-playing-45.png | Bin .../{ => public}/images/sunshine-playing.ico | Bin .../{ => public}/images/sunshine-playing.png | Bin .../{ => public}/images/sunshine-playing.svg | 0 .../web/{ => public}/images/sunshine.ico | Bin .../common/assets/web/template_header.html | 9 + .../common/assets/web/troubleshooting.html | 353 ++-- src_assets/common/assets/web/welcome.html | 125 +- vite.config.js | 53 + 57 files changed, 1831 insertions(+), 2140 deletions(-) create mode 100644 src_assets/common/assets/web/Navbar.vue create mode 100644 src_assets/common/assets/web/ResourceCard.vue delete mode 100644 src_assets/common/assets/web/clients.html delete mode 100644 src_assets/common/assets/web/header-no-nav.html delete mode 100644 src_assets/common/assets/web/header.html rename src_assets/common/assets/web/{ => public}/images/logo-sunshine-16.png (100%) rename src_assets/common/assets/web/{ => public}/images/logo-sunshine-45.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-locked-16.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-locked-45.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-locked.ico (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-locked.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-locked.svg (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-pausing-16.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-pausing-45.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-pausing.ico (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-pausing.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-pausing.svg (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-playing-16.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-playing-45.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-playing.ico (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-playing.png (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine-playing.svg (100%) rename src_assets/common/assets/web/{ => public}/images/sunshine.ico (100%) create mode 100644 src_assets/common/assets/web/template_header.html create mode 100644 vite.config.js diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8eadad4140c..38907881d2c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -398,8 +398,6 @@ jobs: mkdir -p build mkdir -p artifacts - npm install - cd build cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ @@ -527,8 +525,6 @@ jobs: BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }} COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} run: | - npm install - mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release \ @@ -719,8 +715,9 @@ jobs: mingw-w64-x86_64-boost mingw-w64-x86_64-cmake mingw-w64-x86_64-curl - mingw-w64-x86_64-onevpl + mingw-w64-x86_64-nodejs mingw-w64-x86_64-nsis + mingw-w64-x86_64-onevpl mingw-w64-x86_64-openssl mingw-w64-x86_64-opus mingw-w64-x86_64-toolchain @@ -728,10 +725,6 @@ jobs: wget yasm - - name: Install npm packages - run: | - npm install - - name: Build Windows shell: msys2 {0} env: diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 9bc7c56ceee..34ea09f7a3a 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -84,3 +84,4 @@ elseif(UNIX) include(${CMAKE_MODULE_PATH}/dependencies/linux.cmake) endif() endif() + diff --git a/cmake/packaging/common.cmake b/cmake/packaging/common.cmake index 0b41524f6cb..ad3f9bc0682 100644 --- a/cmake/packaging/common.cmake +++ b/cmake/packaging/common.cmake @@ -12,9 +12,14 @@ set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_STRIP_FILES YES) -# install npm modules -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" - DESTINATION "${SUNSHINE_ASSETS_DIR}/web") +#install common assets +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" + DESTINATION "${SUNSHINE_ASSETS_DIR}" + PATTERN "web" EXCLUDE) + +# install built vite assets +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/assets/web" + DESTINATION "${SUNSHINE_ASSETS_DIR}") # platform specific packaging if(WIN32) diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index 842277b9d27..8106345ffe8 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -70,11 +70,11 @@ if(${SUNSHINE_TRAY} STREQUAL 1) install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status" RENAME "sunshine-tray.svg") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-playing.svg" + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-playing.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-pausing.svg" + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-pausing.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-locked.svg" + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-locked.svg" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ diff --git a/cmake/packaging/macos.cmake b/cmake/packaging/macos.cmake index 2b173393bbf..f7c3a518c97 100644 --- a/cmake/packaging/macos.cmake +++ b/cmake/packaging/macos.cmake @@ -10,8 +10,6 @@ if(SUNSHINE_PACKAGE_MACOS) # todo set(MAC_PREFIX "${CMAKE_PROJECT_NAME}.app/Contents") set(INSTALL_RUNTIME_DIR "${MAC_PREFIX}/MacOS") - install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") diff --git a/cmake/packaging/unix.cmake b/cmake/packaging/unix.cmake index 660811f3b33..bacbfc910de 100644 --- a/cmake/packaging/unix.cmake +++ b/cmake/packaging/unix.cmake @@ -13,6 +13,3 @@ if(NOT CMAKE_INSTALL_PREFIX) endif() install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - -install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 3231d761f8c..dc2add19854 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -36,9 +36,6 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/gamepad/" COMPONENT gamepad) # Sunshine assets -install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}" - COMPONENT assets) install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets) diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake index 72f89bf5182..7c446e466df 100644 --- a/cmake/targets/common.cmake +++ b/cmake/targets/common.cmake @@ -33,3 +33,9 @@ foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) endforeach() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301 + +#WebUI build +add_custom_target(web-ui ALL + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Installing NPM Dependencies and Building the Web UI" + COMMAND bash -c \"npm install && SUNSHINE_SOURCE_ASSETS_DIR=${SUNSHINE_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${CMAKE_BINARY_DIR} npm run build\") # cmake-lint: disable=C0301 diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile index 1172d35a5e9..c9d4fccdede 100644 --- a/docker/debian-bookworm.dockerfile +++ b/docker/debian-bookworm.dockerfile @@ -95,9 +95,6 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build diff --git a/docker/debian-bullseye.dockerfile b/docker/debian-bullseye.dockerfile index 6d7ebdd30af..3e602105cb2 100644 --- a/docker/debian-bullseye.dockerfile +++ b/docker/debian-bullseye.dockerfile @@ -31,6 +31,7 @@ set -e apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ + ca-certificates \ cmake=3.18.* \ git \ libavdevice-dev \ @@ -58,8 +59,6 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - nodejs \ - npm \ wget if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then apt-get install -y --no-install-recommends \ @@ -69,6 +68,17 @@ apt-get clean rm -rf /var/lib/apt/lists/* _DEPS +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install 20.9.0 +nvm use 20.9.0 +_INSTALL_NODE + # install cuda WORKDIR /build/cuda # versions: https://developer.nvidia.com/cuda-toolkit-archive @@ -95,16 +105,17 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build # cmake and cpack +# hadolint ignore=SC1091 RUN <<_MAKE #!/bin/bash set -e +#Set Node version +source "$HOME/.nvm/nvm.sh" +nvm use 20.9.0 cmake \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker/fedora-38.dockerfile b/docker/fedora-38.dockerfile index 2245ba9b9aa..9f836fb889a 100644 --- a/docker/fedora-38.dockerfile +++ b/docker/fedora-38.dockerfile @@ -52,7 +52,7 @@ dnf -y install \ libXrandr-devel \ libXtst-devel \ mesa-libGL-devel \ - nodejs-npm \ + nodejs \ numactl-devel \ openssl-devel \ opus-devel \ @@ -94,9 +94,6 @@ _DEPS WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build diff --git a/docker/fedora-39.dockerfile b/docker/fedora-39.dockerfile index 6c6db891bbf..26b10f4b004 100644 --- a/docker/fedora-39.dockerfile +++ b/docker/fedora-39.dockerfile @@ -52,7 +52,7 @@ dnf -y install \ libXrandr-devel \ libXtst-devel \ mesa-libGL-devel \ - nodejs-npm \ + nodejs \ numactl-devel \ openssl-devel \ opus-devel \ @@ -94,9 +94,6 @@ _DEPS WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile index 5634d48e0c0..bad8285d648 100644 --- a/docker/ubuntu-20.04.dockerfile +++ b/docker/ubuntu-20.04.dockerfile @@ -31,6 +31,7 @@ set -e apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ + ca-certificates \ gcc-10=10.5.* \ g++-10=10.5.* \ git \ @@ -59,8 +60,6 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - nodejs \ - npm \ wget if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then apt-get install -y --no-install-recommends \ @@ -70,6 +69,17 @@ apt-get clean rm -rf /var/lib/apt/lists/* _DEPS +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install 20.9.0 +nvm use 20.9.0 +_INSTALL_NODE + # Update gcc alias # https://stackoverflow.com/a/70653945/11214013 RUN <<_GCC_ALIAS @@ -131,16 +141,17 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build # cmake and cpack +# hadolint ignore=SC1091 RUN <<_MAKE #!/bin/bash set -e +#Set Node version +source "$HOME/.nvm/nvm.sh" +nvm use 20.9.0 cmake \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index c9c6b70db89..2f37a691bc7 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -32,6 +32,7 @@ apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ cmake=3.22.* \ + ca-certificates \ git \ libayatana-appindicator3-dev \ libavdevice-dev \ @@ -58,8 +59,6 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - nodejs \ - npm \ wget if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then apt-get install -y --no-install-recommends \ @@ -69,6 +68,17 @@ apt-get clean rm -rf /var/lib/apt/lists/* _DEPS +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install 20.9.0 +nvm use 20.9.0 +_INSTALL_NODE + # install cuda WORKDIR /build/cuda # versions: https://developer.nvidia.com/cuda-toolkit-archive @@ -95,16 +105,18 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build # cmake and cpack +# hadolint ignore=SC1091 RUN <<_MAKE #!/bin/bash set -e +#Set Node version +source "$HOME/.nvm/nvm.sh" +nvm use 20.9.0 +#Actually build cmake \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst index 0ac90079e39..eab0aaab607 100644 --- a/docs/source/building/linux.rst +++ b/docs/source/building/linux.rst @@ -192,13 +192,6 @@ If the version of CUDA available from your distro is not adequate, manually inst ./cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm rm ./cuda.run -npm dependencies ----------------- -Install npm dependencies. - .. code-block:: bash - - npm install - Build ----- .. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing. diff --git a/docs/source/building/macos.rst b/docs/source/building/macos.rst index 2d39ec17951..6bfa2c7061e 100644 --- a/docs/source/building/macos.rst +++ b/docs/source/building/macos.rst @@ -24,13 +24,6 @@ Install Requirements cd /usr/local/include ln -s ../opt/openssl/include/openssl . -npm dependencies ----------------- -Install npm dependencies. - .. code-block:: bash - - npm install - Build ----- .. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing. diff --git a/docs/source/building/windows.rst b/docs/source/building/windows.rst index 623bd16a409..a8164d3cb20 100644 --- a/docs/source/building/windows.rst +++ b/docs/source/building/windows.rst @@ -16,17 +16,8 @@ Install dependencies: pacman -S base-devel cmake diffutils gcc git make mingw-w64-x86_64-binutils \ mingw-w64-x86_64-boost mingw-w64-x86_64-cmake mingw-w64-x86_64-curl \ - mingw-w64-x86_64-onevpl mingw-w64-x86_64-openssl mingw-w64-x86_64-opus \ - mingw-w64-x86_64-toolchain - -npm dependencies ----------------- -Install nodejs and npm. Downloads available `here `__. - -Install npm dependencies. - .. code-block:: bash - - npm install + mingw-w64-x86_64-nodejs mingw-w64-x86_64-onevpl mingw-w64-x86_64-openssl \ + mingw-w64-x86_64-opus mingw-w64-x86_64-toolchain Build ----- diff --git a/docs/source/conf.py b/docs/source/conf.py index 3c9e338bb07..c2b66a56635 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -69,7 +69,7 @@ # -- Options for HTML output ------------------------------------------------- # images -html_favicon = os.path.join(root_dir, 'src_assets', 'common', 'assets', 'web', 'images', 'sunshine.ico') +html_favicon = os.path.join(root_dir, 'src_assets', 'common', 'assets', 'web', 'public', 'images', 'sunshine.ico') html_logo = os.path.join(root_dir, 'sunshine.png') # Add any paths that contain custom static files (such as style sheets) here, diff --git a/docs/source/contributing/contributing.rst b/docs/source/contributing/contributing.rst index a50300d2327..ab85e13deee 100644 --- a/docs/source/contributing/contributing.rst +++ b/docs/source/contributing/contributing.rst @@ -3,3 +3,23 @@ Contributing Read our contribution guide in our organization level `docs `__. + +Web UI +------ +The Web UI uses `Vite `__ as its build system, to handle the integration of the NPM libraries. + +The HTML pages used by the Web UI are found in ``src_assets/common/assets/web``. + +`EJS `__ is used as a templating system for the pages (check ``template_header.html`` and ``template_header_main.html``). + +The Style System is provided by `Bootstrap `__. + +The JS framework used by the more interactive pages is `Vue `__. + +Building +^^^^^^^^ +Sunshine already builds the UI as part of its build process, but you can make faster changes by starting vite manually. + +.. code-block:: bash + + npm run dev \ No newline at end of file diff --git a/package.json b/package.json index f5152b6a54a..8ed5b32d933 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,15 @@ { + "scripts": { + "build": "vite build --debug", + "dev": "vite build --watch" + }, "dependencies": { "@fortawesome/fontawesome-free": "6.4.2", + "@popperjs/core": "2.11.8", + "@vitejs/plugin-vue": "4.3.4", "bootstrap": "5.3.2", - "vue": "2.6.12" + "vite": "4.4.9", + "vite-plugin-ejs": "1.6.4", + "vue": "3.2.25" } } diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index cfd760653df..68cbecb872b 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -70,10 +70,6 @@ prepare() { } build() { - pushd "$pkgname" - npm install - popd - export BRANCH="@GITHUB_BRANCH@" export BUILD_VERSION="@GITHUB_BUILD_VERSION@" export COMMIT="@GITHUB_COMMIT@" diff --git a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml index be1ae8adbf2..d4f0c164753 100644 --- a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml +++ b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml @@ -312,9 +312,6 @@ modules: env: npm_config_nodedir: /usr/lib/sdk/node18 NPM_CONFIG_LOGLEVEL: info - build-commands: - # Install npm dependencies - - cd ${FLATPAK_BUILDER_BUILDDIR} && npm install config-opts: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=/app diff --git a/packaging/macos/Portfile b/packaging/macos/Portfile index c22c1cb9dca..73a775a1dc5 100644 --- a/packaging/macos/Portfile +++ b/packaging/macos/Portfile @@ -55,10 +55,6 @@ platform darwin { } } -pre-build { - system -W ${worksrcpath} "npm install" -} - notes-append "Run @PROJECT_NAME@ by executing 'sunshine ', e.g. 'sunshine ~/sunshine.conf' " notes-append "The config file will be created if it doesn't exist." notes-append "It is recommended to set a location for the apps file in the config." diff --git a/scripts/icons/convert_and_pack.sh b/scripts/icons/convert_and_pack.sh index dd1183b9992..950effc98d6 100644 --- a/scripts/icons/convert_and_pack.sh +++ b/scripts/icons/convert_and_pack.sh @@ -37,9 +37,9 @@ icon_sizes=${!icon_sizes_keys[@]} echo "using icon sizes:" echo ${icon_sizes[@]} -src_vectors=("../../src_assets/common/assets/web/images/sunshine-locked.svg" - "../../src_assets/common/assets/web/images/sunshine-pausing.svg" - "../../src_assets/common/assets/web/images/sunshine-playing.svg" +src_vectors=("../../src_assets/common/assets/web/public/images/sunshine-locked.svg" + "../../src_assets/common/assets/web/public/images/sunshine-pausing.svg" + "../../src_assets/common/assets/web/public/images/sunshine-playing.svg" "../../sunshine.svg") echo "using sources vectors:" diff --git a/src/confighttp.cpp b/src/confighttp.cpp index 0de9cfb90c6..50bd87d3df4 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -161,11 +161,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "index.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -174,11 +173,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "pin.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -187,12 +185,11 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "apps.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); headers.emplace("Access-Control-Allow-Origin", "https://images.igdb.com/"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -201,11 +198,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "clients.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -214,11 +210,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "config.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -227,11 +222,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "password.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -241,11 +235,10 @@ namespace confighttp { send_redirect(response, request, "/"); return; } - std::string header = read_file(WEB_DIR "header-no-nav.html"); std::string content = read_file(WEB_DIR "welcome.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -254,11 +247,10 @@ namespace confighttp { print_req(request); - std::string header = read_file(WEB_DIR "header.html"); std::string content = read_file(WEB_DIR "troubleshooting.html"); SimpleWeb::CaseInsensitiveMultimap headers; headers.emplace("Content-Type", "text/html; charset=utf-8"); - response->write(header + content, headers); + response->write(content, headers); } void @@ -295,14 +287,14 @@ namespace confighttp { getNodeModules(resp_https_t response, req_https_t request) { print_req(request); fs::path webDirPath(WEB_DIR); - fs::path nodeModulesPath(webDirPath / "node_modules"); + fs::path nodeModulesPath(webDirPath / "assets"); // .relative_path is needed to shed any leading slash that might exist in the request path auto filePath = fs::weakly_canonical(webDirPath / fs::path(request->path).relative_path()); - // Don't do anything if file does not exist or is outside the node_modules directory + // Don't do anything if file does not exist or is outside the assets directory if (!isChildPath(filePath, nodeModulesPath)) { - BOOST_LOG(warning) << "Someone requested a path " << filePath << " that is outside the node_modules folder"; + BOOST_LOG(warning) << "Someone requested a path " << filePath << " that is outside the assets folder"; response->write(SimpleWeb::StatusCode::client_error_bad_request, "Bad Request"); } else if (!fs::exists(filePath)) { @@ -757,7 +749,7 @@ namespace confighttp { server.resource["^/api/covers/upload$"]["POST"] = uploadCover; server.resource["^/images/sunshine.ico$"]["GET"] = getFaviconImage; server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage; - server.resource["^/node_modules\\/.+$"]["GET"] = getNodeModules; + server.resource["^/assets\\/.+$"]["GET"] = getNodeModules; server.config.reuse_address = true; server.config.address = net::af_to_any_address_string(address_family); server.config.port = port_https; diff --git a/src_assets/common/assets/web/Navbar.vue b/src_assets/common/assets/web/Navbar.vue new file mode 100644 index 00000000000..948fb4d7244 --- /dev/null +++ b/src_assets/common/assets/web/Navbar.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src_assets/common/assets/web/ResourceCard.vue b/src_assets/common/assets/web/ResourceCard.vue new file mode 100644 index 00000000000..8bdfb5f9311 --- /dev/null +++ b/src_assets/common/assets/web/ResourceCard.vue @@ -0,0 +1,36 @@ + diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index bd09051d669..c9131440340 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -1,370 +1,383 @@ -
-
-

Applications

-
Applications are refreshed only when Client is restarted
-
-
- - - - - - - - - - - - - -
NameActions
{{app.name}} - - -
-
-
-
- -
- - -
- Application Name, as shown on Moonlight -
-
- -
- - -
- The file where the output of the command is stored, if it is not - specified, the output is ignored -
-
- -
- - -
- Enable/Disable the execution of Global Prep Commands for this - application. -
-
-
- -
- A list of commands to be run before/after this application.
- If any of the prep-commands fail, starting the application is aborted. + + + + + <%- header %> + + + + + +
+
+

Applications

+
Applications are refreshed only when Client is restarted
+
+
+ + + + + + + + + + + + + +
NameActions
{{app.name}} + + +
+
+
+
+ +
+ + +
+ Application Name, as shown on Moonlight +
-
- + +
+ + +
+ The file where the output of the command is stored, if it is not + specified, the output is ignored +
- - - - - - - - - - - - - - - - - -
Do Command Undo Command - Run as Admin -
- - - - -
- - -
-
- - -
-
- -
- -
-
{{c}}
- + +
+ + +
+ Enable/Disable the execution of Global Prep Commands for this + application. +
-
- - +
+ +
+ A list of commands to be run before/after this application.
+ If any of the prep-commands fail, starting the application is aborted. +
+
+ +
+ + + + + + + + + + + + + + + + + +
Do Command Undo Command + Run as Admin +
+ + + + +
+ + +
+
+ + +
-
- A list of commands to be run and forgotten about + +
+ +
+ + +
+
+ +
+
+ A list of commands to be run and forgotten about +
-
- -
- - -
- The main application, if it is not specified, a process is started - that sleeps indefinitely + +
+ + +
+ The main application, if it is not specified, a process is started + that sleeps indefinitely +
-
- -
- - -
- The working directory that should be passed to the process. For - example, some applications use the working directory to search for - configuration files. If not set, Sunshine will default to the parent - directory of the command + +
+ + +
+ The working directory that should be passed to the process. For + example, some applications use the working directory to search for + configuration files. If not set, Sunshine will default to the parent + directory of the command +
-
- -
- - -
- This can be necessary for some applications that require administrator - permissions to run properly. + +
+ + +
+ This can be necessary for some applications that require administrator + permissions to run properly. +
-
- -
- - -
- This will attempt to automatically detect launcher-type apps that close - quickly after launching another program or instance of themselves. When - a launcher-type app is detected, it is treated as a detached app. + +
+ + +
+ This will attempt to automatically detect launcher-type apps that close + quickly after launching another program or instance of themselves. When + a launcher-type app is detected, it is treated as a detached app. +
-
- -
- -
- - -