summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2022-12-03 13:32:24 -0500
committerGravatar Liam2022-12-04 10:12:26 -0500
commit6d2c59737177dba09a0a2a31e96276addf52c172 (patch)
tree9bb6050c056d66f880557e3fd5b3058638afd66d
parentMerge pull request #9300 from ameerj/pch (diff)
downloadyuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.gz
yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.xz
yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.zip
externals: update dynarmic, SDL2
-rw-r--r--CMakeLists.txt12
-rw-r--r--externals/CMakeLists.txt4
m---------externals/SDL0
m---------externals/dynarmic0
-rw-r--r--src/core/hid/emulated_controller.cpp1
-rw-r--r--src/video_core/CMakeLists.txt10
-rw-r--r--src/video_core/engines/sw_blitter/converter.cpp22
-rw-r--r--src/yuzu_cmd/CMakeLists.txt5
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp6
9 files changed, 33 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdf63a030..facf4ea5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,10 @@
3 3
4cmake_minimum_required(VERSION 3.22) 4cmake_minimum_required(VERSION 3.22)
5 5
6# Dynarmic has cmake_minimum_required(3.12) and we may want to override
7# some of its variables, which is only possible in 3.13+
8set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
9
6list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") 10list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
7list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") 11list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
8list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/find-modules") 12list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/find-modules")
@@ -71,7 +75,8 @@ if (YUZU_USE_PRECOMPILED_HEADERS)
71 # buildcache does not properly cache PCH files, leading to compilation errors. 75 # buildcache does not properly cache PCH files, leading to compilation errors.
72 # See https://github.com/mbitsnbites/buildcache/discussions/230 76 # See https://github.com/mbitsnbites/buildcache/discussions/230
73 message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH") 77 message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH")
74 set(YUZU_USE_PRECOMPILED_HEADERS OFF) 78 set(DYNARMIC_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
79 set(YUZU_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
75 endif() 80 endif()
76endif() 81endif()
77if (YUZU_USE_PRECOMPILED_HEADERS) 82if (YUZU_USE_PRECOMPILED_HEADERS)
@@ -444,7 +449,7 @@ if (TARGET Boost::boost)
444endif() 449endif()
445 450
446# Ensure libusb is properly configured (based on dolphin libusb include) 451# Ensure libusb is properly configured (based on dolphin libusb include)
447if(NOT APPLE AND NOT YUZU_USE_BUNDLED_LIBUSB) 452if(NOT YUZU_USE_BUNDLED_LIBUSB)
448 find_package(PkgConfig) 453 find_package(PkgConfig)
449 if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD") 454 if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
450 pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24) 455 pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24)
@@ -454,7 +459,8 @@ if(NOT APPLE AND NOT YUZU_USE_BUNDLED_LIBUSB)
454 459
455 if (LIBUSB_FOUND) 460 if (LIBUSB_FOUND)
456 add_library(usb INTERFACE) 461 add_library(usb INTERFACE)
457 target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}") 462 target_include_directories(usb INTERFACE "${LIBUSB_INCLUDEDIR}" "${LIBUSB_INCLUDE_DIRS}")
463 target_link_directories(usb INTERFACE "${LIBUSB_LIBRARY_DIRS}")
458 target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}") 464 target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}")
459 else() 465 else()
460 message(WARNING "libusb not found, falling back to externals") 466 message(WARNING "libusb not found, falling back to externals")
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 25ef0c058..db41a6635 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -12,9 +12,6 @@ endif()
12 12
13# Dynarmic 13# Dynarmic
14if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) 14if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
15 if (ARCHITECTURE_arm64)
16 set(DYNARMIC_FRONTENDS "A32")
17 endif()
18 set(DYNARMIC_NO_BUNDLED_FMT ON) 15 set(DYNARMIC_NO_BUNDLED_FMT ON)
19 set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE) 16 set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE)
20 add_subdirectory(dynarmic) 17 add_subdirectory(dynarmic)
@@ -72,6 +69,7 @@ if (YUZU_USE_EXTERNAL_SDL2)
72 endif() 69 endif()
73 70
74 add_subdirectory(SDL EXCLUDE_FROM_ALL) 71 add_subdirectory(SDL EXCLUDE_FROM_ALL)
72 target_link_directories(SDL2-static INTERFACE "${SDL2_BINARY_DIR}")
75endif() 73endif()
76 74
77# ENet 75# ENet
diff --git a/externals/SDL b/externals/SDL
Subproject b424665e0899769b200231ba943353a5fee1b6b Subproject f17058b562c8a1090c0c996b42982721ace9090
diff --git a/externals/dynarmic b/externals/dynarmic
Subproject a5b57bb9cd1500a6e0a3c800b35c1984211dff1 Subproject a76a2fff534b5584c9921bc5c060e910e95b773
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index c96d9eef3..9779378be 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -3,6 +3,7 @@
3 3
4#include <algorithm> 4#include <algorithm>
5 5
6#include "common/polyfill_ranges.h"
6#include "common/thread.h" 7#include "common/thread.h"
7#include "core/hid/emulated_controller.h" 8#include "core/hid/emulated_controller.h"
8#include "core/hid/input_converter.h" 9#include "core/hid/input_converter.h"
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 97609ded4..5d4821ad2 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -280,9 +280,15 @@ if (MSVC)
280 /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data 280 /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
281 ) 281 )
282else() 282else()
283 target_compile_options(video_core PRIVATE 283 if (APPLE)
284 -Werror=conversion 284 # error: declaration shadows a typedef in 'interval_base_set<SubType, DomainT, Compare, Interval, Alloc>'
285 # error: implicit conversion loses integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char')
286 target_compile_options(video_core PRIVATE -Wno-shadow -Wno-unused-local-typedef)
287 else()
288 target_compile_options(video_core PRIVATE -Werror=conversion)
289 endif()
285 290
291 target_compile_options(video_core PRIVATE
286 -Wno-sign-conversion 292 -Wno-sign-conversion
287 ) 293 )
288 294
diff --git a/src/video_core/engines/sw_blitter/converter.cpp b/src/video_core/engines/sw_blitter/converter.cpp
index cd46dfd4f..2419b5632 100644
--- a/src/video_core/engines/sw_blitter/converter.cpp
+++ b/src/video_core/engines/sw_blitter/converter.cpp
@@ -2,12 +2,12 @@
2// SPDX-License-Identifier: GPL-3.0-or-later 2// SPDX-License-Identifier: GPL-3.0-or-later
3 3
4#include <array> 4#include <array>
5#include <bit>
6#include <cmath> 5#include <cmath>
7#include <span> 6#include <span>
8#include <unordered_map> 7#include <unordered_map>
9 8
10#include "common/assert.h" 9#include "common/assert.h"
10#include "common/bit_cast.h"
11#include "video_core/engines/sw_blitter/converter.h" 11#include "video_core/engines/sw_blitter/converter.h"
12#include "video_core/surface.h" 12#include "video_core/surface.h"
13#include "video_core/textures/decoders.h" 13#include "video_core/textures/decoders.h"
@@ -693,21 +693,21 @@ private:
693 return shifted_value >> shift_amount; 693 return shifted_value >> shift_amount;
694 }; 694 };
695 const auto force_to_fp16 = [](f32 base_value) { 695 const auto force_to_fp16 = [](f32 base_value) {
696 u32 tmp = std::bit_cast<u32>(base_value); 696 u32 tmp = Common::BitCast<u32>(base_value);
697 constexpr size_t fp32_mantissa_bits = 23; 697 constexpr size_t fp32_mantissa_bits = 23;
698 constexpr size_t fp16_mantissa_bits = 10; 698 constexpr size_t fp16_mantissa_bits = 10;
699 constexpr size_t mantissa_mask = 699 constexpr size_t mantissa_mask =
700 ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL); 700 ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL);
701 tmp = tmp & static_cast<u32>(mantissa_mask); 701 tmp = tmp & static_cast<u32>(mantissa_mask);
702 // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM 702 // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM
703 return std::bit_cast<f32>(tmp); 703 return Common::BitCast<f32>(tmp);
704 }; 704 };
705 const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) { 705 const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) {
706 constexpr size_t fp32_mantissa_bits = 23; 706 constexpr size_t fp32_mantissa_bits = 23;
707 size_t shift_towards = fp32_mantissa_bits - mantissa; 707 size_t shift_towards = fp32_mantissa_bits - mantissa;
708 const u32 new_value = 708 const u32 new_value =
709 static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31)); 709 static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31));
710 return std::bit_cast<f32>(new_value); 710 return Common::BitCast<f32>(new_value);
711 }; 711 };
712 const auto calculate_snorm = [&]() { 712 const auto calculate_snorm = [&]() {
713 return static_cast<f32>( 713 return static_cast<f32>(
@@ -737,13 +737,13 @@ private:
737 out_component = force_to_fp16(out_component); 737 out_component = force_to_fp16(out_component);
738 } else if constexpr (component_types[which_component] == ComponentType::FLOAT) { 738 } else if constexpr (component_types[which_component] == ComponentType::FLOAT) {
739 if constexpr (component_sizes[which_component] == 32) { 739 if constexpr (component_sizes[which_component] == 32) {
740 out_component = std::bit_cast<f32>(value); 740 out_component = Common::BitCast<f32>(value);
741 } else if constexpr (component_sizes[which_component] == 16) { 741 } else if constexpr (component_sizes[which_component] == 16) {
742 static constexpr u32 sign_mask = 0x8000; 742 static constexpr u32 sign_mask = 0x8000;
743 static constexpr u32 mantissa_mask = 0x8000; 743 static constexpr u32 mantissa_mask = 0x8000;
744 out_component = std::bit_cast<f32>(((value & sign_mask) << 16) | 744 out_component = Common::BitCast<f32>(((value & sign_mask) << 16) |
745 (((value & 0x7c00) + 0x1C000) << 13) | 745 (((value & 0x7c00) + 0x1C000) << 13) |
746 ((value & mantissa_mask) << 13)); 746 ((value & mantissa_mask) << 13));
747 } else { 747 } else {
748 out_component = from_fp_n(value, component_sizes[which_component], 748 out_component = from_fp_n(value, component_sizes[which_component],
749 component_sizes[which_component] - 5); 749 component_sizes[which_component] - 5);
@@ -771,7 +771,7 @@ private:
771 }; 771 };
772 const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) { 772 const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) {
773 constexpr size_t fp32_mantissa_bits = 23; 773 constexpr size_t fp32_mantissa_bits = 23;
774 u32 tmp_value = std::bit_cast<u32>(std::max(base_value, 0.0f)); 774 u32 tmp_value = Common::BitCast<u32>(std::max(base_value, 0.0f));
775 size_t shift_towards = fp32_mantissa_bits - mantissa; 775 size_t shift_towards = fp32_mantissa_bits - mantissa;
776 return tmp_value >> shift_towards; 776 return tmp_value >> shift_towards;
777 }; 777 };
@@ -799,13 +799,13 @@ private:
799 insert_to_word(tmp_word); 799 insert_to_word(tmp_word);
800 } else if constexpr (component_types[which_component] == ComponentType::FLOAT) { 800 } else if constexpr (component_types[which_component] == ComponentType::FLOAT) {
801 if constexpr (component_sizes[which_component] == 32) { 801 if constexpr (component_sizes[which_component] == 32) {
802 u32 tmp_word = std::bit_cast<u32>(in_component); 802 u32 tmp_word = Common::BitCast<u32>(in_component);
803 insert_to_word(tmp_word); 803 insert_to_word(tmp_word);
804 } else if constexpr (component_sizes[which_component] == 16) { 804 } else if constexpr (component_sizes[which_component] == 16) {
805 static constexpr u32 sign_mask = 0x8000; 805 static constexpr u32 sign_mask = 0x8000;
806 static constexpr u32 mantissa_mask = 0x03ff; 806 static constexpr u32 mantissa_mask = 0x03ff;
807 static constexpr u32 exponent_mask = 0x7c00; 807 static constexpr u32 exponent_mask = 0x7c00;
808 const u32 tmp_word = std::bit_cast<u32>(in_component); 808 const u32 tmp_word = Common::BitCast<u32>(in_component);
809 const u32 half = ((tmp_word >> 16) & sign_mask) | 809 const u32 half = ((tmp_word >> 16) & sign_mask) |
810 ((((tmp_word & 0x7f800000) - 0x38000000) >> 13) & exponent_mask) | 810 ((((tmp_word & 0x7f800000) - 0x38000000) >> 13) & exponent_mask) |
811 ((tmp_word >> 13) & mantissa_mask); 811 ((tmp_word >> 13) & mantissa_mask);
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt
index daabf608d..094387ade 100644
--- a/src/yuzu_cmd/CMakeLists.txt
+++ b/src/yuzu_cmd/CMakeLists.txt
@@ -44,8 +44,9 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR})
44target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) 44target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include)
45 45
46if (YUZU_USE_EXTERNAL_SDL2) 46if (YUZU_USE_EXTERNAL_SDL2)
47 target_compile_definitions(yuzu-cmd PRIVATE -DYUZU_USE_EXTERNAL_SDL2) 47 target_link_libraries(yuzu-cmd PRIVATE SDL2-static)
48 target_include_directories(yuzu-cmd PRIVATE ${PROJECT_BINARY_DIR}/externals/SDL/include) 48else()
49 target_link_libraries(yuzu-cmd PRIVATE SDL2)
49endif() 50endif()
50 51
51if(UNIX AND NOT APPLE) 52if(UNIX AND NOT APPLE)
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
index 0d580fe4f..9ed47d453 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
@@ -12,12 +12,6 @@
12#include "video_core/renderer_vulkan/renderer_vulkan.h" 12#include "video_core/renderer_vulkan/renderer_vulkan.h"
13#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" 13#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h"
14 14
15#ifdef YUZU_USE_EXTERNAL_SDL2
16// Include this before SDL.h to prevent the external from including a dummy
17#define USING_GENERATED_CONFIG_H
18#include <SDL_config.h>
19#endif
20
21#include <SDL.h> 15#include <SDL.h>
22#include <SDL_syswm.h> 16#include <SDL_syswm.h>
23 17