ffmpeg

Update rpcs3.yml

Update rpcs3.yml

Update rpcs3.yml

folded scalar with neg newline

x64-windows-release

x64-windows-rel

if: "!cancelled()"

vcpkg_build_type

Update rpcs3.yml

no ccache

${{github.run_id}}

zlib

vcpkg qt

vulkan

ffmpeg

llvm

build with clang-cl

Create build-windows-clang-cl.ps1

llvm --keep-going

llvm[clang,core,tools,lld,target-x86]:x64-windows-release

llvm:x64-windows-release@17.0.2

llvm with debug on

Create vcpkg.json

Update rpcs3.yml

ffmpeg features

vcpkg nuget

minimal vcpkg.json

Update rpcs3.yml

fetch nuget

more packages vcpkg.json

libpng vcpkg classic

cmake 3.29.0

Rename vcpkg.json to x_vcpkg.json

Update rpcs3.yml

Update rpcs3.yml

llvm

Update rpcs3.yml

git llvm

LLVM with cache

Update rpcs3.yml

Update rpcs3.yml

build llvm

LLVM_TARGETS_TO_BUILD="X86"

llvm binary

set path

build rpcs3

DIA SDK

Update rpcs3.yml

Update rpcs3.yml

Update rpcs3.yml

fix conditionals

fix conditionals

set shell

VCPKG env vars

DIA SDK

Update asm.hpp

Update types.hpp

Update aesni.cpp

Update CMakeLists.txt

Update ConfigureCompiler.cmake

Update StrFmt.cpp

Update CMakeLists.txt

Update CMakeLists.txt

Build with changes

Update CMakeLists.txt

D:\a\rpcs3\rpcs3\llvm

D:\a\rpcs3\rpcs3\llvm

llvm-*

llvm-${{ matrix.llvmver }}

clangpath llvm-*

$llvmver

$clangPath

$clangPath include bin

rm duplicate "add_compile_options"

USE_SYSTEM_ZSTD

USE_SYSTEM_ZSTD

USE_SYSTEM_ZSTD

USE_SYSTEM_ZSTD

zstd

Update CMakeLists.txt

PkgConfig zstd

zstd::zstd ALIAS PkgConfig::libzstd

clang-cl only

cache hit

Update CMakeLists.txt

cache-hit

cache vcpkg/vcpkg.exe

NOT USE_SYSTEM_ZSTD

vcpkg_root

revert zstd

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

/defaultlib:zstd_static.lib

Remove else

/defaultlib:zstd.lib

Zstd ahared

Nodefaultlib

Create Findzstd.cmake

zstd CMakeLists.txt

not use zstd system CMakeLists.txt

dont add 3rdparty::libzstd

add_library(PkgConfig::libzstd ALIAS 3rdparty::zstd)

add_library(PkgConfig::libzstd ALIAS 3rdparty::zstd)

add_library(3rdparty::libzstd ALIAS PkgConfig::zstd)

add_library(3rdparty::zstd ALIAS PkgConfig::zstd)

Update Findzstd.cmake

zstd::zstd

Update CMakeLists.txt

zstd::zstd

zstd::zstd CMakeLists.txt

PkgConfig::libzstd CMakeLists.txt

zstd::libzstd

Update CMakeLists.txt

Update CMakeLists.txt

vcpkg zstd CMakeLists.txt

MODULES CMakeLists.txt

zstd::libzstd

add_library(3rdparty::7zip ALIAS 3rdparty_7zip)

LLVM Static-link on

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Release>:Release>")

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")

Update CMakeLists.txt

message(STATUS "MSVC Runtime Library: ${CMAKE_MSVC_RUNTIME_LIBRARY}")

revert CMakeLists.txt

DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded"

rpcs3_emu SHARED

STATIC CMakeLists.txt

cmake_policy(SET CMP0091 NEW)

LLVM_AVAILABLE=ON

add_compile_definitions(LLVM_AVAILABLE=true)

add_compile_options(/MT)

LLVM_AVAILABLE=1

add_compile_definitions(_DISABLE_STRING_ANNOTATION=1 _DISABLE_VECTOR_ANNOTATION=1)

Update build-windows-clang-cl.ps1

clang msvc17-msvcrt

rm compressed archve

cachee name

cache name again

builtin clang-rt

build all

set $llvmPath

extract into llvm

copy with -verbose

mv destination path

build llvm cache

$clangPath

full build

LLVM static

LLVM -> LLVMCore

STATIC_LINK_LLVM=OFF

no lookup llvm bin dir

revert

revert

revert

LLVMCore -> LLVM

LLVM -> LLVM-C

llvm_map_components_to_libnames

Update CMakeLists.txt

LLVM CMakeLists.txt

LLVM_DIR=$llvmPath

MultiThreadedDLL

CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded

-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

clang-cl version

cmake -v

--log-level=VERBOSE

built-in LLVM

llvm lib folder

PF short name

built-in LLVM/Clang

20.1.8

mt.exe path

Use llvm-mt

"$clangPath/llvm-mt.exe"

fix terminator

Add winqtdeploy to PATH

Test windeployqt6.exe with version

Missing )

No winqtdeploy

Build no quotes

prep artifacts

no winqtdeploy

$VcpkgWindeployqt --version

$($VcpkgWindeployqt) --version

--version

Invoke-Expression

Update build-windows-clang-cl.ps1

rpcs3_win_clang.7z

rpcs3 artifacts dir

cp artifacts

build/bin dir

clone recent asmjit

Update build-windows-clang-cl.ps1

CMAKE_CXX_SCAN_FOR_MODULES=ON

default-openal

USE_NATIVE_INSTRUCTIONS=ON

Update ConfigureCompiler.cmake

USE_NATIVE_INSTRUCTIONS=OFF / rm 512 instuctions

revert

set(LLVM_LIBS LLVM)

COMPILER_X86 only

add_compile_options(-msse -msse2 -mcx16 -mavx512f -mavx -mavx2 -maes -mrtm -mpclmul -mmwaitx -mwaitpkg)

avx512 flags

add_compile_options(-march=native)

