forked from eden-emu/eden
Compare commits
3 commits
13ecc1e481
...
28d26b0d76
Author | SHA1 | Date | |
---|---|---|---|
28d26b0d76 | |||
ad6045d9a4 | |||
3fbfd64722 |
7 changed files with 238 additions and 161 deletions
42
.ci/windows/install-msvc.ps1
Executable file
42
.ci/windows/install-msvc.ps1
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
# Check if running as administrator
|
||||||
|
if (-not ([bool](net session 2>$null))) {
|
||||||
|
Write-Host "This script must be run with administrator privileges!"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$VSVer = "17"
|
||||||
|
$ExeFile = "vs_BuildTools.exe"
|
||||||
|
$Uri = "https://aka.ms/vs/$VSVer/release/$ExeFile"
|
||||||
|
$Destination = "./$ExeFile"
|
||||||
|
|
||||||
|
Write-Host "Downloading Visual Studio Build Tools from $Uri"
|
||||||
|
$WebClient = New-Object System.Net.WebClient
|
||||||
|
$WebClient.DownloadFile($Uri, $Destination)
|
||||||
|
Write-Host "Finished downloading $ExeFile"
|
||||||
|
|
||||||
|
$VSROOT = "C:/VSBuildTools/$VSVer"
|
||||||
|
$Arguments = @(
|
||||||
|
"--installPath `"$VSROOT`"", # set custom installation path
|
||||||
|
"--quiet", # suppress UI
|
||||||
|
"--wait", # wait for installation to complete
|
||||||
|
"--norestart", # prevent automatic restart
|
||||||
|
"--add Microsoft.VisualStudio.Workload.VCTools", # add C++ build tools workload
|
||||||
|
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64", # add core x86/x64 C++ tools
|
||||||
|
"--add Microsoft.VisualStudio.Component.Windows10SDK.19041" # add specific Windows SDK
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Host "Installing Visual Studio Build Tools"
|
||||||
|
$InstallProcess = Start-Process -FilePath $Destination -NoNewWindow -PassThru -Wait -ArgumentList $Arguments
|
||||||
|
$ExitCode = $InstallProcess.ExitCode
|
||||||
|
|
||||||
|
if ($ExitCode -ne 0) {
|
||||||
|
Write-Host "Error installing Visual Studio Build Tools (Error: $ExitCode)"
|
||||||
|
Exit $ExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Finished installing Visual Studio Build Tools"
|
|
@ -3,6 +3,12 @@
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
# Check if running as administrator
|
||||||
|
if (-not ([bool](net session 2>$null))) {
|
||||||
|
Write-Host "This script must be run with administrator privileges!"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
$VulkanSDKVer = "1.4.321.1"
|
$VulkanSDKVer = "1.4.321.1"
|
||||||
$ExeFile = "vulkansdk-windows-X64-$VulkanSDKVer.exe"
|
$ExeFile = "vulkansdk-windows-X64-$VulkanSDKVer.exe"
|
||||||
$Uri = "https://sdk.lunarg.com/sdk/download/$VulkanSDKVer/windows/$ExeFile"
|
$Uri = "https://sdk.lunarg.com/sdk/download/$VulkanSDKVer/windows/$ExeFile"
|
||||||
|
|
262
docs/build/Windows.md
vendored
262
docs/build/Windows.md
vendored
|
@ -1,149 +1,195 @@
|
||||||
# THIS GUIDE IS INTENDED FOR DEVELOPERS ONLY, SUPPORT WILL ONLY BE GIVEN IF YOU'RE A DEVELOPER.
|
# ⚠️ This guide is for developers ONLY! Support will be provided to developers ONLY.
|
||||||
|
|
||||||
## Method I: MSVC Build for Windows
|
## 📋 Current building methods:
|
||||||
|
|
||||||
### Minimal Dependencies
|
* [ Minimal Dependencies](#minimal-dependencies)
|
||||||
|
* [⚡ Method I: MSVC Build for Windows](#method-i-msvc-build-for-windows)
|
||||||
|
* [🐧 Method II: MinGW-w64 Build with MSYS2](#method-ii-mingw-w64-build-with-msys2)
|
||||||
|
* [🖥️ Method III: CLion Environment Setup](#method-iii-clion-environment-setup)
|
||||||
|
* [💻 Building from the command line with MSVC](#building-from-the-command-line-with-msvc)
|
||||||
|
* [📜 Building with Scripts](#building-with-scripts)
|
||||||
|
|
||||||
On Windows, all library dependencies are automatically included within the `externals` folder, or can be downloaded on-demand. To build Eden, you need to install:
|
---
|
||||||
|
|
||||||
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)** - **Make sure to select C++ support in the installer. Make sure to update to the latest version if already installed.**
|
|
||||||
* **[CMake](https://cmake.org/download/)** - Used to generate Visual Studio project files. Does not matter if either 32-bit or 64-bit version is installed.
|
|
||||||
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - **Make sure to select Latest SDK.**
|
|
||||||
- A convenience script to install the latest SDK is provided in `.ci\windows\install-vulkan-sdk.ps1`.
|
|
||||||
|
|
||||||

|
## Minimal Dependencies
|
||||||
|
|
||||||
* **Git** - We recommend [Git for Windows](https://gitforwindows.org).
|
On Windows, **all** library dependencies are **automatically included** within the `externals` folder.
|
||||||
|
|
||||||

|
You still need to install:
|
||||||
|
|
||||||
* While installing Git Bash, you should tell it to include Git in your system path. (Choose the "Git from the command line and also from 3rd-party software" option.) If you missed that, don't worry, you'll just have to manually tell CMake where your git.exe is, since it's used to include version info into the built executable.
|
* **[CMake](https://cmake.org/download/)** - Used to generate Visual Studio project files.
|
||||||
|
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - Make sure to select **Latest SDK**.
|
||||||
|
|
||||||

|
* *A convenience script to install the latest SDK is provided in `.ci/windows/install-vulkan-sdk.ps1`*
|
||||||
|
* **[Git for Windows](https://gitforwindows.org)** - We recommend installing Git for command line use and version control integration.
|
||||||
|
|
||||||
### Cloning Eden with Git
|
<img src="https://i.imgur.com/x0rRs1t.png" width="500">
|
||||||
|
|
||||||
**Master:**
|
* *While installing Git Bash, select "Git from the command line and also from 3rd-party software". If missed, manually set `git.exe` path in CMake.*
|
||||||
```cmd
|
|
||||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
|
||||||
cd eden
|
|
||||||
```
|
|
||||||
|
|
||||||

|
---
|
||||||
|
|
||||||
* *(Note: eden by default downloads to `C:\Users\<user-name>\eden` (Master)
|
## ⚡ Method I: MSVC Build for Windows
|
||||||
|
|
||||||
### Building
|
### a. Prerequisites to MSVC Build
|
||||||
|
|
||||||
* Open the CMake GUI application and point it to the `eden` (Master)
|
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)** - Make sure to **select C++ support** in the installer, or **update to the latest version** if already installed.
|
||||||
|
|
||||||

|
* *A convenience script to install the **minimal** version (Visual Build Tools) is provided in `.ci/windows/install-msvc.ps1`*
|
||||||
|
|
||||||
* For the build directory, use a `/build` subdirectory inside the source directory or some other directory of your choice. (Tell CMake to create it.)
|
---
|
||||||
|
|
||||||
|
### b. Clone the eden repository with Git
|
||||||
|
|
||||||
|
Open Terminal on
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
git clone https://git.eden-emu.dev/eden-emu/eden
|
||||||
|
cd eden
|
||||||
|
```
|
||||||
|
|
||||||
|
* *By default `eden` downloads to `C:\Users\<user-name>\eden`*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### c. Building
|
||||||
|
|
||||||
|
* Open the CMake GUI application and point it to the `eden`
|
||||||
|
|
||||||
|
<img src="https://i.imgur.com/qOslIWv.png" width="500">
|
||||||
|
|
||||||
|
* For the build directory, use a `build/` subdirectory inside the source directory or some other directory of your choice. (Tell CMake to create it.)
|
||||||
|
|
||||||
* Click the "Configure" button and choose `Visual Studio 17 2022`, with `x64` for the optional platform.
|
* Click the "Configure" button and choose `Visual Studio 17 2022`, with `x64` for the optional platform.
|
||||||
|
|
||||||

|
<img src="https://i.imgur.com/DKiREaK.png" width="500">
|
||||||
|
|
||||||
* *(Note: If you used GitHub's own app to clone, run `git submodule update --init --recursive` to get the remaining dependencies)*
|
|
||||||
|
|
||||||
* *(You may also want to disable `YUZU_TESTS` in this case since Catch2 is not yet supported with this.)*
|
* *(You may also want to disable `YUZU_TESTS` in this case since Catch2 is not yet supported with this.)*
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/22451773/180585999-07316d6e-9751-4d11-b957-1cf57cd7cd58.png" width="500">
|
||||||
|
|
||||||
* Click "Generate" to create the project files.
|
* Click "Generate" to create the project files.
|
||||||
|
|
||||||

|
<img src="https://i.imgur.com/5LKg92k.png" width="500">
|
||||||
|
|
||||||
* Open the solution file `yuzu.sln` in Visual Studio 2022, which is located in the build folder.
|
* Open the solution file `yuzu.sln` in Visual Studio 2022, which is located in the build folder.
|
||||||
|
|
||||||

|
<img src="https://i.imgur.com/208yMml.png" width="500">
|
||||||
|
|
||||||
* Depending if you want a graphical user interface or not (`eden` has the graphical user interface, while `eden-cmd` doesn't), select `eden` or `eden-cmd` in the Solution Explorer, right-click and `Set as StartUp Project`.
|
* * Depending on whether you want a graphical user interface or not, select in the Solution Explorer:
|
||||||
|
* `eden` (GUI)
|
||||||
|
* `eden-cmd` (command-line only)
|
||||||
|
* Then **right-click** and choose `Set as StartUp Project`.
|
||||||
|
|
||||||
 
|
<img src="https://i.imgur.com/nPMajnn.png" height="500">
|
||||||
|
<img src="https://i.imgur.com/BDMLzRZ.png" height="500">
|
||||||
|
|
||||||
* Select the appropriate build type, Debug for debug purposes or Release for performance (in case of doubt choose Release).
|
* Select the appropriate build type, `Debug` for debug purposes or `Release` for performance (in case of doubt choose `Release`).
|
||||||
|
|
||||||

|
<img src="https://i.imgur.com/qxg4roC.png" width="500">
|
||||||
|
|
||||||
* Right-click the project you want to build and press Build in the submenu or press F5.
|
* **Right-click** the project you want to build and press **Build** in the submenu or press `F5`.
|
||||||
|
|
||||||

|
<img src="https://i.imgur.com/CkQgOFW.png" height="500">
|
||||||
|
|
||||||
## Method II: MinGW-w64 Build with MSYS2
|
---
|
||||||
|
|
||||||
### Prerequisites to install
|
## 🐧 Method II: MinGW-w64 Build with MSYS2
|
||||||
|
|
||||||
* [MSYS2](https://www.msys2.org)
|
### a. Prerequisites to MinGW-w64
|
||||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - **Make sure to select Latest SDK.**
|
|
||||||
* Make sure to follow the instructions and update to the latest version by running `pacman -Syu` as many times as needed.
|
|
||||||
|
|
||||||
### Install eden dependencies for MinGW-w64
|
* **[MSYS2](https://www.msys2.org)** - A versatile and up-to-date development environment for Windows, providing a Unix-like shell, package manager, and toolchain.
|
||||||
|
|
||||||
* Open the `MSYS2 MinGW 64-bit` (mingw64.exe) shell
|
---
|
||||||
* Download and install all dependencies using: `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
|
|
||||||
* Add MinGW binaries to the PATH: `echo 'PATH=/mingw64/bin:$PATH' >> ~/.bashrc`
|
|
||||||
* Add glslangValidator to the PATH: `echo 'PATH=$(readlink -e /c/VulkanSDK/*/Bin/):$PATH' >> ~/.bashrc`
|
|
||||||
|
|
||||||
### Clone the eden repository with Git
|
### b. Install eden dependencies for MinGW-w64
|
||||||
|
|
||||||
```bash
|
* Open the `MSYS2 MinGW 64-bit` shell (`mingw64.exe`)
|
||||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
* Download and install all dependencies using:
|
||||||
cd eden
|
* `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
|
||||||
```
|
* Add MinGW binaries to the PATH:
|
||||||
|
* `echo 'PATH=/mingw64/bin:$PATH' >> ~/.bashrc`
|
||||||
|
* Add VulkanSDK to the PATH:
|
||||||
|
* `echo 'PATH=$(readlink -e /c/VulkanSDK/*/Bin/):$PATH' >> ~/.bashrc`
|
||||||
|
|
||||||
### Run the following commands to build eden (dynamically linked build)
|
---
|
||||||
|
|
||||||
|
### c. Clone the eden repository with Git
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
git clone https://git.eden-emu.dev/eden-emu/eden
|
||||||
|
cd eden
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### d. Building dynamically-linked eden
|
||||||
|
|
||||||
|
* This process will generate a *dynamically* linked build
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Make build dir and enter
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake -G "MSYS Makefiles" -DYUZU_TESTS=OFF ..
|
|
||||||
|
# Generate CMake Makefiles
|
||||||
|
cmake .. -G "MSYS Makefiles" -DYUZU_TESTS=OFF
|
||||||
|
|
||||||
|
# Build
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
# test eden out with
|
|
||||||
|
# Run eden!
|
||||||
./bin/eden.exe
|
./bin/eden.exe
|
||||||
```
|
```
|
||||||
|
|
||||||
* *(Note: This build is not a static build meaning that you need to include all of the DLLs with the .exe in order to use it!)*
|
* *Warning: This build is not a **static** build meaning that you **need** to include all of the DLLs with the .exe in order to use it or other systems!*
|
||||||
|
|
||||||
e.g.
|
---
|
||||||
```Bash
|
|
||||||
cp externals/ffmpeg-*/bin/*.dll bin/
|
### Additional notes
|
||||||
|
|
||||||
|
|
||||||
|
* Eden doesn't require the rather large Qt dependency, but you will lack a GUI frontend
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ...
|
||||||
|
|
||||||
|
# Generate CMake Makefiles (withou QT)
|
||||||
|
cmake .. -G "MSYS Makefiles" -DYUZU_TESTS=OFF -DENABLE_QT=no
|
||||||
|
|
||||||
|
$ ...
|
||||||
```
|
```
|
||||||
|
|
||||||
Bonus Note: Running programs from inside `MSYS2 MinGW x64` shell has a different %PATH% than directly from explorer. This different %PATH% has the locations of the other DLLs required.
|
* Running programs from inside `MSYS2 MinGW x64` shell has a different `%PATH%` than directly from explorer.
|
||||||

|
* This different `%PATH%` has the locations of the other DLLs required.
|
||||||
|
|
||||||
|
<img src="https://user-images.githubusercontent.com/190571/165000848-005e8428-8a82-41b1-bb4d-4ce7797cdac8.png" width="500">
|
||||||
|
|
||||||
### Building without Qt (Optional)
|
---
|
||||||
|
|
||||||
Doesn't require the rather large Qt dependency, but you will lack a GUI frontend:
|
## 🖥️ Method III: CLion Environment Setup
|
||||||
|
|
||||||
* Pass the `-DENABLE_QT=no` flag to cmake
|
### a. Prerequisites to CLion
|
||||||
|
|
||||||
## Method III: CLion Environment Setup
|
|
||||||
|
|
||||||
### Minimal Dependencies
|
|
||||||
|
|
||||||
To build eden, you need to install the following:
|
|
||||||
|
|
||||||
* [CLion](https://www.jetbrains.com/clion/) - This IDE is not free; for a free alternative, check Method I
|
* [CLion](https://www.jetbrains.com/clion/) - This IDE is not free; for a free alternative, check Method I
|
||||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - Make sure to select the Latest SDK.
|
|
||||||
|
|
||||||
### Cloning eden with CLion
|
---
|
||||||
|
|
||||||
|
### b. Cloning eden with CLion
|
||||||
|
|
||||||
* Clone the Repository:
|
* Clone the Repository:
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899046-0d41d7d6-8e4d-4ed2-9587-b57088af5214.png" width="500">
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899061-b2ea274a-e88c-40ae-bf0b-4450b46e9fea.png" width="500">
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899076-0e5988c4-d431-4284-a5ff-9ecff973db76.png" width="500">
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### c. Building & Setup
|
||||||
### Building & Setup
|
|
||||||
|
|
||||||
* Once Cloned, You will be taken to a prompt like the image below:
|
* Once Cloned, You will be taken to a prompt like the image below:
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899092-3fe4cec6-a540-44e3-9e1e-3de9c2fffc2f.png" width="500">
|
||||||
|
|
||||||
* Set the settings to the image below:
|
* Set the settings to the image below:
|
||||||
* Change `Build type: Release`
|
* Change `Build type: Release`
|
||||||
|
@ -152,42 +198,62 @@ To build eden, you need to install the following:
|
||||||
* Change `Generator: Let CMake decide`
|
* Change `Generator: Let CMake decide`
|
||||||
* Change `Build directory: build`
|
* Change `Build directory: build`
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899164-6cee8482-3d59-428f-b1bc-e6dc793c9b20.png" width="500">
|
||||||
|
|
||||||
* Click OK; now Clion will build a directory and index your code to allow for IntelliSense. Please be patient.
|
* Click OK; now Clion will build a directory and index your code to allow for IntelliSense. Please be patient.
|
||||||
* Once this process has been completed (No loading bar bottom right), you can now build eden
|
* Once this process has been completed (No loading bar bottom right), you can now build eden
|
||||||
* In the top right, click on the drop-down menu, select all configurations, then select eden
|
* In the top right, click on the drop-down menu, select all configurations, then select eden
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899226-975048e9-bc6d-4ec1-bc2d-bd8a1e15ed04.png" height="500" >
|
||||||
|
|
||||||
* Now run by clicking the play button or pressing Shift+F10, and eden will auto-launch once built.
|
* Now run by clicking the play button or pressing Shift+F10, and eden will auto-launch once built.
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/42481638/216899275-d514ec6a-e563-470e-81e2-3e04f0429b68.png" width="500">
|
||||||
|
|
||||||
## Building from the command line with MSVC
|
---
|
||||||
|
|
||||||
|
## 💻 Building from the command line with MSVC
|
||||||
|
|
||||||
```cmd
|
```cmd
|
||||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
# Clone eden and enter
|
||||||
|
git clone https://git.eden-emu.dev/eden-emu/eden
|
||||||
cd eden
|
cd eden
|
||||||
mkdir build
|
|
||||||
cd build
|
# Make build dir and enter
|
||||||
cmake .. -G "Visual Studio 17 2022" -A x64
|
mkdir build && cd build
|
||||||
|
|
||||||
|
# Generate CMake Makefiles
|
||||||
|
cmake .. -G "Visual Studio 17 2022" -A x64 -DYUZU_TESTS=OFF
|
||||||
|
|
||||||
|
# Build
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
```
|
```
|
||||||
|
|
||||||
### Building with Scripts
|
## 📜 Building with Scripts
|
||||||
A convenience script for building is provided in `.ci/windows/build.sh`. You must run this with Bash, e.g. Git Bash or MinGW TTY. To use this script, you must have windeployqt installed (usually bundled with Qt) and set the `WINDEPLOYQT` environment variable to its canonical Bash location, e.g. `WINDEPLOYQT="/c/Qt/6.9.1/msvc2022_64/bin/windeployqt6.exe" .ci/windows/build.sh`.
|
|
||||||
|
|
||||||
Extra CMake flags should be placed in the arguments of the script.
|
* A convenience script for building is provided in `.ci/windows/build.sh`.
|
||||||
|
* You must run this with Bash, e.g. Git Bash or MinGW TTY.
|
||||||
|
* To use this script, you must have `windeployqt` installed (usually bundled with Qt) and set the `WINDEPLOYQT` environment variable to its canonical Bash location:
|
||||||
|
* `WINDEPLOYQT="/c/Qt/6.9.1/msvc2022_64/bin/windeployqt6.exe" .ci/windows/build.sh`.
|
||||||
|
* You can use `aqtinstall`, more info on <https://github.com/miurahr/aqtinstall> and <https://ddalcino.github.io/aqt-list-server/>
|
||||||
|
|
||||||
Additional environment variables can be used to control building:
|
|
||||||
- `BUILD_TYPE`: Sets the build type to use. Defaults to `Release`
|
|
||||||
|
|
||||||
The following environment variables are boolean flags. Set to `true` to enable or `false` to disable:
|
* Extra CMake flags should be placed in the arguments of the script.
|
||||||
- `DEVEL` (default FALSE): Disable Qt update checker
|
|
||||||
- `USE_WEBENGINE` (default FALSE): Enable Qt WebEngine
|
#### Additional environment variables can be used to control building:
|
||||||
- `USE_MULTIMEDIA` (default TRUE): Enable Qt Multimedia
|
|
||||||
- `BUNDLE_QT` (default FALSE): Use bundled Qt
|
* `BUILD_TYPE` (default `Release`): Sets the build type to use.
|
||||||
* Note that using system Qt requires you to include the Qt CMake directory in `CMAKE_PREFIX_PATH`, e.g. `.ci/windows/build.sh -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64/lib/cmake/Qt6`
|
|
||||||
|
* The following environment variables are boolean flags. Set to `true` to enable or `false` to disable:
|
||||||
|
|
||||||
|
* `DEVEL` (default FALSE): Disable Qt update checker
|
||||||
|
* `USE_WEBENGINE` (default FALSE): Enable Qt WebEngine
|
||||||
|
* `USE_MULTIMEDIA` (default TRUE): Enable Qt Multimedia
|
||||||
|
* `BUNDLE_QT` (default FALSE): Use bundled Qt
|
||||||
|
|
||||||
|
* Note that using **system Qt** requires you to include the Qt CMake directory in `CMAKE_PREFIX_PATH`
|
||||||
|
* `.ci/windows/build.sh -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64/lib/cmake/Qt6`
|
||||||
|
|
||||||
|
* After building, a zip can be packaged via `.ci/windows/package.sh`. You must have 7-zip installed and in your PATH.
|
||||||
|
* The resulting zip will be placed into `artifacts` in the source directory.
|
||||||
|
|
||||||
After building, a zip can be packaged via `.ci/windows/package.sh`. Note that you must have 7-zip installed and in your PATH. The resulting zip will be placed into `artifacts` in the source directory.
|
|
||||||
|
|
|
@ -34,12 +34,9 @@ NCA::NCA(VirtualFile file_, const NCA* base_nca)
|
||||||
}
|
}
|
||||||
|
|
||||||
reader = std::make_shared<NcaReader>();
|
reader = std::make_shared<NcaReader>();
|
||||||
if (Result rc =
|
if (Result rc = reader->Initialize(file, GetCryptoConfiguration(), GetNcaCompressionConfiguration()); R_FAILED(rc)) {
|
||||||
reader->Initialize(file, GetCryptoConfiguration(), GetNcaCompressionConfiguration());
|
|
||||||
R_FAILED(rc)) {
|
|
||||||
if (rc != ResultInvalidNcaSignature) {
|
if (rc != ResultInvalidNcaSignature) {
|
||||||
LOG_ERROR(Loader, "File reader errored out during header read: {:#x}",
|
LOG_ERROR(Loader, "File reader errored out during header read: {:#x}", rc.GetInnerValue());
|
||||||
rc.GetInnerValue());
|
|
||||||
}
|
}
|
||||||
status = Loader::ResultStatus::ErrorBadNCAHeader;
|
status = Loader::ResultStatus::ErrorBadNCAHeader;
|
||||||
return;
|
return;
|
||||||
|
@ -84,10 +81,8 @@ NCA::NCA(VirtualFile file_, const NCA* base_nca)
|
||||||
std::vector<VirtualFile> filesystems(fs_count);
|
std::vector<VirtualFile> filesystems(fs_count);
|
||||||
for (s32 i = 0; i < fs_count; i++) {
|
for (s32 i = 0; i < fs_count; i++) {
|
||||||
NcaFsHeaderReader header_reader;
|
NcaFsHeaderReader header_reader;
|
||||||
const Result rc = fs.OpenStorage(&filesystems[i], &header_reader, i);
|
if (Result rc = fs.OpenStorage(&filesystems[i], &header_reader, i); R_FAILED(rc)) {
|
||||||
if (R_FAILED(rc)) {
|
LOG_DEBUG(Loader, "File reader errored out during read of section {}: {:#x}", i, rc.GetInnerValue());
|
||||||
LOG_ERROR(Loader, "File reader errored out during read of section {}: {:#x}", i,
|
|
||||||
rc.GetInnerValue());
|
|
||||||
status = Loader::ResultStatus::ErrorBadNCAHeader;
|
status = Loader::ResultStatus::ErrorBadNCAHeader;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,23 +4,18 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/file_sys/fssystem/fssystem_integrity_verification_storage.h"
|
|
||||||
#include "common/alignment.h"
|
#include "common/alignment.h"
|
||||||
|
#include "core/file_sys/fssystem/fssystem_integrity_verification_storage.h"
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
constexpr inline u32 ILog2(u32 val)
|
constexpr inline u32 ILog2(u32 val) {
|
||||||
{
|
|
||||||
ASSERT(val > 0);
|
ASSERT(val > 0);
|
||||||
return static_cast<u32>((sizeof(u32) * 8) - 1 - std::countl_zero<u32>(val));
|
return static_cast<u32>((sizeof(u32) * 8) - 1 - std::countl_zero<u32>(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntegrityVerificationStorage::Initialize(VirtualFile hs,
|
void IntegrityVerificationStorage::Initialize(VirtualFile hs, VirtualFile ds, s64 verif_block_size,
|
||||||
VirtualFile ds,
|
s64 upper_layer_verif_block_size, bool is_real_data) {
|
||||||
s64 verif_block_size,
|
|
||||||
s64 upper_layer_verif_block_size,
|
|
||||||
bool is_real_data)
|
|
||||||
{
|
|
||||||
// Validate preconditions.
|
// Validate preconditions.
|
||||||
ASSERT(verif_block_size >= HashSize);
|
ASSERT(verif_block_size >= HashSize);
|
||||||
|
|
||||||
|
@ -40,28 +35,22 @@ void IntegrityVerificationStorage::Initialize(VirtualFile hs,
|
||||||
ASSERT(m_upper_layer_verification_block_size == 1ll << m_upper_layer_verification_block_order);
|
ASSERT(m_upper_layer_verification_block_size == 1ll << m_upper_layer_verification_block_order);
|
||||||
|
|
||||||
// Validate sizes.
|
// Validate sizes.
|
||||||
if (m_data_storage != nullptr) {
|
{
|
||||||
s64 hash_size = m_hash_storage->GetSize();
|
s64 hash_size = m_hash_storage->GetSize();
|
||||||
s64 data_size = m_data_storage->GetSize();
|
s64 data_size = m_data_storage->GetSize();
|
||||||
ASSERT(((hash_size / HashSize) * m_verification_block_size) >= data_size);
|
ASSERT(((hash_size / HashSize) * m_verification_block_size) >= data_size);
|
||||||
} else {
|
|
||||||
LOG_ERROR(Loader,
|
|
||||||
"Failed to initialize integrity verification store. Game, update, or DLC may not "
|
|
||||||
"work.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set data.
|
// Set data.
|
||||||
m_is_real_data = is_real_data;
|
m_is_real_data = is_real_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntegrityVerificationStorage::Finalize()
|
void IntegrityVerificationStorage::Finalize() {
|
||||||
{
|
|
||||||
m_hash_storage = VirtualFile();
|
m_hash_storage = VirtualFile();
|
||||||
m_data_storage = VirtualFile();
|
m_data_storage = VirtualFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t IntegrityVerificationStorage::Read(u8* buffer, size_t size, size_t offset) const
|
size_t IntegrityVerificationStorage::Read(u8* buffer, size_t size, size_t offset) const {
|
||||||
{
|
|
||||||
// Succeed if zero size.
|
// Succeed if zero size.
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return size;
|
return size;
|
||||||
|
@ -70,13 +59,7 @@ size_t IntegrityVerificationStorage::Read(u8* buffer, size_t size, size_t offset
|
||||||
// Validate arguments.
|
// Validate arguments.
|
||||||
ASSERT(buffer != nullptr);
|
ASSERT(buffer != nullptr);
|
||||||
|
|
||||||
if (m_data_storage == nullptr) {
|
// Validate the offset.
|
||||||
LOG_ERROR(Loader,
|
|
||||||
"Integrity verification store failed read operation. Game, update or DLC may not "
|
|
||||||
"work.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s64 data_size = m_data_storage->GetSize();
|
s64 data_size = m_data_storage->GetSize();
|
||||||
ASSERT(offset <= static_cast<size_t>(data_size));
|
ASSERT(offset <= static_cast<size_t>(data_size));
|
||||||
|
|
||||||
|
@ -104,8 +87,7 @@ size_t IntegrityVerificationStorage::Read(u8* buffer, size_t size, size_t offset
|
||||||
return m_data_storage->Read(buffer, read_size, offset);
|
return m_data_storage->Read(buffer, read_size, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t IntegrityVerificationStorage::GetSize() const
|
size_t IntegrityVerificationStorage::GetSize() const {
|
||||||
{
|
|
||||||
return m_data_storage->GetSize();
|
return m_data_storage->GetSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1051,8 +1051,8 @@ Result NcaFileSystemDriver::CreatePatchMetaStorage(
|
||||||
ASSERT(out_aes_ctr_ex_meta != nullptr);
|
ASSERT(out_aes_ctr_ex_meta != nullptr);
|
||||||
ASSERT(out_indirect_meta != nullptr);
|
ASSERT(out_indirect_meta != nullptr);
|
||||||
ASSERT(base_storage != nullptr);
|
ASSERT(base_storage != nullptr);
|
||||||
ASSERT(patch_info.HasAesCtrExTable());
|
//ASSERT(patch_info.HasAesCtrExTable());
|
||||||
ASSERT(patch_info.HasIndirectTable());
|
//ASSERT(patch_info.HasIndirectTable());
|
||||||
ASSERT(Common::IsAligned<s64>(patch_info.aes_ctr_ex_size, NcaHeader::XtsBlockSize));
|
ASSERT(Common::IsAligned<s64>(patch_info.aes_ctr_ex_size, NcaHeader::XtsBlockSize));
|
||||||
|
|
||||||
// Validate patch info extents.
|
// Validate patch info extents.
|
||||||
|
@ -1334,8 +1334,8 @@ Result NcaFileSystemDriver::CreateIntegrityVerificationStorageImpl(
|
||||||
R_UNLESS(last_layer_info_offset + layer_info.size <= layer_info_offset,
|
R_UNLESS(last_layer_info_offset + layer_info.size <= layer_info_offset,
|
||||||
ResultRomNcaInvalidIntegrityLayerInfoOffset);
|
ResultRomNcaInvalidIntegrityLayerInfoOffset);
|
||||||
}
|
}
|
||||||
storage_info.SetDataStorage(std::make_shared<OffsetVfsFile>(
|
storage_info[level_hash_info.max_layers - 1] = std::make_shared<OffsetVfsFile>(
|
||||||
std::move(base_storage), layer_info.size, last_layer_info_offset));
|
std::move(base_storage), layer_info.size, last_layer_info_offset);
|
||||||
|
|
||||||
// Make the integrity romfs storage.
|
// Make the integrity romfs storage.
|
||||||
auto integrity_storage = std::make_shared<IntegrityRomFsStorage>();
|
auto integrity_storage = std::make_shared<IntegrityRomFsStorage>();
|
||||||
|
|
|
@ -2160,34 +2160,20 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||||
if (!image_handle) {
|
if (!image_handle) {
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
if (image_format == Shader::ImageFormat::Typeless) {
|
||||||
|
return Handle(texture_type);
|
||||||
|
}
|
||||||
|
const bool is_signed{image_format == Shader::ImageFormat::R8_SINT ||
|
||||||
|
image_format == Shader::ImageFormat::R16_SINT};
|
||||||
if (!storage_views) {
|
if (!storage_views) {
|
||||||
storage_views = std::make_unique<StorageViews>();
|
storage_views = std::make_unique<StorageViews>();
|
||||||
}
|
}
|
||||||
|
auto& views{is_signed ? storage_views->signeds : storage_views->unsigneds};
|
||||||
// Storage images MUST use identity component mapping.
|
auto& view{views[static_cast<size_t>(texture_type)]};
|
||||||
// Typeless: use the underlying image's native format.
|
if (view) {
|
||||||
if (image_format == Shader::ImageFormat::Typeless) {
|
|
||||||
auto& view = storage_views->unsigneds[static_cast<size_t>(texture_type)];
|
|
||||||
if (view) {
|
|
||||||
return *view;
|
|
||||||
}
|
|
||||||
const auto fmt_info =
|
|
||||||
MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, /*is_image=*/true, format);
|
|
||||||
const VkFormat vk_format = fmt_info.format;
|
|
||||||
// Storage images are color-aspect only
|
|
||||||
view = MakeView(vk_format, VK_IMAGE_ASPECT_COLOR_BIT); // identity components inside
|
|
||||||
return *view;
|
return *view;
|
||||||
}
|
}
|
||||||
const bool is_signed = (image_format == Shader::ImageFormat::R8_SINT ||image_format == Shader::ImageFormat::R16_SINT);
|
view = MakeView(Format(image_format), VK_IMAGE_ASPECT_COLOR_BIT);
|
||||||
auto& views = is_signed ? storage_views->signeds : storage_views->unsigneds;
|
|
||||||
auto& view = views[static_cast<size_t>(texture_type)];
|
|
||||||
if (view) {
|
|
||||||
return *view;
|
|
||||||
}
|
|
||||||
|
|
||||||
const VkFormat vk_format = Format(image_format);
|
|
||||||
view = MakeView(vk_format, VK_IMAGE_ASPECT_COLOR_BIT);// identity components inside
|
|
||||||
return *view;
|
return *view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue