diff options
author | Liam <byteslice@airmail.cc> | 2022-12-03 19:32:24 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-12-04 16:12:26 +0100 |
commit | 6d2c59737177dba09a0a2a31e96276addf52c172 (patch) | |
tree | 9bb6050c056d66f880557e3fd5b3058638afd66d /src | |
parent | Merge pull request #9300 from ameerj/pch (diff) | |
download | yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.gz yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.bz2 yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.lz yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.xz yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.tar.zst yuzu-6d2c59737177dba09a0a2a31e96276addf52c172.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 1 | ||||
-rw-r--r-- | src/video_core/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/video_core/engines/sw_blitter/converter.cpp | 22 | ||||
-rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 6 |
5 files changed, 23 insertions, 21 deletions
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 @@ #include <algorithm> +#include "common/polyfill_ranges.h" #include "common/thread.h" #include "core/hid/emulated_controller.h" #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) /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data ) else() - target_compile_options(video_core PRIVATE - -Werror=conversion + if (APPLE) + # error: declaration shadows a typedef in 'interval_base_set<SubType, DomainT, Compare, Interval, Alloc>' + # error: implicit conversion loses integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char') + target_compile_options(video_core PRIVATE -Wno-shadow -Wno-unused-local-typedef) + else() + target_compile_options(video_core PRIVATE -Werror=conversion) + endif() + target_compile_options(video_core PRIVATE -Wno-sign-conversion ) 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 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include <array> -#include <bit> #include <cmath> #include <span> #include <unordered_map> #include "common/assert.h" +#include "common/bit_cast.h" #include "video_core/engines/sw_blitter/converter.h" #include "video_core/surface.h" #include "video_core/textures/decoders.h" @@ -693,21 +693,21 @@ private: return shifted_value >> shift_amount; }; const auto force_to_fp16 = [](f32 base_value) { - u32 tmp = std::bit_cast<u32>(base_value); + u32 tmp = Common::BitCast<u32>(base_value); constexpr size_t fp32_mantissa_bits = 23; constexpr size_t fp16_mantissa_bits = 10; constexpr size_t mantissa_mask = ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL); tmp = tmp & static_cast<u32>(mantissa_mask); // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM - return std::bit_cast<f32>(tmp); + return Common::BitCast<f32>(tmp); }; const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) { constexpr size_t fp32_mantissa_bits = 23; size_t shift_towards = fp32_mantissa_bits - mantissa; const u32 new_value = static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31)); - return std::bit_cast<f32>(new_value); + return Common::BitCast<f32>(new_value); }; const auto calculate_snorm = [&]() { return static_cast<f32>( @@ -737,13 +737,13 @@ private: out_component = force_to_fp16(out_component); } else if constexpr (component_types[which_component] == ComponentType::FLOAT) { if constexpr (component_sizes[which_component] == 32) { - out_component = std::bit_cast<f32>(value); + out_component = Common::BitCast<f32>(value); } else if constexpr (component_sizes[which_component] == 16) { static constexpr u32 sign_mask = 0x8000; static constexpr u32 mantissa_mask = 0x8000; - out_component = std::bit_cast<f32>(((value & sign_mask) << 16) | - (((value & 0x7c00) + 0x1C000) << 13) | - ((value & mantissa_mask) << 13)); + out_component = Common::BitCast<f32>(((value & sign_mask) << 16) | + (((value & 0x7c00) + 0x1C000) << 13) | + ((value & mantissa_mask) << 13)); } else { out_component = from_fp_n(value, component_sizes[which_component], component_sizes[which_component] - 5); @@ -771,7 +771,7 @@ private: }; const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) { constexpr size_t fp32_mantissa_bits = 23; - u32 tmp_value = std::bit_cast<u32>(std::max(base_value, 0.0f)); + u32 tmp_value = Common::BitCast<u32>(std::max(base_value, 0.0f)); size_t shift_towards = fp32_mantissa_bits - mantissa; return tmp_value >> shift_towards; }; @@ -799,13 +799,13 @@ private: insert_to_word(tmp_word); } else if constexpr (component_types[which_component] == ComponentType::FLOAT) { if constexpr (component_sizes[which_component] == 32) { - u32 tmp_word = std::bit_cast<u32>(in_component); + u32 tmp_word = Common::BitCast<u32>(in_component); insert_to_word(tmp_word); } else if constexpr (component_sizes[which_component] == 16) { static constexpr u32 sign_mask = 0x8000; static constexpr u32 mantissa_mask = 0x03ff; static constexpr u32 exponent_mask = 0x7c00; - const u32 tmp_word = std::bit_cast<u32>(in_component); + const u32 tmp_word = Common::BitCast<u32>(in_component); const u32 half = ((tmp_word >> 16) & sign_mask) | ((((tmp_word & 0x7f800000) - 0x38000000) >> 13) & exponent_mask) | ((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}) target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) if (YUZU_USE_EXTERNAL_SDL2) - target_compile_definitions(yuzu-cmd PRIVATE -DYUZU_USE_EXTERNAL_SDL2) - target_include_directories(yuzu-cmd PRIVATE ${PROJECT_BINARY_DIR}/externals/SDL/include) + target_link_libraries(yuzu-cmd PRIVATE SDL2-static) +else() + target_link_libraries(yuzu-cmd PRIVATE SDL2) endif() if(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 @@ #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" -#ifdef YUZU_USE_EXTERNAL_SDL2 -// Include this before SDL.h to prevent the external from including a dummy -#define USING_GENERATED_CONFIG_H -#include <SDL_config.h> -#endif - #include <SDL.h> #include <SDL_syswm.h> |