check_cxx_compiler_flag("-march=native"

add_compile_options(-maes -mrtm -mpclmul -mmwaitx -mwaitpkg)

COMMAND Qt6::windeployqt --version

COMMAND Qt6::windeployqt $<TARGET_FILE:rpcs3>

add vcpkg bin to PATH

check vcpkg is added to PATH

update PATH cache

[System.EnvironmentVariableTarget]::Machine

display all paths

cmd.exe /c "echo %PATH%"

make windeployqt verbose

verbose 2

Invoke-Expression "cmd.exe /c "set PATH=%PATH%;$VcpkgBin""

Update build-windows-clang-cl.ps1

no invoke

cmd.exe /c "set PATH=$VcpkgBin;%PATH%"

--ignore-library-errors

-DQTPATH_EXE="$VcpkgQtpath"

no  --ignore-library-errors

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

Update CMakeLists.txt

change \ to /

${WINDEPLOYQT_EXECUTABLE}

Qt6::windeployqt

gci vcpkg tools bin

--ignore-library-errors

x64-windows/tools

VCPKG_TRIPLET: x64-windows

Save vcpkg cache

revert

revert

remove MSVC runtime message

revert

rm dupes

revert

Delete buildfiles/cmake/Findzstd.cmake

WINDEPLOYQT_EXECUTABLE

Delete x_vcpkg.json

add AVX512 compile options

Wno-deprecated-anon-enum-enum-conversion

clean-up

silence warnings

terminate properly

set PRIVATE CFLAGS

--no-vulkan

rm vulkan lib at package step

override cflags

remove  OpenGL_GL_PREFERENCE=LEGACY

rm  --no-vulkan switch

Update CMakeLists.txt

restore LLVM dir

ASMJIT_CMAKE_FLAGS

revert

order

check_cxx_compiler_flag

Wno-unused-value

revert

revert

Update CMakeLists.txt

Update llvm_build_clang_cl.vcxproj

Update llvm_build_clang_cl.vcxproj

Update rpcs3.yml

go to deploy if successful

Create deploy-windows-clang-cl.sh

build then deploy

Update build-windows-clang-cl.ps1

deploy step

test

Update ProgramStateCache.cpp

remove AVX512

Update JITLLVM.cpp

FFMPEG 8.0

FFMPEG 8.0

LLVM 21

LLVM 21

set CMAKE_MSVC_RUNTIME_LIBRARY

update OpenAL

msys2 clang

git openal-soft reset

update yaml

reset to master

reset to master

"Build succeeded"

ALSOFT_ENABLE_MODULES OFF

Build All Jobs

Run Builds when not on Main branch

Win Qt 6.9.3

Update build-mac-arm64.sh

Update build-mac.sh

Create TCDarwinX86_64.cmake
This commit is contained in:
qurious-pixel 2025-07-19 21:02:56 -07:00 committed by Live session user
parent 7fe3afbbc2
commit 42c7f13ce5
26 changed files with 511 additions and 118 deletions

View file

@ -6,14 +6,15 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1 export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_INSTALL_CLEANUP=1
/opt/homebrew/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype googletest #create-dmg brew install -f --overwrite --quiet ccache pipenv googletest ffmpeg@5 "llvm@$LLVM_COMPILER_VER" glew sdl3 vulkan-headers
/opt/homebrew/bin/brew install -f --quiet ffmpeg@5 brew link -f --quiet "llvm@$LLVM_COMPILER_VER" 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 # moltenvk based on commit for 1.3.0 release
export HOMEBREW_DEVELOPER=1 # Prevents blocking of local formulae
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb 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 HOMEBREW_DEVELOPER=0
export CXX=clang++ export CXX=clang++
export CC=clang export CC=clang
@ -32,17 +33,17 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
git clone https://github.com/engnr/qt-downloader.git git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597 git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.9.1 URL workaround # nested Qt 6.10.0 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}_{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 # sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
# archived Qt 6.7.3 URL workaround # archived Qt 6.7.3 URL workaround
sed -i '' "s/official_releases/archive/g" qt-downloader sed -i '' "s/official_releases/archive/g" qt-downloader
cd "/tmp/Qt" cd "/tmp/Qt"
arch -arm64 "$BREW_PATH/bin/pipenv" run pip3 uninstall py7zr requests semantic_version lxml "$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 "$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" 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.1 workaround # sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.10.0 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" "$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 fi
cd "$WORKDIR" cd "$WORKDIR"

View file

@ -6,18 +6,17 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1 export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_INSTALL_CLEANUP=1
#/usr/sbin/softwareupdate --install-rosetta --agree-to-license brew install -f --overwrite --quiet ccache pipenv "llvm@$LLVM_COMPILER_VER"
brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER"
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew update arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet ffmpeg@5 "llvm@$LLVM_COMPILER_VER" glew sdl3 vulkan-headers
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python || arch -x86_64 /usr/local/bin/brew link --overwrite python arch -x86_64 /usr/local/bin/brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype #create-dmg
arch -x86_64 /usr/local/bin/brew install -f --quiet ffmpeg@5
arch -x86_64 /usr/local/bin/brew install --quiet "llvm@$LLVM_COMPILER_VER" glew cmake sdl3 vulkan-headers coreutils
arch -x86_64 /usr/local/bin/brew link -f --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
# moltenvk based on commit for 1.3.0 release # moltenvk based on commit for 1.3.0 release
export HOMEBREW_DEVELOPER=1 # Prevents blocking of local formulae
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb
arch -x86_64 /usr/local/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb arch -x86_64 /usr/local/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
export HOMEBREW_DEVELOPER=0
export CXX=clang++ export CXX=clang++
export CC=clang export CC=clang
@ -36,16 +35,16 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
git clone https://github.com/engnr/qt-downloader.git git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597 git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.9.1 URL workaround # nested Qt 6.10.0 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}_{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 # sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
# archived Qt 6.7.3 URL workaround # archived Qt 6.7.3 URL workaround
sed -i '' "s/official_releases/archive/g" qt-downloader sed -i '' "s/official_releases/archive/g" qt-downloader
cd "/tmp/Qt" 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 "/opt/homebrew/bin/pipenv" --python "/opt/homebrew/bin/python3" run pip3 install py7zr requests semantic_version lxml
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64" 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.1 workaround # sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.10.0 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" "/opt/homebrew/bin/pipenv" --python "/opt/homebrew/bin/python3" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
fi fi
cd "$WORKDIR" cd "$WORKDIR"
@ -54,12 +53,12 @@ ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN" export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
export SDL3_DIR="$BREW_X64_PATH/opt/sdl3/lib/cmake/SDL3" export SDL3_DIR="$BREW_X64_PATH/opt/sdl3/lib/cmake/SDL3"
export PATH="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH" export PATH="/opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib" export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib"
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie -D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie -D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export LIBRARY_PATH="$BREW_X64_PATH/lib" export LIBRARY_PATH="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER/lib:$BREW_X64_PATH/lib"
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib" export LD_LIBRARY_PATH="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER/lib:$BREW_X64_PATH/lib"
export VULKAN_SDK export VULKAN_SDK
VULKAN_SDK="$BREW_X64_PATH/opt/molten-vk" VULKAN_SDK="$BREW_X64_PATH/opt/molten-vk"
@ -67,7 +66,7 @@ ln -s "$VULKAN_SDK/lib/libMoltenVK.dylib" "$VULKAN_SDK/lib/libvulkan.dylib"
export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json" export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
export LLVM_DIR export LLVM_DIR
LLVM_DIR="BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER" LLVM_DIR="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER"
# exclude ffmpeg, LLVM, opencv, and sdl from submodule update # exclude ffmpeg, LLVM, opencv, and sdl from submodule update
# shellcheck disable=SC2046 # shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules) git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules)
@ -79,7 +78,7 @@ mkdir build && cd build || exit 1
export MACOSX_DEPLOYMENT_TARGET=14.0 export MACOSX_DEPLOYMENT_TARGET=14.0
"$BREW_X64_PATH/bin/cmake" .. \ "/opt/homebrew/bin/cmake" .. \
-DBUILD_RPCS3_TESTS=OFF \ -DBUILD_RPCS3_TESTS=OFF \
-DRUN_RPCS3_TESTS=OFF \ -DRUN_RPCS3_TESTS=OFF \
-DUSE_SDL=ON \ -DUSE_SDL=ON \
@ -107,6 +106,8 @@ export MACOSX_DEPLOYMENT_TARGET=14.0
"$CMAKE_EXTRA_OPTS" \ "$CMAKE_EXTRA_OPTS" \
-DLLVM_TARGET_ARCH=X86_64 \ -DLLVM_TARGET_ARCH=X86_64 \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \ -DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
-DCMAKE_TOOLCHAIN_FILE=buildfiles/cmake/TCDarwinX86_64.cmake \
-DCMAKE_IGNORE_PATH="$BREW_X64_PATH/lib" \ -DCMAKE_IGNORE_PATH="$BREW_X64_PATH/lib" \
-DCMAKE_IGNORE_PREFIX_PATH=/usr/local/opt \ -DCMAKE_IGNORE_PREFIX_PATH=/usr/local/opt \
-DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" \ -DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" \
@ -114,7 +115,7 @@ export MACOSX_DEPLOYMENT_TARGET=14.0
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \ -DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
-G Ninja -G Ninja
"$BREW_X64_PATH/bin/ninja"; build_status=$?; "/opt/homebrew/bin/ninja"; build_status=$?;
cd .. cd ..

View file

@ -0,0 +1,143 @@
# .ci/build-windows-clang-cl.ps1
# Enable strict error handling
$ErrorActionPreference = "Stop"
trap {
Write-Host "ERROR: $($_.Exception.Message)"
exit 1
}
Write-Host "Starting RPCS3 build (PowerShell script)"
# Automatically find clang_rt.builtins-x86_64.lib
Write-Host "Searching for clang_rt.builtins-x86_64.lib ..."
$clangBuiltinsLibPath = Get-ChildItem -Path "C:/Program Files/LLVM/lib/clang" -Recurse -Filter "clang_rt.builtins-x86_64.lib" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match "windows\\clang_rt\.builtins-x86_64\.lib$" } |
Select-Object -First 1
if (-not $clangBuiltinsLibPath) {
Write-Error "Could not find clang_rt.builtins-x86_64.lib in LLVM installation."
exit 1
}
function Get-ShortPath([string]$path) {
$fso = New-Object -ComObject Scripting.FileSystemObject
return $fso.GetFolder($path).ShortPath
}
$clangBuiltinsDir = Split-Path -Parent $clangBuiltinsLibPath.FullName
$clangBuiltinsDirShort = Get-ShortPath $clangBuiltinsDir
$clangBuiltinsLib = Split-Path -Leaf $clangBuiltinsLibPath.FullName
$clangPath = "C:\Program Files\LLVM\bin"
#$clangPath = Get-ChildItem -Path "D:\a\rpcs3\rpcs3\llvm-*\bin"
#$llvmPath = Get-ChildItem -Path "D:\a\rpcs3\rpcs3\llvm-*\lib\cmake\llvm"
Write-Host "Found Clang builtins library: $clangBuiltinsLib in $clangBuiltinsDir or short $clangBuiltinsDirShort"
Write-Host "Found Clang Path: $clangPath"
# Get Windows Kits root from registry
$kitsRoot = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10"
$kitsRootPath = $kitsRoot.KitsRoot10
# Search for mt.exe in x64 SDK bin directories
Write-Host "Searching for mt.exe ..."
$mtPath = Get-ChildItem -Path "$clangPath" -Recurse -Filter "llvm-mt.exe" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match "\\llvm-mt\.exe$" } |
Sort-Object FullName -Descending |
Select-Object -First 1
if (-not $mtPath) {
Write-Error "Could not find mt.exe in Windows Kits directories."
exit 1
}
$mtExePath = "$mtPath"
Write-Host "Found mt.exe at: $mtExePath"
$VcpkgRoot="$(Get-Location)/vcpkg"
$VcpkgTriplet=$env:VCPKG_TRIPLET
$VcpkgInstall="$VcpkgRoot/installed/$VcpkgTriplet"
$VcpkgInclude="$VcpkgInstall/include"
$VcpkgLib="$VcpkgInstall/lib"
$VcpkgBin="$VcpkgInstall/bin"
# Configure git safe directory
Write-Host "Configuring git safe directory"
& git config --global --add safe.directory '*'
# Initialize submodules except certain ones
Write-Host "Initializing submodules"
$excludedSubs = @('llvm','opencv','ffmpeg','FAudio','zlib','libpng','feralinteractive')
# Get submodule paths excluding those in $excludedSubs
$submodules = Select-String -Path .gitmodules -Pattern 'path = (.+)' | ForEach-Object {
$_.Matches[0].Groups[1].Value
} | Where-Object {
$path = $_
-not ($excludedSubs | Where-Object { $path -like "*$_*" })
}
Write-Host "Updating submodules: $($submodules -join ', ')"
& git submodule update --init --quiet $submodules
& git -C 3rdparty/OpenAL/openal-soft reset --hard master
# Create and enter build directory
Write-Host "Creating build directory"
if (!(Test-Path build)) {
New-Item -ItemType Directory -Path build | Out-Null
}
Set-Location build
Write-Host "Changed directory to: $(Get-Location)"
# Run CMake with Ninja generator and required flags
Write-Host "Running CMake configuration"
& cmake .. `
-G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER="$clangPath/clang-cl.exe" `
-DCMAKE_CXX_COMPILER="$clangPath/clang-cl.exe" `
-DCMAKE_LINKER="$clangPath/lld-link.exe" `
-DCMAKE_INSTALL_PREFIX=/usr `
-DCMAKE_TOOLCHAIN_FILE="$VcpkgRoot/scripts/buildsystems/vcpkg.cmake" `
-DCMAKE_EXE_LINKER_FLAGS="/LIBPATH:$clangBuiltinsDirShort /defaultlib:$clangBuiltinsLib" `
-DCMAKE_MT="$clangPath/llvm-mt.exe" `
-DUSE_NATIVE_INSTRUCTIONS=OFF `
-DUSE_PRECOMPILED_HEADERS=OFF `
-DVCPKG_TARGET_TRIPLET="$VcpkgTriplet" `
-DFFMPEG_INCLUDE_DIR="$VcpkgInclude" `
-DFFMPEG_LIBAVCODEC="$VcpkgLib/avcodec.lib" `
-DFFMPEG_LIBAVFORMAT="$VcpkgLib/avformat.lib" `
-DFFMPEG_LIBAVUTIL="$VcpkgLib/avutil.lib" `
-DFFMPEG_LIBSWSCALE="$VcpkgLib/swscale.lib" `
-DFFMPEG_LIBSWRESAMPLE="$VcpkgLib/swresample.lib" `
-DUSE_SYSTEM_CURL=OFF `
-DUSE_FAUDIO=OFF `
-DUSE_SDL=ON `
-DUSE_SYSTEM_SDL=OFF `
-DUSE_SYSTEM_FFMPEG=ON `
-DUSE_SYSTEM_OPENCV=ON `
-DUSE_SYSTEM_OPENAL=OFF `
-DUSE_SYSTEM_LIBPNG=ON `
-DUSE_DISCORD_RPC=ON `
-DUSE_SYSTEM_ZSTD=ON `
-DWITH_LLVM=ON `
-DSTATIC_LINK_LLVM=ON `
-DBUILD_RPCS3_TESTS=OFF
Write-Host "CMake configuration complete"
# Build with ninja
Write-Host "Starting build with Ninja..."
& ninja
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed with exit code $LASTEXITCODE"
exit 1
}
Write-Host "Build succeeded"
# Go back to root directory
Set-Location ..
Write-Host "Returned to root directory: $(Get-Location)"

View file

@ -6,6 +6,7 @@ git config --global --add safe.directory '*'
# Note: Tried to use git submodule status, but it takes over 20 seconds # Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046 # shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/ffmpeg/ && !/curl/ && !/FAudio/ && !/zlib/ { print $3 }' .gitmodules) git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/ffmpeg/ && !/curl/ && !/FAudio/ && !/zlib/ { print $3 }' .gitmodules)
git -C 3rdparty/OpenAL/openal-soft reset --hard master
mkdir build && cd build || exit 1 mkdir build && cd build || exit 1
@ -57,5 +58,5 @@ cd ..
# If it compiled succesfully let's deploy. # If it compiled succesfully let's deploy.
if [ "$build_status" -eq 0 ]; then if [ "$build_status" -eq 0 ]; then
.ci/deploy-windows-clang.sh "x86_64" echo "Build succeeded"
fi fi

View file

@ -0,0 +1,42 @@
#!/bin/sh -ex
# source ci-vars.env
# shellcheck disable=SC1091
. .ci/ci-vars.env
cd build || exit 1
CPU_ARCH="${1:-x86_64}"
echo "Deploying rpcs3 windows clang-cl $CPU_ARCH"
# First let's print some info about our caches
C:/Strawberry/c/bin/ccache.exe --show-stats -v
# BUILD_blablabla is CI specific, so we wrap it for portability
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
# Remove unecessary files
rm -f ./bin/vulkan-1.dll
# Prepare compatibility and SDL database for packaging
mkdir ./bin/config
mkdir ./bin/config/input_configs
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
# Download SSL certificate (not needed with CURLSSLOPT_NATIVE_CA)
#curl -fsSL 'https://curl.haxx.se/ca/cacert.pem' 1> ./bin/cacert.pem
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./bin/*
# Generate sha256 hashes
# Write to file for GitHub releases
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
# Move files to publishing directory
mkdir "$ARTIFACT_DIR"
cp -- "$BUILD" "$ARTIFACT_DIR"
cp -- "$BUILD.sha256" "$ARTIFACT_DIR"

View file

@ -5,8 +5,8 @@ defaults:
shell: bash shell: bash
on: on:
push: push:
branches: #branches:
- master # Only trigger push event on 'master' branch # - master # Only trigger push event on 'master' branch
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
@ -24,7 +24,7 @@ env:
jobs: jobs:
Linux_Build: Linux_Build:
# Only run push event on master branch of main repo, but run all PRs # Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master') #if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -117,13 +117,13 @@ jobs:
Mac_Build: Mac_Build:
# Only run push event on master branch of main repo, but run all PRs # Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master') #if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- name: Intel - name: Intel
build_sh: "arch -X86_64 .ci/build-mac.sh" build_sh: .ci/build-mac.sh
UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842 UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac
- name: Apple Silicon - name: Apple Silicon
@ -191,14 +191,14 @@ jobs:
run: .ci/github-upload.sh run: .ci/github-upload.sh
- name: Save Build Ccache - name: Save Build Ccache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }} key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Save Qt Cache - name: Save Qt Cache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: /tmp/Qt path: /tmp/Qt
@ -206,15 +206,15 @@ jobs:
Windows_Build: Windows_Build:
# Only run push event on master branch of main repo, but run all PRs # Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master') #if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 Windows name: RPCS3 Windows
runs-on: windows-2025 runs-on: windows-2025
env: env:
COMPILER: msvc COMPILER: msvc
QT_VER_MAIN: '6' QT_VER_MAIN: '6'
QT_VER: '6.9.1' QT_VER: '6.9.3'
QT_VER_MSVC: 'msvc2022' QT_VER_MSVC: 'msvc2022'
QT_DATE: '202505291653' QT_DATE: '202509261208'
LLVM_VER: '19.1.7' LLVM_VER: '19.1.7'
VULKAN_VER: '1.3.268.0' VULKAN_VER: '1.3.268.0'
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5' VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
@ -312,14 +312,14 @@ jobs:
run: .ci/github-upload.sh run: .ci/github-upload.sh
- name: Save Build Ccache - name: Save Build Ccache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }} key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Save Dependencies Cache - name: Save Dependencies Cache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: ${{ env.DEPS_CACHE_DIR }} path: ${{ env.DEPS_CACHE_DIR }}
@ -327,25 +327,33 @@ jobs:
Windows_Build_Clang: Windows_Build_Clang:
# Only run push event on master branch of main repo, but run all PRs # Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master') #if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 Windows Clang
runs-on: windows-2025 runs-on: windows-2025
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- msys2: clang64 - msys2: clang64
compiler: clang compiler: clang
arch: win64 arch: win64
- compiler: clang-cl
llvmver: 20.1.8
arch: win64
env: env:
CCACHE_DIR: 'C:\ccache' CCACHE_DIR: 'C:\ccache'
VCPKG_TRIPLET: x64-windows
VCPKG_BUILD_TYPE: release
name: RPCS3 Windows ${{ matrix.compiler }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@main uses: actions/checkout@main
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup msys2 - name: Setup msys2
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
if: ${{ matrix.compiler == 'clang' }}
with: with:
msystem: ${{ matrix.msys2 }} msystem: ${{ matrix.msys2 }}
update: true update: true
@ -373,6 +381,89 @@ jobs:
git git
p7zip p7zip
- name: Clone and bootstrap vcpkg
if: ${{ matrix.compiler == 'clang-cl' }}
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
- name: Restore vcpkg cache
if: ${{ matrix.compiler == 'clang-cl' }}
uses: actions/cache/restore@main
id: restore-vcpkg-cache
with:
path: |
vcpkg/vcpkg.exe
vcpkg/installed
vcpkg/buildtrees
key: vcpkg-${{ runner.os }}-${{ matrix.compiler }}-${{ runner.arch }}-${{ hashFiles('**/vcpkg') }}
restore-keys: vcpkg-${{ runner.os }}-${{ matrix.compiler }}-${{ runner.arch }}-
- name: Install dependencies with vcpkg
if: ${{ matrix.compiler == 'clang-cl' }}
shell: pwsh
run: >-
.\vcpkg\vcpkg.exe install
ffmpeg[avcodec,avformat,swscale,swresample]
libpng
opencv
qtbase
qtmultimedia
qtsvg
qttools
vulkan
zlib
--triplet $env:VCPKG_TRIPLET
--clean-after-build
- name: Save vcpkg cache
if: ${{ matrix.compiler == 'clang-cl' }}
#if: ${{ !steps.restore-vcpkg-cache.outputs.cache-hit && matrix.compiler == 'clang-cl' }}
#if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: |
vcpkg/vcpkg.exe
vcpkg/installed
vcpkg/buildtrees
key: ${{ steps.restore-vcpkg-cache.outputs.cache-primary-key }}
- name: Restore LLVM Cache
if: ${{ matrix.compiler == 'clang-cl' }}
uses: actions/cache/restore@main
id: llvm-cache
with:
path: ./llvm-${{ matrix.llvmver }}
key: ${{ runner.os }}-llvm-dl-cache-${{ hashFiles('**/llvm-${{ matrix.llvmver }}') }}
restore-keys: ${{ runner.os }}-clang-dl-cache-
- name: Add LLVM
if: ${{ matrix.compiler == 'clang-cl' }}
shell: pwsh
run: |
if (!(Test-Path -Path D:\a\rpcs3\rpcs3\llvm-${{ matrix.llvmver }}\)) {
rm -r llvm-*
curl -fsSLO https://github.com/vovkos/llvm-package-windows/releases/download/llvm-20.1.8/llvm-20.1.8-windows-amd64-msvc17-msvcrt.7z
curl -fsSLO https://github.com/vovkos/llvm-package-windows/releases/download/clang-20.1.8/clang-20.1.8-windows-amd64-msvc17-msvcrt.7z
7z x llvm-*.7z
mv llvm* llvm-${{ matrix.llvmver }}
rm llvm-*.7z
7z x clang-*.7z
Copy-Item -Path "D:\a\rpcs3\rpcs3\clang*\*" -Destination "D:\a\rpcs3\rpcs3\llvm-${{ matrix.llvmver }}" -Recurse -Force
rm -r clang*
}
Add-Content -Path $env:GITHUB_PATH -Value "D:\a\rpcs3\rpcs3\llvm-${{ matrix.llvmver }}\bin"
C:\PROGRA~1\LLVM\bin\clang-cl.exe --version
- name: Save LLVM Cache
if: ${{ matrix.compiler == 'clang-cl' && steps.llvm-cache.outputs.cache-hit != 'true' }}
#if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ./llvm-${{ matrix.llvmver }}
key: ${{ steps.llvm-cache.outputs.cache-primary-key }}
- name: Restore build Ccache - name: Restore build Ccache
uses: actions/cache/restore@main uses: actions/cache/restore@main
id: restore-build-ccache id: restore-build-ccache
@ -382,20 +473,39 @@ jobs:
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}- restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-
- name: Build RPCS3 - name: Build RPCS3
if: ${{ matrix.compiler == 'clang' }}
shell: msys2 {0} shell: msys2 {0}
run: | run: |
export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR") export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR")
echo "CCACHE_DIR=$CCACHE_DIR" echo "CCACHE_DIR=$CCACHE_DIR"
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
.ci/build-windows-clang.sh .ci/build-windows-clang.sh
- name: install DIA SDK
if: ${{ matrix.compiler == 'clang-cl' }}
run: |
mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true
cp -r "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK"
- name: Build RPCS3
if: ${{ matrix.compiler == 'clang-cl' }}
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
powershell -ExecutionPolicy Bypass -File .ci/build-windows-clang-cl.ps1
- name: Save build Ccache - name: Save build Ccache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }} key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Prepare Artifacts
shell: bash
run: |
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
.ci/deploy-windows-${{ matrix.compiler }}.sh
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@main uses: actions/upload-artifact@main
with: with:
@ -406,7 +516,7 @@ jobs:
FreeBSD_Build: FreeBSD_Build:
# Only run push event on master branch of main repo, but run all PRs # Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master') #if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 FreeBSD name: RPCS3 FreeBSD
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60 timeout-minutes: 60
@ -437,7 +547,7 @@ jobs:
run: .ci/install-freebsd.sh && .ci/build-freebsd.sh run: .ci/install-freebsd.sh && .ci/build-freebsd.sh
- name: Save Build Ccache - name: Save Build Ccache
if: github.ref == 'refs/heads/master' #if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main uses: actions/cache/save@main
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}

View file

@ -11,6 +11,7 @@ if(USE_SYSTEM_OPENAL)
else() else()
option(ALSOFT_UTILS "Build utility programs" OFF) option(ALSOFT_UTILS "Build utility programs" OFF)
option(ALSOFT_EXAMPLES "Build example programs" OFF) option(ALSOFT_EXAMPLES "Build example programs" OFF)
option(ALSOFT_ENABLE_MODULES "Enable use of C++20 modules when supported" OFF)
set(LIBTYPE "STATIC") set(LIBTYPE "STATIC")
add_subdirectory(openal-soft EXCLUDE_FROM_ALL) add_subdirectory(openal-soft EXCLUDE_FROM_ALL)
add_library(3rdparty_openal INTERFACE) add_library(3rdparty_openal INTERFACE)

View file

@ -49,11 +49,11 @@
<PropertyGroup Label="UserMacros"> <PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64 <CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)" cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft" cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeReleaseCLI> </CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64 <CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)" cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft" cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeDebugCLI> </CmakeDebugCLI>
<CmakeCopyCLI> <CmakeCopyCLI>
echo Copying.. echo Copying..
@ -106,4 +106,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -106,4 +106,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -22,5 +22,17 @@ else()
add_subdirectory(wolfssl EXCLUDE_FROM_ALL) add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP FP_MAX_BITS=8192 WOLFSSL_NO_OPTIONS_H) target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP WOLFSSL_NO_OPTIONS_H)
endif()
if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Disable 128-bit Math
set(WOLFSSL_ASM ON CACHE BOOL "" FORCE)
set(WOLFSSL_FAST_MATH OFF CACHE BOOL "" FORCE)
target_compile_definitions(wolfssl PUBLIC WOLFSSL_SP_NO_128BIT FP_MAX_BITS=4096)
# Disable warnings
target_compile_options(wolfssl PRIVATE /w)
else()
target_compile_definitions(wolfssl PUBLIC FP_MAX_BITS=8192)
endif()
endif()

View file

@ -1,8 +1,17 @@
option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF) # zstd
option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) # Select the version of zstd to use, default is builtin
option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) if(NOT USE_SYSTEM_ZSTD)
option(ZSTD_BUILD_TESTS "BUILD TESTS" OFF) option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF)
option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF)
add_subdirectory(zstd/build/cmake EXLUDE_FROM_ALL) option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
add_library(3rdparty_zstd INTERFACE) option(ZSTD_BUILD_TESTS "BUILD TESTS" OFF)
target_link_libraries(3rdparty_zstd INTERFACE libzstd_static)
add_subdirectory(zstd/build/cmake EXLUDE_FROM_ALL)
add_library(3rdparty_zstd INTERFACE)
target_link_libraries(3rdparty_zstd INTERFACE libzstd_static)
else()
message(STATUS "RPCS3: using VCPKG zstd")
find_package(zstd CONFIG REQUIRED)
add_library(3rdparty_zstd INTERFACE)
target_link_libraries(3rdparty_zstd INTERFACE zstd::libzstd)
endif()

View file

@ -46,6 +46,7 @@ option(USE_SYSTEM_PUGIXML "Prefer system pugixml instead of the builtin one" OFF
option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" ON) option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" ON)
option(USE_SYSTEM_WOLFSSL "Prefer system MoltenVK instead of the builtin one" OFF) option(USE_SYSTEM_WOLFSSL "Prefer system MoltenVK instead of the builtin one" OFF)
option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON) option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON)
option(USE_SYSTEM_ZSTD "Prefer system zstd instead of the prebuild one" OFF)
option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF) option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF)
option(USE_LTO "Use LTO for building" ON) option(USE_LTO "Use LTO for building" ON)
option(BUILD_RPCS3_TESTS "Build RPCS3 unit tests." OFF) option(BUILD_RPCS3_TESTS "Build RPCS3 unit tests." OFF)
@ -116,7 +117,9 @@ if(MSVC)
message(AUTHOR_WARNING "Debug build currently can not work with static CRT.") message(AUTHOR_WARNING "Debug build currently can not work with static CRT.")
endif() endif()
endif() endif()
add_compile_options(/MP) if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(/MP)
endif()
endif() endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)

View file

@ -658,7 +658,11 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
std::string result; std::string result;
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context); auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
#if LLVM_VERSION_MAJOR > 20
null_mod->setTargetTriple(llvm::Triple(jit_compiler::triple1()));
#else
null_mod->setTargetTriple(jit_compiler::triple1()); null_mod->setTargetTriple(jit_compiler::triple1());
#endif
std::unique_ptr<llvm::RTDyldMemoryManager> mem; std::unique_ptr<llvm::RTDyldMemoryManager> mem;
@ -672,7 +676,11 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
else else
{ {
mem = std::make_unique<MemoryManager2>(std::move(symbols_cement)); mem = std::make_unique<MemoryManager2>(std::move(symbols_cement));
#if LLVM_VERSION_MAJOR > 20
null_mod->setTargetTriple(llvm::Triple(jit_compiler::triple2()));
#else
null_mod->setTargetTriple(jit_compiler::triple2()); null_mod->setTargetTriple(jit_compiler::triple2());
#endif
} }
} }
else else

View file

@ -525,7 +525,7 @@ void fmt_class_string<u128>::format(std::string& out, u64 arg)
return; return;
} }
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
fmt::append(out, "0x%016llx%016llx", num.hi, num.lo); fmt::append(out, "0x%016llx%016llx", num.hi, num.lo);
#else #else
fmt::append(out, "0x%016llx%016llx", static_cast<u64>(num >> 64), static_cast<u64>(num)); fmt::append(out, "0x%016llx%016llx", static_cast<u64>(num >> 64), static_cast<u64>(num));

View file

@ -1,11 +1,24 @@
# Check and configure compiler options for RPCS3 # Check and configure compiler options for RPCS3
if(MSVC) if(MSVC)
add_compile_options(/Zc:throwingNew- /constexpr:steps16777216) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
check_cxx_compiler_flag("-msse -msse2 -mcx16" COMPILER_X86)
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if (COMPILER_X86)
#add_compile_options(-msse -msse2 -mcx16 -mavx512f -mavx512vbmi -mavx512vl -mavx512dq -mavx512vpopcntdq -mavx -mavx2 -maes -mrtm -mpclmul -mmwaitx -mwaitpkg)
add_compile_options(-maes -mrtm -mpclmul -mmwaitx -mwaitpkg)
endif()
if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_compile_options(-march=native)
endif()
add_link_options(/dynamicbase)
else()
add_compile_options(/Zc:throwingNew- /constexpr:steps16777216)
add_link_options(/DYNAMICBASE)
endif()
add_compile_definitions( add_compile_definitions(
_CRT_SECURE_NO_DEPRECATE=1 _CRT_NON_CONFORMING_SWPRINTFS=1 _SCL_SECURE_NO_WARNINGS=1 _CRT_SECURE_NO_DEPRECATE=1 _CRT_NON_CONFORMING_SWPRINTFS=1 _SCL_SECURE_NO_WARNINGS=1
NOMINMAX _ENABLE_EXTENDED_ALIGNED_STORAGE=1 _HAS_EXCEPTIONS=0) NOMINMAX _ENABLE_EXTENDED_ALIGNED_STORAGE=1 _HAS_EXCEPTIONS=0)
add_link_options(/DYNAMICBASE)
#TODO: Some of these could be cleaned up #TODO: Some of these could be cleaned up
add_compile_options(/wd4805) # Comparing boolean and int add_compile_options(/wd4805) # Comparing boolean and int

View file

@ -0,0 +1,2 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

View file

@ -157,10 +157,15 @@ if (NOT ANDROID)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/test $<TARGET_FILE_DIR:rpcs3>/test COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/test $<TARGET_FILE_DIR:rpcs3>/test
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt )
get_target_property(WINDEPLOYQT_EXECUTABLE Qt6::windeployqt IMPORTED_LOCATION)
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${WINDEPLOYQT_EXECUTABLE} --no-compiler-runtime --no-opengl-sw --no-patchqt
--no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import --no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>" --plugindir $<TARGET_FILE_DIR:rpcs3>/qt6/plugins
--verbose 0 "$<TARGET_FILE:rpcs3>") --verbose 0
$<TARGET_FILE:rpcs3>
)
endif() endif()
# Unix installation # Unix installation

View file

@ -197,6 +197,21 @@ void aesni_gcm_mult( unsigned char c[16],
const unsigned char b[16] ) const unsigned char b[16] )
{ {
#if defined(POLARSSL_HAVE_MSVC_X64_INTRINSICS) #if defined(POLARSSL_HAVE_MSVC_X64_INTRINSICS)
#ifdef __clang__
__m128i xa, xb, m0, m1, x10, x32, r;
xa[1] = _byteswap_uint64( *((unsigned __int64*)a + 0) );
xa[0] = _byteswap_uint64( *((unsigned __int64*)a + 1) );
xb[1] = _byteswap_uint64( *((unsigned __int64*)b + 0) );
xb[0] = _byteswap_uint64( *((unsigned __int64*)b + 1) );
clmul256( xa, xb, &m0, &m1 );
sll256( m0, m1, &x10, &x32 );
r = reducemod128( x10, x32 );
*((unsigned __int64*)c + 0) = _byteswap_uint64( r[1] );
*((unsigned __int64*)c + 1) = _byteswap_uint64( r[0] );
#else
__m128i xa, xb, m0, m1, x10, x32, r; __m128i xa, xb, m0, m1, x10, x32, r;
xa.m128i_u64[1] = _byteswap_uint64( *((unsigned __int64*)a + 0) ); xa.m128i_u64[1] = _byteswap_uint64( *((unsigned __int64*)a + 0) );
@ -210,6 +225,7 @@ void aesni_gcm_mult( unsigned char c[16],
*((unsigned __int64*)c + 0) = _byteswap_uint64( r.m128i_u64[1] ); *((unsigned __int64*)c + 0) = _byteswap_uint64( r.m128i_u64[1] );
*((unsigned __int64*)c + 1) = _byteswap_uint64( r.m128i_u64[0] ); *((unsigned __int64*)c + 1) = _byteswap_uint64( r.m128i_u64[0] );
#endif
#else #else
unsigned char aa[16], bb[16], cc[16]; unsigned char aa[16], bb[16], cc[16];
size_t i; size_t i;

View file

@ -81,6 +81,7 @@ target_sources(rpcs3_emu PRIVATE
../../Utilities/Thread.cpp ../../Utilities/Thread.cpp
../../Utilities/version.cpp ../../Utilities/version.cpp
) )
if(APPLE) if(APPLE)
target_sources(rpcs3_emu PRIVATE target_sources(rpcs3_emu PRIVATE
../../darwin/util/sysinfo_darwin.mm ../../darwin/util/sysinfo_darwin.mm
@ -90,12 +91,12 @@ endif()
target_include_directories(rpcs3_emu PUBLIC "${CMAKE_SOURCE_DIR}") target_include_directories(rpcs3_emu PUBLIC "${CMAKE_SOURCE_DIR}")
set_source_files_properties("../../Utilities/JITLLVM.cpp" "../../Utilities/JITASM.cpp" PROPERTIES set_source_files_properties("../../Utilities/JITLLVM.cpp" "../../Utilities/JITASM.cpp" PROPERTIES
COMPILE_FLAGS "$<IF:$<CXX_COMPILER_ID:MSVC>,/GR-,-fno-rtti>" COMPILE_FLAGS "$<IF:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<CXX_COMPILER_ID:Clang>>/GR-,-fno-rtti>"
SKIP_PRECOMPILE_HEADERS ON SKIP_PRECOMPILE_HEADERS ON
) )
set_source_files_properties("../util/yaml.cpp" PROPERTIES set_source_files_properties("../util/yaml.cpp" PROPERTIES
COMPILE_FLAGS "$<IF:$<CXX_COMPILER_ID:MSVC>,/EHsc,-fexceptions>" COMPILE_FLAGS "$<IF:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<CXX_COMPILER_ID:Clang>>/EHsc,-fexceptions>"
SKIP_PRECOMPILE_HEADERS ON SKIP_PRECOMPILE_HEADERS ON
) )

View file

@ -111,28 +111,7 @@ void AtracXdecDecoder::alloc_avcodec()
fmt::throw_exception("avcodec_find_decoder() failed"); fmt::throw_exception("avcodec_find_decoder() failed");
} }
ensure(!(codec->capabilities & AV_CODEC_CAP_SUBFRAMES)); //ensure(!(codec->capabilities & AV_CODEC_CAP_SUBFRAMES));
ctx = avcodec_alloc_context3(codec);
if (!ctx)
{
fmt::throw_exception("avcodec_alloc_context3() failed");
}
// Allows FFmpeg to output directly into guest memory
ctx->opaque = this;
ctx->thread_type = FF_THREAD_SLICE; // Silences a warning by FFmpeg about requesting frame threading with a custom get_buffer2(). Default is FF_THREAD_FRAME & FF_THREAD_SLICE
ctx->get_buffer2 = [](AVCodecContext* s, AVFrame* frame, int /*flags*/) -> int
{
for (s32 i = 0; i < frame->ch_layout.nb_channels; i++)
{
frame->data[i] = static_cast<AtracXdecDecoder*>(s->opaque)->work_mem.get_ptr() + ATXDEC_MAX_FRAME_LENGTH + ATXDEC_SAMPLES_PER_FRAME * sizeof(f32) * i;
frame->linesize[i] = ATXDEC_SAMPLES_PER_FRAME * sizeof(f32);
}
frame->buf[0] = av_buffer_create(frame->data[0], ATXDEC_SAMPLES_PER_FRAME * sizeof(f32) * frame->ch_layout.nb_channels, [](void*, uint8_t*){}, nullptr, 0);
return 0;
};
packet = av_packet_alloc(); packet = av_packet_alloc();
if (!packet) if (!packet)
@ -149,18 +128,47 @@ void AtracXdecDecoder::alloc_avcodec()
void AtracXdecDecoder::free_avcodec() void AtracXdecDecoder::free_avcodec()
{ {
av_packet_free(&packet); if (packet)
av_frame_free(&frame); {
avcodec_free_context(&ctx); av_packet_free(&packet);
}
if (frame)
{
av_frame_free(&frame);
}
if (ctx)
{
avcodec_free_context(&ctx);
}
} }
void AtracXdecDecoder::init_avcodec() void AtracXdecDecoder::init_avcodec()
{ {
if (int err = avcodec_close(ctx); err) if (ctx)
{ {
fmt::throw_exception("avcodec_close() failed (err=0x%x='%s')", err, utils::av_error_to_string(err)); avcodec_free_context(&ctx);
} }
ctx = avcodec_alloc_context3(codec);
if (!ctx)
{
fmt::throw_exception("avcodec_alloc_context3() failed");
}
// Allows FFmpeg to output directly into guest memory
ctx->opaque = this;
ctx->thread_type = FF_THREAD_SLICE; // Silences a warning by FFmpeg about requesting frame threading with a custom get_buffer2(). Default is FF_THREAD_FRAME & FF_THREAD_SLICE
ctx->get_buffer2 = [](AVCodecContext* s, AVFrame* frame, int /*flags*/) -> int
{
for (s32 i = 0; i < frame->ch_layout.nb_channels; i++)
{
frame->data[i] = static_cast<AtracXdecDecoder*>(s->opaque)->work_mem.get_ptr() + ATXDEC_MAX_FRAME_LENGTH + ATXDEC_SAMPLES_PER_FRAME * sizeof(f32) * i;
frame->linesize[i] = ATXDEC_SAMPLES_PER_FRAME * sizeof(f32);
}
frame->buf[0] = av_buffer_create(frame->data[0], ATXDEC_SAMPLES_PER_FRAME * sizeof(f32) * frame->ch_layout.nb_channels, [](void*, uint8_t*){}, nullptr, 0);
return 0;
};
ctx->block_align = nbytes; ctx->block_align = nbytes;
ctx->ch_layout.nb_channels = nch_in; ctx->ch_layout.nb_channels = nch_in;
ctx->sample_rate = sampling_freq; ctx->sample_rate = sampling_freq;

View file

@ -192,10 +192,10 @@ struct AtracXdecDecoder
// HLE exclusive // HLE exclusive
b8 config_is_set = false; // For savestates b8 config_is_set = false; // For savestates
const AVCodec* codec; const AVCodec* codec = nullptr;
AVCodecContext* ctx; AVCodecContext* ctx = nullptr;
AVPacket* packet; AVPacket* packet = nullptr;
AVFrame* frame; AVFrame* frame = nullptr;
u8 spurs_stuff[84]; // 120 bytes on LLE, pointers to CellSpurs, CellSpursTaskset, etc. u8 spurs_stuff[84]; // 120 bytes on LLE, pointers to CellSpurs, CellSpursTaskset, etc.

View file

@ -5751,7 +5751,11 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module<lv2_obj>& module
std::unique_ptr<Module> _module = std::make_unique<Module>(obj_name, jit.get_context()); std::unique_ptr<Module> _module = std::make_unique<Module>(obj_name, jit.get_context());
// Initialize target // Initialize target
#if LLVM_VERSION_MAJOR > 20
_module->setTargetTriple(Triple(jit_compiler::triple1()));
#else
_module->setTargetTriple(jit_compiler::triple1()); _module->setTargetTriple(jit_compiler::triple1());
#endif
_module->setDataLayout(jit.get_engine().getTargetMachine()->createDataLayout()); _module->setDataLayout(jit.get_engine().getTargetMachine()->createDataLayout());
// Initialize translator // Initialize translator

View file

@ -1601,7 +1601,11 @@ public:
// Create LLVM module // Create LLVM module
std::unique_ptr<Module> _module = std::make_unique<Module>(m_hash + ".obj", m_context); std::unique_ptr<Module> _module = std::make_unique<Module>(m_hash + ".obj", m_context);
#if LLVM_VERSION_MAJOR > 20
_module->setTargetTriple(Triple(jit_compiler::triple2()));
#else
_module->setTargetTriple(jit_compiler::triple2()); _module->setTargetTriple(jit_compiler::triple2());
#endif
_module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout()); _module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout());
m_module = _module.get(); m_module = _module.get();
@ -2876,7 +2880,11 @@ public:
// Create LLVM module // Create LLVM module
std::unique_ptr<Module> _module = std::make_unique<Module>("spu_interpreter.obj", m_context); std::unique_ptr<Module> _module = std::make_unique<Module>("spu_interpreter.obj", m_context);
#if LLVM_VERSION_MAJOR > 20
_module->setTargetTriple(Triple(jit_compiler::triple2()));
#else
_module->setTargetTriple(jit_compiler::triple2()); _module->setTargetTriple(jit_compiler::triple2());
#endif
_module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout()); _module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout());
m_module = _module.get(); m_module = _module.get();

View file

@ -23,7 +23,8 @@
#endif #endif
#endif #endif
#ifdef _MSC_VER //#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
#define AVX512_ICL_FUNC #define AVX512_ICL_FUNC
#else #else
#define AVX512_ICL_FUNC __attribute__((__target__("avx512f,avx512bw,avx512dq,avx512cd,avx512vl,avx512bitalg,avx512ifma,avx512vbmi,avx512vbmi2,avx512vnni,avx512vpopcntdq"))) #define AVX512_ICL_FUNC __attribute__((__target__("avx512f,avx512bw,avx512dq,avx512cd,avx512vl,avx512bitalg,avx512ifma,avx512vbmi,avx512vbmi2,avx512vnni,avx512vpopcntdq")))
@ -32,7 +33,8 @@
using namespace program_hash_util; using namespace program_hash_util;
#ifdef ARCH_X64 //#ifdef ARCH_X64
#if defined(ARCH_X64) && !(defined(__clang__) && defined(_MSC_VER))
AVX512_ICL_FUNC usz get_vertex_program_ucode_hash_512(const RSXVertexProgram &program) AVX512_ICL_FUNC usz get_vertex_program_ucode_hash_512(const RSXVertexProgram &program)
{ {
// Load all elements of the instruction_mask bitset // Load all elements of the instruction_mask bitset
@ -424,7 +426,8 @@ vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vert
usz vertex_program_storage_hash::operator()(const RSXVertexProgram &program) const usz vertex_program_storage_hash::operator()(const RSXVertexProgram &program) const
{ {
#ifdef ARCH_X64 //#ifdef ARCH_X64
#if defined(ARCH_X64) && !(defined(__clang__) && defined(_MSC_VER))
usz ucode_hash; usz ucode_hash;
if (utils::has_avx512_icl()) if (utils::has_avx512_icl())
@ -449,7 +452,8 @@ usz vertex_program_storage_hash::operator()(const RSXVertexProgram &program) con
return rpcs3::hash64(ucode_hash, metadata_hash); return rpcs3::hash64(ucode_hash, metadata_hash);
} }
#ifdef ARCH_X64 //#ifdef ARCH_X64
#if defined(ARCH_X64) && !(defined(__clang__) && defined(_MSC_VER))
AVX512_ICL_FUNC bool vertex_program_compare_512(const RSXVertexProgram &binary1, const RSXVertexProgram &binary2) AVX512_ICL_FUNC bool vertex_program_compare_512(const RSXVertexProgram &binary1, const RSXVertexProgram &binary2)
{ {
// Load all elements of the instruction_mask bitset // Load all elements of the instruction_mask bitset
@ -540,7 +544,8 @@ bool vertex_program_compare::operator()(const RSXVertexProgram &binary1, const R
return false; return false;
} }
#ifdef ARCH_X64 //#ifdef ARCH_X64
#if defined(ARCH_X64) && !(defined(__clang__) && defined(_MSC_VER))
if (utils::has_avx512_icl()) if (utils::has_avx512_icl())
{ {
return vertex_program_compare_512(binary1, binary2); return vertex_program_compare_512(binary1, binary2);

View file

@ -9,7 +9,7 @@ extern bool g_use_rtm;
extern u64 g_rtm_tx_limit1; extern u64 g_rtm_tx_limit1;
#ifdef _M_X64 #ifdef _M_X64
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
extern "C" extern "C"
{ {
u32 _xbegin(); u32 _xbegin();
@ -242,7 +242,7 @@ namespace utils
constexpr u32 popcnt128(const u128& v) constexpr u32 popcnt128(const u128& v)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
return popcnt64(v.lo) + popcnt64(v.hi); return popcnt64(v.lo) + popcnt64(v.hi);
#else #else
return popcnt64(v) + popcnt64(v >> 64); return popcnt64(v) + popcnt64(v >> 64);
@ -274,7 +274,7 @@ namespace utils
inline s64 div128(s64 high, s64 low, s64 divisor, s64* remainder = nullptr) inline s64 div128(s64 high, s64 low, s64 divisor, s64* remainder = nullptr)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
s64 rem = 0; s64 rem = 0;
s64 r = _div128(high, low, divisor, &rem); s64 r = _div128(high, low, divisor, &rem);
@ -296,7 +296,7 @@ namespace utils
inline u64 udiv128(u64 high, u64 low, u64 divisor, u64* remainder = nullptr) inline u64 udiv128(u64 high, u64 low, u64 divisor, u64* remainder = nullptr)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
u64 rem = 0; u64 rem = 0;
u64 r = _udiv128(high, low, divisor, &rem); u64 r = _udiv128(high, low, divisor, &rem);
@ -316,7 +316,7 @@ namespace utils
return r; return r;
} }
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
inline u128 operator/(u128 lhs, u64 rhs) inline u128 operator/(u128 lhs, u64 rhs)
{ {
u64 rem = 0; u64 rem = 0;
@ -326,7 +326,7 @@ namespace utils
constexpr u32 ctz128(u128 arg) constexpr u32 ctz128(u128 arg)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
if (!arg.lo) if (!arg.lo)
return std::countr_zero(arg.hi) + 64u; return std::countr_zero(arg.hi) + 64u;
else else
@ -341,7 +341,7 @@ namespace utils
constexpr u32 clz128(u128 arg) constexpr u32 clz128(u128 arg)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
if (arg.hi) if (arg.hi)
return std::countl_zero(arg.hi); return std::countl_zero(arg.hi);
else else
@ -470,6 +470,6 @@ namespace utils
using utils::busy_wait; using utils::busy_wait;
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
using utils::operator/; using utils::operator/;
#endif #endif

View file

@ -249,13 +249,13 @@ public:
} }
}; };
#if defined(ARCH_X64) && !defined(_MSC_VER) #if defined(ARCH_X64) && !defined(_MSC_VER) && !defined(__m128)
using __m128i = long long __attribute__((vector_size(16))); using __m128i = long long __attribute__((vector_size(16)));
using __m128d = double __attribute__((vector_size(16))); using __m128d = double __attribute__((vector_size(16)));
using __m128 = float __attribute__((vector_size(16))); using __m128 = float __attribute__((vector_size(16)));
#endif #endif
#ifndef _MSC_VER #if !defined(_MSC_VER) || defined(__clang__)
using u128 = __uint128_t; using u128 = __uint128_t;
using s128 = __int128_t; using s128 = __int128_t;
#else #else
@ -266,8 +266,8 @@ extern "C"
union __m128i; union __m128i;
struct __m128d; struct __m128d;
uchar _addcarry_u64(uchar, u64, u64, u64*); constexpr uchar _addcarry_u64(uchar, u64, u64, u64*);
uchar _subborrow_u64(uchar, u64, u64, u64*); constexpr uchar _subborrow_u64(uchar, u64, u64, u64*);
u64 __shiftleft128(u64, u64, uchar); u64 __shiftleft128(u64, u64, uchar);
u64 __shiftright128(u64, u64, uchar); u64 __shiftright128(u64, u64, uchar);
u64 _umul128(u64, u64, u64*); u64 _umul128(u64, u64, u64*);
@ -579,7 +579,7 @@ struct s128 : u128
// Optimization for u64*u64=u128 // Optimization for u64*u64=u128
constexpr u128 u128_from_mul(u64 a, u64 b) constexpr u128 u128_from_mul(u64 a, u64 b)
{ {
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
if (!std::is_constant_evaluated()) if (!std::is_constant_evaluated())
{ {
u64 hi; u64 hi;