Compare commits

..

39 Commits

Author SHA1 Message Date
2950a7c6f2 Android #147 2023-12-01 00:57:44 +00:00
df02bf3daa Merge PR 12235 2023-12-01 00:57:44 +00:00
3c45ba1c22 Merge pull request #12234 from abouvier/unbundle-gamemode
cmake: prefer system gamemode library
2023-11-30 11:52:03 -05:00
d2bb9e9729 cmake: prefer system gamemode library 2023-11-30 16:54:00 +01:00
127bfb81d5 Merge pull request #12229 from liamwhite/qcom-wtf
renderer_vulkan: exclude more qcom drivers from extensions
2023-11-30 09:21:27 -05:00
3a12fe5d13 Merge pull request #12227 from jbeich/gamemode
cmake: unbreak build on FreeBSD by re-enabling gamemode
2023-11-30 09:21:19 -05:00
5345ab40eb Merge pull request #12225 from liamwhite/mac-ci
Add mac workflow
2023-11-30 09:21:12 -05:00
57a391e71d Merge pull request #12074 from GPUCode/yuwu-on-the-metal
Implement Native Code Execution (NCE)
2023-11-30 09:20:55 -05:00
8f62e8e63f renderer_vulkan: exclude more qcom drivers from extensions 2023-11-29 21:06:06 -05:00
df96caec79 cmake: sync gamemode conditionals with code after 5eec980a2d
FAILED: bin/yuzu
ld: error: unable to find library -lgamemode

FAILED: bin/yuzu-cmd
ld: error: undefined symbol: Common::Linux::StartGamemode()
>>> referenced by yuzu.cpp
>>>               src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/yuzu.cpp.o:(main)

ld: error: undefined symbol: Common::Linux::StopGamemode()
>>> referenced by yuzu.cpp
>>>               src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/yuzu.cpp.o:(main)
2023-11-30 00:05:11 +01:00
4a3abba16d core: Rename patcher file 2023-11-29 23:49:16 +02:00
d21305c2e7 add mac workflow 2023-11-29 16:02:37 -05:00
340548aba7 cmake: Move HAS_NCE to root cmake
* So we can use it in common
2023-11-29 01:35:06 +02:00
a76a8fb5fe qt: add cpu_backend configuration 2023-11-26 20:44:07 -05:00
15f35b8657 general: fix mac compile 2023-11-26 19:50:10 -05:00
7482e03c77 loader: fix gcc compile 2023-11-26 19:34:07 -05:00
6432508740 oaknut: Address warnings 2023-11-25 00:47:43 -05:00
5a9ffa81a6 host_memory: Simplify randomness generation 2023-11-25 00:47:43 -05:00
9ff8d0f3e6 Address more review comments 2023-11-25 00:47:43 -05:00
d040b27a35 loader: apply nso patch to offset program image 2023-11-25 00:47:36 -05:00
cf534f5149 arm_nce: skip data aborts for crash handling parity 2023-11-25 00:47:36 -05:00
20de0ddf1f android: show current backend in fps overlay 2023-11-25 00:47:36 -05:00
1cde01c8c8 arm: Print backtrace on data abort 2023-11-25 00:47:36 -05:00
f542a3bb7a patch: check offsets from first code word 2023-11-25 00:47:36 -05:00
3ec3cca4d8 core: Define HAS_NCE macro 2023-11-25 00:47:36 -05:00
c37b5f431f common: Enforce fastmem for nce usage 2023-11-25 00:47:36 -05:00
263b7a44f9 arm_nce: skip dc cvac on possibly write-protected areas 2023-11-25 00:47:36 -05:00
6de2edcca1 Address some review comments 2023-11-25 00:47:35 -05:00
8fab363237 android: Add cpu bakend gui toggle 2023-11-25 00:47:28 -05:00
9f91ba1f73 arm: Implement native code execution backend 2023-11-25 00:46:47 -05:00
4838837620 device_memory: Enable direct mapped addresses for nce 2023-11-25 00:46:47 -05:00
2e02efbdd0 externals: Add oaknut submodule 2023-11-25 00:46:47 -05:00
15331c2a60 settings: Add cpu backend setting 2023-11-25 00:46:15 -05:00
f2a8409083 kernel: Manually specify aslr region start 2023-11-25 00:46:15 -05:00
5938a9582a core: Respect memory permissions in Map 2023-11-25 00:46:15 -05:00
4766baddf3 host_memory: Switch to FreeRegionManager 2023-11-25 00:46:15 -05:00
448d4815de host_memory: ensure map base is between 36 and 39 bits 2023-11-25 00:46:15 -05:00
29e7d79a86 common: Add free region manager
* Abstraction for placeholder region tracking in host_memory
2023-11-25 00:46:15 -05:00
20011dfeb8 common: Add libc sigaction hook 2023-11-25 00:46:15 -05:00
13 changed files with 86 additions and 44 deletions

