mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Merge branch 'master' into rsx
This commit is contained in:
commit
2b0f61f6ac
39 changed files with 319 additions and 483 deletions
|
@ -6,14 +6,14 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
|||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
|
||||
/opt/homebrew/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype #create-dmg
|
||||
/opt/homebrew/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype googletest #create-dmg
|
||||
/opt/homebrew/bin/brew install -f --quiet ffmpeg@5
|
||||
/opt/homebrew/bin/brew install --quiet "llvm@$LLVM_COMPILER_VER" glew cmake sdl3 vulkan-headers coreutils
|
||||
/opt/homebrew/bin/brew link -f --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
|
||||
|
||||
# moltenvk based on commit for 1.3.0 release
|
||||
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb
|
||||
/opt/homebrew/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
|
||||
/opt/homebrew/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
|
||||
|
@ -32,7 +32,7 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
|||
git clone https://github.com/engnr/qt-downloader.git
|
||||
cd qt-downloader
|
||||
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
||||
# nested Qt 6.9.0 URL workaround
|
||||
# nested Qt 6.9.1 URL workaround
|
||||
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
|
||||
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
|
||||
# archived Qt 6.7.3 URL workaround
|
||||
|
@ -41,7 +41,7 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
|||
arch -arm64 "$BREW_PATH/bin/pipenv" run pip3 uninstall py7zr requests semantic_version lxml
|
||||
arch -arm64 "$BREW_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml --no-cache
|
||||
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
|
||||
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.0 workaround
|
||||
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.1 workaround
|
||||
arch -arm64 "$BREW_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
|
||||
fi
|
||||
|
||||
|
@ -77,8 +77,8 @@ mkdir build && cd build || exit 1
|
|||
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||
|
||||
"$BREW_PATH/bin/cmake" .. \
|
||||
-DBUILD_RPCS3_TESTS=OFF \
|
||||
-DRUN_RPCS3_TESTS=OFF \
|
||||
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DUSE_VULKAN=ON \
|
||||
|
|
|
@ -36,7 +36,7 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
|||
git clone https://github.com/engnr/qt-downloader.git
|
||||
cd qt-downloader
|
||||
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
||||
# nested Qt 6.9.0 URL workaround
|
||||
# nested Qt 6.9.1 URL workaround
|
||||
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
|
||||
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
|
||||
# archived Qt 6.7.3 URL workaround
|
||||
|
@ -44,7 +44,7 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
|||
cd "/tmp/Qt"
|
||||
arch -x86_64 "$BREW_X64_PATH/bin/pipenv" --python "$BREW_X64_PATH/bin/python3" run pip3 install py7zr requests semantic_version lxml
|
||||
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
|
||||
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.0 workaround
|
||||
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.1 workaround
|
||||
arch -x86_64 "$BREW_X64_PATH/bin/pipenv" --python "$BREW_X64_PATH/bin/python3" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
|
||||
fi
|
||||
|
||||
|
|
129
.cirrus.yml
129
.cirrus.yml
|
@ -7,99 +7,8 @@ env:
|
|||
BUILD_SOURCEBRANCHNAME: $CIRRUS_BRANCH
|
||||
RPCS3_TOKEN: ENCRYPTED[100ebb8e3552bf2021d0ef55dccda3e58d27be5b6cab0b0b92843ef490195d3c4edaefa087e4a3b425caa6392300b9b1]
|
||||
QT_VER_MAIN: '6'
|
||||
QT_VER: '6.9.0'
|
||||
QT_VER: '6.9.1'
|
||||
LLVM_COMPILER_VER: '19'
|
||||
LLVM_VER: '19.1.7'
|
||||
|
||||
# windows_task:
|
||||
# matrix:
|
||||
# - name: Cirrus Windows
|
||||
# windows_container:
|
||||
# image: cirrusci/windowsservercore:visualstudio2019
|
||||
# cpu: 8
|
||||
# memory: 16G
|
||||
# env:
|
||||
# CIRRUS_SHELL: "bash"
|
||||
# COMPILER: msvc
|
||||
# BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}\artifacts\
|
||||
# QT_VER_MSVC: 'msvc2022'
|
||||
# QT_DATE: '202503301022'
|
||||
# QTDIR: C:\Qt\${QT_VER}\${QT_VER_MSVC}_64
|
||||
# VULKAN_VER: '1.3.268.0'
|
||||
# VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
|
||||
# VULKAN_SDK: C:\VulkanSDK\${VULKAN_VER}
|
||||
# CACHE_DIR: "./cache"
|
||||
# UPLOAD_COMMIT_HASH: 7d09e3be30805911226241afbb14f8cdc2eb054e
|
||||
# UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-win"
|
||||
# deps_cache:
|
||||
# folder: "./cache"
|
||||
# #obj_cache:
|
||||
# # folder: "./tmp"
|
||||
# #obj2_cache:
|
||||
# # folder: "./rpcs3/x64"
|
||||
# setup_script:
|
||||
# - './.ci/get_keys-windows.sh'
|
||||
# - './.ci/setup-windows.sh'
|
||||
# rpcs3_script:
|
||||
# - export PATH=${PATH}:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
|
||||
# - msbuild.exe rpcs3.sln //p:Configuration=Release //m
|
||||
# deploy_script:
|
||||
# - mkdir artifacts
|
||||
# - source './.ci/export-cirrus-vars.sh'
|
||||
# - './.ci/deploy-windows.sh'
|
||||
# artifacts:
|
||||
# name: Artifact
|
||||
# path: "*.7z*"
|
||||
# push_script: |
|
||||
# if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
|
||||
# source './.ci/export-cirrus-vars.sh'
|
||||
# './.ci/github-upload.sh'
|
||||
# fi;
|
||||
|
||||
# linux_task:
|
||||
# container:
|
||||
# image: rpcs3/rpcs3-ci-jammy:1.6
|
||||
# cpu: 4
|
||||
# memory: 16G
|
||||
# env:
|
||||
# BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
|
||||
# ARTDIR: ${CIRRUS_WORKING_DIR}/artifacts/
|
||||
# CCACHE_DIR: "/tmp/ccache_dir"
|
||||
# CCACHE_MAXSIZE: 300M
|
||||
# CI_HAS_ARTIFACTS: true
|
||||
# UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
|
||||
# UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
|
||||
# DEPLOY_APPIMAGE: true
|
||||
# APPDIR: "./appdir"
|
||||
# RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
|
||||
# ccache_cache:
|
||||
# folder: "/tmp/ccache_dir"
|
||||
# matrix:
|
||||
# - name: Cirrus Linux GCC
|
||||
# env:
|
||||
# COMPILER: gcc
|
||||
# gcc_script:
|
||||
# - mkdir artifacts
|
||||
# - ".ci/build-linux.sh"
|
||||
# - name: Cirrus Linux Clang
|
||||
# env:
|
||||
# COMPILER: clang
|
||||
# clang_script:
|
||||
# - mkdir artifacts
|
||||
# - ".ci/build-linux.sh"
|
||||
# artifacts:
|
||||
# name: Artifact
|
||||
# path: "artifacts/*"
|
||||
# push_script: |
|
||||
# if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ] && [ "$COMPILER" = "gcc" ]; then
|
||||
# COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
|
||||
# COMM_COUNT=$(git rev-list --count HEAD)
|
||||
# COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
# export AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
|
||||
# .ci/github-upload.sh
|
||||
# fi;
|
||||
|
||||
freebsd_task:
|
||||
matrix:
|
||||
|
@ -115,39 +24,3 @@ freebsd_task:
|
|||
folder: /tmp/ccache_dir
|
||||
install_script: "sh -ex ./.ci/install-freebsd.sh"
|
||||
script: "./.ci/build-freebsd.sh"
|
||||
|
||||
# linux_aarch64_task:
|
||||
# env:
|
||||
# BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
|
||||
# ARTDIR: ${CIRRUS_WORKING_DIR}/artifacts/
|
||||
# CCACHE_DIR: "/tmp/ccache_dir"
|
||||
# CCACHE_MAXSIZE: 300M
|
||||
# CI_HAS_ARTIFACTS: true
|
||||
# UPLOAD_COMMIT_HASH: a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1
|
||||
# UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux-arm64"
|
||||
# DEPLOY_APPIMAGE: true
|
||||
# APPDIR: "./appdir"
|
||||
# RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
|
||||
# COMPILER: clang
|
||||
# ccache_cache:
|
||||
# folder: "/tmp/ccache_dir"
|
||||
# matrix:
|
||||
# - name: Cirrus Linux AArch64 Clang
|
||||
# arm_container:
|
||||
# image: 'docker.io/rpcs3/rpcs3-ci-jammy-aarch64:1.6'
|
||||
# cpu: 8
|
||||
# memory: 8G
|
||||
# clang_script:
|
||||
# - mkdir artifacts
|
||||
# - "sh -ex ./.ci/build-linux-aarch64.sh"
|
||||
# artifacts:
|
||||
# name: Artifact
|
||||
# path: "artifacts/*"
|
||||
# push_script: |
|
||||
# if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
|
||||
# COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
|
||||
# COMM_COUNT=$(git rev-list --count HEAD)
|
||||
# COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
# export AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
# .ci/github-upload.sh
|
||||
# fi;
|
||||
|
|
9
.github/workflows/rpcs3.yml
vendored
9
.github/workflows/rpcs3.yml
vendored
|
@ -137,6 +137,7 @@ jobs:
|
|||
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
|
||||
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
|
||||
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
|
||||
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@main
|
||||
|
@ -160,7 +161,7 @@ jobs:
|
|||
restore-keys: ${{ runner.os }}-qt-${{ matrix.name }}-${{ env.QT_VER }}
|
||||
|
||||
- name: Build
|
||||
run: ${{ matrix.build_sh }}
|
||||
run: ${{ matrix.build_sh }}
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@main
|
||||
|
@ -185,7 +186,7 @@ jobs:
|
|||
env:
|
||||
RPCS3_TOKEN: ${{ secrets.RPCS3_TOKEN }}
|
||||
run: .ci/github-upload.sh
|
||||
|
||||
|
||||
- name: Save Build Ccache
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: actions/cache/save@main
|
||||
|
@ -208,9 +209,9 @@ jobs:
|
|||
env:
|
||||
COMPILER: msvc
|
||||
QT_VER_MAIN: '6'
|
||||
QT_VER: '6.9.0'
|
||||
QT_VER: '6.9.1'
|
||||
QT_VER_MSVC: 'msvc2022'
|
||||
QT_DATE: '202503301022'
|
||||
QT_DATE: '202505291653'
|
||||
LLVM_VER: '19.1.7'
|
||||
VULKAN_VER: '1.3.268.0'
|
||||
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
|
||||
|
|
10
BUILDING.md
10
BUILDING.md
|
@ -19,26 +19,26 @@ The following tools are required to build RPCS3 on Windows 10 or later:
|
|||
with standalone **CMake** tool.
|
||||
|
||||
- [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
|
||||
- [Qt 6.9.0](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Qt 6.9.1](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
|
||||
The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode.
|
||||
|
||||
In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs:
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.9.0\msvc2022_64\`
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.9.1\msvc2022_64\`
|
||||
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
|
||||
|
||||
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead.
|
||||
|
||||
In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool):
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.9.0\msvc2022_64\`
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.9.1\msvc2022_64\`
|
||||
|
||||
### Linux
|
||||
|
||||
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager:
|
||||
- Clang 17+ or GCC 13+
|
||||
- [CMake 3.28.0+](https://www.cmake.org/download/)
|
||||
- [Qt 6.9.0](https://www.qt.io/download-qt-installer)
|
||||
- [Qt 6.9.1](https://www.qt.io/download-qt-installer)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
- [SDL3](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
|
||||
|
||||
|
@ -121,7 +121,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
|
|||
##### Configuring the Qt Plugin (if used)
|
||||
|
||||
1) go to `Extensions->Qt VS Tools->Qt Versions`
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.9.0\msvc2022_64`, version will fill in automatically
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.9.1\msvc2022_64`, version will fill in automatically
|
||||
3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**)
|
||||
4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**)
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ class thread_future
|
|||
thread_future* prev{};
|
||||
|
||||
protected:
|
||||
atomic_t<void(*)(thread_base*, thread_future*)> exec{};
|
||||
atomic_t<void(*)(const thread_base*, thread_future*)> exec{};
|
||||
|
||||
atomic_t<u32> done{0};
|
||||
|
||||
|
@ -389,7 +389,7 @@ public:
|
|||
: m_args(std::forward<Args>(args)...)
|
||||
, m_func(std::forward<Ctx>(func))
|
||||
{
|
||||
thread_future::exec.raw() = +[](thread_base* tb, thread_future* tf)
|
||||
thread_future::exec.raw() = +[](const thread_base* tb, thread_future* tf)
|
||||
{
|
||||
const auto _this = static_cast<future*>(tf);
|
||||
|
||||
|
|
|
@ -84,9 +84,8 @@ public:
|
|||
transactional_storage& operator=(const transactional_storage&) = delete;
|
||||
|
||||
transactional_storage(transactional_storage&& other)
|
||||
: pool(std::move(other.pool))
|
||||
{
|
||||
pool = std::move(other.pool);
|
||||
|
||||
std::unique_lock lock_other{other.current_mutex};
|
||||
const std::shared_ptr<T> other_current = other.current;
|
||||
other.current = nullptr;
|
||||
|
|
|
@ -351,7 +351,7 @@ public:
|
|||
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
||||
{
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
|
||||
const bool connected = pad && pad->is_connected() && i < attribute.max_connect;
|
||||
const bool connected = pad && pad->is_connected() && !pad->is_copilot() && i < attribute.max_connect;
|
||||
const bool is_real_move = g_cfg.io.move != move_handler::real || pad->m_pad_handler == pad_handler::move;
|
||||
|
||||
update_connection(i, connected && is_real_move);
|
||||
|
@ -407,7 +407,7 @@ public:
|
|||
std::lock_guard pad_lock(pad::g_pad_mutex);
|
||||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
if (pad && pad->m_pad_handler == pad_handler::move)
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && !pad->is_copilot())
|
||||
{
|
||||
if (!pad->move_data.calibration_requested || !pad->move_data.calibration_succeeded)
|
||||
{
|
||||
|
@ -437,7 +437,7 @@ public:
|
|||
std::lock_guard pad_lock(pad::g_pad_mutex);
|
||||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
if (pad && pad->m_pad_handler == pad_handler::move)
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && !pad->is_copilot())
|
||||
{
|
||||
pad->move_data.calibration_requested = false;
|
||||
pad->move_data.calibration_succeeded = false;
|
||||
|
@ -469,7 +469,7 @@ public:
|
|||
for (u32 i = 0; i < std::min<u32>(attribute.max_connect, CELL_GEM_MAX_NUM); i++)
|
||||
{
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && pad->is_connected())
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
connected_controllers++;
|
||||
|
||||
|
@ -490,7 +490,7 @@ public:
|
|||
for (u32 i = 0; i < std::min<u32>(attribute.max_connect, CELL_GEM_MAX_NUM); i++)
|
||||
{
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
|
||||
if (pad && pad->is_connected())
|
||||
if (pad && pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
connected_controllers++;
|
||||
|
||||
|
@ -1776,7 +1776,7 @@ static void ds3_input_to_pad(const u32 gem_num, be_t<u16>& digital_buttons, be_t
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1864,7 +1864,7 @@ static void ds3_pos_to_gem_state(u32 gem_num, gem_config::gem_controller& contro
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1895,7 +1895,7 @@ static void ps_move_pos_to_gem_state(u32 gem_num, gem_config::gem_controller& co
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected())
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1940,7 +1940,7 @@ static void ds3_input_to_ext(u32 gem_num, gem_config::gem_controller& controller
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1952,7 +1952,7 @@ static void ds3_input_to_ext(u32 gem_num, gem_config::gem_controller& controller
|
|||
|
||||
ext.status = controller.ext_status;
|
||||
|
||||
for (const AnalogStick& stick : pad->m_sticks)
|
||||
for (const AnalogStick& stick : pad->m_sticks_external)
|
||||
{
|
||||
switch (stick.m_offset)
|
||||
{
|
||||
|
@ -1964,7 +1964,7 @@ static void ds3_input_to_ext(u32 gem_num, gem_config::gem_controller& controller
|
|||
}
|
||||
}
|
||||
|
||||
for (const Button& button : pad->m_buttons)
|
||||
for (const Button& button : pad->m_buttons_external)
|
||||
{
|
||||
if (!button.m_pressed)
|
||||
continue;
|
||||
|
@ -2400,7 +2400,7 @@ error_code cellGemEnableMagnetometer(u32 gem_num, u32 enable)
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad && pad->m_pad_handler == pad_handler::move)
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && !pad->is_copilot())
|
||||
{
|
||||
pad->move_data.magnetometer_enabled = controller.enabled_magnetometer;
|
||||
}
|
||||
|
@ -2448,7 +2448,7 @@ error_code cellGemEnableMagnetometer2(u32 gem_num, u32 enable)
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad && pad->m_pad_handler == pad_handler::move)
|
||||
if (pad && pad->m_pad_handler == pad_handler::move && !pad->is_copilot())
|
||||
{
|
||||
pad->move_data.magnetometer_enabled = controller.enabled_magnetometer;
|
||||
}
|
||||
|
@ -2777,7 +2777,7 @@ error_code cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, v
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad && pad->is_connected())
|
||||
if (pad && pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
inertial_state->temperature = pad->move_data.temperature;
|
||||
inertial_state->accelerometer[0] = pad->move_data.accelerometer_x;
|
||||
|
@ -3392,7 +3392,7 @@ error_code cellGemReadExternalPortDeviceInfo(u32 gem_num, vm::ptr<u32> ext_id, v
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected())
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return CELL_GEM_NOT_CONNECTED;
|
||||
}
|
||||
|
@ -3706,7 +3706,7 @@ error_code cellGemWriteExternalPort(u32 gem_num, vm::ptr<u8[CELL_GEM_EXTERNAL_PO
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), pad_num(gem_num));
|
||||
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected())
|
||||
if (pad->m_pad_handler != pad_handler::move || !pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return CELL_GEM_NOT_CONNECTED;
|
||||
}
|
||||
|
|
|
@ -411,60 +411,27 @@ void pad_get_data(u32 port_no, CellPadData* data, bool get_periph_data = false)
|
|||
}
|
||||
};
|
||||
|
||||
for (const Button& button : pad->m_buttons)
|
||||
for (const Button& button : pad->m_buttons_external)
|
||||
{
|
||||
// here we check btns, and set pad accordingly,
|
||||
// if something changed, set btnChanged
|
||||
|
||||
bool pressed = button.m_pressed;
|
||||
u16 value = button.m_value;
|
||||
|
||||
// Merge copilots
|
||||
if (!pad->copilots.empty())
|
||||
{
|
||||
for (const auto& copilot : pad->copilots)
|
||||
{
|
||||
if (!copilot || !copilot->is_connected())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const Button& other : copilot->m_buttons)
|
||||
{
|
||||
if (button.m_offset == other.m_offset && button.m_outKeyCode == other.m_outKeyCode)
|
||||
{
|
||||
if (other.m_pressed)
|
||||
{
|
||||
pressed = true;
|
||||
|
||||
if (value < other.m_value)
|
||||
{
|
||||
value = other.m_value;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (button.m_offset)
|
||||
{
|
||||
case CELL_PAD_BTN_OFFSET_DIGITAL1:
|
||||
{
|
||||
if (pressed)
|
||||
if (button.m_pressed)
|
||||
pad->m_digital_1 |= button.m_outKeyCode;
|
||||
else
|
||||
pad->m_digital_1 &= ~button.m_outKeyCode;
|
||||
|
||||
switch (button.m_outKeyCode)
|
||||
{
|
||||
case CELL_PAD_CTRL_LEFT: set_value(pad->m_press_left, value); break;
|
||||
case CELL_PAD_CTRL_DOWN: set_value(pad->m_press_down, value); break;
|
||||
case CELL_PAD_CTRL_RIGHT: set_value(pad->m_press_right, value); break;
|
||||
case CELL_PAD_CTRL_UP: set_value(pad->m_press_up, value); break;
|
||||
// These arent pressure btns
|
||||
case CELL_PAD_CTRL_LEFT: set_value(pad->m_press_left, button.m_value); break;
|
||||
case CELL_PAD_CTRL_DOWN: set_value(pad->m_press_down, button.m_value); break;
|
||||
case CELL_PAD_CTRL_RIGHT: set_value(pad->m_press_right, button.m_value); break;
|
||||
case CELL_PAD_CTRL_UP: set_value(pad->m_press_up, button.m_value); break;
|
||||
// These aren't pressure btns
|
||||
case CELL_PAD_CTRL_R3:
|
||||
case CELL_PAD_CTRL_L3:
|
||||
case CELL_PAD_CTRL_START:
|
||||
|
@ -475,21 +442,21 @@ void pad_get_data(u32 port_no, CellPadData* data, bool get_periph_data = false)
|
|||
}
|
||||
case CELL_PAD_BTN_OFFSET_DIGITAL2:
|
||||
{
|
||||
if (pressed)
|
||||
if (button.m_pressed)
|
||||
pad->m_digital_2 |= button.m_outKeyCode;
|
||||
else
|
||||
pad->m_digital_2 &= ~button.m_outKeyCode;
|
||||
|
||||
switch (button.m_outKeyCode)
|
||||
{
|
||||
case CELL_PAD_CTRL_SQUARE: set_value(pad->m_press_square, value); break;
|
||||
case CELL_PAD_CTRL_CROSS: set_value(pad->m_press_cross, value); break;
|
||||
case CELL_PAD_CTRL_CIRCLE: set_value(pad->m_press_circle, value); break;
|
||||
case CELL_PAD_CTRL_TRIANGLE: set_value(pad->m_press_triangle, value); break;
|
||||
case CELL_PAD_CTRL_R1: set_value(pad->m_press_R1, value); break;
|
||||
case CELL_PAD_CTRL_L1: set_value(pad->m_press_L1, value); break;
|
||||
case CELL_PAD_CTRL_R2: set_value(pad->m_press_R2, value); break;
|
||||
case CELL_PAD_CTRL_L2: set_value(pad->m_press_L2, value); break;
|
||||
case CELL_PAD_CTRL_SQUARE: set_value(pad->m_press_square, button.m_value); break;
|
||||
case CELL_PAD_CTRL_CROSS: set_value(pad->m_press_cross, button.m_value); break;
|
||||
case CELL_PAD_CTRL_CIRCLE: set_value(pad->m_press_circle, button.m_value); break;
|
||||
case CELL_PAD_CTRL_TRIANGLE: set_value(pad->m_press_triangle, button.m_value); break;
|
||||
case CELL_PAD_CTRL_R1: set_value(pad->m_press_R1, button.m_value); break;
|
||||
case CELL_PAD_CTRL_L1: set_value(pad->m_press_L1, button.m_value); break;
|
||||
case CELL_PAD_CTRL_R2: set_value(pad->m_press_R2, button.m_value); break;
|
||||
case CELL_PAD_CTRL_L2: set_value(pad->m_press_L2, button.m_value); break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -498,18 +465,18 @@ void pad_get_data(u32 port_no, CellPadData* data, bool get_periph_data = false)
|
|||
{
|
||||
switch (button.m_outKeyCode)
|
||||
{
|
||||
case CELL_PAD_CTRL_PRESS_RIGHT: set_value(pad->m_press_right, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_LEFT: set_value(pad->m_press_left, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_UP: set_value(pad->m_press_up, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_DOWN: set_value(pad->m_press_down, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_TRIANGLE: set_value(pad->m_press_triangle, value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_CIRCLE: set_value(pad->m_press_circle, value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_CROSS: set_value(pad->m_press_cross, value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_SQUARE: set_value(pad->m_press_square, value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_L1: set_value(pad->m_press_L1, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_R1: set_value(pad->m_press_R1, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_L2: set_value(pad->m_press_L2, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_R2: set_value(pad->m_press_R2, value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_RIGHT: set_value(pad->m_press_right, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_LEFT: set_value(pad->m_press_left, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_UP: set_value(pad->m_press_up, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_DOWN: set_value(pad->m_press_down, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_TRIANGLE: set_value(pad->m_press_triangle, button.m_value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_CIRCLE: set_value(pad->m_press_circle, button.m_value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_CROSS: set_value(pad->m_press_cross, button.m_value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_SQUARE: set_value(pad->m_press_square, button.m_value, true, 255, 63); break; // Infrared on RIDE Skateboard
|
||||
case CELL_PAD_CTRL_PRESS_L1: set_value(pad->m_press_L1, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_R1: set_value(pad->m_press_R1, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_L2: set_value(pad->m_press_L2, button.m_value, true); break;
|
||||
case CELL_PAD_CTRL_PRESS_R2: set_value(pad->m_press_R2, button.m_value, true); break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
@ -519,46 +486,14 @@ void pad_get_data(u32 port_no, CellPadData* data, bool get_periph_data = false)
|
|||
}
|
||||
}
|
||||
|
||||
for (const AnalogStick& stick : pad->m_sticks)
|
||||
for (const AnalogStick& stick : pad->m_sticks_external)
|
||||
{
|
||||
u16 value = stick.m_value;
|
||||
|
||||
// Merge copilots
|
||||
if (!pad->copilots.empty())
|
||||
{
|
||||
const auto normalize = [](s32 value)
|
||||
{
|
||||
return (value - 128) / 127.0f;
|
||||
};
|
||||
|
||||
f32 accumulated_value = normalize(value);
|
||||
|
||||
for (const auto& copilot : pad->copilots)
|
||||
{
|
||||
if (!copilot || !copilot->is_connected())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const AnalogStick& other : copilot->m_sticks)
|
||||
{
|
||||
if (stick.m_offset == other.m_offset)
|
||||
{
|
||||
accumulated_value += normalize(other.m_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
value = static_cast<u16>(std::round(std::clamp(accumulated_value * 127.0f + 128.0f, 0.0f, 255.0f)));
|
||||
}
|
||||
|
||||
switch (stick.m_offset)
|
||||
{
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X: set_value(pad->m_analog_left_x, value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y: set_value(pad->m_analog_left_y, value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X: set_value(pad->m_analog_right_x, value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_Y: set_value(pad->m_analog_right_y, value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X: set_value(pad->m_analog_left_x, stick.m_value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y: set_value(pad->m_analog_left_y, stick.m_value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X: set_value(pad->m_analog_right_x, stick.m_value); break;
|
||||
case CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_Y: set_value(pad->m_analog_right_y, stick.m_value); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
@ -1305,7 +1240,7 @@ error_code cellPadLddGetPortNo(s32 handle)
|
|||
return CELL_PAD_ERROR_UNINITIALIZED;
|
||||
|
||||
const auto handler = pad::get_pad_thread();
|
||||
auto& pads = handler->GetPads();
|
||||
const auto& pads = handler->GetPads();
|
||||
|
||||
if (handle < 0 || static_cast<u32>(handle) >= pads.size())
|
||||
return CELL_PAD_ERROR_INVALID_PARAMETER;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "Emu/Io/pad_types.h"
|
||||
|
||||
#include <array>
|
||||
#include "util/types.hpp"
|
||||
|
||||
enum CellPadError : u32
|
||||
{
|
||||
|
|
|
@ -173,7 +173,7 @@ void usb_device_buzz::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint*/
|
|||
{
|
||||
const auto& pad = pads[i];
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ void usb_device_ghltar::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint
|
|||
const auto handler = pad::get_pad_thread();
|
||||
const auto& pad = ::at32(handler->GetPads(), m_controller_index);
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -198,9 +198,9 @@ void usb_device_gametablet::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endp
|
|||
const auto gamepad_handler = pad::get_pad_thread();
|
||||
const auto& pads = gamepad_handler->GetPads();
|
||||
const auto& pad = ::at32(pads, m_controller_index);
|
||||
if (pad->is_connected())
|
||||
if (pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
for (Button& button : pad->m_buttons)
|
||||
for (Button& button : pad->m_buttons_external)
|
||||
{
|
||||
if (!button.m_pressed)
|
||||
{
|
||||
|
|
|
@ -258,7 +258,7 @@ void usb_device_guncon3::interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint,
|
|||
const auto gamepad_handler = pad::get_pad_thread();
|
||||
const auto& pads = gamepad_handler->GetPads();
|
||||
const auto& pad = ::at32(pads, m_controller_index);
|
||||
if (pad->is_connected())
|
||||
if (pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
cfg->handle_input(pad, true, input_callback);
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ void usb_device_topshotelite::interrupt_transfer(u32 buf_size, u8* buf, u32 /*en
|
|||
const auto gamepad_handler = pad::get_pad_thread();
|
||||
const auto& pads = gamepad_handler->GetPads();
|
||||
const auto& pad = ::at32(pads, m_controller_index);
|
||||
if (pad->is_connected())
|
||||
if (pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
cfg->handle_input(pad, true, input_callback);
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ void usb_device_topshotfearmaster::interrupt_transfer(u32 buf_size, u8* buf, u32
|
|||
const auto gamepad_handler = pad::get_pad_thread();
|
||||
const auto& pads = gamepad_handler->GetPads();
|
||||
const auto& pad = ::at32(pads, m_controller_index);
|
||||
if (pad->is_connected())
|
||||
if (pad->is_connected() && !pad->is_copilot())
|
||||
{
|
||||
cfg->handle_input(pad, true, input_callback);
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ void usb_device_turntable::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpo
|
|||
const auto& pads = handler->GetPads();
|
||||
const auto& pad = ::at32(pads, m_controller_index);
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
return;
|
||||
|
||||
const auto& cfg = ::at32(g_cfg_turntable.players, m_controller_index);
|
||||
|
|
|
@ -90,10 +90,10 @@ public:
|
|||
|
||||
void handle_input(std::shared_ptr<Pad> pad, bool press_only, const std::function<void(T, pad_button, u16, bool, bool&)>& func) const
|
||||
{
|
||||
if (!pad)
|
||||
if (!pad || pad->is_copilot())
|
||||
return;
|
||||
|
||||
for (const Button& button : pad->m_buttons)
|
||||
for (const Button& button : pad->m_buttons_external)
|
||||
{
|
||||
if (button.m_pressed || !press_only)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
for (const AnalogStick& stick : pad->m_sticks)
|
||||
for (const AnalogStick& stick : pad->m_sticks_external)
|
||||
{
|
||||
if (handle_input(func, stick.m_offset, get_axis_keycode(stick.m_offset, stick.m_value), stick.m_value, true, true))
|
||||
{
|
||||
|
|
|
@ -543,6 +543,9 @@ struct Pad
|
|||
std::array<AnalogSensor, 4> m_sensors{};
|
||||
std::array<VibrateMotor, 2> m_vibrateMotors{};
|
||||
|
||||
std::vector<Button> m_buttons_external;
|
||||
std::array<AnalogStick, 4> m_sticks_external{};
|
||||
|
||||
std::vector<std::shared_ptr<Pad>> copilots;
|
||||
|
||||
// These hold bits for their respective buttons
|
||||
|
@ -612,6 +615,12 @@ struct Pad
|
|||
return umax;
|
||||
}
|
||||
|
||||
bool is_copilot() const
|
||||
{
|
||||
const u32 copilot_player_id = copilot_player();
|
||||
return copilot_player_id != umax && copilot_player_id != m_player_id;
|
||||
}
|
||||
|
||||
bool is_connected() const
|
||||
{
|
||||
return !!(m_port_status & CELL_PAD_STATUS_CONNECTED);
|
||||
|
|
|
@ -210,7 +210,7 @@ void usb_device_usio::translate_input_taiko()
|
|||
const usz offset = player * 8ULL;
|
||||
auto& status = m_io_status[0];
|
||||
|
||||
if (const auto& pad = ::at32(handler->GetPads(), pad_number); pad->is_connected() && is_input_allowed())
|
||||
if (const auto& pad = ::at32(handler->GetPads(), pad_number); pad->is_connected() && !pad->is_copilot() && is_input_allowed())
|
||||
{
|
||||
const auto& cfg = ::at32(g_cfg_usio.players, pad_number);
|
||||
cfg->handle_input(pad, false, [&](usio_btn btn, pad_button /*pad_btn*/, u16 /*value*/, bool pressed, bool& /*abort*/)
|
||||
|
@ -295,7 +295,7 @@ void usb_device_usio::translate_input_tekken()
|
|||
auto& status = m_io_status[player / 2];
|
||||
auto& input = digital_input[player / 2];
|
||||
|
||||
if (const auto& pad = ::at32(handler->GetPads(), pad_number); pad->is_connected() && is_input_allowed())
|
||||
if (const auto& pad = ::at32(handler->GetPads(), pad_number); pad->is_connected() && !pad->is_copilot() && is_input_allowed())
|
||||
{
|
||||
const auto& cfg = ::at32(g_cfg_usio.players, pad_number);
|
||||
cfg->handle_input(pad, false, [&](usio_btn btn, pad_button /*pad_btn*/, u16 /*value*/, bool pressed, bool& /*abort*/)
|
||||
|
|
|
@ -81,7 +81,8 @@ namespace vm
|
|||
|
||||
static inline atomic_t<reservation_waiter_t>* reservation_notifier_begin_wait(u32 raddr, u64 rtime)
|
||||
{
|
||||
atomic_t<reservation_waiter_t>& waiter = *reservation_notifier(raddr).first;
|
||||
const auto notifiers = reservation_notifier(raddr);
|
||||
atomic_t<reservation_waiter_t>& waiter = *notifiers.first;
|
||||
|
||||
waiter.atomic_op([](reservation_waiter_t& value)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace np
|
|||
u32 last_free = 0;
|
||||
bool found_space = false;
|
||||
|
||||
for (auto& a : m_allocs)
|
||||
for (const auto& a : m_allocs)
|
||||
{
|
||||
if ((a.first - last_free) >= alloc_size)
|
||||
{
|
||||
|
|
|
@ -225,7 +225,7 @@ namespace rsx
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!pad->is_connected())
|
||||
if (!pad->is_connected() || pad->is_copilot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ namespace rsx
|
|||
continue;
|
||||
}
|
||||
|
||||
for (const Button& button : pad->m_buttons)
|
||||
for (const Button& button : pad->m_buttons_external)
|
||||
{
|
||||
pad_button button_id = pad_button::pad_button_max_enum;
|
||||
if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL1)
|
||||
|
@ -391,7 +391,7 @@ namespace rsx
|
|||
break;
|
||||
}
|
||||
|
||||
for (const AnalogStick& stick : pad->m_sticks)
|
||||
for (const AnalogStick& stick : pad->m_sticks_external)
|
||||
{
|
||||
pad_button button_id = pad_button::pad_button_max_enum;
|
||||
pad_button release_id = pad_button::pad_button_max_enum;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define VMA_IMPLEMENTATION
|
||||
#define VMA_VULKAN_VERSION 1000000
|
||||
#define VMA_VULKAN_VERSION 1002000
|
||||
|
||||
#include "util/atomic.hpp"
|
||||
#include "Utilities/mutex.h"
|
||||
|
|
|
@ -77,32 +77,29 @@ namespace vk
|
|||
VkDescriptorSetLayoutBindingFlagsCreateInfo binding_infos = {};
|
||||
rsx::simple_array<VkDescriptorBindingFlags> binding_flags;
|
||||
|
||||
if (g_render_device->get_descriptor_indexing_support())
|
||||
const auto deferred_mask = g_render_device->get_descriptor_update_after_bind_support();
|
||||
binding_flags.resize(::size32(bindings));
|
||||
|
||||
for (u32 i = 0; i < binding_flags.size(); ++i)
|
||||
{
|
||||
const auto deferred_mask = g_render_device->get_descriptor_update_after_bind_support();
|
||||
binding_flags.resize(::size32(bindings));
|
||||
|
||||
for (u32 i = 0; i < binding_flags.size(); ++i)
|
||||
if ((1ull << bindings[i].descriptorType) & ~deferred_mask)
|
||||
{
|
||||
if ((1ull << bindings[i].descriptorType) & ~deferred_mask)
|
||||
{
|
||||
binding_flags[i] = 0u;
|
||||
}
|
||||
else
|
||||
{
|
||||
binding_flags[i] = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT;
|
||||
}
|
||||
binding_flags[i] = 0u;
|
||||
}
|
||||
else
|
||||
{
|
||||
binding_flags[i] = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT;
|
||||
}
|
||||
|
||||
binding_infos.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT;
|
||||
binding_infos.pNext = nullptr;
|
||||
binding_infos.bindingCount = ::size32(binding_flags);
|
||||
binding_infos.pBindingFlags = binding_flags.data();
|
||||
|
||||
infos.pNext = &binding_infos;
|
||||
infos.flags |= VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT;
|
||||
}
|
||||
|
||||
binding_infos.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT;
|
||||
binding_infos.pNext = nullptr;
|
||||
binding_infos.bindingCount = ::size32(binding_flags);
|
||||
binding_infos.pBindingFlags = binding_flags.data();
|
||||
|
||||
infos.pNext = &binding_infos;
|
||||
infos.flags |= VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT;
|
||||
|
||||
VkDescriptorSetLayout result;
|
||||
CHECK_RESULT(vkCreateDescriptorSetLayout(*g_render_device, &infos, nullptr, &result));
|
||||
return result;
|
||||
|
|
|
@ -20,125 +20,109 @@ namespace vk
|
|||
supported_extensions instance_extensions(supported_extensions::instance);
|
||||
supported_extensions device_extensions(supported_extensions::device, nullptr, dev);
|
||||
|
||||
if (!instance_extensions.is_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
|
||||
VkPhysicalDeviceFeatures2KHR features2;
|
||||
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
||||
features2.pNext = nullptr;
|
||||
|
||||
VkPhysicalDeviceFloat16Int8FeaturesKHR shader_support_info{};
|
||||
VkPhysicalDeviceDescriptorIndexingFeatures descriptor_indexing_info{};
|
||||
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT fbo_loops_info{};
|
||||
VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR shader_barycentric_info{};
|
||||
VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border_color_info{};
|
||||
VkPhysicalDeviceBorderColorSwizzleFeaturesEXT border_color_swizzle_info{};
|
||||
VkPhysicalDeviceFaultFeaturesEXT device_fault_info{};
|
||||
VkPhysicalDeviceMultiDrawFeaturesEXT multidraw_info{};
|
||||
|
||||
// Core features
|
||||
shader_support_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES;
|
||||
features2.pNext = &shader_support_info;
|
||||
|
||||
descriptor_indexing_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
|
||||
descriptor_indexing_info.pNext = features2.pNext;
|
||||
features2.pNext = &descriptor_indexing_info;
|
||||
descriptor_indexing_support = true;
|
||||
|
||||
// Optional features
|
||||
if (device_extensions.is_supported(VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME))
|
||||
{
|
||||
vkGetPhysicalDeviceFeatures(dev, &features);
|
||||
fbo_loops_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT;
|
||||
fbo_loops_info.pNext = features2.pNext;
|
||||
features2.pNext = &fbo_loops_info;
|
||||
}
|
||||
else
|
||||
|
||||
if (device_extensions.is_supported(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME))
|
||||
{
|
||||
VkPhysicalDeviceFeatures2KHR features2;
|
||||
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
||||
features2.pNext = nullptr;
|
||||
shader_barycentric_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR;
|
||||
shader_barycentric_info.pNext = features2.pNext;
|
||||
features2.pNext = &shader_barycentric_info;
|
||||
}
|
||||
|
||||
VkPhysicalDeviceFloat16Int8FeaturesKHR shader_support_info{};
|
||||
VkPhysicalDeviceDescriptorIndexingFeatures descriptor_indexing_info{};
|
||||
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT fbo_loops_info{};
|
||||
VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR shader_barycentric_info{};
|
||||
VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border_color_info{};
|
||||
VkPhysicalDeviceBorderColorSwizzleFeaturesEXT border_color_swizzle_info{};
|
||||
VkPhysicalDeviceFaultFeaturesEXT device_fault_info{};
|
||||
VkPhysicalDeviceMultiDrawFeaturesEXT multidraw_info{};
|
||||
if (device_extensions.is_supported(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME))
|
||||
{
|
||||
custom_border_color_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT;
|
||||
custom_border_color_info.pNext = features2.pNext;
|
||||
features2.pNext = &custom_border_color_info;
|
||||
}
|
||||
|
||||
if (device_extensions.is_supported(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME))
|
||||
{
|
||||
shader_support_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR;
|
||||
features2.pNext = &shader_support_info;
|
||||
}
|
||||
if (device_extensions.is_supported(VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME))
|
||||
{
|
||||
border_color_swizzle_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT;
|
||||
border_color_swizzle_info.pNext = features2.pNext;
|
||||
features2.pNext = &border_color_swizzle_info;
|
||||
}
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME))
|
||||
{
|
||||
descriptor_indexing_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
|
||||
descriptor_indexing_info.pNext = features2.pNext;
|
||||
features2.pNext = &descriptor_indexing_info;
|
||||
descriptor_indexing_support = true;
|
||||
}
|
||||
if (device_extensions.is_supported(VK_EXT_DEVICE_FAULT_EXTENSION_NAME))
|
||||
{
|
||||
device_fault_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT;
|
||||
device_fault_info.pNext = features2.pNext;
|
||||
features2.pNext = &device_fault_info;
|
||||
}
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME))
|
||||
{
|
||||
fbo_loops_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT;
|
||||
fbo_loops_info.pNext = features2.pNext;
|
||||
features2.pNext = &fbo_loops_info;
|
||||
}
|
||||
if (device_extensions.is_supported(VK_EXT_MULTI_DRAW_EXTENSION_NAME))
|
||||
{
|
||||
multidraw_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT;
|
||||
multidraw_info.pNext = features2.pNext;
|
||||
features2.pNext = &multidraw_info;
|
||||
}
|
||||
|
||||
if (device_extensions.is_supported(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME))
|
||||
{
|
||||
shader_barycentric_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR;
|
||||
shader_barycentric_info.pNext = features2.pNext;
|
||||
features2.pNext = &shader_barycentric_info;
|
||||
}
|
||||
vkGetPhysicalDeviceFeatures2(dev, &features2);
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME))
|
||||
{
|
||||
custom_border_color_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT;
|
||||
custom_border_color_info.pNext = features2.pNext;
|
||||
features2.pNext = &custom_border_color_info;
|
||||
}
|
||||
shader_types_support.allow_float64 = !!features2.features.shaderFloat64;
|
||||
shader_types_support.allow_float16 = !!shader_support_info.shaderFloat16;
|
||||
shader_types_support.allow_int8 = !!shader_support_info.shaderInt8;
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME))
|
||||
{
|
||||
border_color_swizzle_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT;
|
||||
border_color_swizzle_info.pNext = features2.pNext;
|
||||
features2.pNext = &border_color_swizzle_info;
|
||||
}
|
||||
custom_border_color_support.supported = !!custom_border_color_info.customBorderColors && !!custom_border_color_info.customBorderColorWithoutFormat;
|
||||
custom_border_color_support.swizzle_extension_supported = border_color_swizzle_info.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT;
|
||||
custom_border_color_support.require_border_color_remap = !border_color_swizzle_info.borderColorSwizzleFromImage;
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_DEVICE_FAULT_EXTENSION_NAME))
|
||||
{
|
||||
device_fault_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT;
|
||||
device_fault_info.pNext = features2.pNext;
|
||||
features2.pNext = &device_fault_info;
|
||||
}
|
||||
multidraw_support.supported = !!multidraw_info.multiDraw;
|
||||
multidraw_support.max_batch_size = 65536;
|
||||
|
||||
if (device_extensions.is_supported(VK_EXT_MULTI_DRAW_EXTENSION_NAME))
|
||||
{
|
||||
multidraw_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT;
|
||||
multidraw_info.pNext = features2.pNext;
|
||||
features2.pNext = &multidraw_info;
|
||||
}
|
||||
optional_features_support.barycentric_coords = !!shader_barycentric_info.fragmentShaderBarycentric;
|
||||
optional_features_support.framebuffer_loops = !!fbo_loops_info.attachmentFeedbackLoopLayout;
|
||||
optional_features_support.extended_device_fault = !!device_fault_info.deviceFault;
|
||||
|
||||
auto _vkGetPhysicalDeviceFeatures2KHR = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures2KHR>(vkGetInstanceProcAddr(parent, "vkGetPhysicalDeviceFeatures2KHR"));
|
||||
ensure(_vkGetPhysicalDeviceFeatures2KHR); // "vkGetInstanceProcAddress failed to find entry point!"
|
||||
_vkGetPhysicalDeviceFeatures2KHR(dev, &features2);
|
||||
features = features2.features;
|
||||
|
||||
shader_types_support.allow_float64 = !!features2.features.shaderFloat64;
|
||||
shader_types_support.allow_float16 = !!shader_support_info.shaderFloat16;
|
||||
shader_types_support.allow_int8 = !!shader_support_info.shaderInt8;
|
||||
|
||||
custom_border_color_support.supported = !!custom_border_color_info.customBorderColors && !!custom_border_color_info.customBorderColorWithoutFormat;
|
||||
custom_border_color_support.swizzle_extension_supported = border_color_swizzle_info.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT;
|
||||
custom_border_color_support.require_border_color_remap = !border_color_swizzle_info.borderColorSwizzleFromImage;
|
||||
|
||||
multidraw_support.supported = !!multidraw_info.multiDraw;
|
||||
multidraw_support.max_batch_size = 65536;
|
||||
|
||||
optional_features_support.barycentric_coords = !!shader_barycentric_info.fragmentShaderBarycentric;
|
||||
optional_features_support.framebuffer_loops = !!fbo_loops_info.attachmentFeedbackLoopLayout;
|
||||
optional_features_support.extended_device_fault = !!device_fault_info.deviceFault;
|
||||
|
||||
features = features2.features;
|
||||
|
||||
if (descriptor_indexing_support)
|
||||
{
|
||||
descriptor_indexing_support.supported = true; // VK_API_VERSION_1_2
|
||||
#define SET_DESCRIPTOR_BITFLAG(field, bit) if (descriptor_indexing_info.field) descriptor_indexing_support.update_after_bind_mask |= (1ull << bit)
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingUniformBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingSampledImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingSampledImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingUniformTexelBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageTexelBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingUniformBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingSampledImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingSampledImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageImageUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingUniformTexelBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER);
|
||||
SET_DESCRIPTOR_BITFLAG(descriptorBindingStorageTexelBufferUpdateAfterBind, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER);
|
||||
#undef SET_DESCRIPTOR_BITFLAG
|
||||
}
|
||||
}
|
||||
|
||||
optional_features_support.shader_stencil_export = device_extensions.is_supported(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME);
|
||||
optional_features_support.conditional_rendering = device_extensions.is_supported(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME);
|
||||
optional_features_support.external_memory_host = device_extensions.is_supported(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME);
|
||||
optional_features_support.sampler_mirror_clamped = device_extensions.is_supported(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME);
|
||||
optional_features_support.synchronization_2 = device_extensions.is_supported(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);
|
||||
optional_features_support.unrestricted_depth_range = device_extensions.is_supported(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME);
|
||||
|
||||
optional_features_support.debug_utils = instance_extensions.is_supported(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
|
||||
optional_features_support.surface_capabilities_2 = instance_extensions.is_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||
optional_features_support.surface_capabilities_2 = instance_extensions.is_supported(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME);
|
||||
|
||||
// Post-initialization checks
|
||||
if (!custom_border_color_support.swizzle_extension_supported)
|
||||
|
@ -172,16 +156,6 @@ namespace vk
|
|||
return;
|
||||
}
|
||||
|
||||
// Try to query driver properties if possible
|
||||
supported_extensions instance_extensions(supported_extensions::instance);
|
||||
supported_extensions device_extensions(supported_extensions::device, nullptr, dev);
|
||||
|
||||
if (!instance_extensions.is_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) ||
|
||||
!device_extensions.is_supported(VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VkPhysicalDeviceProperties2KHR properties2;
|
||||
properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
|
||||
properties2.pNext = nullptr;
|
||||
|
@ -189,11 +163,7 @@ namespace vk
|
|||
driver_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
|
||||
driver_properties.pNext = properties2.pNext;
|
||||
properties2.pNext = &driver_properties;
|
||||
|
||||
auto _vkGetPhysicalDeviceProperties2KHR = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties2KHR>(vkGetInstanceProcAddr(parent, "vkGetPhysicalDeviceProperties2KHR"));
|
||||
ensure(_vkGetPhysicalDeviceProperties2KHR);
|
||||
|
||||
_vkGetPhysicalDeviceProperties2KHR(dev, &properties2);
|
||||
vkGetPhysicalDeviceProperties2(dev, &properties2);
|
||||
}
|
||||
|
||||
void physical_device::get_physical_device_properties_1(bool allow_extensions)
|
||||
|
@ -204,14 +174,8 @@ namespace vk
|
|||
return;
|
||||
}
|
||||
|
||||
supported_extensions instance_extensions(supported_extensions::instance);
|
||||
supported_extensions device_extensions(supported_extensions::device, nullptr, dev);
|
||||
|
||||
if (!instance_extensions.is_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VkPhysicalDeviceProperties2KHR properties2;
|
||||
properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
|
||||
properties2.pNext = nullptr;
|
||||
|
@ -219,12 +183,9 @@ namespace vk
|
|||
VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_props{};
|
||||
VkPhysicalDeviceMultiDrawPropertiesEXT multidraw_props{};
|
||||
|
||||
if (descriptor_indexing_support)
|
||||
{
|
||||
descriptor_indexing_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT;
|
||||
descriptor_indexing_props.pNext = properties2.pNext;
|
||||
properties2.pNext = &descriptor_indexing_props;
|
||||
}
|
||||
descriptor_indexing_props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT;
|
||||
descriptor_indexing_props.pNext = properties2.pNext;
|
||||
properties2.pNext = &descriptor_indexing_props;
|
||||
|
||||
if (multidraw_support.supported)
|
||||
{
|
||||
|
@ -233,10 +194,7 @@ namespace vk
|
|||
properties2.pNext = &multidraw_props;
|
||||
}
|
||||
|
||||
auto _vkGetPhysicalDeviceProperties2KHR = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties2KHR>(vkGetInstanceProcAddr(parent, "vkGetPhysicalDeviceProperties2KHR"));
|
||||
ensure(_vkGetPhysicalDeviceProperties2KHR);
|
||||
|
||||
_vkGetPhysicalDeviceProperties2KHR(dev, &properties2);
|
||||
vkGetPhysicalDeviceProperties2(dev, &properties2);
|
||||
props = properties2.properties;
|
||||
|
||||
if (descriptor_indexing_support)
|
||||
|
@ -548,11 +506,6 @@ namespace vk
|
|||
// 1. Anisotropic sampling
|
||||
// 2. Indexable storage buffers
|
||||
VkPhysicalDeviceFeatures enabled_features{};
|
||||
if (pgpu->shader_types_support.allow_float16)
|
||||
{
|
||||
requested_extensions.push_back(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (pgpu->custom_border_color_support)
|
||||
{
|
||||
requested_extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME);
|
||||
|
@ -575,7 +528,6 @@ namespace vk
|
|||
|
||||
if (pgpu->optional_features_support.external_memory_host)
|
||||
{
|
||||
requested_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
|
||||
requested_extensions.push_back(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
|
@ -584,17 +536,6 @@ namespace vk
|
|||
requested_extensions.push_back(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (pgpu->optional_features_support.sampler_mirror_clamped)
|
||||
{
|
||||
requested_extensions.push_back(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (pgpu->descriptor_indexing_support)
|
||||
{
|
||||
requested_extensions.push_back(VK_KHR_MAINTENANCE3_EXTENSION_NAME);
|
||||
requested_extensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (pgpu->optional_features_support.framebuffer_loops)
|
||||
{
|
||||
requested_extensions.push_back(VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME);
|
||||
|
@ -607,7 +548,7 @@ namespace vk
|
|||
|
||||
if (pgpu->optional_features_support.synchronization_2)
|
||||
{
|
||||
requested_extensions.push_back(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);
|
||||
requested_extensions.push_back(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME); // VK_API_VERSION_1_3
|
||||
}
|
||||
|
||||
if (pgpu->optional_features_support.extended_device_fault)
|
||||
|
|
|
@ -94,7 +94,6 @@ namespace vk
|
|||
bool debug_utils = false;
|
||||
bool external_memory_host = false;
|
||||
bool framebuffer_loops = false;
|
||||
bool sampler_mirror_clamped = false;
|
||||
bool shader_stencil_export = false;
|
||||
bool surface_capabilities_2 = false;
|
||||
bool synchronization_2 = false;
|
||||
|
@ -184,7 +183,6 @@ namespace vk
|
|||
bool get_external_memory_host_support() const { return pgpu->optional_features_support.external_memory_host; }
|
||||
bool get_surface_capabilities_2_support() const { return pgpu->optional_features_support.surface_capabilities_2; }
|
||||
bool get_debug_utils_support() const { return g_cfg.video.renderdoc_compatiblity && pgpu->optional_features_support.debug_utils; }
|
||||
bool get_descriptor_indexing_support() const { return pgpu->descriptor_indexing_support; }
|
||||
bool get_framebuffer_loops_support() const { return pgpu->optional_features_support.framebuffer_loops; }
|
||||
bool get_barycoords_support() const { return pgpu->optional_features_support.barycentric_coords; }
|
||||
bool get_synchronization2_support() const { return pgpu->optional_features_support.synchronization_2; }
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace vk
|
|||
app.applicationVersion = 0;
|
||||
app.pEngineName = app_name;
|
||||
app.engineVersion = 0;
|
||||
app.apiVersion = VK_API_VERSION_1_0;
|
||||
app.apiVersion = VK_API_VERSION_1_2;
|
||||
|
||||
// Set up instance information
|
||||
|
||||
|
@ -123,11 +123,6 @@ namespace vk
|
|||
extensions.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (support.is_supported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
|
||||
{
|
||||
extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (support.is_supported(VK_EXT_LAYER_SETTINGS_EXTENSION_NAME))
|
||||
{
|
||||
|
@ -146,11 +141,6 @@ namespace vk
|
|||
}
|
||||
#endif
|
||||
|
||||
if (support.is_supported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME))
|
||||
{
|
||||
extensions.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
if (support.is_supported(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME))
|
||||
{
|
||||
extensions.push_back(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME);
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace vk
|
|||
allocatorInfo.physicalDevice = pdev;
|
||||
allocatorInfo.device = dev;
|
||||
allocatorInfo.instance = inst;
|
||||
allocatorInfo.vulkanApiVersion = VK_API_VERSION_1_0;
|
||||
allocatorInfo.vulkanApiVersion = VK_API_VERSION_1_2;
|
||||
|
||||
std::vector<VkDeviceSize> heap_limits;
|
||||
const auto vram_allocation_limit = g_cfg.video.vk.vram_allocation_limit * 0x100000ull;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wnullability-completeness"
|
||||
#endif
|
||||
#define VMA_VULKAN_VERSION 1000000
|
||||
#define VMA_VULKAN_VERSION 1002000
|
||||
#include "3rdparty/GPUOpen/VulkanMemoryAllocator/include/vk_mem_alloc.h"
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
|
|
|
@ -230,16 +230,22 @@ void pad_thread::Init()
|
|||
// Set copilots
|
||||
for (usz i = 0; i < m_pads.size(); i++)
|
||||
{
|
||||
if (!m_pads[i]) continue;
|
||||
auto& pad = m_pads[i];
|
||||
if (!pad)
|
||||
continue;
|
||||
|
||||
m_pads[i]->copilots.clear();
|
||||
pad->copilots.clear();
|
||||
|
||||
if (pad->is_copilot())
|
||||
continue;
|
||||
|
||||
for (usz j = 0; j < m_pads.size(); j++)
|
||||
{
|
||||
if (i == j || !m_pads[j] || m_pads[j]->copilot_player() != i)
|
||||
auto& other = m_pads[j];
|
||||
if (i == j || !other || other->copilot_player() != i)
|
||||
continue;
|
||||
|
||||
m_pads[i]->copilots.push_back(m_pads[j]);
|
||||
pad->copilots.push_back(other);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,6 +289,87 @@ void pad_thread::SetIntercepted(bool intercepted)
|
|||
}
|
||||
}
|
||||
|
||||
void pad_thread::apply_copilots()
|
||||
{
|
||||
const auto normalize = [](s32 value)
|
||||
{
|
||||
return (value - 128) / 127.0f;
|
||||
};
|
||||
|
||||
std::lock_guard lock(pad::g_pad_mutex);
|
||||
|
||||
for (auto& pad : m_pads)
|
||||
{
|
||||
if (!pad || !pad->is_connected())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pad->m_buttons_external = pad->m_buttons;
|
||||
pad->m_sticks_external = pad->m_sticks;
|
||||
|
||||
if (pad->copilots.empty() || pad->is_copilot())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Merge buttons
|
||||
for (const auto& copilot : pad->copilots)
|
||||
{
|
||||
if (!copilot || !copilot->is_connected())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (Button& button : pad->m_buttons_external)
|
||||
{
|
||||
for (const Button& other : copilot->m_buttons)
|
||||
{
|
||||
if (button.m_offset == other.m_offset && button.m_outKeyCode == other.m_outKeyCode)
|
||||
{
|
||||
if (other.m_pressed)
|
||||
{
|
||||
button.m_pressed = true;
|
||||
|
||||
if (button.m_value < other.m_value)
|
||||
{
|
||||
button.m_value = other.m_value;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge sticks
|
||||
for (AnalogStick& stick : pad->m_sticks_external)
|
||||
{
|
||||
f32 accumulated_value = normalize(stick.m_value);
|
||||
|
||||
for (const auto& copilot : pad->copilots)
|
||||
{
|
||||
if (!copilot || !copilot->is_connected())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const AnalogStick& other : copilot->m_sticks)
|
||||
{
|
||||
if (stick.m_offset == other.m_offset)
|
||||
{
|
||||
accumulated_value += normalize(other.m_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stick.m_value = static_cast<u16>(std::round(std::clamp(accumulated_value * 127.0f + 128.0f, 0.0f, 255.0f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pad_thread::update_pad_states()
|
||||
{
|
||||
for (usz i = 0; i < m_pads.size(); i++)
|
||||
|
@ -442,6 +529,8 @@ void pad_thread::operator()()
|
|||
}
|
||||
}
|
||||
|
||||
apply_copilots();
|
||||
|
||||
if (Emu.IsRunning())
|
||||
{
|
||||
update_pad_states();
|
||||
|
@ -633,8 +722,9 @@ void pad_thread::InitLddPad(u32 handle, const u32* port_status)
|
|||
|
||||
static const input::product_info product = input::get_product_info(input::product_type::playstation_3_controller);
|
||||
|
||||
m_pads[handle]->ldd = true;
|
||||
m_pads[handle]->Init
|
||||
auto& pad = m_pads[handle];
|
||||
pad->ldd = true;
|
||||
pad->Init
|
||||
(
|
||||
port_status ? *port_status : CELL_PAD_STATUS_CONNECTED | CELL_PAD_STATUS_ASSIGN_CHANGES | CELL_PAD_STATUS_CUSTOM_CONTROLLER,
|
||||
CELL_PAD_CAPABILITY_PS3_CONFORMITY,
|
||||
|
@ -647,7 +737,7 @@ void pad_thread::InitLddPad(u32 handle, const u32* port_status)
|
|||
);
|
||||
|
||||
input_log.notice("Pad %d: LDD, VID=0x%x, PID=0x%x, class_type=0x%x, class_profile=0x%x",
|
||||
handle, m_pads[handle]->m_vendor_id, m_pads[handle]->m_product_id, m_pads[handle]->m_class_type, m_pads[handle]->m_class_profile);
|
||||
handle, pad->m_vendor_id, pad->m_product_id, pad->m_class_type, pad->m_class_profile);
|
||||
|
||||
num_ldd_pad++;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ protected:
|
|||
u32 num_ldd_pad = 0;
|
||||
|
||||
private:
|
||||
void apply_copilots();
|
||||
void update_pad_states();
|
||||
|
||||
u32 m_mask_start_press_to_resume = 0;
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
$(QTDIR)\bin\windeployqt6 --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
xcopy /y /d "$(SolutionDir)3rdparty\opencv\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
@ -169,7 +169,7 @@
|
|||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --debug "$(TargetPath)"
|
||||
$(QTDIR)\bin\windeployqt6 --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --debug "$(TargetPath)"
|
||||
xcopy /y /d "$(SolutionDir)3rdparty\opencv\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
$(QTDIR)\bin\windeployqt6 --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
xcopy /y /d "$(SolutionDir)3rdparty\opencv\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
@ -77,7 +77,7 @@
|
|||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
$(QTDIR)\bin\windeployqt6 --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
|
||||
xcopy /y /d "$(SolutionDir)3rdparty\opencv\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace utils
|
|||
#endif
|
||||
}
|
||||
|
||||
constexpr void prefetch_write(void* ptr)
|
||||
constexpr void prefetch_write(const void* ptr)
|
||||
{
|
||||
if (std::is_constant_evaluated())
|
||||
{
|
||||
|
|
|
@ -15,12 +15,12 @@ namespace utils
|
|||
{
|
||||
u128 __vectorcall atomic_load16(const void* ptr)
|
||||
{
|
||||
return std::bit_cast<u128>(_mm_load_si128((__m128i*)ptr));
|
||||
return std::bit_cast<u128>(_mm_load_si128(static_cast<const __m128i*>(ptr)));
|
||||
}
|
||||
|
||||
void __vectorcall atomic_store16(void* ptr, u128 value)
|
||||
{
|
||||
_mm_store_si128((__m128i*)ptr, std::bit_cast<__m128i>(value));
|
||||
_mm_store_si128(static_cast<__m128i*>(ptr), std::bit_cast<__m128i>(value));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -479,7 +479,7 @@ struct atomic_storage
|
|||
#endif
|
||||
|
||||
#if defined(_M_X64) && defined(_MSC_VER)
|
||||
return _interlockedbittestandset((long*)dst, bit) != 0;
|
||||
return _interlockedbittestandset(reinterpret_cast<long*>(dst), bit) != 0;
|
||||
#elif defined(ARCH_X64)
|
||||
bool result;
|
||||
__asm__ volatile ("lock btsl %2, 0(%1)\n" : "=@ccc" (result) : "r" (dst), "Ir" (bit) : "cc", "memory");
|
||||
|
@ -506,7 +506,7 @@ struct atomic_storage
|
|||
#endif
|
||||
|
||||
#if defined(_M_X64) && defined(_MSC_VER)
|
||||
return _interlockedbittestandreset((long*)dst, bit) != 0;
|
||||
return _interlockedbittestandreset(reinterpret_cast<long*>(dst), bit) != 0;
|
||||
#elif defined(ARCH_X64)
|
||||
bool result;
|
||||
__asm__ volatile ("lock btrl %2, 0(%1)\n" : "=@ccc" (result) : "r" (dst), "Ir" (bit) : "cc", "memory");
|
||||
|
@ -536,9 +536,9 @@ struct atomic_storage
|
|||
while (true)
|
||||
{
|
||||
// Keep trying until we actually invert desired bit
|
||||
if (!_bittest((long*)dst, bit) && !_interlockedbittestandset((long*)dst, bit))
|
||||
if (!_bittest(reinterpret_cast<const long*>(dst), bit) && !_interlockedbittestandset(reinterpret_cast<long*>(dst), bit))
|
||||
return false;
|
||||
if (_interlockedbittestandreset((long*)dst, bit))
|
||||
if (_interlockedbittestandreset(reinterpret_cast<long*>(dst), bit))
|
||||
return true;
|
||||
}
|
||||
#elif defined(ARCH_X64)
|
||||
|
|
|
@ -16,6 +16,8 @@ namespace utils
|
|||
T* result;
|
||||
__asm__("mov %0, %1" : "=r" (result) : "r" (ptr) : "memory");
|
||||
return result;
|
||||
#else
|
||||
#error "Missing utils::bless() implementation"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -444,7 +444,7 @@ namespace utils
|
|||
if (proc_dir)
|
||||
{
|
||||
// proc available, iterate through tasks and count them
|
||||
struct dirent* entry;
|
||||
const struct dirent* entry;
|
||||
while ((entry = readdir(proc_dir)) != NULL)
|
||||
{
|
||||
if (entry->d_name[0] == '.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue