summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/templates/merge-private.yml4
-rw-r--r--.ci/templates/merge.yml4
-rw-r--r--.ci/yuzu-mainline-step2.yml2
-rw-r--r--.ci/yuzu-patreon-step2.yml2
-rw-r--r--.travis.yml59
-rwxr-xr-x.travis/clang-format/build.sh3
-rwxr-xr-x.travis/clang-format/deps.sh3
-rwxr-xr-x.travis/clang-format/docker.sh5
-rwxr-xr-x.travis/clang-format/script.sh37
-rwxr-xr-x.travis/common/post-upload.sh25
-rwxr-xr-x.travis/common/pre-upload.sh6
-rw-r--r--.travis/common/travis-ci.env18
-rwxr-xr-x.travis/linux-mingw/build.sh3
-rwxr-xr-x.travis/linux-mingw/deps.sh3
-rwxr-xr-x.travis/linux-mingw/docker.sh42
-rw-r--r--.travis/linux-mingw/scan_dll.py106
-rwxr-xr-x.travis/linux-mingw/upload.sh13
-rwxr-xr-x.travis/linux/build.sh4
-rwxr-xr-x.travis/linux/deps.sh3
-rwxr-xr-x.travis/linux/docker.sh11
-rwxr-xr-x.travis/linux/upload.sh14
-rwxr-xr-x.travis/macos/build.sh17
-rwxr-xr-x.travis/macos/deps.sh6
-rwxr-xr-x.travis/macos/upload.sh28
-rw-r--r--src/common/fs/path_util.cpp27
-rw-r--r--src/core/hle/service/am/applets/applet_web_browser.cpp10
-rw-r--r--src/video_core/command_classes/codecs/h264.cpp7
-rw-r--r--src/video_core/command_classes/vic.cpp260
-rw-r--r--src/video_core/command_classes/vic.h20
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp4
-rw-r--r--src/yuzu/debugger/profiler.cpp12
-rw-r--r--src/yuzu/game_list.cpp3
32 files changed, 209 insertions, 552 deletions
diff --git a/.ci/templates/merge-private.yml b/.ci/templates/merge-private.yml
index f15a74355..c74561c46 100644
--- a/.ci/templates/merge-private.yml
+++ b/.ci/templates/merge-private.yml
@@ -1,6 +1,8 @@
1jobs: 1jobs:
2- job: merge 2- job: merge
3 displayName: 'pull requests' 3 displayName: 'pull requests'
4 pool:
5 vmImage: 'ubuntu-latest'
4 steps: 6 steps:
5 - checkout: self 7 - checkout: self
6 submodules: recursive 8 submodules: recursive
@@ -24,6 +26,8 @@ jobs:
24- job: upload_source 26- job: upload_source
25 displayName: 'upload' 27 displayName: 'upload'
26 dependsOn: merge 28 dependsOn: merge
29 pool:
30 vmImage: 'ubuntu-latest'
27 steps: 31 steps:
28 - template: ./sync-source.yml 32 - template: ./sync-source.yml
29 parameters: 33 parameters:
diff --git a/.ci/templates/merge.yml b/.ci/templates/merge.yml
index 460dfa1c1..27c36e162 100644
--- a/.ci/templates/merge.yml
+++ b/.ci/templates/merge.yml
@@ -1,6 +1,8 @@
1jobs: 1jobs:
2- job: merge 2- job: merge
3 displayName: 'pull requests' 3 displayName: 'pull requests'
4 pool:
5 vmImage: 'ubuntu-latest'
4 steps: 6 steps:
5 - checkout: self 7 - checkout: self
6 submodules: recursive 8 submodules: recursive
@@ -23,6 +25,8 @@ jobs:
23- job: upload_source 25- job: upload_source
24 displayName: 'upload' 26 displayName: 'upload'
25 dependsOn: merge 27 dependsOn: merge
28 pool:
29 vmImage: 'ubuntu-latest'
26 steps: 30 steps:
27 - template: ./sync-source.yml 31 - template: ./sync-source.yml
28 parameters: 32 parameters:
diff --git a/.ci/yuzu-mainline-step2.yml b/.ci/yuzu-mainline-step2.yml
index 3159ce3ed..91e21a126 100644
--- a/.ci/yuzu-mainline-step2.yml
+++ b/.ci/yuzu-mainline-step2.yml
@@ -66,5 +66,7 @@ stages:
66 jobs: 66 jobs:
67 - job: github 67 - job: github
68 displayName: 'github' 68 displayName: 'github'
69 pool:
70 vmImage: ubuntu-latest
69 steps: 71 steps:
70 - template: ./templates/release-github.yml 72 - template: ./templates/release-github.yml
diff --git a/.ci/yuzu-patreon-step2.yml b/.ci/yuzu-patreon-step2.yml
index 3f338e2a0..ad61ac74e 100644
--- a/.ci/yuzu-patreon-step2.yml
+++ b/.ci/yuzu-patreon-step2.yml
@@ -29,5 +29,7 @@ stages:
29 jobs: 29 jobs:
30 - job: release 30 - job: release
31 displayName: 'source' 31 displayName: 'source'
32 pool:
33 vmImage: 'ubuntu-latest'
32 steps: 34 steps:
33 - template: ./templates/release-private-tag.yml 35 - template: ./templates/release-private-tag.yml
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 93fda1dfa..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,59 +0,0 @@
1language: cpp
2matrix:
3 include:
4 - os: linux
5 env: NAME="clang-format"
6 sudo: required
7 dist: trusty
8 services: docker
9 install: "./.travis/clang-format/deps.sh"
10 script: "./.travis/clang-format/build.sh"
11 - os: linux
12 env: NAME="linux build"
13 sudo: required
14 dist: trusty
15 services: docker
16 addons:
17 apt:
18 packages:
19 - p7zip-full
20 install: "./.travis/linux/deps.sh"
21 script: "./.travis/linux/build.sh"
22 after_success: "./.travis/linux/upload.sh"
23 cache: ccache
24 - os: osx
25 env: NAME="macos build"
26 sudo: false
27 osx_image: xcode10.2
28 install: "./.travis/macos/deps.sh"
29 script: "./.travis/macos/build.sh"
30 after_success: "./.travis/macos/upload.sh"
31 cache: ccache
32 - os: linux
33 env: NAME="MinGW build"
34 sudo: required
35 dist: trusty
36 services: docker
37 addons:
38 apt:
39 packages:
40 - p7zip-full
41 install: "./.travis/linux-mingw/deps.sh"
42 script: "./.travis/linux-mingw/build.sh"
43 after_success: "./.travis/linux-mingw/upload.sh"
44 cache: ccache
45
46deploy:
47 provider: releases
48 api_key:
49 secure: ElsIAlbvVXBNKsP31nVPysh+mf0GQA4DiL/y5iJeQxKQYR6iRoNo+RfzOBmdswdo0bE/PGeBAlfzCkp15gjhWf6Je0N6dRpczmcmLq6SSQFn1Mpq00xMJB2AgQIlaHs6KFgoUA173EBKbPwgU/NubTFpJFm/Wa+NcSWAHQXKL9KT2M3qKpxNkPl3mKEVsbch4REP+T/46vsa+ikw0VE0kIs6V93LqUQZpI2F0Dhihx8Cxr5iedkE1QsNK+QSX9iItMHbfek9OH980gP7L3lkZltyAA1Pk0c37OAgz2PwczwNKwCT8jg9PMzdcKmWouvLyAkZFuA806ElzwHY3oEd91Zm6+Bk5n24yBKZ9027AZzw38NK2Z2m9Akb8+ar8PdsKU6N5pDutX9qSLayr0oMgJ0s7/xnGBGdL3gfkPCFc50xO/2DxlsOR+zAhPNM9Y76hhGy6A7/40+9uzrJvd4nAuDvIXRzi2Yl2L7mKBE4suMKbFLtk2LlgM0qY5JMVTQ8NliaEtqopfPur2KWFVJUpWDNLtNX8xGqhfwg7cLjIiGmnxSaJBTDuZI6dpEjkWkU0n1xYhGqEqit8DbehYzazozMJ+Vsr8hku7jGlUtlw+U6HG1e19O2y4aGeSwYPROcCNz+BLwmVM8oZE3Roy3qoaa2yiFf+sy6rUHznrhsfEM=
50 file_glob: true
51 file: "artifacts/*"
52 skip_cleanup: true
53 on:
54 tags: true
55
56notifications:
57 webhooks:
58 urls:
59 - https://api.yuzu-emu.org/code/travis/notify
diff --git a/.travis/clang-format/build.sh b/.travis/clang-format/build.sh
deleted file mode 100755
index 36c276c43..000000000
--- a/.travis/clang-format/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/bash -ex
2
3docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.travis/clang-format/docker.sh
diff --git a/.travis/clang-format/deps.sh b/.travis/clang-format/deps.sh
deleted file mode 100755
index a15d164c7..000000000
--- a/.travis/clang-format/deps.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/sh -ex
2
3docker pull citraemu/build-environments:linux-clang-format
diff --git a/.travis/clang-format/docker.sh b/.travis/clang-format/docker.sh
deleted file mode 100755
index b519ab40e..000000000
--- a/.travis/clang-format/docker.sh
+++ /dev/null
@@ -1,5 +0,0 @@
1#!/bin/bash -ex
2
3# Run clang-format
4cd /yuzu
5./.travis/clang-format/script.sh
diff --git a/.travis/clang-format/script.sh b/.travis/clang-format/script.sh
deleted file mode 100755
index 56a785fe0..000000000
--- a/.travis/clang-format/script.sh
+++ /dev/null
@@ -1,37 +0,0 @@
1#!/bin/bash -ex
2
3if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \
4 dist/*.svg dist/*.xml; then
5 echo Trailing whitespace found, aborting
6 exit 1
7fi
8
9# Default clang-format points to default 3.5 version one
10CLANG_FORMAT=clang-format-10.0
11$CLANG_FORMAT --version
12
13if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
14 # Get list of every file modified in this pull request
15 files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)"
16else
17 # Check everything for branch pushes
18 files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
19fi
20
21# Turn off tracing for this because it's too verbose
22set +x
23
24for f in $files_to_lint; do
25 d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true)
26 if ! [ -z "$d" ]; then
27 echo "!!! $f not compliant to coding style, here is the fix:"
28 echo "$d"
29 fail=1
30 fi
31done
32
33set -x
34
35if [ "$fail" = 1 ]; then
36 exit 1
37fi
diff --git a/.travis/common/post-upload.sh b/.travis/common/post-upload.sh
deleted file mode 100755
index 28735a9cf..000000000
--- a/.travis/common/post-upload.sh
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/bin/bash -ex
2
3# Copy documentation
4cp license.txt "$REV_NAME"
5cp README.md "$REV_NAME"
6
7tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"
8
9# Find out what release we are building
10if [ -z $TRAVIS_TAG ]; then
11 RELEASE_NAME=head
12else
13 RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1)
14 if [ "$NAME" = "MinGW build" ]; then
15 RELEASE_NAME="${RELEASE_NAME}-mingw"
16 fi
17fi
18
19mv "$REV_NAME" $RELEASE_NAME
20
217z a "$REV_NAME.7z" $RELEASE_NAME
22
23# move the compiled archive into the artifacts directory to be uploaded by travis releases
24mv "$ARCHIVE_NAME" artifacts/
25mv "$REV_NAME.7z" artifacts/
diff --git a/.travis/common/pre-upload.sh b/.travis/common/pre-upload.sh
deleted file mode 100755
index 3c2fc79a2..000000000
--- a/.travis/common/pre-upload.sh
+++ /dev/null
@@ -1,6 +0,0 @@
1#!/bin/bash -ex
2
3GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
4GITREV="`git show -s --format='%h'`"
5
6mkdir -p artifacts
diff --git a/.travis/common/travis-ci.env b/.travis/common/travis-ci.env
deleted file mode 100644
index cffeb2e2b..000000000
--- a/.travis/common/travis-ci.env
+++ /dev/null
@@ -1,18 +0,0 @@
1# List of environment variables to be shared with Docker containers
2CI
3TRAVIS
4CONTINUOUS_INTEGRATION
5TRAVIS_BRANCH
6TRAVIS_BUILD_ID
7TRAVIS_BUILD_NUMBER
8TRAVIS_COMMIT
9TRAVIS_COMMIT_RANGE
10TRAVIS_EVENT_TYPE
11TRAVIS_JOB_ID
12TRAVIS_JOB_NUMBER
13TRAVIS_REPO_SLUG
14TRAVIS_TAG
15
16# yuzu specific flags
17ENABLE_COMPATIBILITY_REPORTING
18USE_DISCORD_PRESENCE
diff --git a/.travis/linux-mingw/build.sh b/.travis/linux-mingw/build.sh
deleted file mode 100755
index b12d70b12..000000000
--- a/.travis/linux-mingw/build.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/bash -ex
2mkdir "$HOME/.ccache" || true
3docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.travis/linux-mingw/docker.sh
diff --git a/.travis/linux-mingw/deps.sh b/.travis/linux-mingw/deps.sh
deleted file mode 100755
index 55b5d6006..000000000
--- a/.travis/linux-mingw/deps.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/sh -ex
2
3docker pull yuzuemu/build-environments:linux-mingw
diff --git a/.travis/linux-mingw/docker.sh b/.travis/linux-mingw/docker.sh
deleted file mode 100755
index 80d7dfe9b..000000000
--- a/.travis/linux-mingw/docker.sh
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/bash -ex
2
3cd /yuzu
4# override Travis CI unreasonable ccache size
5echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf"
6
7mkdir build && cd build
8cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release
9ninja
10
11# Clean up the dirty hacks
12rm /bin/uname && mv /bin/uname1 /bin/uname
13rm /bin/cmd
14
15ccache -s
16
17echo "Tests skipped"
18#ctest -VV -C Release
19
20echo 'Prepare binaries...'
21cd ..
22mkdir package
23
24QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/'
25find build/ -name "yuzu*.exe" -exec cp {} 'package' \;
26
27# copy Qt plugins
28mkdir package/platforms
29cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
30cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
31cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
32rm -f package/mediaservice/*d.dll
33
34for i in package/*.exe; do
35 # we need to process pdb here, however, cv2pdb
36 # does not work here, so we just simply strip all the debug symbols
37 x86_64-w64-mingw32-strip "${i}"
38done
39
40pip3 install pefile
41python3 .travis/linux-mingw/scan_dll.py package/*.exe "package/"
42python3 .travis/linux-mingw/scan_dll.py package/imageformats/*.dll "package/"
diff --git a/.travis/linux-mingw/scan_dll.py b/.travis/linux-mingw/scan_dll.py
deleted file mode 100644
index 163183f2e..000000000
--- a/.travis/linux-mingw/scan_dll.py
+++ /dev/null
@@ -1,106 +0,0 @@
1import pefile
2import sys
3import re
4import os
5import queue
6import shutil
7
8# constant definitions
9KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL',
10 'DWMAPI.DLL', 'UXTHEME.DLL', 'DNSAPI.DLL', 'IPHLPAPI.DLL']
11# below is for Ubuntu 18.04 with specified PPA enabled, if you are using
12# other distro or different repositories, change the following accordingly
13DLL_PATH = [
14 '/usr/x86_64-w64-mingw32/bin/',
15 '/usr/x86_64-w64-mingw32/lib/',
16 '/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/'
17]
18
19missing = []
20
21
22def parse_imports(file_name):
23 results = []
24 pe = pefile.PE(file_name, fast_load=True)
25 pe.parse_data_directories()
26
27 for entry in pe.DIRECTORY_ENTRY_IMPORT:
28 current = entry.dll.decode()
29 current_u = current.upper() # b/c Windows is often case insensitive
30 # here we filter out system dlls
31 # dll w/ names like *32.dll are likely to be system dlls
32 if current_u.upper() not in KNOWN_SYS_DLLS and not re.match(string=current_u, pattern=r'.*32\.DLL'):
33 results.append(current)
34
35 return results
36
37
38def parse_imports_recursive(file_name, path_list=[]):
39 q = queue.Queue() # create a FIFO queue
40 # file_name can be a string or a list for the convience
41 if isinstance(file_name, str):
42 q.put(file_name)
43 elif isinstance(file_name, list):
44 for i in file_name:
45 q.put(i)
46 full_list = []
47 while q.qsize():
48 current = q.get_nowait()
49 print('> %s' % current)
50 deps = parse_imports(current)
51 # if this dll does not have any import, ignore it
52 if not deps:
53 continue
54 for dep in deps:
55 # the dependency already included in the list, skip
56 if dep in full_list:
57 continue
58 # find the requested dll in the provided paths
59 full_path = find_dll(dep)
60 if not full_path:
61 missing.append(dep)
62 continue
63 full_list.append(dep)
64 q.put(full_path)
65 path_list.append(full_path)
66 return full_list
67
68
69def find_dll(name):
70 for path in DLL_PATH:
71 for root, _, files in os.walk(path):
72 for f in files:
73 if name.lower() == f.lower():
74 return os.path.join(root, f)
75
76
77def deploy(name, dst, dry_run=False):
78 dlls_path = []
79 parse_imports_recursive(name, dlls_path)
80 for dll_entry in dlls_path:
81 if not dry_run:
82 shutil.copy(dll_entry, dst)
83 else:
84 print('[Dry-Run] Copy %s to %s' % (dll_entry, dst))
85 print('Deploy completed.')
86 return dlls_path
87
88
89def main():
90 if len(sys.argv) < 3:
91 print('Usage: %s [files to examine ...] [target deploy directory]')
92 return 1
93 to_deploy = sys.argv[1:-1]
94 tgt_dir = sys.argv[-1]
95 if not os.path.isdir(tgt_dir):
96 print('%s is not a directory.' % tgt_dir)
97 return 1
98 print('Scanning dependencies...')
99 deploy(to_deploy, tgt_dir)
100 if missing:
101 print('Following DLLs are not found: %s' % ('\n'.join(missing)))
102 return 0
103
104
105if __name__ == '__main__':
106 main()
diff --git a/.travis/linux-mingw/upload.sh b/.travis/linux-mingw/upload.sh
deleted file mode 100755
index 66e896bc4..000000000
--- a/.travis/linux-mingw/upload.sh
+++ /dev/null
@@ -1,13 +0,0 @@
1#!/bin/bash -ex
2
3. .travis/common/pre-upload.sh
4
5REV_NAME="yuzu-windows-mingw-${GITDATE}-${GITREV}"
6ARCHIVE_NAME="${REV_NAME}.tar.gz"
7COMPRESSION_FLAGS="-czvf"
8
9mkdir "$REV_NAME"
10# get around the permission issues
11cp -r package/* "$REV_NAME"
12
13. .travis/common/post-upload.sh
diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh
deleted file mode 100755
index 0c7fb8c9d..000000000
--- a/.travis/linux/build.sh
+++ /dev/null
@@ -1,4 +0,0 @@
1#!/bin/bash -ex
2
3mkdir -p "$HOME/.ccache"
4docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/home/yuzu/.ccache yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.travis/linux/docker.sh
diff --git a/.travis/linux/deps.sh b/.travis/linux/deps.sh
deleted file mode 100755
index 8d23c517d..000000000
--- a/.travis/linux/deps.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/sh -ex
2
3docker pull yuzuemu/build-environments:linux-fresh
diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh
deleted file mode 100755
index 166fb6d4c..000000000
--- a/.travis/linux/docker.sh
+++ /dev/null
@@ -1,11 +0,0 @@
1#!/bin/bash -ex
2
3cd /yuzu
4
5mkdir build && cd build
6cmake .. -G Ninja -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON
7ninja
8
9ccache -s
10
11ctest -VV -C Release
diff --git a/.travis/linux/upload.sh b/.travis/linux/upload.sh
deleted file mode 100755
index 61842be12..000000000
--- a/.travis/linux/upload.sh
+++ /dev/null
@@ -1,14 +0,0 @@
1#!/bin/bash -ex
2
3. .travis/common/pre-upload.sh
4
5REV_NAME="yuzu-linux-${GITDATE}-${GITREV}"
6ARCHIVE_NAME="${REV_NAME}.tar.xz"
7COMPRESSION_FLAGS="-cJvf"
8
9mkdir "$REV_NAME"
10
11cp build/bin/yuzu-cmd "$REV_NAME"
12cp build/bin/yuzu "$REV_NAME"
13
14. .travis/common/post-upload.sh
diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh
deleted file mode 100755
index db1c7cae7..000000000
--- a/.travis/macos/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
1#!/bin/bash -ex
2
3set -o pipefail
4
5export MACOSX_DEPLOYMENT_TARGET=10.14
6export Qt5_DIR=$(brew --prefix)/opt/qt5
7export PATH="/usr/local/opt/ccache/libexec:$PATH"
8
9# TODO: Build using ninja instead of make
10mkdir build && cd build
11cmake --version
12cmake .. -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DUSE_DISCORD_PRESENCE=ON
13make -j4
14
15ccache -s
16
17ctest -VV -C Release
diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh
deleted file mode 100755
index faeafa216..000000000
--- a/.travis/macos/deps.sh
+++ /dev/null
@@ -1,6 +0,0 @@
1#!/bin/sh -ex
2
3brew update
4brew install p7zip qt5 sdl2 ccache
5brew outdated cmake || brew upgrade cmake
6pip3 install macpack
diff --git a/.travis/macos/upload.sh b/.travis/macos/upload.sh
deleted file mode 100755
index c2f43a906..000000000
--- a/.travis/macos/upload.sh
+++ /dev/null
@@ -1,28 +0,0 @@
1#!/bin/bash -ex
2
3. .travis/common/pre-upload.sh
4
5REV_NAME="yuzu-osx-${GITDATE}-${GITREV}"
6ARCHIVE_NAME="${REV_NAME}.tar.gz"
7COMPRESSION_FLAGS="-czvf"
8
9mkdir "$REV_NAME"
10
11cp build/bin/yuzu-cmd "$REV_NAME"
12cp -r build/bin/yuzu.app "$REV_NAME"
13
14# move libs into folder for deployment
15macpack "${REV_NAME}/yuzu.app/Contents/MacOS/yuzu" -d "../Frameworks"
16# move qt frameworks into app bundle for deployment
17$(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/yuzu.app" -executable="${REV_NAME}/yuzu.app/Contents/MacOS/yuzu"
18
19# move libs into folder for deployment
20macpack "${REV_NAME}/yuzu-cmd" -d "libs"
21
22# Make the launching script executable
23chmod +x ${REV_NAME}/yuzu.app/Contents/MacOS/yuzu
24
25# Verify loader instructions
26find "$REV_NAME" -exec otool -L {} \;
27
28. .travis/common/post-upload.sh
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 43b79bd6d..1bcb897b5 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -82,32 +82,35 @@ public:
82 82
83private: 83private:
84 PathManagerImpl() { 84 PathManagerImpl() {
85 fs::path yuzu_path;
86 fs::path yuzu_path_cache;
87 fs::path yuzu_path_config;
88
85#ifdef _WIN32 89#ifdef _WIN32
86 auto yuzu_path = GetExeDirectory() / PORTABLE_DIR; 90 yuzu_path = GetExeDirectory() / PORTABLE_DIR;
87 91
88 if (!IsDir(yuzu_path)) { 92 if (!IsDir(yuzu_path)) {
89 yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; 93 yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR;
90 } 94 }
91 95
92 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 96 yuzu_path_cache = yuzu_path / CACHE_DIR;
93 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); 97 yuzu_path_config = yuzu_path / CONFIG_DIR;
94 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
95#else 98#else
96 auto yuzu_path = GetCurrentDir() / PORTABLE_DIR; 99 yuzu_path = GetCurrentDir() / PORTABLE_DIR;
97 100
98 if (Exists(yuzu_path) && IsDir(yuzu_path)) { 101 if (Exists(yuzu_path) && IsDir(yuzu_path)) {
99 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 102 yuzu_path_cache = yuzu_path / CACHE_DIR;
100 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); 103 yuzu_path_config = yuzu_path / CONFIG_DIR;
101 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
102 } else { 104 } else {
103 yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; 105 yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR;
104 106 yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR;
105 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 107 yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR;
106 GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR);
107 GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR);
108 } 108 }
109#endif 109#endif
110 110
111 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
112 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache);
113 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config);
111 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); 114 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR);
112 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); 115 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR);
113 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); 116 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR);
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp
index 35f194961..927eeefff 100644
--- a/src/core/hle/service/am/applets/applet_web_browser.cpp
+++ b/src/core/hle/service/am/applets/applet_web_browser.cpp
@@ -24,6 +24,7 @@
24#include "core/hle/service/am/applets/applet_web_browser.h" 24#include "core/hle/service/am/applets/applet_web_browser.h"
25#include "core/hle/service/filesystem/filesystem.h" 25#include "core/hle/service/filesystem/filesystem.h"
26#include "core/hle/service/ns/pl_u.h" 26#include "core/hle/service/ns/pl_u.h"
27#include "core/loader/loader.h"
27 28
28namespace Service::AM::Applets { 29namespace Service::AM::Applets {
29 30
@@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id,
122 const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); 123 const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type);
123 124
124 if (nca == nullptr) { 125 if (nca == nullptr) {
126 if (nca_type == FileSys::ContentRecordType::HtmlDocument) {
127 LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS.");
128 FileSys::VirtualFile romfs;
129 system.GetAppLoader().ReadManualRomFS(romfs);
130 if (romfs != nullptr) {
131 return romfs;
132 }
133 }
134
125 LOG_ERROR(Service_AM, 135 LOG_ERROR(Service_AM,
126 "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", 136 "NCA of type={} with title_id={:016X} is not found in the ContentProvider!",
127 nca_type, title_id); 137 nca_type, title_id);
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp
index 51ee14c13..5519c4705 100644
--- a/src/video_core/command_classes/codecs/h264.cpp
+++ b/src/video_core/command_classes/codecs/h264.cpp
@@ -20,6 +20,8 @@
20 20
21#include <array> 21#include <array>
22#include <bit> 22#include <bit>
23
24#include "common/settings.h"
23#include "video_core/command_classes/codecs/h264.h" 25#include "video_core/command_classes/codecs/h264.h"
24#include "video_core/gpu.h" 26#include "video_core/gpu.h"
25#include "video_core/memory_manager.h" 27#include "video_core/memory_manager.h"
@@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister
96 (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); 98 (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2);
97 99
98 // TODO (ameerj): Where do we get this number, it seems to be particular for each stream 100 // TODO (ameerj): Where do we get this number, it seems to be particular for each stream
99 writer.WriteUe(6); // Max number of reference frames 101 const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue();
102 const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU;
103 const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u;
104 writer.WriteUe(max_num_ref_frames);
100 writer.WriteBit(false); 105 writer.WriteBit(false);
101 writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); 106 writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1);
102 writer.WriteUe(pic_height - 1); 107 writer.WriteUe(pic_height - 1);
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index 0ee07f398..dc768b952 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -16,6 +16,7 @@ extern "C" {
16} 16}
17 17
18#include "common/assert.h" 18#include "common/assert.h"
19#include "common/bit_field.h"
19#include "common/logging/log.h" 20#include "common/logging/log.h"
20 21
21#include "video_core/command_classes/nvdec.h" 22#include "video_core/command_classes/nvdec.h"
@@ -26,6 +27,25 @@ extern "C" {
26#include "video_core/textures/decoders.h" 27#include "video_core/textures/decoders.h"
27 28
28namespace Tegra { 29namespace Tegra {
30namespace {
31enum class VideoPixelFormat : u64_le {
32 RGBA8 = 0x1f,
33 BGRA8 = 0x20,
34 RGBX8 = 0x23,
35 Yuv420 = 0x44,
36};
37} // Anonymous namespace
38
39union VicConfig {
40 u64_le raw{};
41 BitField<0, 7, VideoPixelFormat> pixel_format;
42 BitField<7, 2, u64_le> chroma_loc_horiz;
43 BitField<9, 2, u64_le> chroma_loc_vert;
44 BitField<11, 4, u64_le> block_linear_kind;
45 BitField<15, 4, u64_le> block_linear_height_log2;
46 BitField<32, 14, u64_le> surface_width_minus1;
47 BitField<46, 14, u64_le> surface_height_minus1;
48};
29 49
30Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) 50Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_)
31 : gpu(gpu_), 51 : gpu(gpu_),
@@ -65,134 +85,156 @@ void Vic::Execute() {
65 if (!frame) { 85 if (!frame) {
66 return; 86 return;
67 } 87 }
68 const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value()); 88 const u64 surface_width = config.surface_width_minus1 + 1;
69 switch (pixel_format) { 89 const u64 surface_height = config.surface_height_minus1 + 1;
90 if (static_cast<u64>(frame->width) != surface_width ||
91 static_cast<u64>(frame->height) > surface_height) {
92 // TODO: Properly support multiple video streams with differing frame dimensions
93 LOG_WARNING(Debug,
94 "Frame dimensions {}x{} can't be safely decoded into surface dimensions {}x{}",
95 frame->width, frame->height, surface_width, surface_height);
96 return;
97 }
98 switch (config.pixel_format) {
99 case VideoPixelFormat::RGBA8:
70 case VideoPixelFormat::BGRA8: 100 case VideoPixelFormat::BGRA8:
71 case VideoPixelFormat::RGBA8: { 101 case VideoPixelFormat::RGBX8:
72 LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); 102 WriteRGBFrame(frame, config);
103 break;
104 case VideoPixelFormat::Yuv420:
105 WriteYUVFrame(frame, config);
106 break;
107 default:
108 UNIMPLEMENTED_MSG("Unknown video pixel format {:X}", config.pixel_format.Value());
109 break;
110 }
111}
73 112
74 if (scaler_ctx == nullptr || frame->width != scaler_width || 113void Vic::WriteRGBFrame(const AVFrame* frame, const VicConfig& config) {
75 frame->height != scaler_height) { 114 LOG_TRACE(Service_NVDRV, "Writing RGB Frame");
76 const AVPixelFormat target_format = 115
77 (pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA; 116 if (!scaler_ctx || frame->width != scaler_width || frame->height != scaler_height) {
117 const AVPixelFormat target_format = [pixel_format = config.pixel_format]() {
118 switch (pixel_format) {
119 case VideoPixelFormat::RGBA8:
120 return AV_PIX_FMT_RGBA;
121 case VideoPixelFormat::BGRA8:
122 return AV_PIX_FMT_BGRA;
123 case VideoPixelFormat::RGBX8:
124 return AV_PIX_FMT_RGB0;
125 default:
126 return AV_PIX_FMT_RGBA;
127 }
128 }();
129
130 sws_freeContext(scaler_ctx);
131 // Frames are decoded into either YUV420 or NV12 formats. Convert to desired RGB format
132 scaler_ctx = sws_getContext(frame->width, frame->height,
133 static_cast<AVPixelFormat>(frame->format), frame->width,
134 frame->height, target_format, 0, nullptr, nullptr, nullptr);
135 scaler_width = frame->width;
136 scaler_height = frame->height;
137 converted_frame_buffer.reset();
138 }
139 // Get Converted frame
140 const u32 width = static_cast<u32>(frame->width);
141 const u32 height = static_cast<u32>(frame->height);
142 const std::size_t linear_size = width * height * 4;
143
144 // Only allocate frame_buffer once per stream, as the size is not expected to change
145 if (!converted_frame_buffer) {
146 converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free};
147 }
148 const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0};
149 u8* const converted_frame_buf_addr{converted_frame_buffer.get()};
150
151 sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, &converted_frame_buf_addr,
152 converted_stride.data());
153
154 const u32 blk_kind = static_cast<u32>(config.block_linear_kind);
155 if (blk_kind != 0) {
156 // swizzle pitch linear to block linear
157 const u32 block_height = static_cast<u32>(config.block_linear_height_log2);
158 const auto size = Texture::CalculateSize(true, 4, width, height, 1, block_height, 0);
159 luma_buffer.resize(size);
160 Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(),
161 converted_frame_buffer.get(), block_height, 0, 0);
162
163 gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size);
164 } else {
165 // send pitch linear frame
166 gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr,
167 linear_size);
168 }
169}
78 170
79 sws_freeContext(scaler_ctx); 171void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) {
80 scaler_ctx = nullptr; 172 LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame");
81 173
82 // Frames are decoded into either YUV420 or NV12 formats. Convert to desired format 174 const std::size_t surface_width = config.surface_width_minus1 + 1;
83 scaler_ctx = sws_getContext(frame->width, frame->height, 175 const std::size_t surface_height = config.surface_height_minus1 + 1;
84 static_cast<AVPixelFormat>(frame->format), frame->width, 176 const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width));
85 frame->height, target_format, 0, nullptr, nullptr, nullptr); 177 const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height));
178 const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL;
86 179
87 scaler_width = frame->width; 180 const auto stride = static_cast<size_t>(frame->linesize[0]);
88 scaler_height = frame->height; 181
89 } 182 luma_buffer.resize(aligned_width * surface_height);
90 // Get Converted frame 183 chroma_buffer.resize(aligned_width * surface_height / 2);
91 const u32 width = static_cast<u32>(frame->width); 184
92 const u32 height = static_cast<u32>(frame->height); 185 // Populate luma buffer
93 const std::size_t linear_size = width * height * 4; 186 const u8* luma_src = frame->data[0];
94 187 for (std::size_t y = 0; y < frame_height; ++y) {
95 // Only allocate frame_buffer once per stream, as the size is not expected to change 188 const std::size_t src = y * stride;
96 if (!converted_frame_buffer) { 189 const std::size_t dst = y * aligned_width;
97 converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free}; 190 for (std::size_t x = 0; x < frame_width; ++x) {
191 luma_buffer[dst + x] = luma_src[src + x];
98 } 192 }
99 const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0}; 193 }
100 u8* const converted_frame_buf_addr{converted_frame_buffer.get()}; 194 gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(),
101 195 luma_buffer.size());
102 sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, 196
103 &converted_frame_buf_addr, converted_stride.data()); 197 // Chroma
104 198 const std::size_t half_height = frame_height / 2;
105 const u32 blk_kind = static_cast<u32>(config.block_linear_kind); 199 const auto half_stride = static_cast<size_t>(frame->linesize[1]);
106 if (blk_kind != 0) { 200
107 // swizzle pitch linear to block linear 201 switch (frame->format) {
108 const u32 block_height = static_cast<u32>(config.block_linear_height_log2); 202 case AV_PIX_FMT_YUV420P: {
109 const auto size = 203 // Frame from FFmpeg software
110 Tegra::Texture::CalculateSize(true, 4, width, height, 1, block_height, 0); 204 // Populate chroma buffer from both channels with interleaving.
111 luma_buffer.resize(size); 205 const std::size_t half_width = frame_width / 2;
112 Tegra::Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(), 206 const u8* chroma_b_src = frame->data[1];
113 converted_frame_buffer.get(), block_height, 0, 0); 207 const u8* chroma_r_src = frame->data[2];
114 208 for (std::size_t y = 0; y < half_height; ++y) {
115 gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size); 209 const std::size_t src = y * half_stride;
116 } else { 210 const std::size_t dst = y * aligned_width;
117 // send pitch linear frame 211
118 gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr, 212 for (std::size_t x = 0; x < half_width; ++x) {
119 linear_size); 213 chroma_buffer[dst + x * 2] = chroma_b_src[src + x];
214 chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x];
215 }
120 } 216 }
121 break; 217 break;
122 } 218 }
123 case VideoPixelFormat::Yuv420: { 219 case AV_PIX_FMT_NV12: {
124 LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame"); 220 // Frame from VA-API hardware
125 221 // This is already interleaved so just copy
126 const std::size_t surface_width = config.surface_width_minus1 + 1; 222 const u8* chroma_src = frame->data[1];
127 const std::size_t surface_height = config.surface_height_minus1 + 1; 223 for (std::size_t y = 0; y < half_height; ++y) {
128 const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width));
129 const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height));
130 const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL;
131
132 const auto stride = static_cast<size_t>(frame->linesize[0]);
133
134 luma_buffer.resize(aligned_width * surface_height);
135 chroma_buffer.resize(aligned_width * surface_height / 2);
136
137 // Populate luma buffer
138 const u8* luma_src = frame->data[0];
139 for (std::size_t y = 0; y < frame_height; ++y) {
140 const std::size_t src = y * stride; 224 const std::size_t src = y * stride;
141 const std::size_t dst = y * aligned_width; 225 const std::size_t dst = y * aligned_width;
142 for (std::size_t x = 0; x < frame_width; ++x) { 226 for (std::size_t x = 0; x < frame_width; ++x) {
143 luma_buffer[dst + x] = luma_src[src + x]; 227 chroma_buffer[dst + x] = chroma_src[src + x];
144 }
145 }
146 gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(),
147 luma_buffer.size());
148
149 // Chroma
150 const std::size_t half_height = frame_height / 2;
151 const auto half_stride = static_cast<size_t>(frame->linesize[1]);
152
153 switch (frame->format) {
154 case AV_PIX_FMT_YUV420P: {
155 // Frame from FFmpeg software
156 // Populate chroma buffer from both channels with interleaving.
157 const std::size_t half_width = frame_width / 2;
158 const u8* chroma_b_src = frame->data[1];
159 const u8* chroma_r_src = frame->data[2];
160 for (std::size_t y = 0; y < half_height; ++y) {
161 const std::size_t src = y * half_stride;
162 const std::size_t dst = y * aligned_width;
163
164 for (std::size_t x = 0; x < half_width; ++x) {
165 chroma_buffer[dst + x * 2] = chroma_b_src[src + x];
166 chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x];
167 }
168 } 228 }
169 break;
170 }
171 case AV_PIX_FMT_NV12: {
172 // Frame from VA-API hardware
173 // This is already interleaved so just copy
174 const u8* chroma_src = frame->data[1];
175 for (std::size_t y = 0; y < half_height; ++y) {
176 const std::size_t src = y * stride;
177 const std::size_t dst = y * aligned_width;
178 for (std::size_t x = 0; x < frame_width; ++x) {
179 chroma_buffer[dst + x] = chroma_src[src + x];
180 }
181 }
182 break;
183 }
184 default:
185 UNREACHABLE();
186 break;
187 } 229 }
188 gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(),
189 chroma_buffer.size());
190 break; 230 break;
191 } 231 }
192 default: 232 default:
193 UNIMPLEMENTED_MSG("Unknown video pixel format {}", config.pixel_format.Value()); 233 UNREACHABLE();
194 break; 234 break;
195 } 235 }
236 gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(),
237 chroma_buffer.size());
196} 238}
197 239
198} // namespace Tegra 240} // namespace Tegra
diff --git a/src/video_core/command_classes/vic.h b/src/video_core/command_classes/vic.h
index 74246e08c..6d4cdfd57 100644
--- a/src/video_core/command_classes/vic.h
+++ b/src/video_core/command_classes/vic.h
@@ -6,7 +6,6 @@
6 6
7#include <memory> 7#include <memory>
8#include <vector> 8#include <vector>
9#include "common/bit_field.h"
10#include "common/common_types.h" 9#include "common/common_types.h"
11 10
12struct SwsContext; 11struct SwsContext;
@@ -14,6 +13,7 @@ struct SwsContext;
14namespace Tegra { 13namespace Tegra {
15class GPU; 14class GPU;
16class Nvdec; 15class Nvdec;
16union VicConfig;
17 17
18class Vic { 18class Vic {
19public: 19public:
@@ -27,6 +27,7 @@ public:
27 }; 27 };
28 28
29 explicit Vic(GPU& gpu, std::shared_ptr<Nvdec> nvdec_processor); 29 explicit Vic(GPU& gpu, std::shared_ptr<Nvdec> nvdec_processor);
30
30 ~Vic(); 31 ~Vic();
31 32
32 /// Write to the device state. 33 /// Write to the device state.
@@ -35,22 +36,9 @@ public:
35private: 36private:
36 void Execute(); 37 void Execute();
37 38
38 enum class VideoPixelFormat : u64_le { 39 void WriteRGBFrame(const AVFrame* frame, const VicConfig& config);
39 RGBA8 = 0x1f,
40 BGRA8 = 0x20,
41 Yuv420 = 0x44,
42 };
43 40
44 union VicConfig { 41 void WriteYUVFrame(const AVFrame* frame, const VicConfig& config);
45 u64_le raw{};
46 BitField<0, 7, u64_le> pixel_format;
47 BitField<7, 2, u64_le> chroma_loc_horiz;
48 BitField<9, 2, u64_le> chroma_loc_vert;
49 BitField<11, 4, u64_le> block_linear_kind;
50 BitField<15, 4, u64_le> block_linear_height_log2;
51 BitField<32, 14, u64_le> surface_width_minus1;
52 BitField<46, 14, u64_le> surface_height_minus1;
53 };
54 42
55 GPU& gpu; 43 GPU& gpu;
56 std::shared_ptr<Tegra::Nvdec> nvdec_processor; 44 std::shared_ptr<Tegra::Nvdec> nvdec_processor;
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index da328d904..f31f86339 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) {
1837 const float led_size = 5.0f; 1837 const float led_size = 5.0f;
1838 const QPointF led_position = sideview_center + QPointF(0, -36); 1838 const QPointF led_position = sideview_center + QPointF(0, -36);
1839 int led_count = 0; 1839 int led_count = 0;
1840 for (const auto color : led_color) { 1840 for (const auto& color : led_color) {
1841 p.setBrush(color); 1841 p.setBrush(color);
1842 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); 1842 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
1843 } 1843 }
@@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) {
1933 const float led_size = 5.0f; 1933 const float led_size = 5.0f;
1934 const QPointF led_position = sideview_center + QPointF(0, -36); 1934 const QPointF led_position = sideview_center + QPointF(0, -36);
1935 int led_count = 0; 1935 int led_count = 0;
1936 for (const auto color : led_color) { 1936 for (const auto& color : led_color) {
1937 p.setBrush(color); 1937 p.setBrush(color);
1938 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); 1938 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
1939 } 1939 }
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index 7a6f84d96..33110685a 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) {
143} 143}
144 144
145void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { 145void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
146 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 146 const auto mouse_position = ev->pos();
147 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
147 ev->accept(); 148 ev->accept();
148} 149}
149 150
150void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { 151void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
151 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 152 const auto mouse_position = ev->pos();
153 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
152 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); 154 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
153 ev->accept(); 155 ev->accept();
154} 156}
155 157
156void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { 158void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
157 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 159 const auto mouse_position = ev->pos();
160 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
158 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); 161 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
159 ev->accept(); 162 ev->accept();
160} 163}
161 164
162void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { 165void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
163 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 166 const auto wheel_position = ev->position().toPoint();
167 MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
164 ev->angleDelta().y() / 120); 168 ev->angleDelta().y() / 120);
165 ev->accept(); 169 ev->accept();
166} 170}
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index f9d949e75..ba54423ff 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} {
159 * @return true if the haystack contains all words of userinput 159 * @return true if the haystack contains all words of userinput
160 */ 160 */
161static bool ContainsAllWords(const QString& haystack, const QString& userinput) { 161static bool ContainsAllWords(const QString& haystack, const QString& userinput) {
162 const QStringList userinput_split = 162 const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts);
163 userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts);
164 163
165 return std::all_of(userinput_split.begin(), userinput_split.end(), 164 return std::all_of(userinput_split.begin(), userinput_split.end(),
166 [&haystack](const QString& s) { return haystack.contains(s); }); 165 [&haystack](const QString& s) { return haystack.contains(s); });