View File

@ -68,6 +68,25 @@ jobs:
with:
name: ${{ matrix.type }}
path: artifacts/
build-mac:
name: 'test build (macos)'
needs: format
runs-on: macos-13
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Install dependencies
run: |
brew install autoconf automake boost@1.83 ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@5 sdl2 speexdsp zlib zlib zstd
- name: Build
run: |
mkdir build
cd build
export Qt5_DIR="/usr/local/opt/qt@5/lib/cmake"
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
ninja
build-msvc:
name: 'test build (windows, msvc)'
needs: format

View File

@ -151,3 +151,7 @@ License: GPL-3.0-or-later
Files: externals/stb/*
Copyright: Sean Barrett
License: MIT
Files: externals/gamemode/*
Copyright: Copyright 2017-2019 Feral Interactive
License: BSD-3-Clause

View File

@ -343,6 +343,10 @@ if(ENABLE_OPENSSL)
find_package(OpenSSL 1.1.1 REQUIRED)
endif()
if (UNIX AND NOT APPLE)
find_package(gamemode 1.7 MODULE)
endif()
# Please consider this as a stub
if(ENABLE_QT6 AND Qt6_LOCATION)
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")

View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
find_package(PkgConfig QUIET)
pkg_search_module(GAMEMODE QUIET IMPORTED_TARGET gamemode)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(gamemode
REQUIRED_VARS GAMEMODE_INCLUDEDIR
VERSION_VAR GAMEMODE_VERSION
)
if (gamemode_FOUND AND NOT TARGET gamemode::headers)
add_library(gamemode::headers ALIAS PkgConfig::GAMEMODE)
endif()

View File

@ -1,6 +1,6 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
| [12074](https://github.com/yuzu-emu/yuzu//pull/12074) | [`4a3abba16`](https://github.com/yuzu-emu/yuzu//pull/12074/files) | Implement Native Code Execution (NCE) | [GPUCode](https://github.com/GPUCode/) | Yes |
| [12235](https://github.com/yuzu-emu/yuzu//pull/12235) | [`e7dd968ac`](https://github.com/yuzu-emu/yuzu//pull/12235/files) | renderer_vulkan: adjust window origin and swizzle independently | [liamwhite](https://github.com/liamwhite/) | Yes |
End of merge log. You can find the original README.md below the break.

View File

@ -193,8 +193,10 @@ if (ANDROID)
endif()
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(gamemode)
if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers)
add_library(gamemode INTERFACE)
target_include_directories(gamemode INTERFACE gamemode)
add_library(gamemode::headers ALIAS gamemode)
endif()
# Breakpad

View File

@ -1,11 +0,0 @@
# SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
project(gamemode LANGUAGES CXX C)
add_library(gamemode include/gamemode_client.h)
target_link_libraries(gamemode PRIVATE common)
target_include_directories(gamemode PUBLIC include)
set_target_properties(gamemode PROPERTIES LINKER_LANGUAGE C)

View File

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2017-2019 Feral Interactive
// SPDX-License-Identifier: BSD-3-Clause
/*
Copyright (c) 2017-2019, Feral Interactive

View File

@ -182,13 +182,13 @@ if(ANDROID)
)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (UNIX AND NOT APPLE)
target_sources(common PRIVATE
linux/gamemode.cpp
linux/gamemode.h
)
target_link_libraries(common PRIVATE gamemode)
target_link_libraries(common PRIVATE gamemode::headers)
endif()
if(ARCHITECTURE_x86_64)

View File

@ -75,14 +75,20 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in
const float width = conv(src.scale_x * 2.0f);
float y = conv(src.translate_y - src.scale_y);
float height = conv(src.scale_y * 2.0f);
bool y_negate = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
if (!device.IsNvViewportSwizzleSupported()) {
y_negate = y_negate != (src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY);
const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
const bool y_negate = !device.IsNvViewportSwizzleSupported() &&
src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY;
if (lower_left) {
// Flip by surface clip height
y += conv(static_cast<f32>(regs.surface_clip.height));
height = -height;
}
if (y_negate) {
y += conv(static_cast<f32>(regs.surface_clip.height));
// Flip by viewport height
y += height;
height = -height;
}
@ -892,10 +898,6 @@ void RasterizerVulkan::UpdateDynamicStates() {
UpdateFrontFace(regs);
UpdateStencilOp(regs);
if (device.IsExtVertexInputDynamicStateSupported()) {
UpdateVertexInput(regs);
}
if (state_tracker.TouchStateEnable()) {
UpdateDepthBoundsTestEnable(regs);
UpdateDepthTestEnable(regs);
@ -918,6 +920,9 @@ void RasterizerVulkan::UpdateDynamicStates() {
UpdateBlending(regs);
}
}
if (device.IsExtVertexInputDynamicStateSupported()) {
UpdateVertexInput(regs);
}
}
void RasterizerVulkan::HandleTransformFeedback() {

View File

@ -519,10 +519,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state");
RemoveExtensionFeature(extensions.extended_dynamic_state, features.extended_dynamic_state,
VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME);
LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state2");
RemoveExtensionFeature(extensions.extended_dynamic_state2, features.extended_dynamic_state2,
VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME);
}
if (is_nvidia) {
@ -611,18 +607,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
}
}
if (extensions.vertex_input_dynamic_state && is_qualcomm) {
const u32 version = (properties.properties.driverVersion << 3) >> 3;
if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) &&
version < VK_MAKE_API_VERSION(0, 0, 680, 0)) {
// Qualcomm Adreno 7xx drivers do not properly support vertex_input_dynamic_state.
LOG_WARNING(
Render_Vulkan,
"Qualcomm Adreno 7xx drivers have broken VK_EXT_vertex_input_dynamic_state");
// Qualcomm drivers do not properly support vertex_input_dynamic_state.
LOG_WARNING(Render_Vulkan,
"Qualcomm drivers have broken VK_EXT_vertex_input_dynamic_state");
RemoveExtensionFeature(extensions.vertex_input_dynamic_state,
features.vertex_input_dynamic_state,
VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
}
}
sets_per_pool = 64;
if (is_amd_driver) {
@ -704,6 +695,22 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
std::min(properties.properties.limits.maxVertexInputBindings, 16U);
}
if (!extensions.extended_dynamic_state && extensions.extended_dynamic_state2) {
LOG_INFO(Render_Vulkan,
"Removing extendedDynamicState2 due to missing extendedDynamicState");
RemoveExtensionFeature(extensions.extended_dynamic_state2, features.extended_dynamic_state2,
VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME);
}
if (!extensions.extended_dynamic_state2 && extensions.extended_dynamic_state3) {
LOG_INFO(Render_Vulkan,
"Removing extendedDynamicState3 due to missing extendedDynamicState2");
RemoveExtensionFeature(extensions.extended_dynamic_state3, features.extended_dynamic_state3,
VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME);
dynamic_state3_blending = false;
dynamic_state3_enables = false;
}
logical = vk::Device::Create(physical, queue_cis, ExtensionListForVulkan(loaded_extensions),
first_next, dld);

View File

@ -386,7 +386,7 @@ if (NOT WIN32)
target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus gamemode)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus)
endif()
target_compile_definitions(yuzu PRIVATE