62 changed files with 1710 additions and 1271 deletions
-
2.ci/license-header.sh
-
19.github/workflows/sources.yml
-
61.github/workflows/translations.yml
-
2.gitignore
-
34CMakeLists.txt
-
58CMakeModules/MinGWClangCross.cmake
-
57CMakeModules/MinGWCross.cmake
-
BINdist/eden.ico
-
9dist/icon_variations/README.md
-
80dist/icon_variations/base_small.svg
-
BINdist/yuzu.bmp
-
46docs/Build.md
-
22docs/Deps.md
-
7externals/CMakeLists.txt
-
28externals/ffmpeg/CMakeLists.txt
-
4externals/nx_tzdb/cpmfile.json
-
6src/CMakeLists.txt
-
37src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt
-
4src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
-
1src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt
-
12src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt
-
20src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt
-
8src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt
-
57src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsDialogFragment.kt
-
4src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
-
9src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsViewModel.kt
-
6src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
-
1src/android/app/src/main/jni/android_settings.h
-
55src/android/app/src/main/res/values/arrays.xml
-
29src/android/app/src/main/res/values/strings.xml
-
47src/common/atomic_ops.h
-
16src/common/logging/formatter.h
-
3src/common/settings.cpp
-
3src/common/settings.h
-
279src/common/swap.h
-
7src/core/arm/dynarmic/arm_dynarmic_32.cpp
-
7src/core/arm/dynarmic/arm_dynarmic_64.cpp
-
13src/core/core.cpp
-
14src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
-
6src/core/hle/service/nvdrv/devices/nvhost_gpu.h
-
5src/dynarmic/CMakeLists.txt
-
7src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp
-
2src/shader_recompiler/CMakeLists.txt
-
459src/shader_recompiler/frontend/ir/attribute.cpp
-
464src/shader_recompiler/frontend/ir/attribute.h
-
82src/shader_recompiler/frontend/ir/flow_test.cpp
-
82src/shader_recompiler/frontend/ir/flow_test.h
-
28src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp
-
8src/video_core/renderer_opengl/gl_rasterizer.cpp
-
14src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
-
2src/video_core/renderer_vulkan/vk_graphics_pipeline.h
-
7src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
-
145src/video_core/renderer_vulkan/vk_rasterizer.cpp
-
7src/video_core/vulkan_common/vulkan_device.cpp
-
14tools/translations/lupdate.sh
-
9tools/translations/qt-source.sh
-
19tools/update-icons.sh
-
19tools/windows/install-vulkan-sdk.ps1
-
36tools/windows/install-vulkan-sdk.sh
-
42tools/windows/load-msvc-env.ps1
-
24tools/windows/load-msvc-env.sh
-
433tools/windows/vcvarsall.sh
@ -0,0 +1,19 @@ |
|||
name: tx-src |
|||
|
|||
on: |
|||
push: |
|||
branches: [ master ] |
|||
|
|||
jobs: |
|||
sources: |
|||
runs-on: source |
|||
steps: |
|||
- uses: actions/checkout@v4 |
|||
with: |
|||
fetch-depth: 0 |
|||
|
|||
- name: Push New Sources |
|||
run: | |
|||
export PATH=/usr/lib/qt6/bin:$PATH |
|||
./tools/translations/qt-source.sh |
|||
tx-cli push -s |
|||
@ -0,0 +1,61 @@ |
|||
name: tx-pull |
|||
|
|||
on: |
|||
# monday, wednesday, saturday at 2pm |
|||
schedule: |
|||
cron: |
|||
- '0 14 * * 1,3,6' |
|||
|
|||
jobs: |
|||
tx-update: |
|||
runs-on: source |
|||
steps: |
|||
- uses: actions/checkout@v4 |
|||
with: |
|||
fetch-depth: 0 |
|||
|
|||
- name: Get New Translations |
|||
run: tx-cli pull -t -f |
|||
|
|||
- name: Push branch |
|||
run: | |
|||
git config --local user.name "Eden CI" |
|||
git config --local user.email "ci@eden-emu.dev" |
|||
git config --local user.signingkey "D57652791BB25D2A" |
|||
git config --local push.autoSetupRemote true |
|||
|
|||
git remote set-url origin ci:eden-emu/eden.git |
|||
|
|||
TIMESTAMP=$(date +"%s") |
|||
echo "TIMESTAMP=$TIMESTAMP" >> "$GITHUB_ENV" |
|||
|
|||
git switch -c update-translations-$TIMESTAMP |
|||
git add dist src/android/app/src/main/res |
|||
|
|||
git commit -sS -m "[dist, android] Update translations from Transifex" |
|||
git push |
|||
|
|||
- name: Create PR |
|||
run: | |
|||
DATE=$(date +"%b %d") |
|||
TITLE="[dist, android] Update translations from Transifex for $DATE" |
|||
BODY="Automatic translation update for $DATE" |
|||
BASE=master |
|||
HEAD=update-translations-$TIMESTAMP |
|||
|
|||
cat << EOF > data.json |
|||
{ |
|||
"base": "$BASE", |
|||
"body": "$BODY", |
|||
"head": "$HEAD", |
|||
"title": "$TITLE" |
|||
} |
|||
EOF |
|||
|
|||
curl -X 'POST' \ |
|||
'https://git.eden-emu.dev/api/v1/repos/eden-emu/eden/pulls' \ |
|||
-H 'accept: application/json' \ |
|||
-H 'Authorization: Bearer ${{ secrets.CI_FJ_TOKEN }}' \ |
|||
-H 'Content-Type: application/json' \ |
|||
-d "@data.json" --fail |
|||
|
|||
@ -1,58 +0,0 @@ |
|||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
set(MINGW_PREFIX /usr/x86_64-w64-mingw32/) |
|||
set(CMAKE_SYSTEM_NAME Windows) |
|||
set(CMAKE_SYSTEM_PROCESSOR x86_64) |
|||
|
|||
set(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) |
|||
set(SDL2_PATH ${MINGW_PREFIX}) |
|||
set(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) |
|||
|
|||
# Specify the cross compiler |
|||
set(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}clang) |
|||
set(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}clang++) |
|||
set(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres) |
|||
set(CMAKE_C_COMPILER_AR ${MINGW_TOOL_PREFIX}ar) |
|||
set(CMAKE_CXX_COMPILER_AR ${MINGW_TOOL_PREFIX}ar) |
|||
set(CMAKE_C_COMPILER_RANLIB ${MINGW_TOOL_PREFIX}ranlib) |
|||
set(CMAKE_CXX_COMPILER_RANLIB ${MINGW_TOOL_PREFIX}ranlib) |
|||
|
|||
# Mingw tools |
|||
set(STRIP ${MINGW_TOOL_PREFIX}strip) |
|||
set(WINDRES ${MINGW_TOOL_PREFIX}windres) |
|||
set(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config) |
|||
|
|||
# ccache wrapper |
|||
option(USE_CCACHE "Use ccache for compilation" OFF) |
|||
if(USE_CCACHE) |
|||
find_program(CCACHE ccache) |
|||
if(CCACHE) |
|||
message(STATUS "Using ccache found in PATH") |
|||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) |
|||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) |
|||
else(CCACHE) |
|||
message(WARNING "USE_CCACHE enabled, but no ccache found") |
|||
endif(CCACHE) |
|||
endif(USE_CCACHE) |
|||
|
|||
# Search for programs in the build host directories |
|||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
|||
|
|||
|
|||
# Echo modified cmake vars to screen for debugging purposes |
|||
if(NOT DEFINED ENV{MINGW_DEBUG_INFO}) |
|||
message("") |
|||
message("Custom cmake vars: (blank = system default)") |
|||
message("-----------------------------------------") |
|||
message("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}") |
|||
message("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}") |
|||
message("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}") |
|||
message("* WINDRES : ${WINDRES}") |
|||
message("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}") |
|||
message("* STRIP : ${STRIP}") |
|||
message("* USE_CCACHE : ${USE_CCACHE}") |
|||
message("") |
|||
# So that the debug info only appears once |
|||
set(ENV{MINGW_DEBUG_INFO} SHOWN) |
|||
endif() |
|||
@ -1,57 +0,0 @@ |
|||
# SPDX-FileCopyrightText: 2018 tech4me <guiwanglong@gmail.com> |
|||
# SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
set(MINGW_PREFIX /usr/x86_64-w64-mingw32/) |
|||
set(CMAKE_SYSTEM_NAME Windows) |
|||
set(CMAKE_SYSTEM_PROCESSOR x86_64) |
|||
# Actually a hack, w/o this will cause some strange errors |
|||
set(CMAKE_HOST_WIN32 TRUE) |
|||
|
|||
|
|||
set(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) |
|||
set(SDL2_PATH ${MINGW_PREFIX}) |
|||
set(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) |
|||
|
|||
# Specify the cross compiler |
|||
set(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) |
|||
set(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++) |
|||
set(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres) |
|||
|
|||
# Mingw tools |
|||
set(STRIP ${MINGW_TOOL_PREFIX}strip) |
|||
set(WINDRES ${MINGW_TOOL_PREFIX}windres) |
|||
set(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config) |
|||
|
|||
# ccache wrapper |
|||
option(USE_CCACHE "Use ccache for compilation" OFF) |
|||
if(USE_CCACHE) |
|||
find_program(CCACHE ccache) |
|||
if(CCACHE) |
|||
message(STATUS "Using ccache found in PATH") |
|||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) |
|||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) |
|||
else(CCACHE) |
|||
message(WARNING "USE_CCACHE enabled, but no ccache found") |
|||
endif(CCACHE) |
|||
endif(USE_CCACHE) |
|||
|
|||
# Search for programs in the build host directories |
|||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
|||
|
|||
|
|||
# Echo modified cmake vars to screen for debugging purposes |
|||
if(NOT DEFINED ENV{MINGW_DEBUG_INFO}) |
|||
message("") |
|||
message("Custom cmake vars: (blank = system default)") |
|||
message("-----------------------------------------") |
|||
message("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}") |
|||
message("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}") |
|||
message("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}") |
|||
message("* WINDRES : ${WINDRES}") |
|||
message("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}") |
|||
message("* STRIP : ${STRIP}") |
|||
message("* USE_CCACHE : ${USE_CCACHE}") |
|||
message("") |
|||
# So that the debug info only appears once |
|||
set(ENV{MINGW_DEBUG_INFO} SHOWN) |
|||
endif() |
|||
@ -0,0 +1,9 @@ |
|||
# Icon variations |
|||
|
|||
These icons are licensed under GPLv3. Please see the [script for generating icons](../../tools/README.md) and appropriatedly redirect for seasonal icons. |
|||
|
|||
- `base_named.svg` - Named variant. |
|||
- `base_small.svg`: Variant used for tiny icons (16x16, 64x64, etc). |
|||
- `base.svg`: Variant without branding/naming. |
|||
|
|||
Try to keep the icons simple. And preferably automatically be able to be generated (to reduce maintanaince burden). Additionally keep the files small (use `svgo` and `optipng`) to not clutter the git. |
|||
@ -0,0 +1,80 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
|||
<svg |
|||
width="512" |
|||
height="512" |
|||
fill="none" |
|||
viewBox="0 0 512 512" |
|||
version="1.1" |
|||
id="svg7" |
|||
sodipodi:docname="base_small.svg" |
|||
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)" |
|||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
|||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
|||
xmlns:xlink="http://www.w3.org/1999/xlink" |
|||
xmlns="http://www.w3.org/2000/svg" |
|||
xmlns:svg="http://www.w3.org/2000/svg"> |
|||
<defs |
|||
id="defs7"> |
|||
<linearGradient |
|||
id="linearGradient10" |
|||
inkscape:collect="always"> |
|||
<stop |
|||
style="stop-color:#f977d9;stop-opacity:1;" |
|||
offset="0" |
|||
id="stop10" /> |
|||
<stop |
|||
style="stop-color:#a655d5;stop-opacity:1;" |
|||
offset="0.54051435" |
|||
id="stop13" /> |
|||
<stop |
|||
style="stop-color:#984fd5;stop-opacity:1;" |
|||
offset="0.5714342" |
|||
id="stop12" /> |
|||
<stop |
|||
style="stop-color:#8c4ad4;stop-opacity:1;" |
|||
offset="0.59666741" |
|||
id="stop14" /> |
|||
<stop |
|||
style="stop-color:#3928d2;stop-opacity:1;" |
|||
offset="1" |
|||
id="stop11" /> |
|||
</linearGradient> |
|||
<linearGradient |
|||
inkscape:collect="always" |
|||
xlink:href="#linearGradient10" |
|||
id="linearGradient11" |
|||
x1="264.17508" |
|||
y1="28.385544" |
|||
x2="264.17508" |
|||
y2="488.65109" |
|||
gradientUnits="userSpaceOnUse" |
|||
gradientTransform="matrix(0.97815818,0,0,0.97880258,4.570042,5.8799159)" /> |
|||
</defs> |
|||
<sodipodi:namedview |
|||
id="namedview7" |
|||
pagecolor="#ffffff" |
|||
bordercolor="#000000" |
|||
borderopacity="0.25" |
|||
inkscape:showpageshadow="2" |
|||
inkscape:pageopacity="0.0" |
|||
inkscape:pagecheckerboard="0" |
|||
inkscape:deskcolor="#d1d1d1" |
|||
inkscape:zoom="0.88388348" |
|||
inkscape:cx="153.30075" |
|||
inkscape:cy="243.24473" |
|||
inkscape:window-width="1600" |
|||
inkscape:window-height="849" |
|||
inkscape:window-x="0" |
|||
inkscape:window-y="27" |
|||
inkscape:window-maximized="1" |
|||
inkscape:current-layer="svg7" |
|||
showguides="false" /> |
|||
<path |
|||
id="path9" |
|||
style="fill:url(#linearGradient11);fill-opacity:1;stroke:none;stroke-width:13.3314;stroke-opacity:1;paint-order:stroke fill markers" |
|||
d="M 262.97461 33.6875 A 218.44267 225.23091 0 0 0 138.83789 73.589844 L 141.13867 72.265625 L 161.2207 65.195312 L 181.01953 61.517578 L 204.35352 64.205078 L 228.96094 76.650391 L 265.80078 115 L 283 99.400391 L 304.59961 85.800781 L 331 76.400391 L 360.59961 69.599609 L 379.95508 69.208984 A 218.44267 225.23091 0 0 0 262.97461 33.6875 z M 380.07617 69.291016 L 350.19922 77.800781 L 329.19922 89.199219 L 307.40039 108 L 288.80078 129.80078 L 287.40039 135 L 302.40039 129.59961 L 319 127.80078 L 348.80078 131.80078 L 370.19922 141.40039 L 393 161.40039 L 399.59961 171.59961 L 374.80078 160.80078 L 338.40039 150.80078 L 309.19922 150 L 288.80078 154.40039 L 293.19922 155.19922 L 319.19922 168.80078 L 338 187.19922 L 350.80078 224 L 349.19922 260 L 326 222.80078 L 302.80078 194 L 277.59961 172.40039 L 269.19922 187.59961 L 256.80078 281.59961 L 258 364 L 278.40039 452.80078 L 297.19531 481.36914 A 218.44267 225.23091 0 0 0 481.41797 258.91797 A 218.44267 225.23091 0 0 0 380.07617 69.291016 z M 133.07422 77.839844 A 218.44267 225.23091 0 0 0 44.533203 258.91797 A 218.44267 225.23091 0 0 0 257.04102 484.06641 L 247.3457 458.62891 L 237.87109 418.18359 L 233.0625 380.42383 L 230.375 354.9668 L 229.95117 321.30859 L 232.35547 291.32812 L 237.44727 254.98242 L 254.55859 191.9082 L 261.62891 172.5332 L 255.54883 174.08984 L 240.98242 180.87695 L 229.59961 190.19922 L 210.59961 208.19922 L 197.40039 229.40039 L 186.40039 252.59961 L 173.40039 269 L 171.40039 253.19922 L 173.59961 229.40039 L 183 202.40039 L 199.40039 178 L 221.04102 153.44141 L 209.02148 155.70508 L 177.05859 162.77539 L 148.06836 171.40234 L 119.92578 183 L 120.63281 180.16992 L 129.82422 165.88672 L 151.17969 147.50195 L 172.95898 135.48242 L 190.07031 129.54102 L 209.02148 127.98633 L 227.6875 128.69336 L 247.76953 128.41016 L 246.49805 125.1582 L 226.69922 105.92383 L 219.62695 97.439453 L 221.4668 90.085938 L 206.75781 94.044922 L 195.86914 95.458984 L 179.46289 88.671875 L 156.12891 81.458984 L 133.07422 77.839844 z " /> |
|||
<path |
|||
style="fill:#1b1b1b;fill-opacity:0.12492698;stroke:none;stroke-width:13.374;stroke-opacity:0.415999;paint-order:stroke fill markers" |
|||
d="m 259.36665,490.16617 39.03323,-6.96642 -20,-30.4 -20.4,-88.8 -1.2,-82.4 12.4,-94 8.4,-15.2 25.2,21.6 23.2,28.8 23.2,37.2 1.6,-36 -12.8,-36.8 -18.8,-18.4 -26,-13.6 -4.4,-0.8 20.4,-4.4 29.2,0.8 36.4,10 24.8,10.8 -6.6,-10.2 -22.8,-20 -21.4,-9.6 -29.8,-4 -16.6,1.8 -15,5.4 1.4,-5.2 18.6,-21.8 21.8,-18.800003 21,-11.4 30.2,-8.6 -19.8,0.4 -29.6,6.8 -26.4,9.4 -21.6,13.6 -17.2,15.600003 -36.83882,-38.349628 -24.60732,-12.445079 -23.33452,-2.687006 -19.79899,3.676955 -20.08184,7.071068 -9.33381,5.374012 24.32448,3.818376 23.33452,7.212489 16.40488,6.788226 10.88944,-1.414214 14.70782,-3.959798 -1.83847,7.353911 7.07106,8.485288 19.79899,19.2333 1.2728,3.25269 -20.08184,0.28284 -18.66762,-0.7071 -18.95046,1.55563 -17.11198,5.9397 -21.77889,12.02081 -21.35462,18.38478 -9.19239,14.28356 -0.70711,2.82843 28.14285,-11.59656 28.99138,-8.6267 31.96122,-7.07107 12.02082,-2.26274 -21.64158,24.55783 -16.4,24.4 -9.4,27 -2.2,23.8 2,15.8 13,-16.4 11,-23.2 13.2,-21.2 19,-18 11.38199,-9.32209 14.5664,-6.78822 6.08112,-1.55564 -7.07107,19.37473 -17.11198,63.07393 -5.09117,36.34528 -2.40416,29.98133 0.42426,33.65828 2.68701,25.45585 4.80832,37.7595 9.47523,40.44651 z" |
|||
id="path8-4" /> |
|||
</svg> |
|||
@ -1,459 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include <fmt/ranges.h>
|
|||
|
|||
#include "shader_recompiler/exception.h"
|
|||
#include "shader_recompiler/frontend/ir/attribute.h"
|
|||
|
|||
namespace Shader::IR { |
|||
|
|||
bool IsGeneric(Attribute attribute) noexcept { |
|||
return attribute >= Attribute::Generic0X && attribute <= Attribute::Generic31X; |
|||
} |
|||
|
|||
u32 GenericAttributeIndex(Attribute attribute) { |
|||
if (!IsGeneric(attribute)) { |
|||
throw InvalidArgument("Attribute is not generic {}", attribute); |
|||
} |
|||
return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::Generic0X)) / 4u; |
|||
} |
|||
|
|||
u32 GenericAttributeElement(Attribute attribute) { |
|||
if (!IsGeneric(attribute)) { |
|||
throw InvalidArgument("Attribute is not generic {}", attribute); |
|||
} |
|||
return static_cast<u32>(attribute) % 4; |
|||
} |
|||
|
|||
std::string NameOf(Attribute attribute) { |
|||
switch (attribute) { |
|||
case Attribute::PrimitiveId: |
|||
return "PrimitiveId"; |
|||
case Attribute::Layer: |
|||
return "Layer"; |
|||
case Attribute::ViewportIndex: |
|||
return "ViewportIndex"; |
|||
case Attribute::PointSize: |
|||
return "PointSize"; |
|||
case Attribute::PositionX: |
|||
return "Position.X"; |
|||
case Attribute::PositionY: |
|||
return "Position.Y"; |
|||
case Attribute::PositionZ: |
|||
return "Position.Z"; |
|||
case Attribute::PositionW: |
|||
return "Position.W"; |
|||
case Attribute::Generic0X: |
|||
return "Generic[0].X"; |
|||
case Attribute::Generic0Y: |
|||
return "Generic[0].Y"; |
|||
case Attribute::Generic0Z: |
|||
return "Generic[0].Z"; |
|||
case Attribute::Generic0W: |
|||
return "Generic[0].W"; |
|||
case Attribute::Generic1X: |
|||
return "Generic[1].X"; |
|||
case Attribute::Generic1Y: |
|||
return "Generic[1].Y"; |
|||
case Attribute::Generic1Z: |
|||
return "Generic[1].Z"; |
|||
case Attribute::Generic1W: |
|||
return "Generic[1].W"; |
|||
case Attribute::Generic2X: |
|||
return "Generic[2].X"; |
|||
case Attribute::Generic2Y: |
|||
return "Generic[2].Y"; |
|||
case Attribute::Generic2Z: |
|||
return "Generic[2].Z"; |
|||
case Attribute::Generic2W: |
|||
return "Generic[2].W"; |
|||
case Attribute::Generic3X: |
|||
return "Generic[3].X"; |
|||
case Attribute::Generic3Y: |
|||
return "Generic[3].Y"; |
|||
case Attribute::Generic3Z: |
|||
return "Generic[3].Z"; |
|||
case Attribute::Generic3W: |
|||
return "Generic[3].W"; |
|||
case Attribute::Generic4X: |
|||
return "Generic[4].X"; |
|||
case Attribute::Generic4Y: |
|||
return "Generic[4].Y"; |
|||
case Attribute::Generic4Z: |
|||
return "Generic[4].Z"; |
|||
case Attribute::Generic4W: |
|||
return "Generic[4].W"; |
|||
case Attribute::Generic5X: |
|||
return "Generic[5].X"; |
|||
case Attribute::Generic5Y: |
|||
return "Generic[5].Y"; |
|||
case Attribute::Generic5Z: |
|||
return "Generic[5].Z"; |
|||
case Attribute::Generic5W: |
|||
return "Generic[5].W"; |
|||
case Attribute::Generic6X: |
|||
return "Generic[6].X"; |
|||
case Attribute::Generic6Y: |
|||
return "Generic[6].Y"; |
|||
case Attribute::Generic6Z: |
|||
return "Generic[6].Z"; |
|||
case Attribute::Generic6W: |
|||
return "Generic[6].W"; |
|||
case Attribute::Generic7X: |
|||
return "Generic[7].X"; |
|||
case Attribute::Generic7Y: |
|||
return "Generic[7].Y"; |
|||
case Attribute::Generic7Z: |
|||
return "Generic[7].Z"; |
|||
case Attribute::Generic7W: |
|||
return "Generic[7].W"; |
|||
case Attribute::Generic8X: |
|||
return "Generic[8].X"; |
|||
case Attribute::Generic8Y: |
|||
return "Generic[8].Y"; |
|||
case Attribute::Generic8Z: |
|||
return "Generic[8].Z"; |
|||
case Attribute::Generic8W: |
|||
return "Generic[8].W"; |
|||
case Attribute::Generic9X: |
|||
return "Generic[9].X"; |
|||
case Attribute::Generic9Y: |
|||
return "Generic[9].Y"; |
|||
case Attribute::Generic9Z: |
|||
return "Generic[9].Z"; |
|||
case Attribute::Generic9W: |
|||
return "Generic[9].W"; |
|||
case Attribute::Generic10X: |
|||
return "Generic[10].X"; |
|||
case Attribute::Generic10Y: |
|||
return "Generic[10].Y"; |
|||
case Attribute::Generic10Z: |
|||
return "Generic[10].Z"; |
|||
case Attribute::Generic10W: |
|||
return "Generic[10].W"; |
|||
case Attribute::Generic11X: |
|||
return "Generic[11].X"; |
|||
case Attribute::Generic11Y: |
|||
return "Generic[11].Y"; |
|||
case Attribute::Generic11Z: |
|||
return "Generic[11].Z"; |
|||
case Attribute::Generic11W: |
|||
return "Generic[11].W"; |
|||
case Attribute::Generic12X: |
|||
return "Generic[12].X"; |
|||
case Attribute::Generic12Y: |
|||
return "Generic[12].Y"; |
|||
case Attribute::Generic12Z: |
|||
return "Generic[12].Z"; |
|||
case Attribute::Generic12W: |
|||
return "Generic[12].W"; |
|||
case Attribute::Generic13X: |
|||
return "Generic[13].X"; |
|||
case Attribute::Generic13Y: |
|||
return "Generic[13].Y"; |
|||
case Attribute::Generic13Z: |
|||
return "Generic[13].Z"; |
|||
case Attribute::Generic13W: |
|||
return "Generic[13].W"; |
|||
case Attribute::Generic14X: |
|||
return "Generic[14].X"; |
|||
case Attribute::Generic14Y: |
|||
return "Generic[14].Y"; |
|||
case Attribute::Generic14Z: |
|||
return "Generic[14].Z"; |
|||
case Attribute::Generic14W: |
|||
return "Generic[14].W"; |
|||
case Attribute::Generic15X: |
|||
return "Generic[15].X"; |
|||
case Attribute::Generic15Y: |
|||
return "Generic[15].Y"; |
|||
case Attribute::Generic15Z: |
|||
return "Generic[15].Z"; |
|||
case Attribute::Generic15W: |
|||
return "Generic[15].W"; |
|||
case Attribute::Generic16X: |
|||
return "Generic[16].X"; |
|||
case Attribute::Generic16Y: |
|||
return "Generic[16].Y"; |
|||
case Attribute::Generic16Z: |
|||
return "Generic[16].Z"; |
|||
case Attribute::Generic16W: |
|||
return "Generic[16].W"; |
|||
case Attribute::Generic17X: |
|||
return "Generic[17].X"; |
|||
case Attribute::Generic17Y: |
|||
return "Generic[17].Y"; |
|||
case Attribute::Generic17Z: |
|||
return "Generic[17].Z"; |
|||
case Attribute::Generic17W: |
|||
return "Generic[17].W"; |
|||
case Attribute::Generic18X: |
|||
return "Generic[18].X"; |
|||
case Attribute::Generic18Y: |
|||
return "Generic[18].Y"; |
|||
case Attribute::Generic18Z: |
|||
return "Generic[18].Z"; |
|||
case Attribute::Generic18W: |
|||
return "Generic[18].W"; |
|||
case Attribute::Generic19X: |
|||
return "Generic[19].X"; |
|||
case Attribute::Generic19Y: |
|||
return "Generic[19].Y"; |
|||
case Attribute::Generic19Z: |
|||
return "Generic[19].Z"; |
|||
case Attribute::Generic19W: |
|||
return "Generic[19].W"; |
|||
case Attribute::Generic20X: |
|||
return "Generic[20].X"; |
|||
case Attribute::Generic20Y: |
|||
return "Generic[20].Y"; |
|||
case Attribute::Generic20Z: |
|||
return "Generic[20].Z"; |
|||
case Attribute::Generic20W: |
|||
return "Generic[20].W"; |
|||
case Attribute::Generic21X: |
|||
return "Generic[21].X"; |
|||
case Attribute::Generic21Y: |
|||
return "Generic[21].Y"; |
|||
case Attribute::Generic21Z: |
|||
return "Generic[21].Z"; |
|||
case Attribute::Generic21W: |
|||
return "Generic[21].W"; |
|||
case Attribute::Generic22X: |
|||
return "Generic[22].X"; |
|||
case Attribute::Generic22Y: |
|||
return "Generic[22].Y"; |
|||
case Attribute::Generic22Z: |
|||
return "Generic[22].Z"; |
|||
case Attribute::Generic22W: |
|||
return "Generic[22].W"; |
|||
case Attribute::Generic23X: |
|||
return "Generic[23].X"; |
|||
case Attribute::Generic23Y: |
|||
return "Generic[23].Y"; |
|||
case Attribute::Generic23Z: |
|||
return "Generic[23].Z"; |
|||
case Attribute::Generic23W: |
|||
return "Generic[23].W"; |
|||
case Attribute::Generic24X: |
|||
return "Generic[24].X"; |
|||
case Attribute::Generic24Y: |
|||
return "Generic[24].Y"; |
|||
case Attribute::Generic24Z: |
|||
return "Generic[24].Z"; |
|||
case Attribute::Generic24W: |
|||
return "Generic[24].W"; |
|||
case Attribute::Generic25X: |
|||
return "Generic[25].X"; |
|||
case Attribute::Generic25Y: |
|||
return "Generic[25].Y"; |
|||
case Attribute::Generic25Z: |
|||
return "Generic[25].Z"; |
|||
case Attribute::Generic25W: |
|||
return "Generic[25].W"; |
|||
case Attribute::Generic26X: |
|||
return "Generic[26].X"; |
|||
case Attribute::Generic26Y: |
|||
return "Generic[26].Y"; |
|||
case Attribute::Generic26Z: |
|||
return "Generic[26].Z"; |
|||
case Attribute::Generic26W: |
|||
return "Generic[26].W"; |
|||
case Attribute::Generic27X: |
|||
return "Generic[27].X"; |
|||
case Attribute::Generic27Y: |
|||
return "Generic[27].Y"; |
|||
case Attribute::Generic27Z: |
|||
return "Generic[27].Z"; |
|||
case Attribute::Generic27W: |
|||
return "Generic[27].W"; |
|||
case Attribute::Generic28X: |
|||
return "Generic[28].X"; |
|||
case Attribute::Generic28Y: |
|||
return "Generic[28].Y"; |
|||
case Attribute::Generic28Z: |
|||
return "Generic[28].Z"; |
|||
case Attribute::Generic28W: |
|||
return "Generic[28].W"; |
|||
case Attribute::Generic29X: |
|||
return "Generic[29].X"; |
|||
case Attribute::Generic29Y: |
|||
return "Generic[29].Y"; |
|||
case Attribute::Generic29Z: |
|||
return "Generic[29].Z"; |
|||
case Attribute::Generic29W: |
|||
return "Generic[29].W"; |
|||
case Attribute::Generic30X: |
|||
return "Generic[30].X"; |
|||
case Attribute::Generic30Y: |
|||
return "Generic[30].Y"; |
|||
case Attribute::Generic30Z: |
|||
return "Generic[30].Z"; |
|||
case Attribute::Generic30W: |
|||
return "Generic[30].W"; |
|||
case Attribute::Generic31X: |
|||
return "Generic[31].X"; |
|||
case Attribute::Generic31Y: |
|||
return "Generic[31].Y"; |
|||
case Attribute::Generic31Z: |
|||
return "Generic[31].Z"; |
|||
case Attribute::Generic31W: |
|||
return "Generic[31].W"; |
|||
case Attribute::ColorFrontDiffuseR: |
|||
return "ColorFrontDiffuse.R"; |
|||
case Attribute::ColorFrontDiffuseG: |
|||
return "ColorFrontDiffuse.G"; |
|||
case Attribute::ColorFrontDiffuseB: |
|||
return "ColorFrontDiffuse.B"; |
|||
case Attribute::ColorFrontDiffuseA: |
|||
return "ColorFrontDiffuse.A"; |
|||
case Attribute::ColorFrontSpecularR: |
|||
return "ColorFrontSpecular.R"; |
|||
case Attribute::ColorFrontSpecularG: |
|||
return "ColorFrontSpecular.G"; |
|||
case Attribute::ColorFrontSpecularB: |
|||
return "ColorFrontSpecular.B"; |
|||
case Attribute::ColorFrontSpecularA: |
|||
return "ColorFrontSpecular.A"; |
|||
case Attribute::ColorBackDiffuseR: |
|||
return "ColorBackDiffuse.R"; |
|||
case Attribute::ColorBackDiffuseG: |
|||
return "ColorBackDiffuse.G"; |
|||
case Attribute::ColorBackDiffuseB: |
|||
return "ColorBackDiffuse.B"; |
|||
case Attribute::ColorBackDiffuseA: |
|||
return "ColorBackDiffuse.A"; |
|||
case Attribute::ColorBackSpecularR: |
|||
return "ColorBackSpecular.R"; |
|||
case Attribute::ColorBackSpecularG: |
|||
return "ColorBackSpecular.G"; |
|||
case Attribute::ColorBackSpecularB: |
|||
return "ColorBackSpecular.B"; |
|||
case Attribute::ColorBackSpecularA: |
|||
return "ColorBackSpecular.A"; |
|||
case Attribute::ClipDistance0: |
|||
return "ClipDistance[0]"; |
|||
case Attribute::ClipDistance1: |
|||
return "ClipDistance[1]"; |
|||
case Attribute::ClipDistance2: |
|||
return "ClipDistance[2]"; |
|||
case Attribute::ClipDistance3: |
|||
return "ClipDistance[3]"; |
|||
case Attribute::ClipDistance4: |
|||
return "ClipDistance[4]"; |
|||
case Attribute::ClipDistance5: |
|||
return "ClipDistance[5]"; |
|||
case Attribute::ClipDistance6: |
|||
return "ClipDistance[6]"; |
|||
case Attribute::ClipDistance7: |
|||
return "ClipDistance[7]"; |
|||
case Attribute::PointSpriteS: |
|||
return "PointSprite.S"; |
|||
case Attribute::PointSpriteT: |
|||
return "PointSprite.T"; |
|||
case Attribute::FogCoordinate: |
|||
return "FogCoordinate"; |
|||
case Attribute::TessellationEvaluationPointU: |
|||
return "TessellationEvaluationPoint.U"; |
|||
case Attribute::TessellationEvaluationPointV: |
|||
return "TessellationEvaluationPoint.V"; |
|||
case Attribute::InstanceId: |
|||
return "InstanceId"; |
|||
case Attribute::VertexId: |
|||
return "VertexId"; |
|||
case Attribute::FixedFncTexture0S: |
|||
return "FixedFncTexture[0].S"; |
|||
case Attribute::FixedFncTexture0T: |
|||
return "FixedFncTexture[0].T"; |
|||
case Attribute::FixedFncTexture0R: |
|||
return "FixedFncTexture[0].R"; |
|||
case Attribute::FixedFncTexture0Q: |
|||
return "FixedFncTexture[0].Q"; |
|||
case Attribute::FixedFncTexture1S: |
|||
return "FixedFncTexture[1].S"; |
|||
case Attribute::FixedFncTexture1T: |
|||
return "FixedFncTexture[1].T"; |
|||
case Attribute::FixedFncTexture1R: |
|||
return "FixedFncTexture[1].R"; |
|||
case Attribute::FixedFncTexture1Q: |
|||
return "FixedFncTexture[1].Q"; |
|||
case Attribute::FixedFncTexture2S: |
|||
return "FixedFncTexture[2].S"; |
|||
case Attribute::FixedFncTexture2T: |
|||
return "FixedFncTexture[2].T"; |
|||
case Attribute::FixedFncTexture2R: |
|||
return "FixedFncTexture[2].R"; |
|||
case Attribute::FixedFncTexture2Q: |
|||
return "FixedFncTexture[2].Q"; |
|||
case Attribute::FixedFncTexture3S: |
|||
return "FixedFncTexture[3].S"; |
|||
case Attribute::FixedFncTexture3T: |
|||
return "FixedFncTexture[3].T"; |
|||
case Attribute::FixedFncTexture3R: |
|||
return "FixedFncTexture[3].R"; |
|||
case Attribute::FixedFncTexture3Q: |
|||
return "FixedFncTexture[3].Q"; |
|||
case Attribute::FixedFncTexture4S: |
|||
return "FixedFncTexture[4].S"; |
|||
case Attribute::FixedFncTexture4T: |
|||
return "FixedFncTexture[4].T"; |
|||
case Attribute::FixedFncTexture4R: |
|||
return "FixedFncTexture[4].R"; |
|||
case Attribute::FixedFncTexture4Q: |
|||
return "FixedFncTexture[4].Q"; |
|||
case Attribute::FixedFncTexture5S: |
|||
return "FixedFncTexture[5].S"; |
|||
case Attribute::FixedFncTexture5T: |
|||
return "FixedFncTexture[5].T"; |
|||
case Attribute::FixedFncTexture5R: |
|||
return "FixedFncTexture[5].R"; |
|||
case Attribute::FixedFncTexture5Q: |
|||
return "FixedFncTexture[5].Q"; |
|||
case Attribute::FixedFncTexture6S: |
|||
return "FixedFncTexture[6].S"; |
|||
case Attribute::FixedFncTexture6T: |
|||
return "FixedFncTexture[6].T"; |
|||
case Attribute::FixedFncTexture6R: |
|||
return "FixedFncTexture[6].R"; |
|||
case Attribute::FixedFncTexture6Q: |
|||
return "FixedFncTexture[6].Q"; |
|||
case Attribute::FixedFncTexture7S: |
|||
return "FixedFncTexture[7].S"; |
|||
case Attribute::FixedFncTexture7T: |
|||
return "FixedFncTexture[7].T"; |
|||
case Attribute::FixedFncTexture7R: |
|||
return "FixedFncTexture[7].R"; |
|||
case Attribute::FixedFncTexture7Q: |
|||
return "FixedFncTexture[7].Q"; |
|||
case Attribute::FixedFncTexture8S: |
|||
return "FixedFncTexture[8].S"; |
|||
case Attribute::FixedFncTexture8T: |
|||
return "FixedFncTexture[8].T"; |
|||
case Attribute::FixedFncTexture8R: |
|||
return "FixedFncTexture[8].R"; |
|||
case Attribute::FixedFncTexture8Q: |
|||
return "FixedFncTexture[8].Q"; |
|||
case Attribute::FixedFncTexture9S: |
|||
return "FixedFncTexture[9].S"; |
|||
case Attribute::FixedFncTexture9T: |
|||
return "FixedFncTexture[9].T"; |
|||
case Attribute::FixedFncTexture9R: |
|||
return "FixedFncTexture[9].R"; |
|||
case Attribute::FixedFncTexture9Q: |
|||
return "FixedFncTexture[9].Q"; |
|||
case Attribute::ViewportMask: |
|||
return "ViewportMask"; |
|||
case Attribute::FrontFace: |
|||
return "FrontFace"; |
|||
case Attribute::BaseInstance: |
|||
return "BaseInstance"; |
|||
case Attribute::BaseVertex: |
|||
return "BaseVertex"; |
|||
case Attribute::DrawID: |
|||
return "DrawID"; |
|||
} |
|||
return fmt::format("<reserved attribute {}>", static_cast<int>(attribute)); |
|||
} |
|||
|
|||
} // namespace Shader::IR
|
|||
@ -1,82 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include <string>
|
|||
|
|||
#include <fmt/ranges.h>
|
|||
|
|||
#include "shader_recompiler/frontend/ir/flow_test.h"
|
|||
|
|||
namespace Shader::IR { |
|||
|
|||
std::string NameOf(FlowTest flow_test) { |
|||
switch (flow_test) { |
|||
case FlowTest::F: |
|||
return "F"; |
|||
case FlowTest::LT: |
|||
return "LT"; |
|||
case FlowTest::EQ: |
|||
return "EQ"; |
|||
case FlowTest::LE: |
|||
return "LE"; |
|||
case FlowTest::GT: |
|||
return "GT"; |
|||
case FlowTest::NE: |
|||
return "NE"; |
|||
case FlowTest::GE: |
|||
return "GE"; |
|||
case FlowTest::NUM: |
|||
return "NUM"; |
|||
case FlowTest::NaN: |
|||
return "NAN"; |
|||
case FlowTest::LTU: |
|||
return "LTU"; |
|||
case FlowTest::EQU: |
|||
return "EQU"; |
|||
case FlowTest::LEU: |
|||
return "LEU"; |
|||
case FlowTest::GTU: |
|||
return "GTU"; |
|||
case FlowTest::NEU: |
|||
return "NEU"; |
|||
case FlowTest::GEU: |
|||
return "GEU"; |
|||
case FlowTest::T: |
|||
return "T"; |
|||
case FlowTest::OFF: |
|||
return "OFF"; |
|||
case FlowTest::LO: |
|||
return "LO"; |
|||
case FlowTest::SFF: |
|||
return "SFF"; |
|||
case FlowTest::LS: |
|||
return "LS"; |
|||
case FlowTest::HI: |
|||
return "HI"; |
|||
case FlowTest::SFT: |
|||
return "SFT"; |
|||
case FlowTest::HS: |
|||
return "HS"; |
|||
case FlowTest::OFT: |
|||
return "OFT"; |
|||
case FlowTest::CSM_TA: |
|||
return "CSM_TA"; |
|||
case FlowTest::CSM_TR: |
|||
return "CSM_TR"; |
|||
case FlowTest::CSM_MX: |
|||
return "CSM_MX"; |
|||
case FlowTest::FCSM_TA: |
|||
return "FCSM_TA"; |
|||
case FlowTest::FCSM_TR: |
|||
return "FCSM_TR"; |
|||
case FlowTest::FCSM_MX: |
|||
return "FCSM_MX"; |
|||
case FlowTest::RLE: |
|||
return "RLE"; |
|||
case FlowTest::RGT: |
|||
return "RGT"; |
|||
} |
|||
return fmt::format("<invalid flow test {}>", static_cast<int>(flow_test)); |
|||
} |
|||
|
|||
} // namespace Shader::IR
|
|||
@ -1,14 +0,0 @@ |
|||
#!/bin/sh |
|||
|
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
for i in dist/languages/*.ts; do |
|||
SRC=en_US |
|||
TARGET=`head -n1 $i | awk -F 'language="' '{split($2, a, "\""); print a[1]}'` |
|||
|
|||
# requires fd |
|||
SOURCES=`fd . src/yuzu src/qt_common -tf -e ui -e cpp -e h -e plist` |
|||
|
|||
lupdate -source-language $SRC -target-language $TARGET $SOURCES -ts /data/code/eden/$i |
|||
done |
|||
@ -0,0 +1,36 @@ |
|||
#!/usr/bin/sh |
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
: "${VULKAN_SDK_VER:=1.4.328.1}" |
|||
: "${VULKAN_ROOT:=C:/VulkanSDK/$VULKAN_SDK_VER}" |
|||
EXE_FILE="vulkansdk-windows-X64-$VULKAN_SDK_VER.exe" |
|||
URI="https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/$EXE_FILE" |
|||
VULKAN_ROOT_UNIX=$(cygpath -u "$VULKAN_ROOT") |
|||
|
|||
# Check if Vulkan SDK is already installed |
|||
if [ -d "$VULKAN_ROOT_UNIX" ]; then |
|||
echo "-- Vulkan SDK already installed at $VULKAN_ROOT_UNIX" |
|||
exit 0 |
|||
fi |
|||
|
|||
echo "Downloading Vulkan SDK $VULKAN_SDK_VER from $URI" |
|||
[ ! -f "./$EXE_FILE" ] && curl -L -o "./$EXE_FILE" "$URI" |
|||
chmod +x "./$EXE_FILE" |
|||
echo "Finished downloading $EXE_FILE" |
|||
|
|||
echo "Installing Vulkan SDK $VULKAN_SDK_VER..." |
|||
if net session > /dev/null 2>&1; then |
|||
./$EXE_FILE --root "$VULKAN_ROOT" --accept-licenses --default-answer --confirm-command install |
|||
else |
|||
echo "This script must be run with administrator privileges!" |
|||
exit 1 |
|||
fi |
|||
|
|||
echo "Finished installing Vulkan SDK $VULKAN_SDK_VER" |
|||
|
|||
# GitHub Actions integration |
|||
if [ \"${GITHUB_ACTIONS:-false}\" = \"true\" ]; then |
|||
echo \"VULKAN_SDK=$VULKAN_ROOT\" >> \"$GITHUB_ENV\" |
|||
echo \"$VULKAN_ROOT/bin\" >> \"$GITHUB_PATH\" |
|||
fi |
|||
@ -0,0 +1,42 @@ |
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
$osArch = $env:PROCESSOR_ARCHITECTURE |
|||
|
|||
switch ($osArch) { |
|||
"AMD64" { $arch = "x64" } |
|||
"ARM64" { $arch = "arm64" } |
|||
default { |
|||
Write-Error "load-msvc-env.ps1: Unsupported architecture: $osArch" |
|||
exit 1 |
|||
} |
|||
} |
|||
|
|||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" |
|||
|
|||
if (!(Test-Path $vswhere)) { |
|||
Write-Error "load-msvc-env.ps1: vswhere not found" |
|||
exit 1 |
|||
} |
|||
|
|||
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath |
|||
|
|||
if (-not $vs) { |
|||
Write-Error "load-msvc-env.ps1: Visual Studio (with Desktop development with C++) not found" |
|||
exit 1 |
|||
} |
|||
|
|||
$bat = "$vs\VC\Auxiliary\Build\vcvarsall.bat" |
|||
|
|||
if (!(Test-Path $bat)) { |
|||
Write-Error "load-msvc-env.ps1: (vcvarsall.bat) not found" |
|||
exit 1 |
|||
} |
|||
|
|||
cmd /c "`"$bat`" $arch && set" | ForEach-Object { |
|||
if ($_ -match "^(.*?)=(.*)$") { |
|||
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process') |
|||
} |
|||
} |
|||
|
|||
Write-Host "load-msvc-env.ps1: MSVC environment loaded for $arch ($vs)" |
|||
@ -0,0 +1,24 @@ |
|||
#!/usr/bin/bash |
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
# SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
ARCH_RAW="$PROCESSOR_ARCHITECTURE" |
|||
|
|||
case "$ARCH_RAW" in |
|||
AMD64) ARCH="x64" ;; |
|||
ARM64) ARCH="arm64" ;; |
|||
*) echo "load-msvc-env.sh: Unsupported architecture: $ARCH_RAW"; exit 1 ;; |
|||
esac |
|||
|
|||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
|||
VCVARS_BASH="$SCRIPT_DIR/vcvarsall.sh" |
|||
|
|||
if [ ! -f "$VCVARS_BASH" ]; then |
|||
echo "load-msvc-env.sh: vcvarsall.sh not found in $SCRIPT_DIR" |
|||
#exit 1 |
|||
fi |
|||
chmod +x "$VCVARS_BASH" |
|||
|
|||
eval "$("$VCVARS_BASH" "$ARCH")" |
|||
|
|||
echo "MSVC environment loaded for $ARCH with vcvars-bash script" |
|||
@ -0,0 +1,433 @@ |
|||
#!/usr/bin/env bash |
|||
# |
|||
# SPDX-FileCopyrightText: Copyright 2023 Nathan Poirier <nathan@poirier.io> |
|||
# SPDX-License-Identifier: MIT License |
|||
# |
|||
# Source: https://github.com/nathan818fr/vcvars-bash |
|||
# |
|||
set -Eeuo pipefail |
|||
shopt -s inherit_errexit |
|||
|
|||
declare -r VERSION='2025-07-09.1' |
|||
|
|||
function detect_platform() { |
|||
case "${OSTYPE:-}" in |
|||
cygwin* | msys* | win32) |
|||
declare -gr bash_platform='win_cyg' |
|||
;; |
|||
*) |
|||
if [[ -n "${WSL_DISTRO_NAME:-}" ]]; then |
|||
declare -gr bash_platform='win_wsl' |
|||
else |
|||
printf 'error: Unsupported platform (%s)\n' "${OSTYPE:-}" >&2 |
|||
printf 'hint: This script only supports Bash on Windows (Git Bash, WSL, etc.)\n' >&2 |
|||
return 1 |
|||
fi |
|||
;; |
|||
esac |
|||
} |
|||
|
|||
function detect_mode() { |
|||
# Detect the mode depending on the name called |
|||
if [[ "$(basename -- "$0")" == vcvarsrun* ]]; then |
|||
declare -gr script_mode='run' # vcvarsrun.sh |
|||
else |
|||
declare -gr script_mode='default' # vcvarsall.sh |
|||
fi |
|||
} |
|||
|
|||
function print_usage() { |
|||
case "$script_mode" in |
|||
default) |
|||
cat <<EOF |
|||
Usage: eval "\$(vcvarsall.sh [vcvarsall.bat arguments])" |
|||
Script version: $VERSION |
|||
|
|||
Load MSVC environment variables using vcvarsall.bat and export them. |
|||
The script writes a list of export commands to stdout, to be evaluated by a |
|||
POSIX-compliant shell. |
|||
|
|||
Example: eval "\$(vcvarsall.sh x86)" |
|||
EOF |
|||
;; |
|||
run) |
|||
cat <<EOF |
|||
Usage: vcvarsrun.sh [vcvarsall.bat arguments] -- command [arguments...] |
|||
Script version: $VERSION |
|||
|
|||
Load MSVC environment variables using vcvarsall.bat and execute a command with |
|||
them. |
|||
|
|||
Example: vcvarsrun.sh x64 -- cl /nologo /EHsc /Fe:hello.exe hello.cpp |
|||
EOF |
|||
;; |
|||
esac |
|||
cat <<EOF |
|||
|
|||
Environment variables: |
|||
VSINSTALLDIR |
|||
The path to the Visual Studio installation directory. |
|||
Example: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community" |
|||
Default: The latest Visual Studio installation directory found by |
|||
vswhere.exe |
|||
|
|||
VSWHEREPATH |
|||
The path to the vswhere.exe executable. |
|||
Example: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe" |
|||
Default: Automatically detected (in the PATH or well-known locations) |
|||
|
|||
VSWHEREARGS |
|||
The arguments to pass to vswhere.exe. |
|||
This value is always automatically prefixed with "-latest -property installationPath". |
|||
Default: "-products *" |
|||
EOF |
|||
local vcvarsall |
|||
vcvarsall=$(find_vcvarsall) |
|||
printf '\nvcvarsall.bat arguments: %s\n' "$({ cmd "$(cmdesc "$vcvarsall")" -help </dev/null 2>/dev/null || true; } | fix_crlf | sed '/^Syntax:/d; s/^ vcvarsall.bat //')" |
|||
} |
|||
|
|||
function main() { |
|||
detect_platform |
|||
detect_mode |
|||
|
|||
# Parse arguments |
|||
if [[ $# -eq 0 ]]; then |
|||
print_usage >&2 |
|||
return 1 |
|||
fi |
|||
|
|||
local arg vcvarsall_args=() |
|||
for arg in "$@"; do |
|||
shift |
|||
if [[ "$arg" == '--' ]]; then |
|||
if [[ "$script_mode" == 'default' ]]; then |
|||
printf 'error: Unexpected argument: --\n' >&2 |
|||
printf 'hint: Use vcvarsrun to run a command\n' >&2 |
|||
return 1 |
|||
fi |
|||
break |
|||
fi |
|||
vcvarsall_args+=("$(cmdesc "$arg")") |
|||
done |
|||
|
|||
if [[ "$script_mode" == 'run' && $# -eq 0 ]]; then |
|||
printf 'error: No command specified\n' >&2 |
|||
return 1 |
|||
fi |
|||
|
|||
# Get MSVC environment variables from vcvarsall.bat |
|||
local vcvarsall vcvarsall_env |
|||
vcvarsall=$(find_vcvarsall) |
|||
vcvarsall_env=$({ cmd "$(cmdesc "$vcvarsall")" "${vcvarsall_args[@]}" '&&' 'set' </dev/null || true; } | fix_crlf) |
|||
|
|||
# Filter MSVC environment variables and export them. |
|||
# The list of variables to export was based on a comparison between a clean environment and the vcvarsall.bat |
|||
# environment (on different MSVC versions, tools and architectures). |
|||
# |
|||
# Windows environment variables are case-insensitive while Unix-like environment variables are case-sensitive, so: |
|||
# - we always use uppercase names to prevent duplicates environment variables on the Unix-like side |
|||
# - we also ensure that only the first occurrence of a variable is exported (see below) |
|||
# |
|||
# While Windows environment variables are case-insensitive, it is possible to have duplicates in some edge cases. |
|||
# e.g. using Git Bash: |
|||
# export xxx=1; export XXX=2; export xXx=3; cmd.exe //c set XxX=4 '&&' set |
|||
# will output: |
|||
# XXX=4 |
|||
# xXx=3 |
|||
# xxx=1 |
|||
|
|||
declare -A seen_vars |
|||
function export_env() { |
|||
local name=${1^^} |
|||
local value=$2 |
|||
if [[ ! "$name" =~ ^[A-Z0-9_]+$ ]]; then return; fi |
|||
if [[ -n "${seen_vars[$name]:-}" ]]; then return; fi |
|||
seen_vars[$name]=1 |
|||
if [[ "$script_mode" == 'run' ]]; then |
|||
export "${name}=${value}" |
|||
else |
|||
printf "export %s='%s'\n" "$name" "${value//\'/\'\\\'\'}" |
|||
fi |
|||
} |
|||
|
|||
local name value initialized=false |
|||
while IFS='=' read -r name value; do |
|||
if [[ "$initialized" == 'false' ]]; then |
|||
if [[ -n "$value" ]]; then name+="=$value"; fi |
|||
if [[ "$name" == *' Environment initialized for: '* ]]; then initialized=true; fi |
|||
printf '%s\n' "$name" >&2 |
|||
continue |
|||
fi |
|||
|
|||
case "${name^^}" in |
|||
LIB | LIBPATH | INCLUDE | EXTERNAL_INCLUDE | COMMANDPROMPTTYPE | DEVENVDIR | EXTENSIONSDKDIR | FRAMEWORK* | \ |
|||
PLATFORM | PREFERREDTOOLARCHITECTURE | UCRT* | UNIVERSALCRTSDK* | VCIDE* | VCINSTALL* | VCPKG* | VCTOOLS* | \ |
|||
VSCMD* | VSINSTALL* | VS[0-9]* | VISUALSTUDIO* | WINDOWSLIB* | WINDOWSSDK*) |
|||
export_env "$name" "$value" |
|||
;; |
|||
PATH) |
|||
# PATH is a special case, requiring special handling |
|||
local new_paths |
|||
new_paths=$(pathlist_win_to_unix "$value") # Convert to unix-style path list |
|||
new_paths=$(pathlist_normalize "${PATH}:${new_paths}") # Prepend the current PATH |
|||
export_env 'WINDOWS_PATH' "$value" |
|||
export_env 'PATH' "$new_paths" |
|||
;; |
|||
esac |
|||
done <<<"$vcvarsall_env" |
|||
|
|||
if [[ "$initialized" == 'false' ]]; then |
|||
printf 'error: vcvarsall.bat failed' >&2 |
|||
return 1 |
|||
fi |
|||
|
|||
# Execute command if needed |
|||
if [[ "$script_mode" == 'run' ]]; then |
|||
exec "$@" |
|||
fi |
|||
} |
|||
|
|||
# Locate vcvarsall.bat |
|||
# Inputs: |
|||
# VSINSTALLDIR: The path to the Visual Studio installation directory (optional) |
|||
# VSWHEREPATH: The path to the vswhere.exe executable (optional) |
|||
# VSWHEREARGS: The arguments to pass to vswhere.exe (optional) |
|||
# Outputs: |
|||
# stdout: The windows-style path to vcvarsall.bat |
|||
function find_vcvarsall() { |
|||
local vsinstalldir |
|||
if [[ -n "${VSINSTALLDIR:-}" ]]; then |
|||
vsinstalldir="$VSINSTALLDIR" |
|||
else |
|||
local vswhere |
|||
if [[ -n "${VSWHEREPATH:-}" ]]; then |
|||
vswhere=$(unixpath "$VSWHEREPATH") |
|||
else |
|||
vswhere=$(command -v 'vswhere' 2>/dev/null || unixpath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe') |
|||
fi |
|||
|
|||
local vswhereargs=(-latest -property installationPath) |
|||
if [[ -n "${VSWHEREARGS:-}" ]]; then |
|||
parse_args_simple "$VSWHEREARGS" |
|||
vswhereargs+=("${result[@]}") |
|||
else |
|||
vswhereargs+=(-products '*') |
|||
fi |
|||
|
|||
if [[ "${VCVARSBASH_DEBUG:-}" == 1 ]]; then |
|||
printf 'debug: vswhere path: %s\n' "$vswhere" >&2 |
|||
printf 'debug: vswhere args:\n' >&2 |
|||
printf 'debug: [ %s ]\n' "${vswhereargs[@]}" >&2 |
|||
fi |
|||
|
|||
vsinstalldir=$("$vswhere" "${vswhereargs[@]}" </dev/null | fix_crlf) |
|||
if [[ -z "$vsinstalldir" ]]; then |
|||
printf 'error: vswhere returned an empty installation path\n' >&2 |
|||
return 1 |
|||
fi |
|||
fi |
|||
|
|||
printf '%s\n' "$(winpath "$vsinstalldir")\\VC\\Auxiliary\\Build\\vcvarsall.bat" |
|||
} |
|||
|
|||
# Split command arguments into an array, with a simple logic |
|||
# - Arguments are separated by whitespace (space, tab, newline, carriage return) |
|||
# - To include whitespace in an argument, it must be enclosed in double quotes (") |
|||
# - When inside a double-quoted argument, quotes can be escaped by doubling them ("") |
|||
# Inputs: |
|||
# $1: The string to parse |
|||
# Outputs: |
|||
# result: An array of parsed arguments |
|||
function parse_args_simple() { |
|||
declare -g result=() |
|||
local str="$1 " # add a trailing space to simplify the last argument handling |
|||
local args=() |
|||
local current_type=none # none = waiting for next arg, normal = inside normal arg, quoted = inside quoted arg |
|||
local current_value='' |
|||
local i=0 len=${#str} |
|||
while ((i < len)); do |
|||
local c=${str:i:1} |
|||
case "$current_type" in |
|||
none) |
|||
case "$c" in |
|||
' ' | $'\t' | $'\n' | $'\r') |
|||
# Ignore whitespace |
|||
;; |
|||
'"') |
|||
# Start a quoted argument |
|||
current_type=quoted |
|||
current_value='' |
|||
;; |
|||
*) |
|||
# Start a normal argument |
|||
current_type=normal |
|||
current_value="$c" |
|||
;; |
|||
esac |
|||
;; |
|||
normal) |
|||
case "$c" in |
|||
' ' | $'\t' | $'\n' | $'\r') |
|||
# End of normal argument, add it to the list |
|||
args+=("$current_value") |
|||
current_type=none |
|||
current_value='' |
|||
;; |
|||
*) |
|||
# Continue building the normal argument |
|||
current_value+="$c" |
|||
;; |
|||
esac |
|||
;; |
|||
quoted) |
|||
case "$c" in |
|||
'"') |
|||
if [[ "${str:i+1:1}" != '"' ]]; then |
|||
# End of quoted argument, add it to the list |
|||
args+=("$current_value") |
|||
current_type=none |
|||
current_value='' |
|||
else |
|||
# Escaped quote, add a single quote to the current value |
|||
current_value+='"' |
|||
((++i)) # Skip the next quote |
|||
fi |
|||
;; |
|||
*) |
|||
# Continue building the quoted argument |
|||
current_value+="$c" |
|||
;; |
|||
esac |
|||
;; |
|||
esac |
|||
((++i)) |
|||
done |
|||
if [[ "$current_type" != none ]]; then |
|||
printf 'error: Unfinished %s argument: %s\n' "$current_type" "$current_value" >&2 |
|||
return 1 |
|||
fi |
|||
declare -g result=("${args[@]}") |
|||
} |
|||
|
|||
# Run a command with cmd.exe |
|||
# Inputs: |
|||
# $@: The command string to run (use cmdesc to escape arguments when needed) |
|||
# Outputs: |
|||
# stdout: The cmd.exe standard output |
|||
# stderr: The cmd.exe error output |
|||
function cmd() { |
|||
# This seems to work fine on all supported platforms |
|||
# (even with all the weird path and argument conversions on MSYS-like) |
|||
MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' cmd.exe /s /c " ; $* " |
|||
} |
|||
|
|||
# Escape a cmd.exe command argument |
|||
# Inputs: |
|||
# $1: The argument to escape |
|||
# Outputs: |
|||
# stdout: The escaped argument |
|||
function cmdesc() { |
|||
# shellcheck disable=SC2001 |
|||
sed 's/[^0-9A-Za-z]/^\0/g' <<<"$1" |
|||
} |
|||
|
|||
# Convert path to an absolute unix-style path |
|||
# Inputs: |
|||
# $1: The path to convert |
|||
# Outputs: |
|||
# stdout: The converted path |
|||
function unixpath() { |
|||
local path=$1 |
|||
case "$bash_platform" in |
|||
win_wsl) |
|||
case "$path" in |
|||
[a-zA-Z]:\\* | [a-zA-Z]:/* | \\\\* | //*) |
|||
# Convert windows path using wslpath (unix mode, absolute path) |
|||
wslpath -u -a -- "$path" |
|||
;; |
|||
*) |
|||
# Convert unix path using realpath |
|||
realpath -m -- "$path" |
|||
;; |
|||
esac |
|||
;; |
|||
*) |
|||
cygpath -u -a -- "$path" |
|||
;; |
|||
esac |
|||
} |
|||
|
|||
# Convert path to an absolute windows-style path |
|||
# Inputs: |
|||
# $1: The path to convert |
|||
# Outputs: |
|||
# stdout: The converted path |
|||
function winpath() { |
|||
local path=$1 |
|||
case "$bash_platform" in |
|||
win_wsl) |
|||
case "$path" in |
|||
[a-zA-Z]:\\* | [a-zA-Z]:/* | \\\\* | //*) |
|||
# Already a windows path |
|||
printf '%s' "$path" |
|||
;; |
|||
*) |
|||
# Convert using wslpath (windows mode, absolute path) |
|||
wslpath -w -a -- "$path" |
|||
;; |
|||
esac |
|||
;; |
|||
*) |
|||
# Convert using cygpath (windows mode, absolute path, long form) |
|||
cygpath -w -a -l -- "$path" |
|||
;; |
|||
esac |
|||
} |
|||
|
|||
# Convert a windows-style path list to a unix-style path list |
|||
# Inputs: |
|||
# $1: The windows-style path list to convert |
|||
# Outputs: |
|||
# stdout: The converted unix-style path list |
|||
function pathlist_win_to_unix() { |
|||
local win_paths=$1 |
|||
|
|||
local path_dir first=true |
|||
while IFS= read -r -d';' path_dir; do |
|||
if [[ -z "$path_dir" ]]; then continue; fi |
|||
|
|||
if [[ "$first" == 'true' ]]; then first=false; else printf ':'; fi |
|||
printf '%s' "$(unixpath "$path_dir")" |
|||
done <<<"${win_paths};" |
|||
} |
|||
|
|||
# Normalize a unix-style path list, removing duplicates and empty entries |
|||
# Inputs: |
|||
# $1: The list to normalize |
|||
# Outputs: |
|||
# stdout: The normalized path list |
|||
function pathlist_normalize() { |
|||
local unix_paths=$1 |
|||
|
|||
declare -A seen_paths |
|||
local path_dir first=true |
|||
while IFS= read -r -d ':' path_dir; do |
|||
if [[ -z "$path_dir" ]]; then continue; fi |
|||
if [[ -n "${seen_paths[$path_dir]:-}" ]]; then continue; fi |
|||
seen_paths[$path_dir]=1 |
|||
|
|||
if [[ "$first" == 'true' ]]; then first=false; else printf ':'; fi |
|||
printf '%s' "$path_dir" |
|||
done <<<"${unix_paths}:" |
|||
} |
|||
|
|||
# Convert CRLF to LF |
|||
# Inputs: |
|||
# stdin: The input to convert |
|||
# Outputs: |
|||
# stdout: The converted input |
|||
function fix_crlf() { |
|||
sed 's/\r$//' |
|||
} |
|||
|
|||
eval 'main "$@";exit "$?"' |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue