From e05869de893e16f39cc2045593373ce6626537be Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sat, 15 Aug 2026 00:55:44 -0400 Subject: [PATCH] Revert "FOR GODS SAKE MSVC" --- .../0002-add-missing-standard-includes.patch | 20 ------------------- src/video_core/CMakeLists.txt | 6 ------ src/video_core/frame_gen/lossless_dll.cpp | 2 +- .../renderer_vulkan/present/frame_gen.cpp | 6 +++--- .../present/frame_gen_pacer.cpp | 18 ++++++++--------- .../renderer_vulkan/present/lsfg_chain.cpp | 2 +- .../renderer_vulkan/present/lsfg_common.cpp | 2 +- .../renderer_vulkan/present/lsfg_mipmaps.cpp | 4 ++-- 8 files changed, 17 insertions(+), 43 deletions(-) diff --git a/.patch/dxbc/0002-add-missing-standard-includes.patch b/.patch/dxbc/0002-add-missing-standard-includes.patch index d21b7c6b03..fdcfca8ac6 100644 --- a/.patch/dxbc/0002-add-missing-standard-includes.patch +++ b/.patch/dxbc/0002-add-missing-standard-includes.patch @@ -8,16 +8,6 @@ #include "dxbc_common.h" #include "dxbc_enums.h" ---- a/include/dxbc/dxbc_compiler.h -+++ b/include/dxbc/dxbc_compiler.h -@@ -1,6 +1,7 @@ - #pragma once - - #include -+#include - #include - #include - --- a/include/util/util_bit.h +++ b/include/util/util_bit.h @@ -1,5 +1,8 @@ @@ -39,16 +29,6 @@ #include #include ---- a/include/util/util_error.h -+++ b/include/util/util_error.h -@@ -1,6 +1,7 @@ - #pragma once - - #include -+#include - - namespace dxvk { - --- a/src/dxbc/dxbc_defs.cpp +++ b/src/dxbc/dxbc_defs.cpp @@ -1,3 +1,5 @@ diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 33437075c6..10afffb743 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -373,12 +373,6 @@ target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) target_link_libraries(video_core PRIVATE sirit::sirit) target_link_libraries(video_core PRIVATE dxbc) -# dxbc's util_bit.h rejects AVX on Windows -if (WIN32 AND NOT MSVC AND (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)) - set_source_files_properties(frame_gen/lsfg_translate.cpp - PROPERTIES COMPILE_OPTIONS -mno-avx) -endif() - # Header-only stuff needed by all dependent targets target_link_libraries(video_core PUBLIC Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator) diff --git a/src/video_core/frame_gen/lossless_dll.cpp b/src/video_core/frame_gen/lossless_dll.cpp index 97d13edab8..03228b8669 100644 --- a/src/video_core/frame_gen/lossless_dll.cpp +++ b/src/video_core/frame_gen/lossless_dll.cpp @@ -158,7 +158,7 @@ private: [[nodiscard]] std::optional RvaToFileOffset(std::span sections, u32 rva) { for (const Section& section : sections) { - const u32 span = std::max(section.virtual_size, section.raw_size); + const u32 span = std::max(section.virtual_size, section.raw_size); if (span == 0 || rva < section.virtual_address) { continue; } diff --git a/src/video_core/renderer_vulkan/present/frame_gen.cpp b/src/video_core/renderer_vulkan/present/frame_gen.cpp index a79dda82bb..b0d16819e5 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen.cpp @@ -80,7 +80,7 @@ void WritePortablePixmap(const std::filesystem::path& path, const std::string& m void WriteGrayscalePgm(const std::filesystem::path& path, VkExtent2D extent, std::span pixels) { const size_t expected = static_cast(extent.width) * extent.height; - WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min(expected, pixels.size()))); + WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min(expected, pixels.size()))); } void WriteRaw(const std::filesystem::path& path, std::span pixels) { @@ -220,8 +220,8 @@ void FrameGen::Process(const Device& device, Frame* frame, VkFormat format, } } - peak_guest_extent.width = std::max(peak_guest_extent.width, guest_extent.width); - peak_guest_extent.height = std::max(peak_guest_extent.height, guest_extent.height); + peak_guest_extent.width = std::max(peak_guest_extent.width, guest_extent.width); + peak_guest_extent.height = std::max(peak_guest_extent.height, guest_extent.height); const VkExtent2D extent{.width = frame->width, .height = frame->height}; const f32 flow_scale = ConfiguredFlowScale(peak_guest_extent, extent); diff --git a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp index 7eed541f41..78a8c83b5a 100644 --- a/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp +++ b/src/video_core/renderer_vulkan/present/frame_gen_pacer.cpp @@ -47,7 +47,7 @@ constexpr auto PROBE_STEP_DELAY = std::chrono::milliseconds(250); } // Anonymous namespace FrameGenPlan FrameGenPacer::Plan(size_t capacity) { - const size_t ceiling = std::min(capacity, Settings::FrameGenMaxGenerations()); + const size_t ceiling = std::min(capacity, Settings::FrameGenMaxGenerations()); if (ceiling == 0) { Reset(); return {}; @@ -74,7 +74,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { if (smoothed_interval > 0.0f) { f32 burst_threshold = BURST_CADENCE_RATIO / smoothed_interval; if (target_rate > 0.0f) { - burst_threshold = std::max(burst_threshold, target_rate * BURST_TARGET_RATIO); + burst_threshold = std::max(burst_threshold, target_rate * BURST_TARGET_RATIO); } if (1.0f / interval_seconds > burst_threshold) { DeferEvaluations(interval); @@ -109,7 +109,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { } if (target_rate == 0.0f) { - limit = std::min(Settings::FrameGenGenerations(), ceiling); + limit = std::min(Settings::FrameGenGenerations(), ceiling); output_credit = 0.0f; issued_generations = limit; return {.generations = limit, .warm = limit > 0}; @@ -117,7 +117,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { UpdateLimit(now, 1.0f / smoothed_interval, target_rate, ceiling); - const size_t allowed = std::min(limit, ceiling); + const size_t allowed = std::min(limit, ceiling); const f32 desired_outputs = smoothed_interval * target_rate; if (allowed == 0 || desired_outputs <= 1.0f) { output_credit = 0.0f; @@ -127,7 +127,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { output_credit += desired_outputs; const size_t outputs = std::max(1, static_cast(std::floor(output_credit + CREDIT_EPSILON))); - const size_t generations = std::min(outputs - 1, allowed); + const size_t generations = std::min(outputs - 1, allowed); output_credit -= static_cast(generations + 1); if (output_credit < 0.0f) { @@ -142,7 +142,7 @@ FrameGenPlan FrameGenPacer::Plan(size_t capacity) { void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target_rate, size_t ceiling) { - limit = std::min(limit, ceiling); + limit = std::min(limit, ceiling); if (probe_until) { if (now < *probe_until) { @@ -152,9 +152,9 @@ void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target output_credit = 0.0f; const f32 previous_output = - std::min(target_rate, probe_base_rate * static_cast(probe_previous_limit + 1)); + std::min(target_rate, probe_base_rate * static_cast(probe_previous_limit + 1)); const f32 current_output = - std::min(target_rate, base_rate * static_cast(limit + 1)); + std::min(target_rate, base_rate * static_cast(limit + 1)); const bool throughput_regressed = current_output < previous_output * PROBE_THROUGHPUT_TOLERANCE; @@ -166,7 +166,7 @@ void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target if (throughput_regressed || collapsed_for_marginal_gain || emulation_slowed) { limit = probe_previous_limit; - probe_failures = std::min(probe_failures + 1, MAX_PROBE_FAILURES); + probe_failures = std::min(probe_failures + 1, MAX_PROBE_FAILURES); next_probe = now + ProbeBackoff(probe_failures); deficit_since.reset(); return; diff --git a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp index 7b5b69c493..972b13a1c4 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_chain.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_chain.cpp @@ -47,7 +47,7 @@ LsfgChain::LsfgChain(const Device& device, MemoryAllocator& memory_allocator, const size_t level = LSFG_MIP_LEVELS - 1 - i; gamma[i] = LsfgGamma(device, memory_allocator, shaders, resources, descriptor_pool, alpha[level].Outputs(), - beta.Output(std::min(level, LSFG_BETA_OUTPUTS - 1)), + beta.Output(std::min(level, LSFG_BETA_OUTPUTS - 1)), i == 0 ? nullptr : &gamma[i - 1].Output()); if (i < FIRST_DELTA_LEVEL) { diff --git a/src/video_core/renderer_vulkan/present/lsfg_common.cpp b/src/video_core/renderer_vulkan/present/lsfg_common.cpp index 40093978e8..d2df2755e5 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_common.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_common.cpp @@ -93,7 +93,7 @@ VkImageMemoryBarrier MakeBarrier(const LsfgImage& image, VkAccessFlags src_acces LsfgImage::LsfgImage(const Device& device, MemoryAllocator& memory_allocator, VkExtent2D extent_, VkFormat format_) - : extent{std::max(1u, extent_.width), std::max(1u, extent_.height)}, format{format_} { + : extent{std::max(1u, extent_.width), std::max(1u, extent_.height)}, format{format_} { image = CreateChainImage(memory_allocator, extent, format); view = CreateWrappedImageView(device, image, format); } diff --git a/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp b/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp index e06df40d16..3f31f58d68 100644 --- a/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp +++ b/src/video_core/renderer_vulkan/present/lsfg_mipmaps.cpp @@ -40,8 +40,8 @@ LsfgMipmaps::LsfgMipmaps(const Device& device, MemoryAllocator& memory_allocator const VkExtent2D input_extent = (*frames)[0].Extent(); flow_extent = VkExtent2D{ - .width = std::max(1u, static_cast(static_cast(input_extent.width) * flow_scale)), - .height = std::max(1u, static_cast(static_cast(input_extent.height) * flow_scale)), + .width = std::max(1u, static_cast(static_cast(input_extent.width) * flow_scale)), + .height = std::max(1u, static_cast(static_cast(input_extent.height) * flow_scale)), }; for (size_t i = 0; i < LSFG_MIP_LEVELS; ++i) {