From b95309a2445cd8af6edddc4c2bb8667bfe8e06e3 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:52:43 -0400 Subject: [PATCH 01/21] chore: update global workflows (#3107) --- .flake8 | 3 +-- .github/workflows/python-flake8.yml | 32 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.flake8 b/.flake8 index 2d028b2d..2ea73951 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,6 @@ [flake8] filename = - *.py, - *.pys + *.py max-line-length = 120 extend-exclude = venv/ diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml index 61e23f74..6077a957 100644 --- a/.github/workflows/python-flake8.yml +++ b/.github/workflows/python-flake8.yml @@ -26,13 +26,37 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: - python-version: '3.10' + python-version: '3.12' - name: Install dependencies run: | - # pin flake8 before v6.0.0 due to removal of support for type comments (required for Python 2.7 type hints) - python -m pip install --upgrade pip setuptools "flake8<6" + python -m pip install --upgrade \ + pip \ + setuptools \ + wheel \ + flake8 \ + nb-clean \ + nbqa[toolchain] - name: Test with flake8 run: | - python -m flake8 --verbose + python -m flake8 \ + --color=always \ + --verbose + + - name: Test with nbqa + run: | + python -m nbqa flake8 \ + --color=always \ + --verbose \ + . + + - name: Test with nb-clean + run: | + output=$(find . -name '*.ipynb' -exec nb-clean check {} \;) + + # fail if there are any issues + if [ -n "$output" ]; then + echo "$output" + exit 1 + fi From f6659e6641c99809552913a8abd25ccb9a32bced Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:35:44 -0400 Subject: [PATCH 02/21] docs: add interactive table of contents (#3111) --- DOCKER_README.md | 5 +++++ README.md | 11 ++++++++--- docs/app_examples.md | 5 +++++ docs/building.md | 5 +++++ docs/changelog.md | 5 +++++ docs/configuration.md | 5 +++++ docs/contributing.md | 5 +++++ docs/gamestream_migration.md | 5 +++++ docs/getting_started.md | 5 +++++ docs/guides.md | 5 +++++ docs/legal.md | 5 +++++ docs/performance_tuning.md | 5 +++++ docs/third_party_packages.md | 5 +++++ docs/troubleshooting.md | 5 +++++ 14 files changed, 73 insertions(+), 3 deletions(-) diff --git a/DOCKER_README.md b/DOCKER_README.md index 2ff7bbf8..0d9d1f4c 100644 --- a/DOCKER_README.md +++ b/DOCKER_README.md @@ -169,3 +169,8 @@ The architectures supported by these images are shown in the table below. | [Changelog](docs/changelog.md) | [Third-Party Packages](docs/third_party_packages.md) | + +
+ + [TOC] +
diff --git a/README.md b/README.md index c99785ab..6c182058 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,13 @@ Our support methods are listed in our [LizardByte Docs](https://lizardbyte.readt
-| Previous | Next | -|:---------|------------------------------------:| -| | [Overview](docs/getting_started.md) | +| Previous | Next | +|:---------|-------------------------------------------:| +| | [Getting Started](docs/getting_started.md) |
+ +
+ + [TOC] +
diff --git a/docs/app_examples.md b/docs/app_examples.md index 990064de..33ad3c34 100644 --- a/docs/app_examples.md +++ b/docs/app_examples.md @@ -323,3 +323,8 @@ values in most JSON.} | [Configuration](configuration.md) | [Guides](guides.md) | + +
+ + [TOC] +
diff --git a/docs/building.md b/docs/building.md index 502b0a1c..6d0e7c47 100644 --- a/docs/building.md +++ b/docs/building.md @@ -160,3 +160,8 @@ It may be beneficial to build remotely in some cases. This will enable easier bu | [Troubleshooting](troubleshooting.md) | [Contributing](contributing.md) | + +
+ + [TOC] +
diff --git a/docs/changelog.md b/docs/changelog.md index f975767a..9cf35f26 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -15,3 +15,8 @@ | [Getting Started](getting_started.md) | [Docker](../DOCKER_README.md) | + +
+ + [TOC] +
diff --git a/docs/configuration.md b/docs/configuration.md index 98bab79a..fe1d3b7e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2454,3 +2454,8 @@ editing the `conf` file in a text editor. Use the examples as reference. | [Legal](legal.md) | [App Examples](app_examples.md) | + +
+ + [TOC] +
diff --git a/docs/contributing.md b/docs/contributing.md index 33b78062..22e30f11 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -193,3 +193,8 @@ maintainers to run the tests locally. | [Building](building.md) | [Source Code](../third-party/doxyconfig/docs/source_code.md) | + +
+ + [TOC] +
diff --git a/docs/gamestream_migration.md b/docs/gamestream_migration.md index 274ad0e0..8a8699b7 100644 --- a/docs/gamestream_migration.md +++ b/docs/gamestream_migration.md @@ -29,3 +29,8 @@ Sunshine does have some limitations, as compared to Nvidia GameStream. | [Third-party Packages](third_party_packages.md) | [Legal](legal.md) | + +
+ + [TOC] +
diff --git a/docs/getting_started.md b/docs/getting_started.md index a9bd5561..d121813e 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -570,4 +570,9 @@ Tutorials and Guides are community generated. Want to contribute? Reach out to u +
+ + [TOC] +
+ [latest-release]: https://github.com/LizardByte/Sunshine/releases/latest diff --git a/docs/guides.md b/docs/guides.md index c0f592d7..2069a3b5 100644 --- a/docs/guides.md +++ b/docs/guides.md @@ -532,3 +532,8 @@ going up and down. This device will be referred to as Voicemeeter Input.} | [App Examples](app_examples.md) | [Performance Tuning](performance_tuning.md) | + +
+ + [TOC] +
diff --git a/docs/legal.md b/docs/legal.md index aee2effe..161791a6 100644 --- a/docs/legal.md +++ b/docs/legal.md @@ -25,3 +25,8 @@ concerns about using Sunshine in a commercial setting, we recommend consulting w | [Gamestream Migration](gamestream_migration.md) | [Configuration](configuration.md) | + +
+ + [TOC] +
diff --git a/docs/performance_tuning.md b/docs/performance_tuning.md index e055d5aa..79612142 100644 --- a/docs/performance_tuning.md +++ b/docs/performance_tuning.md @@ -18,3 +18,8 @@ Enabling *Fast Sync* in Nvidia settings may help reduce latency. | [Guides](guides.md) | [Troubleshooting](troubleshooting.md) | + +
+ + [TOC] +
diff --git a/docs/third_party_packages.md b/docs/third_party_packages.md index e89dd19b..1793b4ce 100644 --- a/docs/third_party_packages.md +++ b/docs/third_party_packages.md @@ -24,3 +24,8 @@ | [Docker](../DOCKER_README.md) | [Gamestream Migration](gamestream_migration.md) | + +
+ + [TOC] +
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index baf106f1..3eb72cf8 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -198,3 +198,8 @@ permissions on the disk. | [Performance Tuning](performance_tuning.md) | [Building](building.md) | + +
+ + [TOC] +
From 0f40a092de8fc42eb3cab4bd4557f15f75e38d99 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Sat, 31 Aug 2024 13:45:57 -0400 Subject: [PATCH 03/21] chore: update global workflows (#3113) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .github/workflows/ci-docker.yml | 28 --- .github/workflows/common-lint.yml | 245 +++++++++++++++++++++++++ .github/workflows/cpp-lint.yml | 120 ------------ .github/workflows/python-flake8.yml | 62 ------- .github/workflows/release-notifier.yml | 2 +- .github/workflows/yaml-lint.yml | 66 ------- src/platform/linux/graphics.cpp | 2 +- src/platform/linux/x11grab.cpp | 3 +- src/platform/windows/display_wgc.cpp | 2 +- 9 files changed, 249 insertions(+), 281 deletions(-) create mode 100644 .github/workflows/common-lint.yml delete mode 100644 .github/workflows/cpp-lint.yml delete mode 100644 .github/workflows/python-flake8.yml delete mode 100644 .github/workflows/yaml-lint.yml diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index 124febc4..2e84c662 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -120,34 +120,6 @@ jobs: dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }} github_token: ${{ secrets.GITHUB_TOKEN }} - lint_dockerfile: - needs: [check_dockerfiles] - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }} - name: Lint Dockerfile${{ matrix.tag }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Hadolint - id: hadolint - uses: hadolint/hadolint-action@v3.1.0 - with: - dockerfile: ${{ matrix.dockerfile }} - ignore: DL3008,DL3013,DL3016,DL3018,DL3028,DL3059 - output-file: ./hadolint.log - verbose: true - - - name: Log - if: failure() - run: | - echo "Hadolint outcome: ${{ steps.hadolint.outcome }}" >> $GITHUB_STEP_SUMMARY - cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY - docker: needs: [check_dockerfiles, setup_release] if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} diff --git a/.github/workflows/common-lint.yml b/.github/workflows/common-lint.yml new file mode 100644 index 00000000..4a62b245 --- /dev/null +++ b/.github/workflows/common-lint.yml @@ -0,0 +1,245 @@ +--- +# 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. + +# Common linting. + +name: common lint + +on: + pull_request: + branches: [master] + types: [opened, synchronize, reopened] + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + lint: + name: Common Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade \ + pip \ + setuptools \ + wheel \ + cmakelang \ + flake8 \ + nb-clean \ + nbqa[toolchain] + + - name: C++ - find files + id: cpp_files + run: | + # find files + found_files=$(find . -type f \ + -iname "*.c" -o \ + -iname "*.cpp" -o \ + -iname "*.h" -o \ + -iname "*.hpp" -o \ + -iname "*.m" -o \ + -iname "*.mm" \ + ) + ignore_files=$(find . -type f -iname ".clang-format-ignore") + + # Loop through each C++ file + for file in $found_files; do + for ignore_file in $ignore_files; do + ignore_directory=$(dirname "$ignore_file") + # if directory of ignore_file is beginning of file + if [[ "$file" == "$ignore_directory"* ]]; then + echo "ignoring file: ${file}" + found_files="${found_files//${file}/}" + break 1 + fi + done + done + + # remove empty lines + found_files=$(echo "$found_files" | sed '/^\s*$/d') + + echo "found cpp files: ${found_files}" + + # do not quote to keep this as a single line + echo found_files=${found_files} >> $GITHUB_OUTPUT + + - name: C++ - Clang format lint + if: always() && steps.cpp_files.outputs.found_files + uses: DoozyX/clang-format-lint-action@v0.18 + with: + source: ${{ steps.cpp_files.outputs.found_files }} + extensions: 'c,cpp,h,hpp,m,mm' + style: file + inplace: false + + - name: CMake - find files + id: cmake_files + if: always() + run: | + # find files + found_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake") + ignore_files=$(find . -type f -iname ".cmake-lint-ignore") + + # Loop through each C++ file + for file in $found_files; do + for ignore_file in $ignore_files; do + ignore_directory=$(dirname "$ignore_file") + # if directory of ignore_file is beginning of file + if [[ "$file" == "$ignore_directory"* ]]; then + echo "ignoring file: ${file}" + found_files="${found_files//${file}/}" + break 1 + fi + done + done + + # remove empty lines + found_files=$(echo "$found_files" | sed '/^\s*$/d') + + echo "found cmake files: ${found_files}" + + # do not quote to keep this as a single line + echo found_files=${found_files} >> $GITHUB_OUTPUT + + - name: CMake - cmake-lint + if: always() && steps.cmake_files.outputs.found_files + run: | + cmake-lint --line-width 120 --tab-size 4 ${{ steps.cmake_files.outputs.found_files }} + + - name: Docker - find files + id: dokcer_files + if: always() + run: | + found_files=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile") + + echo "found_files: ${found_files}" + + # do not quote to keep this as a single line + echo found_files=${found_files} >> $GITHUB_OUTPUT + + - name: Docker - hadolint + if: always() && steps.dokcer_files.outputs.found_files + run: | + docker pull hadolint/hadolint + + # create hadolint config file + cat < .hadolint.yaml + --- + ignored: + - DL3008 + - DL3013 + - DL3016 + - DL3018 + - DL3028 + - DL3059 + EOF + + failed=0 + failed_files="" + + for file in ${{ steps.dokcer_files.outputs.found_files }}; do + echo "::group::${file}" + docker run --rm -i \ + -e "NO_COLOR=0" \ + -e "HADOLINT_VERBOSE=1" \ + -v $(pwd)/.hadolint.yaml:/.config/hadolint.yaml \ + hadolint/hadolint < $file || { + failed=1 + failed_files="$failed_files $file" + } + echo "::endgroup::" + done + + if [ $failed -ne 0 ]; then + echo "::error:: hadolint failed for the following files: $failed_files" + exit 1 + fi + + - name: Python - flake8 + if: always() + run: | + python -m flake8 \ + --color=always \ + --verbose + + - name: Python - nbqa flake8 + if: always() + run: | + python -m nbqa flake8 \ + --color=always \ + --verbose \ + . + + - name: Python - nb-clean + if: always() + run: | + output=$(find . -name '*.ipynb' -exec nb-clean check {} \;) + + # fail if there are any issues + if [ -n "$output" ]; then + echo "$output" + exit 1 + fi + + - name: YAML - find files + id: yaml_files + if: always() + run: | + # space separated list of files + FILES=.clang-format + + # empty placeholder + found_files="" + + for FILE in ${FILES}; do + if [ -f "$FILE" ] + then + found_files="$found_files $FILE" + fi + done + + echo "found_files=${found_files}" >> $GITHUB_OUTPUT + + - name: YAML - yamllint + id: yamllint + if: always() + uses: ibiqlik/action-yamllint@v3 + with: + # https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration + config_data: | + extends: default + rules: + comments: + level: error + document-start: + level: error + line-length: + max: 120 + new-line-at-end-of-file: + level: error + new-lines: + type: unix + truthy: + # GitHub uses "on" for workflow event triggers + # .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning" + allowed-values: ['true', 'false', 'on'] + check-keys: true + level: warning + file_or_dir: . ${{ steps.yaml_files.outputs.found_files }} + + - name: YAML - log + if: always() && steps.yamllint.outcome == 'failure' + run: | + cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml deleted file mode 100644 index 96cb1d06..00000000 --- a/.github/workflows/cpp-lint.yml +++ /dev/null @@ -1,120 +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. - -# Lint c++ source files and cmake files. - -name: C++ Lint - -on: - pull_request: - branches: [master] - types: [opened, synchronize, reopened] - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - clang-format: - name: Clang Format Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Find cpp files - id: find_files - run: | - # find files - found_files=$(find . -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.m" -o -iname "*.mm") - ignore_files=$(find . -type f -iname ".clang-format-ignore") - - # Loop through each C++ file - for file in $found_files; do - for ignore_file in $ignore_files; do - ignore_directory=$(dirname "$ignore_file") - # if directory of ignore_file is beginning of file - if [[ "$file" == "$ignore_directory"* ]]; then - echo "ignoring file: ${file}" - found_files="${found_files//${file}/}" - break 1 - fi - done - done - - # remove empty lines - found_files=$(echo "$found_files" | sed '/^\s*$/d') - - echo "found cpp files: ${found_files}" - - # do not quote to keep this as a single line - echo found_files=${found_files} >> $GITHUB_OUTPUT - - - name: Clang format lint - if: ${{ steps.find_files.outputs.found_files }} - uses: DoozyX/clang-format-lint-action@v0.18 - with: - source: ${{ steps.find_files.outputs.found_files }} - extensions: 'cpp,h,m,mm' - clangFormatVersion: 16 - style: file - inplace: false - - - name: Upload Artifacts - if: failure() - uses: actions/upload-artifact@v4 - with: - name: clang-format-fixes - path: ${{ steps.find_files.outputs.found_files }} - - cmake-lint: - name: CMake Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools cmakelang - - - name: Find cmake files - id: find_files - run: | - # find files - found_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake") - ignore_files=$(find . -type f -iname ".cmake-lint-ignore") - - # Loop through each C++ file - for file in $found_files; do - for ignore_file in $ignore_files; do - ignore_directory=$(dirname "$ignore_file") - # if directory of ignore_file is beginning of file - if [[ "$file" == "$ignore_directory"* ]]; then - echo "ignoring file: ${file}" - found_files="${found_files//${file}/}" - break 1 - fi - done - done - - # remove empty lines - found_files=$(echo "$found_files" | sed '/^\s*$/d') - - echo "found cmake files: ${found_files}" - - # do not quote to keep this as a single line - echo found_files=${found_files} >> $GITHUB_OUTPUT - - - name: Test with cmake-lint - run: | - cmake-lint --line-width 120 --tab-size 4 ${{ steps.find_files.outputs.found_files }} diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml deleted file mode 100644 index 6077a957..00000000 --- a/.github/workflows/python-flake8.yml +++ /dev/null @@ -1,62 +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. - -# Lint python files with flake8. - -name: flake8 - -on: - pull_request: - branches: [master] - types: [opened, synchronize, reopened] - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - flake8: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: '3.12' - - - name: Install dependencies - run: | - python -m pip install --upgrade \ - pip \ - setuptools \ - wheel \ - flake8 \ - nb-clean \ - nbqa[toolchain] - - - name: Test with flake8 - run: | - python -m flake8 \ - --color=always \ - --verbose - - - name: Test with nbqa - run: | - python -m nbqa flake8 \ - --color=always \ - --verbose \ - . - - - name: Test with nb-clean - run: | - output=$(find . -name '*.ipynb' -exec nb-clean check {} \;) - - # fail if there are any issues - if [ -n "$output" ]; then - echo "$output" - exit 1 - fi diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml index 2d1e632d..1ac8a3a3 100644 --- a/.github/workflows/release-notifier.yml +++ b/.github/workflows/release-notifier.yml @@ -28,7 +28,7 @@ jobs: id: output run: | echo "${RELEASE_BODY}" > ./release_body.md - modified_body=$(sed '/^---$/d; /^## Contributors$/,/<\/a>/d' ./release_body.md) + modified_body=$(sed '/^---/,$d' ./release_body.md) echo "modified_body: ${modified_body}" # use a heredoc to ensure the output is multiline diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml deleted file mode 100644 index 023b836c..00000000 --- a/.github/workflows/yaml-lint.yml +++ /dev/null @@ -1,66 +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. - -# Lint yaml files. - -name: yaml lint - -on: - pull_request: - branches: [master] - types: [opened, synchronize, reopened] - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - yaml-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Find additional files - id: find-files - run: | - # space separated list of files - FILES=.clang-format - - # empty placeholder - FOUND="" - - for FILE in ${FILES}; do - if [ -f "$FILE" ] - then - FOUND="$FOUND $FILE" - fi - done - - echo "found=${FOUND}" >> $GITHUB_OUTPUT - - - name: yaml lint - id: yaml-lint - uses: ibiqlik/action-yamllint@v3 - with: - # https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration - config_data: | - extends: default - rules: - comments: - level: error - line-length: - max: 120 - truthy: - # GitHub uses "on" for workflow event triggers - # .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning" - allowed-values: ['true', 'false', 'on'] - check-keys: true - level: warning - file_or_dir: . ${{ steps.find-files.outputs.found }} - - - name: Log - run: | - cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY diff --git a/src/platform/linux/graphics.cpp b/src/platform/linux/graphics.cpp index 2ba97759..8ffba667 100644 --- a/src/platform/linux/graphics.cpp +++ b/src/platform/linux/graphics.cpp @@ -19,7 +19,7 @@ extern "C" { // They aren't likely to change any time soon. #define fourcc_code(a, b, c, d) ((std::uint32_t)(a) | ((std::uint32_t)(b) << 8) | \ ((std::uint32_t)(c) << 16) | ((std::uint32_t)(d) << 24)) -#define fourcc_mod_code(vendor, val) ((((uint64_t) vendor) << 56) | ((val) &0x00ffffffffffffffULL)) +#define fourcc_mod_code(vendor, val) ((((uint64_t) vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) #define DRM_FORMAT_MOD_INVALID fourcc_mod_code(0, ((1ULL << 56) - 1)) #if !defined(SUNSHINE_SHADERS_DIR) // for testing this needs to be defined in cmake as we don't do an install diff --git a/src/platform/linux/x11grab.cpp b/src/platform/linux/x11grab.cpp index bcb2ff30..44c37609 100644 --- a/src/platform/linux/x11grab.cpp +++ b/src/platform/linux/x11grab.cpp @@ -618,8 +618,7 @@ namespace platf { } ~shm_attr_t() override { - while (!task_pool.cancel(refresh_task_id)) - ; + while (!task_pool.cancel(refresh_task_id)); } capture_e diff --git a/src/platform/windows/display_wgc.cpp b/src/platform/windows/display_wgc.cpp index 1df60fcd..d50e9ccf 100644 --- a/src/platform/windows/display_wgc.cpp +++ b/src/platform/windows/display_wgc.cpp @@ -37,7 +37,7 @@ namespace winrt { #if WINRT_IMPL_HAS_DECLSPEC_UUID __declspec(uuid("A9B3D012-3DF2-4EE3-B8D1-8695F457D3C1")) #endif - IDirect3DDxgiInterfaceAccess: ::IUnknown { + IDirect3DDxgiInterfaceAccess: ::IUnknown { virtual HRESULT __stdcall GetInterface(REFIID id, void **object) = 0; }; } // namespace winrt From 697e8770706d951fa233e6e2be99903acc7fcf6a Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 1 Sep 2024 09:01:03 -0400 Subject: [PATCH 04/21] fix(linux): use correct value for AMD_DEBUG environment variable (#3115) --- 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 b3e31ec6..3ac9670a 100644 --- a/src/platform/linux/misc.cpp +++ b/src/platform/linux/misc.cpp @@ -925,7 +925,7 @@ namespace platf { init() { // enable low latency mode for AMD // https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30039 - set_env("AMD_DEBUG", "lowlatency"); + set_env("AMD_DEBUG", "lowlatencyenc"); // These are allowed to fail. gbm::init(); From 9d7e90ec2eb08ae925341bcc650f7e075a497cec Mon Sep 17 00:00:00 2001 From: Gilles Schintgen Date: Sun, 1 Sep 2024 20:20:29 +0200 Subject: [PATCH 05/21] docs(troubleshooting): update note on AMD lowlatencyenc (Linux) (#3117) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- docs/troubleshooting.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 3eb72cf8..da91630d 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -143,25 +143,24 @@ often grub is used to load the kernel and set its command line.) ### AMD encoding latency issues If you notice unexpectedly high encoding latencies (e.g. in Moonlight's -performance overlay) or strong fluctuations thereof, this is due to -[missing support](https://gitlab.freedesktop.org/drm/amd/-/issues/3336) -in Mesa/libva for AMD's low latency encoder mode. This is particularly -problematic at higher resolutions (4K). - -Only the most recent development versions of mesa include support for this -low-latency mode. It will be included in Mesa-24.2. - -In order to enable it, Sunshine has to be started with a special environment -variable: +performance overlay) or strong fluctuations thereof, your system's Mesa +libraries are outdated (<24.2). This is particularly problematic at higher +resolutions (4K). +Starting with Mesa-24.2 applications can request a +[low-latency mode](https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30039) +by running them with a special +[environment variable](https://docs.mesa3d.org/envvars.html#envvar-AMD_DEBUG): ```bash -AMD_DEBUG=lowlatencyenc sunshine +export AMD_DEBUG=lowlatencyenc ``` +Sunshine sets this variable automatically, no manual +configuration is needed. -To check whether low-latency mode is being used, one can watch the `VCLK` and -`DCLK` frequencies in `amdgpu_top`. Without this encoder tuning both clock -frequencies will fluctuate strongly, whereas with active low-latency encoding -they will stay high as long as the encoder is used. +To check whether low-latency mode is being used, one can watch the VCLK and DCLK +frequencies in amdgpu_top. Without this encoder tuning both clock frequencies +will fluctuate strongly, whereas with active low-latency encoding they will stay +high as long as the encoder is used. ### Gamescope compatibility Some users have reported stuttering issues when streaming games running within Gamescope. From 7ce8547d6e77534d60899f37bcde63c0577a9995 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Tue, 3 Sep 2024 03:02:05 +0300 Subject: [PATCH 06/21] fix(win/video): don't offload chroma subsampling math to texture sampler when downscaling (#3014) * Don't use sampler math for chroma if downscaling * Correct portrait rotation offsets --- src/platform/windows/display_vram.cpp | 189 +++++++++++------- .../convert_yuv420_packed_uv_type0_vs.hlsl | 2 +- .../convert_yuv420_packed_uv_type0s_ps.hlsl | 5 + ...ert_yuv420_packed_uv_type0s_ps_linear.hlsl | 5 + ...ked_uv_type0s_ps_perceptual_quantizer.hlsl | 5 + .../convert_yuv420_packed_uv_type0s_vs.hlsl | 15 ++ .../directx/convert_yuv420_planar_y_vs.hlsl | 2 +- .../directx/convert_yuv444_packed_vs.hlsl | 2 +- .../directx/convert_yuv444_planar_vs.hlsl | 2 +- .../assets/shaders/directx/cursor_vs.hlsl | 2 +- .../shaders/directx/include/base_vs.hlsl | 23 ++- .../directx/include/base_vs_types.hlsl | 9 +- .../convert_yuv420_packed_uv_ps_base.hlsl | 9 + 13 files changed, 177 insertions(+), 93 deletions(-) create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_linear.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer.hlsl create mode 100644 src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 96ddff84..ba2b0685 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -107,6 +107,10 @@ namespace platf::dxgi { 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_packed_uv_type0s_ps_hlsl; + blob_t convert_yuv420_packed_uv_type0s_ps_linear_hlsl; + blob_t convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer_hlsl; + blob_t convert_yuv420_packed_uv_type0s_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; @@ -488,6 +492,110 @@ namespace platf::dxgi { frame_texture->AddRef(); output_texture.reset(frame_texture); + HRESULT status = S_OK; + +#define create_vertex_shader_helper(x, y) \ + if (FAILED(status = device->CreateVertexShader(x->GetBufferPointer(), x->GetBufferSize(), nullptr, &y))) { \ + BOOST_LOG(error) << "Failed to create vertex shader " << #x << ": " << util::log_hex(status); \ + return -1; \ + } +#define create_pixel_shader_helper(x, y) \ + if (FAILED(status = device->CreatePixelShader(x->GetBufferPointer(), x->GetBufferSize(), nullptr, &y))) { \ + BOOST_LOG(error) << "Failed to create pixel shader " << #x << ": " << util::log_hex(status); \ + return -1; \ + } + + const bool downscaling = display->width > width || display->height > height; + + switch (format) { + case DXGI_FORMAT_NV12: + // Semi-planar 8-bit YUV 4:2:0 + create_vertex_shader_helper(convert_yuv420_planar_y_vs_hlsl, convert_Y_or_YUV_vs); + create_pixel_shader_helper(convert_yuv420_planar_y_ps_hlsl, convert_Y_or_YUV_ps); + create_pixel_shader_helper(convert_yuv420_planar_y_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); + if (downscaling) { + create_vertex_shader_helper(convert_yuv420_packed_uv_type0s_vs_hlsl, convert_UV_vs); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_hlsl, convert_UV_ps); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_linear_hlsl, convert_UV_fp16_ps); + } + else { + create_vertex_shader_helper(convert_yuv420_packed_uv_type0_vs_hlsl, convert_UV_vs); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_hlsl, convert_UV_ps); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_linear_hlsl, convert_UV_fp16_ps); + } + break; + + case DXGI_FORMAT_P010: + // Semi-planar 16-bit YUV 4:2:0, 10 most significant bits store the value + create_vertex_shader_helper(convert_yuv420_planar_y_vs_hlsl, convert_Y_or_YUV_vs); + create_pixel_shader_helper(convert_yuv420_planar_y_ps_hlsl, convert_Y_or_YUV_ps); + if (display->is_hdr()) { + create_pixel_shader_helper(convert_yuv420_planar_y_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); + } + else { + create_pixel_shader_helper(convert_yuv420_planar_y_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); + } + if (downscaling) { + create_vertex_shader_helper(convert_yuv420_packed_uv_type0s_vs_hlsl, convert_UV_vs); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_hlsl, convert_UV_ps); + if (display->is_hdr()) { + create_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer_hlsl, convert_UV_fp16_ps); + } + else { + create_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_linear_hlsl, convert_UV_fp16_ps); + } + } + else { + create_vertex_shader_helper(convert_yuv420_packed_uv_type0_vs_hlsl, convert_UV_vs); + create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_hlsl, convert_UV_ps); + if (display->is_hdr()) { + create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_perceptual_quantizer_hlsl, convert_UV_fp16_ps); + } + else { + create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_linear_hlsl, convert_UV_fp16_ps); + } + } + break; + + case DXGI_FORMAT_R16_UINT: + // Planar 16-bit YUV 4:4:4, 10 most significant bits store the value + create_vertex_shader_helper(convert_yuv444_planar_vs_hlsl, convert_Y_or_YUV_vs); + create_pixel_shader_helper(convert_yuv444_planar_ps_hlsl, convert_Y_or_YUV_ps); + if (display->is_hdr()) { + create_pixel_shader_helper(convert_yuv444_planar_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); + } + else { + create_pixel_shader_helper(convert_yuv444_planar_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); + } + break; + + case DXGI_FORMAT_AYUV: + // Packed 8-bit YUV 4:4:4 + create_vertex_shader_helper(convert_yuv444_packed_vs_hlsl, convert_Y_or_YUV_vs); + create_pixel_shader_helper(convert_yuv444_packed_ayuv_ps_hlsl, convert_Y_or_YUV_ps); + create_pixel_shader_helper(convert_yuv444_packed_ayuv_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); + break; + + case DXGI_FORMAT_Y410: + // Packed 10-bit YUV 4:4:4 + create_vertex_shader_helper(convert_yuv444_packed_vs_hlsl, convert_Y_or_YUV_vs); + create_pixel_shader_helper(convert_yuv444_packed_y410_ps_hlsl, convert_Y_or_YUV_ps); + if (display->is_hdr()) { + create_pixel_shader_helper(convert_yuv444_packed_y410_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); + } + else { + create_pixel_shader_helper(convert_yuv444_packed_y410_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); + } + break; + + default: + BOOST_LOG(error) << "Unable to create shaders because of the unrecognized surface format"; + return -1; + } + +#undef create_vertex_shader_helper +#undef create_pixel_shader_helper + auto out_width = width; auto out_height = height; @@ -676,83 +784,6 @@ namespace platf::dxgi { BOOST_LOG(warning) << "Failed to increase encoding GPU thread priority. Please run application as administrator for optimal performance."; } -#define create_vertex_shader_helper(x, y) \ - if (FAILED(status = device->CreateVertexShader(x->GetBufferPointer(), x->GetBufferSize(), nullptr, &y))) { \ - BOOST_LOG(error) << "Failed to create vertex shader " << #x << ": " << util::log_hex(status); \ - return -1; \ - } -#define create_pixel_shader_helper(x, y) \ - if (FAILED(status = device->CreatePixelShader(x->GetBufferPointer(), x->GetBufferSize(), nullptr, &y))) { \ - BOOST_LOG(error) << "Failed to create pixel shader " << #x << ": " << util::log_hex(status); \ - return -1; \ - } - - switch (format) { - case DXGI_FORMAT_NV12: - // Semi-planar 8-bit YUV 4:2:0 - create_vertex_shader_helper(convert_yuv420_planar_y_vs_hlsl, convert_Y_or_YUV_vs); - create_pixel_shader_helper(convert_yuv420_planar_y_ps_hlsl, convert_Y_or_YUV_ps); - create_pixel_shader_helper(convert_yuv420_planar_y_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); - create_vertex_shader_helper(convert_yuv420_packed_uv_type0_vs_hlsl, convert_UV_vs); - create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_hlsl, convert_UV_ps); - create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_linear_hlsl, convert_UV_fp16_ps); - break; - - case DXGI_FORMAT_P010: - // Semi-planar 16-bit YUV 4:2:0, 10 most significant bits store the value - create_vertex_shader_helper(convert_yuv420_planar_y_vs_hlsl, convert_Y_or_YUV_vs); - create_pixel_shader_helper(convert_yuv420_planar_y_ps_hlsl, convert_Y_or_YUV_ps); - create_vertex_shader_helper(convert_yuv420_packed_uv_type0_vs_hlsl, convert_UV_vs); - create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_hlsl, convert_UV_ps); - if (display->is_hdr()) { - create_pixel_shader_helper(convert_yuv420_planar_y_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); - create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_perceptual_quantizer_hlsl, convert_UV_fp16_ps); - } - else { - create_pixel_shader_helper(convert_yuv420_planar_y_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); - create_pixel_shader_helper(convert_yuv420_packed_uv_type0_ps_linear_hlsl, convert_UV_fp16_ps); - } - break; - - case DXGI_FORMAT_R16_UINT: - // Planar 16-bit YUV 4:4:4, 10 most significant bits store the value - create_vertex_shader_helper(convert_yuv444_planar_vs_hlsl, convert_Y_or_YUV_vs); - create_pixel_shader_helper(convert_yuv444_planar_ps_hlsl, convert_Y_or_YUV_ps); - if (display->is_hdr()) { - create_pixel_shader_helper(convert_yuv444_planar_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); - } - else { - create_pixel_shader_helper(convert_yuv444_planar_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); - } - break; - - case DXGI_FORMAT_AYUV: - // Packed 8-bit YUV 4:4:4 - create_vertex_shader_helper(convert_yuv444_packed_vs_hlsl, convert_Y_or_YUV_vs); - create_pixel_shader_helper(convert_yuv444_packed_ayuv_ps_hlsl, convert_Y_or_YUV_ps); - create_pixel_shader_helper(convert_yuv444_packed_ayuv_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); - break; - - case DXGI_FORMAT_Y410: - // Packed 10-bit YUV 4:4:4 - create_vertex_shader_helper(convert_yuv444_packed_vs_hlsl, convert_Y_or_YUV_vs); - create_pixel_shader_helper(convert_yuv444_packed_y410_ps_hlsl, convert_Y_or_YUV_ps); - if (display->is_hdr()) { - create_pixel_shader_helper(convert_yuv444_packed_y410_ps_perceptual_quantizer_hlsl, convert_Y_or_YUV_fp16_ps); - } - else { - create_pixel_shader_helper(convert_yuv444_packed_y410_ps_linear_hlsl, convert_Y_or_YUV_fp16_ps); - } - break; - - default: - BOOST_LOG(error) << "Unable to create shaders because of the unrecognized surface format"; - return -1; - } - -#undef create_vertex_shader_helper -#undef create_pixel_shader_helper - auto default_color_vectors = ::video::color_vectors_from_colorspace(::video::colorspace_e::rec601, false); if (!default_color_vectors) { BOOST_LOG(error) << "Missing color vectors for Rec. 601"sv; @@ -1923,6 +1954,10 @@ namespace platf::dxgi { 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_packed_uv_type0s_ps); + compile_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_linear); + compile_pixel_shader_helper(convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer); + compile_vertex_shader_helper(convert_yuv420_packed_uv_type0s_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); 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 index eb9068b4..fcbe2774 100644 --- 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 @@ -11,5 +11,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset.x, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset, rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps.hlsl new file mode 100644 index 00000000..73fd423c --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_base.hlsl" + +#define LEFT_SUBSAMPLING_SCALE + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_linear.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_linear.hlsl new file mode 100644 index 00000000..c451dc19 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_linear.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_linear_base.hlsl" + +#define LEFT_SUBSAMPLING_SCALE + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer.hlsl new file mode 100644 index 00000000..9156257f --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_ps_perceptual_quantizer.hlsl @@ -0,0 +1,5 @@ +#include "include/convert_perceptual_quantizer_base.hlsl" + +#define LEFT_SUBSAMPLING_SCALE + +#include "include/convert_yuv420_packed_uv_ps_base.hlsl" diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl new file mode 100644 index 00000000..fec99ca3 --- /dev/null +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_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_SCALE +#include "include/base_vs.hlsl" + +vertex_t main_vs(uint vertex_id : SV_VertexID) +{ + return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset, rotate_texture_steps); +} 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 index 33e48145..f9c774eb 100644 --- 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 @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl index 33e48145..f9c774eb 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl index 566da5d8..e8fa1370 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl @@ -15,7 +15,7 @@ cbuffer color_matrix_cbuffer : register(b3) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - vertex_t output = generate_fullscreen_triangle_vertex(vertex_id % 3, rotate_texture_steps); + vertex_t output = generate_fullscreen_triangle_vertex(vertex_id % 3, float2(0, 0), rotate_texture_steps); output.viewport = vertex_id / 3; diff --git a/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl index cf737ede..2d62120c 100644 --- a/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b2) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), 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 index c39e7c6f..8e6f2d92 100644 --- a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl @@ -1,12 +1,6 @@ #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; @@ -30,11 +24,24 @@ vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_ sin(rotation_radians), cos(rotation_radians) }; float2 rotation_center = { 0.5, 0.5 }; tex_coord = round(rotation_center + mul(rotation_matrix, tex_coord - rotation_center)); + + if (rotate_texture_steps % 2) { + subsample_offset.xy = subsample_offset.yx; + } } #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_center = float3(tex_coord.x, tex_coord.x - subsample_offset.x, tex_coord.y); +#elif defined(LEFT_SUBSAMPLING_SCALE) + float2 halfsample_offset = subsample_offset / 2; + float3 right_center_left = float3(tex_coord.x + halfsample_offset.x, + tex_coord.x - halfsample_offset.x, + tex_coord.x - 3 * halfsample_offset.x); + float2 top_bottom = float2(tex_coord.y - halfsample_offset.y, + tex_coord.y + halfsample_offset.y); + output.tex_right_center_left_top = float4(right_center_left, top_bottom.x); + output.tex_right_center_left_bottom = float4(right_center_left, top_bottom.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 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 index cf755c5a..fabc52bb 100644 --- a/src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/base_vs_types.hlsl @@ -3,9 +3,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; +#elif defined(LEFT_SUBSAMPLING_SCALE) + float4 tex_right_center_left_top : TEXCOORD0; + float4 tex_right_center_left_bottom : TEXCOORD1; +#elif defined(TOPLEFT_SUBSAMPLING) + float3 tex_right_left_top : TEXCOORD0; + float3 tex_right_left_bottom : TEXCOORD1; #else float2 tex_coord : TEXCOORD; #endif 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 index c21dccd7..190c7a0e 100644 --- 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 @@ -17,6 +17,15 @@ float2 main_ps(vertex_t input) : SV_Target 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(LEFT_SUBSAMPLING_SCALE) + float3 rgb = image.Sample(def_sampler, input.tex_right_center_left_top.yw).rgb; // top-center + rgb += image.Sample(def_sampler, input.tex_right_center_left_bottom.yw).rgb; // bottom-center + rgb *= 2; + rgb += image.Sample(def_sampler, input.tex_right_center_left_top.xw).rgb; // top-right + rgb += image.Sample(def_sampler, input.tex_right_center_left_top.zw).rgb; // top-left + rgb += image.Sample(def_sampler, input.tex_right_center_left_bottom.xw).rgb; // bottom-right + rgb += image.Sample(def_sampler, input.tex_right_center_left_bottom.zw).rgb; // bottom-left + rgb = CONVERT_FUNCTION(rgb * (1./8)); #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; From d39a0a5fddb4259ec887d7439abb33214442ab31 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:29:35 -0400 Subject: [PATCH 07/21] docs(metadata): update urls (#3124) --- docs/contributing.md | 2 +- gh-pages-template/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 22e30f11..dfc98c3c 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -28,7 +28,7 @@ Read our contribution guide in our organization level Sunshine and related LizardByte projects are being localized into various languages. The default language is `en` (English). -![](https://app.lizardbyte.dev/uno/crowdin/LizardByte_graph.svg) +![](https://app.lizardbyte.dev/dashboard/crowdin/LizardByte_graph.svg) @admonition{Community | We are looking for language coordinators to help approve translations. The goal is to have the bars above filled with green! diff --git a/gh-pages-template/index.html b/gh-pages-template/index.html index 684b62a1..1a909849 100644 --- a/gh-pages-template/index.html +++ b/gh-pages-template/index.html @@ -11,7 +11,7 @@ - + @@ -20,7 +20,7 @@ - + From a87b44d37bd3f893a074d4f0fa7befd20918c8e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:32:19 -0400 Subject: [PATCH 08/21] build(deps): bump third-party/build-deps from `d0a09a6` to `a4fb39f` (#3131) Bumps [third-party/build-deps](https://github.com/LizardByte/build-deps) from `d0a09a6` to `a4fb39f`. - [Commits](https://github.com/LizardByte/build-deps/compare/d0a09a69ce686869ddbc97067854dbd7ef993b90...a4fb39f22e63649d2ef30508644937e3d7a18aed) --- updated-dependencies: - dependency-name: third-party/build-deps dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/build-deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/build-deps b/third-party/build-deps index d0a09a69..a4fb39f2 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit d0a09a69ce686869ddbc97067854dbd7ef993b90 +Subproject commit a4fb39f22e63649d2ef30508644937e3d7a18aed From dce250d62d497ace578b35fc29d3d044034cdd1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:23:33 -0400 Subject: [PATCH 09/21] build(deps): bump third-party/doxyconfig from `6d145da` to `5fcfd9a` (#3136) Bumps [third-party/doxyconfig](https://github.com/LizardByte/doxyconfig) from `6d145da` to `5fcfd9a`. - [Commits](https://github.com/LizardByte/doxyconfig/compare/6d145dab2ec1f387920036c7fffc1d08d52fe926...5fcfd9a3d2ed90f3197268d9668f5c6c408ddc72) --- updated-dependencies: - dependency-name: third-party/doxyconfig dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/doxyconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/doxyconfig b/third-party/doxyconfig index 6d145dab..5fcfd9a3 160000 --- a/third-party/doxyconfig +++ b/third-party/doxyconfig @@ -1 +1 @@ -Subproject commit 6d145dab2ec1f387920036c7fffc1d08d52fe926 +Subproject commit 5fcfd9a3d2ed90f3197268d9668f5c6c408ddc72 From 49319d7688a88436d5884d709b397f423c8490ef Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 4 Sep 2024 22:25:02 -0500 Subject: [PATCH 10/21] fix(win/input): use active keyboard layout for non-normalized key events (#3125) --- src/platform/windows/input.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 5ff61689..ea055174 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -618,12 +618,16 @@ namespace platf { auto &ki = i.ki; // 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) { + // If we're set to always send scancodes, we will use the current keyboard layout to convert to a scancode. This will + // assume the client and host have the same keyboard layout, but it's probably better than always using US English. + if (!(flags & SS_KBE_FLAG_NON_NORMALIZED)) { // Mask off the extended key byte ki.wScan = VK_TO_SCANCODE_MAP[modcode & 0xFF]; } + else if (config::input.always_send_scancodes && modcode != VK_LWIN && modcode != VK_RWIN && modcode != VK_PAUSE) { + // For some reason, MapVirtualKey(VK_LWIN, MAPVK_VK_TO_VSC) doesn't seem to work :/ + ki.wScan = MapVirtualKey(modcode, MAPVK_VK_TO_VSC); + } // If we can map this to a scancode, send it as a scancode for maximum game compatibility. if (ki.wScan) { From 08c706f6dc17f8a48c2fcb4094532dfc27325d2b Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:38:34 -0400 Subject: [PATCH 11/21] fix(gh-pages): update uno url (#3127) --- gh-pages-template/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages-template/index.html b/gh-pages-template/index.html index 1a909849..440e7f3d 100644 --- a/gh-pages-template/index.html +++ b/gh-pages-template/index.html @@ -701,7 +701,7 @@ target="_blank"> Patreon Date: Thu, 5 Sep 2024 09:00:34 -0400 Subject: [PATCH 12/21] chore(l10n): update translations (#3106) --- src_assets/common/assets/web/public/assets/locale/zh.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src_assets/common/assets/web/public/assets/locale/zh.json b/src_assets/common/assets/web/public/assets/locale/zh.json index d1f1a460..e8753316 100644 --- a/src_assets/common/assets/web/public/assets/locale/zh.json +++ b/src_assets/common/assets/web/public/assets/locale/zh.json @@ -52,7 +52,7 @@ "env_client_fps": "客户端请求的帧率 (int)", "env_client_gcmap": "客户端请求的游戏手柄掩码,采用 bitset/bitfield 格式 (int)", "env_client_hdr": "HDR 已被客户端启用 (true/false)", - "env_client_height": "客户端请求的分辨率的高度 (int)", + "env_client_height": "客户端请求的高度 (int)", "env_client_host_audio": "客户端请求在主机播放声音 (true/false)", "env_client_width": "客户端请求的分辨率的宽度 (int)", "env_displayplacer_example": "示例 - 使用 displayplacer 自动更改分辨率:", @@ -74,7 +74,7 @@ "output_desc": "存储命令输出的文件,如果未指定,输出将被忽略", "output_name": "输出", "run_as_desc": "这可能是某些需要管理员权限才能正常运行的应用程序所必需的。", - "wait_all": "继续串流直到所有应用进程终止", + "wait_all": "继续串流直到所有应用进程退出", "wait_all_desc": "这将继续串流直到应用程序启动的所有进程终止。 当未选中时,串流将在初始应用进程终止时停止,即使其他应用进程仍在运行。", "working_dir": "工作目录", "working_dir_desc": "应传递给进程的工作目录。例如,某些应用程序使用工作目录搜索配置文件。如果不设置,Sunshine 将默认使用命令的父目录" @@ -166,7 +166,7 @@ "file_state_desc": "Sunshine 保存当前状态的文件", "gamepad": "模拟游戏手柄类型", "gamepad_auto": "自动选择选项", - "gamepad_desc": "选择要在主机上模拟的游戏手柄类型", + "gamepad_desc": "选择要在主机上模拟的游戏手表类型", "gamepad_ds4": "DS4 (PS4)", "gamepad_ds5": "DS5 (PS5)", "gamepad_switch": "Nintendo Pro (Switch)", @@ -273,7 +273,7 @@ "port_web_ui": "Web UI", "qp": "量化参数 (QP)", "qp_desc": "某些设备可能不支持恒定码率。对于这些设备,则使用 QP 代替。数值越大,压缩率越高,但质量越差。", - "qsv_coder": "QuickSync Coder (H264)", + "qsv_coder": "QSV 编码器 (H264)", "qsv_preset": "QSV 编码器预设", "qsv_preset_fast": "fast - 较快(较低质量)", "qsv_preset_faster": "faster - 更快(更低质量)", From a0dfdedbb65891fd74fe968c553f2e34d39bfda3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:18:01 +0000 Subject: [PATCH 13/21] build(deps): bump third-party/wayland-protocols from `24e612f` to `4878e02` (#3120) build(deps): bump third-party/wayland-protocols Bumps third-party/wayland-protocols from `24e612f` to `4878e02`. --- updated-dependencies: - dependency-name: third-party/wayland-protocols dependency-type: direct:production ... 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 24e612f7..df2b5e5e 160000 --- a/third-party/wayland-protocols +++ b/third-party/wayland-protocols @@ -1 +1 @@ -Subproject commit 24e612f7d735c014c28e3934440c90c240b3bb9a +Subproject commit df2b5e5e7b507515a54e5f5f3b410da5dc05d690 From 972fbd2ffea9b3d6953dfe36eb4f8dc844c69338 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:51:08 -0400 Subject: [PATCH 14/21] build(deps): bump peter-evans/create-pull-request from 6 to 7 (#3128) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/localize.yml | 2 +- .github/workflows/update-pacman-repo.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index da0997a3..a0c3738e 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -77,7 +77,7 @@ jobs: run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - name: Create/Update Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: add-paths: | locale/*.po diff --git a/.github/workflows/update-pacman-repo.yml b/.github/workflows/update-pacman-repo.yml index 328833a8..946bf07f 100644 --- a/.github/workflows/update-pacman-repo.yml +++ b/.github/workflows/update-pacman-repo.yml @@ -94,7 +94,7 @@ jobs: steps.check.outputs.hasTopic == 'true'&& steps.check.outputs.isLatestRelease == 'true' && fromJson(steps.download.outputs.downloaded_files)[0] - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: add-paths: | pkgbuilds/* From 87f0c27aeb80d62144236f85f98016c21ddee94d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:01:38 -0400 Subject: [PATCH 15/21] build(deps): bump vue from 3.4.38 to 3.5.2 (#3146) Bumps [vue](https://github.com/vuejs/core) from 3.4.38 to 3.5.2. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/core/compare/v3.4.38...v3.5.2) --- updated-dependencies: - dependency-name: vue dependency-type: direct:production update-type: version-update:semver-minor ... 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 b4332c3a..f7abd541 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "bootstrap": "5.3.3", "vite": "4.5.2", "vite-plugin-ejs": "1.6.4", - "vue": "3.4.38", + "vue": "3.5.2", "vue-i18n": "9.14.0" } } From cdc2d1ba00c007d2452f2d02dd64450c131b8858 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:52:46 -0400 Subject: [PATCH 16/21] fix(ui-apps): update game db url (#3148) --- src_assets/common/assets/web/apps.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 9a8c65d1..7e156e77 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -481,14 +481,17 @@ return Promise.resolve([]); } let searchName = name.replaceAll(/\s+/g, '.').toLowerCase(); + + // Use raw.githubusercontent.com to avoid CORS issues as we migrate the CNAME + let dbUrl = "https://raw.githubusercontent.com/LizardByte/GameDB/gh-pages"; let bucket = getSearchBucket(name); - return fetch("https://db.lizardbyte.dev/buckets/" + bucket + ".json").then(function (r) { + return fetch(`${dbUrl}/buckets/${bucket}.json`).then(function (r) { if (!r.ok) throw new Error("Failed to search covers"); return r.json(); }).then(maps => Promise.all(Object.keys(maps).map(id => { let item = maps[id]; if (item.name.replaceAll(/\s+/g, '.').toLowerCase().startsWith(searchName)) { - return fetch("https://db.lizardbyte.dev/games/" + id + ".json").then(function (r) { + return fetch(`${dbUrl}/games/${id}.json`).then(function (r) { return r.json(); }).catch(() => null); } From e33dea7e3e509c6aa9bfa60a9222403b429efa07 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:31:00 -0400 Subject: [PATCH 17/21] feat(web): use shared-web (#3116) --- package.json | 12 ++++++------ src_assets/common/assets/web/Navbar.vue | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f7abd541..fee609c7 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "dev": "vite build --watch" }, "dependencies": { - "@fortawesome/fontawesome-free": "6.6.0", - "@popperjs/core": "2.11.8", - "@vitejs/plugin-vue": "4.6.2", - "bootstrap": "5.3.3", - "vite": "4.5.2", - "vite-plugin-ejs": "1.6.4", + "@lizardbyte/shared-web": "2024.901.195233", "vue": "3.5.2", "vue-i18n": "9.14.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "4.6.2", + "vite": "4.5.2", + "vite-plugin-ejs": "1.6.4" } } diff --git a/src_assets/common/assets/web/Navbar.vue b/src_assets/common/assets/web/Navbar.vue index 838c630f..2358750b 100644 --- a/src_assets/common/assets/web/Navbar.vue +++ b/src_assets/common/assets/web/Navbar.vue @@ -39,6 +39,7 @@ From 49b243330155a62df4b327eed0d45c72060f5ca3 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:43:42 -0400 Subject: [PATCH 18/21] ci(windows): fix typo in publisher name (#3154) --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e91ce9f3..3e31ee4c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1107,7 +1107,7 @@ jobs: -DBUILD_WERROR=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DSUNSHINE_ASSETS_DIR=assets \ - -DSUNSHINE_PUBLSIHER_NAME='${{ github.repository_owner }}' \ + -DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \ -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \ -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' \ -DTESTS_SOFTWARE_ENCODER_UNAVAILABLE='skip' From 8c218b576ee026d8e2a9836a5b0b35377cbf1234 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Sep 2024 19:56:25 -0400 Subject: [PATCH 19/21] build(deps): bump vue from 3.5.2 to 3.5.3 (#3150) Bumps [vue](https://github.com/vuejs/core) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/core/compare/v3.5.2...v3.5.3) --- updated-dependencies: - dependency-name: vue dependency-type: direct:production update-type: version-update:semver-patch ... 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 fee609c7..a379c67e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ }, "dependencies": { "@lizardbyte/shared-web": "2024.901.195233", - "vue": "3.5.2", + "vue": "3.5.3", "vue-i18n": "9.14.0" }, "devDependencies": { From 330ab76fcf2faa7b49a1ce2a171094d2088c5698 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 9 Sep 2024 19:44:46 -0400 Subject: [PATCH 20/21] build(cmake): fix typo in publisher name variable (#3158) --- packaging/linux/Arch/PKGBUILD | 2 +- packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml | 2 +- packaging/macos/Portfile | 2 +- packaging/sunshine.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index e8eb8521..135e88a8 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -84,7 +84,7 @@ build() { -D CMAKE_INSTALL_PREFIX=/usr \ -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ -D SUNSHINE_ASSETS_DIR="share/sunshine" \ - -D SUNSHINE_PUBLSIHER_NAME='LizardByte' \ + -D SUNSHINE_PUBLISHER_NAME='LizardByte' \ -D SUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \ -D SUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' diff --git a/packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml b/packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml index f5e90739..156b40c5 100644 --- a/packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml +++ b/packaging/linux/flatpak/dev.lizardbyte.app.Sunshine.yml @@ -77,7 +77,7 @@ modules: - -DSUNSHINE_ENABLE_X11=ON - -DSUNSHINE_ENABLE_DRM=ON - -DSUNSHINE_ENABLE_CUDA=ON - - -DSUNSHINE_PUBLSIHER_NAME='LizardByte' + - -DSUNSHINE_PUBLISHER_NAME='LizardByte' -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' sources: diff --git a/packaging/macos/Portfile b/packaging/macos/Portfile index a2a9eb5e..8c48d31e 100644 --- a/packaging/macos/Portfile +++ b/packaging/macos/Portfile @@ -44,7 +44,7 @@ configure.args -DBOOST_USE_STATIC=ON \ -DBUILD_WERROR=ON \ -DCMAKE_INSTALL_PREFIX=${prefix} \ -DSUNSHINE_ASSETS_DIR=etc/sunshine/assets \ - -DSUNSHINE_PUBLSIHER_NAME='LizardByte' \ + -DSUNSHINE_PUBLISHER_NAME='LizardByte' \ -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \ -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index a8d9a661..7f01d155 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -71,7 +71,7 @@ class @PROJECT_NAME@ < Formula -DSUNSHINE_ASSETS_DIR=sunshine/assets -DSUNSHINE_BUILD_HOMEBREW=ON -DSUNSHINE_ENABLE_TRAY=OFF - -DSUNSHINE_PUBLSIHER_NAME='LizardByte' + -DSUNSHINE_PUBLISHER_NAME='LizardByte' -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' ] From fd7e68457a134102d1b30af5796c79f2aa623224 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 9 Sep 2024 19:13:54 -0500 Subject: [PATCH 21/21] Merge commit from fork PR #2042 introduced another location for storing authorized clients but did not correctly consider how the load/store logic should differ for those places. One location (named_devices) could contain clients which had not completed pairing, while the other (certs) had only fully paired clients. Despite differences in trust level of clients in each list, the logic for loading/saving config treated them identically. The result is that clients that had not successfully completed pairing would be treated as fully paired after a state reload. Fix this state confusion by consolidating to a single location for authorized client state and ensuring it only contains information on fully paired clients. --- src/nvhttp.cpp | 50 +++++++++++--------------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index 8b610a4c..7eec1100 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -142,7 +142,6 @@ namespace nvhttp { }; struct client_t { - std::vector certs; std::vector named_devices; }; @@ -150,6 +149,7 @@ namespace nvhttp { struct { std::string uniqueID; std::string cert; + std::string name; } client; std::unique_ptr cipher_key; @@ -277,7 +277,6 @@ namespace nvhttp { named_cert.cert = el.get_value(); named_cert.uuid = uuid_util::uuid_t::generate().string(); client.named_devices.emplace_back(named_cert); - client.certs.emplace_back(named_cert.cert); } } } @@ -290,15 +289,11 @@ namespace nvhttp { named_cert.cert = el.get_child("cert").get_value(); named_cert.uuid = el.get_child("uuid").get_value(); client.named_devices.emplace_back(named_cert); - client.certs.emplace_back(named_cert.cert); } } // Empty certificate chain and import certs from file cert_chain.clear(); - for (auto &cert : client.certs) { - cert_chain.add(crypto::x509(cert)); - } for (auto &named_cert : client.named_devices) { cert_chain.add(crypto::x509(named_cert.cert)); } @@ -307,17 +302,13 @@ namespace nvhttp { } void - update_id_client(const std::string &uniqueID, std::string &&cert, op_e op) { - switch (op) { - case op_e::ADD: { - client_t &client = client_root; - client.certs.emplace_back(std::move(cert)); - } break; - case op_e::REMOVE: - client_t client; - client_root = client; - break; - } + add_authorized_client(const std::string &name, std::string &&cert) { + client_t &client = client_root; + named_cert_t named_cert; + named_cert.name = name; + named_cert.cert = std::move(cert); + named_cert.uuid = uuid_util::uuid_t::generate().string(); + client.named_devices.emplace_back(named_cert); if (!config::sunshine.flags[config::flag::FRESH_STATE]) { save_state(); @@ -485,9 +476,9 @@ namespace nvhttp { tree.put("root.paired", 1); add_cert->raise(crypto::x509(client.cert)); + // The client is now successfully paired and will be authorized to connect auto it = map_id_sess.find(client.uniqueID); - - update_id_client(client.uniqueID, std::move(client.cert), op_e::ADD); + add_authorized_client(client.name, std::move(client.cert)); map_id_sess.erase(it); } else { @@ -654,14 +645,7 @@ namespace nvhttp { auto &sess = std::begin(map_id_sess)->second; getservercert(sess, tree, pin); - - // set up named cert - client_t &client = client_root; - named_cert_t named_cert; - named_cert.name = name; - named_cert.cert = sess.client.cert; - named_cert.uuid = uuid_util::uuid_t::generate().string(); - client.named_devices.emplace_back(named_cert); + sess.client.name = name; // response to the request for pin std::ostringstream data; @@ -1191,18 +1175,6 @@ namespace nvhttp { client_t &client = client_root; for (auto it = client.named_devices.begin(); it != client.named_devices.end();) { if ((*it).uuid == uuid) { - // Find matching cert and remove it - for (auto cert = client.certs.begin(); cert != client.certs.end();) { - if ((*cert) == (*it).cert) { - cert = client.certs.erase(cert); - removed++; - } - else { - ++cert; - } - } - - // And then remove the named cert it = client.named_devices.erase(it); removed++; }