Revert "FOR GODS SAKE MSVC"

This commit is contained in:
CamilleLaVey
2026-08-15 00:55:44 -04:00
parent 122dcaf913
commit e05869de89
8 changed files with 17 additions and 43 deletions
@@ -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 <array>
+#include <initializer_list>
#include <utility>
#include <vector>
--- a/include/util/util_bit.h
+++ b/include/util/util_bit.h
@@ -1,5 +1,8 @@
@@ -39,16 +29,6 @@
#include <sstream>
#include <vector>
--- a/include/util/util_error.h
+++ b/include/util/util_error.h
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <utility>
namespace dxvk {
--- a/src/dxbc/dxbc_defs.cpp
+++ b/src/dxbc/dxbc_defs.cpp
@@ -1,3 +1,5 @@
-6
View File
@@ -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)
+1 -1
View File
@@ -158,7 +158,7 @@ private:
[[nodiscard]] std::optional<size_t> RvaToFileOffset(std::span<const Section> sections, u32 rva) {
for (const Section& section : sections) {
const u32 span = std::max<u32>(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;
}
@@ -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<const u8> pixels) {
const size_t expected = static_cast<size_t>(extent.width) * extent.height;
WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min<size_t>(expected, pixels.size())));
WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min(expected, pixels.size())));
}
void WriteRaw(const std::filesystem::path& path, std::span<const u8> pixels) {
@@ -220,8 +220,8 @@ void FrameGen::Process(const Device& device, Frame* frame, VkFormat format,
}
}
peak_guest_extent.width = std::max<u32>(peak_guest_extent.width, guest_extent.width);
peak_guest_extent.height = std::max<u32>(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);
@@ -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<size_t>(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<f32>(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<size_t>(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<size_t>(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<size_t>(1, static_cast<size_t>(std::floor(output_credit + CREDIT_EPSILON)));
const size_t generations = std::min<size_t>(outputs - 1, allowed);
const size_t generations = std::min(outputs - 1, allowed);
output_credit -= static_cast<f32>(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<size_t>(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<f32>(target_rate, probe_base_rate * static_cast<f32>(probe_previous_limit + 1));
std::min(target_rate, probe_base_rate * static_cast<f32>(probe_previous_limit + 1));
const f32 current_output =
std::min<f32>(target_rate, base_rate * static_cast<f32>(limit + 1));
std::min(target_rate, base_rate * static_cast<f32>(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<u32>(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;
@@ -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<size_t>(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) {
@@ -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<u32>(1u, extent_.width), std::max<u32>(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);
}
@@ -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<u32>(1u, static_cast<u32>(static_cast<f32>(input_extent.width) * flow_scale)),
.height = std::max<u32>(1u, static_cast<u32>(static_cast<f32>(input_extent.height) * flow_scale)),
.width = std::max(1u, static_cast<u32>(static_cast<f32>(input_extent.width) * flow_scale)),
.height = std::max(1u, static_cast<u32>(static_cast<f32>(input_extent.height) * flow_scale)),
};
for (size_t i = 0; i < LSFG_MIP_LEVELS; ++i) {