From 3ef754c1e781ff9ba75fdfee2da98609ccf39178 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 7 Apr 2023 02:00:48 +0200 Subject: [PATCH] early-access version 3501 --- README.md | 2 +- src/CMakeLists.txt | 11 ++++++++ src/common/intrusive_red_black_tree.h | 8 ------ src/common/typed_address.h | 5 ---- src/core/internal_network/socket_proxy.h | 3 --- src/core/internal_network/sockets.h | 13 ++------- .../backend/glsl/emit_glsl_image.cpp | 3 ++- .../backend/spirv/emit_spirv_image.cpp | 27 +++++++------------ src/shader_recompiler/profile.h | 6 ++--- src/video_core/renderer_opengl/gl_device.cpp | 1 - src/video_core/renderer_opengl/gl_device.h | 9 +++---- .../renderer_opengl/gl_shader_cache.cpp | 2 +- .../renderer_vulkan/vk_pipeline_cache.cpp | 4 ++- .../vulkan_common/vulkan_device.cpp | 1 - src/video_core/vulkan_common/vulkan_device.h | 5 ---- src/web_service/verify_login.cpp | 2 +- 16 files changed, 37 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index ce349f134..462eaf634 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3500. +This is the source code for early-access 3501. ## Legal Notice diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6057c7270..80e32e909 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,6 +126,17 @@ else() add_compile_options("-stdlib=libc++") endif() + # GCC bugs + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # These diagnostics would be great if they worked, but are just completely broken + # and produce bogus errors on external libraries like fmt. + add_compile_options( + -Wno-array-bounds + -Wno-stringop-overread + -Wno-stringop-overflow + ) + endif() + # Set file offset size to 64 bits. # # On modern Unixes, this is typically already the case. The lone exception is diff --git a/src/common/intrusive_red_black_tree.h b/src/common/intrusive_red_black_tree.h index aa575846b..c2f6eebc6 100755 --- a/src/common/intrusive_red_black_tree.h +++ b/src/common/intrusive_red_black_tree.h @@ -96,10 +96,6 @@ public: return m_node == rhs.m_node; } - constexpr bool operator!=(const Iterator& rhs) const { - return !(*this == rhs); - } - constexpr pointer operator->() const { return m_node; } @@ -324,10 +320,6 @@ public: return m_impl == rhs.m_impl; } - constexpr bool operator!=(const Iterator& rhs) const { - return !(*this == rhs); - } - constexpr pointer operator->() const { return Traits::GetParent(std::addressof(*m_impl)); } diff --git a/src/common/typed_address.h b/src/common/typed_address.h index cf7bbeae1..64f4a07c2 100755 --- a/src/common/typed_address.h +++ b/src/common/typed_address.h @@ -116,7 +116,6 @@ public: // Comparison operators. constexpr bool operator==(const TypedAddress&) const = default; - constexpr bool operator!=(const TypedAddress&) const = default; constexpr auto operator<=>(const TypedAddress&) const = default; // For convenience, also define comparison operators versus uint64_t. @@ -124,10 +123,6 @@ public: return m_address == rhs; } - constexpr inline bool operator!=(uint64_t rhs) const { - return m_address != rhs; - } - // Allow getting the address explicitly, for use in accessors. constexpr inline uint64_t GetValue() const { return m_address; diff --git a/src/core/internal_network/socket_proxy.h b/src/core/internal_network/socket_proxy.h index a09a2d5af..1c3e3dcb8 100755 --- a/src/core/internal_network/socket_proxy.h +++ b/src/core/internal_network/socket_proxy.h @@ -16,9 +16,6 @@ namespace Network { class ProxySocket : public SocketBase { public: - YUZU_NON_COPYABLE(ProxySocket); - YUZU_NON_MOVEABLE(ProxySocket); - explicit ProxySocket(RoomNetwork& room_network_) noexcept; ~ProxySocket() override; diff --git a/src/core/internal_network/sockets.h b/src/core/internal_network/sockets.h index d999f27dd..1e0cda83f 100755 --- a/src/core/internal_network/sockets.h +++ b/src/core/internal_network/sockets.h @@ -36,13 +36,10 @@ public: SocketBase() = default; explicit SocketBase(SOCKET fd_) : fd{fd_} {} - virtual ~SocketBase() = default; - virtual SocketBase& operator=(const SocketBase&) = delete; - - // Avoid closing sockets implicitly - virtual SocketBase& operator=(SocketBase&&) noexcept = delete; + YUZU_NON_COPYABLE(SocketBase); + YUZU_NON_MOVEABLE(SocketBase); virtual Errno Initialize(Domain domain, Type type, Protocol protocol) = 0; @@ -109,14 +106,8 @@ public: ~Socket() override; - Socket(const Socket&) = delete; - Socket& operator=(const Socket&) = delete; - Socket(Socket&& rhs) noexcept; - // Avoid closing sockets implicitly - Socket& operator=(Socket&&) noexcept = delete; - Errno Initialize(Domain domain, Type type, Protocol protocol) override; Errno Close() override; diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp index fbfcdb0af..d6dfc73fe 100755 --- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp @@ -152,7 +152,8 @@ std::string ImageGatherSubpixelOffset(const IR::TextureInstInfo& info, std::stri return fmt::format("{}+vec2(0.001953125)/vec2(textureSize({}, 0))", coords, texture); case TextureType::ColorArray2D: case TextureType::ColorCube: - return fmt::format("vec3({0}.xy+vec2(0.001953125)/vec2(textureSize({1}, 0)),{0}.z)", coords, texture); + return fmt::format("vec3({0}.xy+vec2(0.001953125)/vec2(textureSize({1}, 0)),{0}.z)", coords, + texture); default: return std::string{coords}; } diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 05faac863..85d023671 100755 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -266,30 +266,21 @@ Id ImageGatherSubpixelOffset(EmitContext& ctx, const IR::TextureInstInfo& info, Id coords) { // Apply a subpixel offset of 1/512 the texel size of the texture to ensure same rounding on // AMD hardware as on Maxwell or other Nvidia architectures. - const auto calculate_offset{[&](size_t dim) -> std::array { + const auto calculate_coords{[&](size_t dim) { const Id nudge{ctx.Const(0x1p-9f)}; const Id image_size{ctx.OpImageQuerySizeLod(ctx.U32[dim], texture, ctx.u32_zero_value)}; - const Id offset_x{ctx.OpFDiv( - ctx.F32[1], nudge, - ctx.OpConvertUToF(ctx.F32[1], ctx.OpCompositeExtract(ctx.U32[1], image_size, 0)))}; - const Id offset_y{ctx.OpFDiv( - ctx.F32[1], nudge, - ctx.OpConvertUToF(ctx.F32[1], ctx.OpCompositeExtract(ctx.U32[1], image_size, 1)))}; - return {ctx.OpFAdd(ctx.F32[1], ctx.OpCompositeExtract(ctx.F32[1], coords, 0), offset_x), - ctx.OpFAdd(ctx.F32[1], ctx.OpCompositeExtract(ctx.F32[1], coords, 1), offset_y)}; + Id offset{dim == 2 ? ctx.ConstantComposite(ctx.F32[dim], nudge, nudge) + : ctx.ConstantComposite(ctx.F32[dim], nudge, nudge, ctx.f32_zero_value)}; + offset = ctx.OpFDiv(ctx.F32[dim], offset, ctx.OpConvertUToF(ctx.F32[dim], image_size)); + return ctx.OpFAdd(ctx.F32[dim], coords, offset); }}; switch (info.type) { case TextureType::Color2D: - case TextureType::Color2DRect: { - const auto offset{calculate_offset(2)}; - return ctx.OpCompositeConstruct(ctx.F32[2], offset[0], offset[1]); - } + case TextureType::Color2DRect: + return calculate_coords(2); case TextureType::ColorArray2D: - case TextureType::ColorCube: { - const auto offset{calculate_offset(3)}; - return ctx.OpCompositeConstruct(ctx.F32[3], offset[0], offset[1], - ctx.OpCompositeExtract(ctx.F32[1], coords, 2)); - } + case TextureType::ColorCube: + return calculate_coords(3); default: return coords; } diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 59ef89765..ce70dfcf0 100755 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -52,9 +52,9 @@ struct Profile { bool need_declared_frag_colors{}; /// Prevents fast math optimizations that may cause inaccuracies bool need_fastmath_off{}; - /// Some GPU vendors use a lower fixed point format of 16.8 when calculating pixel coordinates - /// in the ImageGather instruction than the Maxwell architecture does. Applying an offset does - /// fix this mismatching rounding behaviour. + /// Some GPU vendors use a different rounding precision when calculating texture pixel + /// coordinates with the 16.8 format in the ImageGather instruction than the Maxwell + /// architecture. Applying an offset does fix this mismatching rounding behaviour. bool need_gather_subpixel_offset{}; /// OpFClamp is broken and OpFMax + OpFMin should be used instead diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index b8efc8881..e20ea0739 100755 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -169,7 +169,6 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) { has_draw_texture = GLAD_GL_NV_draw_texture; warp_size_potentially_larger_than_guest = !is_nvidia && !is_intel; need_fastmath_off = is_nvidia; - need_gather_subpixel_offset = is_amd; can_report_memory = GLAD_GL_NVX_gpu_memory_info; // At the moment of writing this, only Nvidia's driver optimizes BufferSubData on exclusive diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index 4f7dfe769..ba1f5d799 100755 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h @@ -160,10 +160,6 @@ public: return need_fastmath_off; } - bool NeedsGatherSubpixelOffset() const { - return need_gather_subpixel_offset; - } - bool HasCbufFtouBug() const { return has_cbuf_ftou_bug; } @@ -180,6 +176,10 @@ public: return vendor_name == "ATI Technologies Inc."; } + bool IsIntel() const { + return vendor_name == "Intel"; + } + bool CanReportMemoryUsage() const { return can_report_memory; } @@ -229,7 +229,6 @@ private: bool has_draw_texture{}; bool warp_size_potentially_larger_than_guest{}; bool need_fastmath_off{}; - bool need_gather_subpixel_offset{}; bool has_cbuf_ftou_bug{}; bool has_bool_ref_bug{}; bool can_report_memory{}; diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 9c1266c3d..91bb708cd 100755 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -218,7 +218,7 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo .lower_left_origin_mode = true, .need_declared_frag_colors = true, .need_fastmath_off = device.NeedsFastmathOff(), - .need_gather_subpixel_offset = device.NeedsGatherSubpixelOffset(), + .need_gather_subpixel_offset = device.IsAmd() || device.IsIntel(), .has_broken_spirv_clamp = true, .has_broken_unsigned_image_offsets = true, diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index e54949fcb..d56fdbac0 100755 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -329,7 +329,9 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device .lower_left_origin_mode = false, .need_declared_frag_colors = false, - .need_gather_subpixel_offset = device.NeedsGatherSubpixelOffset(), + .need_gather_subpixel_offset = driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || + driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS || + driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 42c64e9f9..6c4caafef 100755 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -431,7 +431,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR "AMD GCN4 and earlier have broken VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); has_broken_cube_compatibility = true; } - need_gather_subpixel_offset = true; } if (extensions.sampler_filter_minmax && is_amd) { // Disable ext_sampler_filter_minmax on AMD GCN4 and lower as it is broken. diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 40bd5a907..7f0a96cb7 100755 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -554,10 +554,6 @@ public: return features.robustness2.nullDescriptor; } - bool NeedsGatherSubpixelOffset() const { - return need_gather_subpixel_offset; - } - u32 GetMaxVertexInputAttributes() const { return properties.properties.limits.maxVertexInputAttributes; } @@ -668,7 +664,6 @@ private: bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. - bool need_gather_subpixel_offset{}; ///< Needs offset at ImageGather for correct rounding. u64 device_access_memory{}; ///< Total size of device local memory in bytes. u32 sets_per_pool{}; ///< Sets per Description Pool diff --git a/src/web_service/verify_login.cpp b/src/web_service/verify_login.cpp index 585b01e4d..b3fa44ecf 100755 --- a/src/web_service/verify_login.cpp +++ b/src/web_service/verify_login.cpp @@ -21,7 +21,7 @@ bool VerifyLogin(const std::string& host, const std::string& username, const std return username.empty(); } - return username == *iter; + return *iter == username; } } // namespace WebService