mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-21 07:18:33 +00:00
[cmake] enable clang-cl and WoA builds (#348)
Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
@@ -86,7 +86,7 @@ static u32 WriteAuxBufferDsp(Core::Memory::Memory& memory, CpuAddr send_info_,
|
||||
u32 write_count{write_count_};
|
||||
u32 read_pos{0};
|
||||
while (write_count > 0) {
|
||||
u32 to_write{std::min(count_max - target_write_offset, write_count)};
|
||||
u32 to_write{(std::min)(count_max - target_write_offset, write_count)};
|
||||
if (to_write > 0) {
|
||||
const auto write_addr = send_buffer + target_write_offset * sizeof(s32);
|
||||
memory.WriteBlockUnsafe(write_addr, &input[read_pos], to_write * sizeof(s32));
|
||||
@@ -157,7 +157,7 @@ static u32 ReadAuxBufferDsp(Core::Memory::Memory& memory, CpuAddr return_info_,
|
||||
u32 read_count{read_count_};
|
||||
u32 write_pos{0};
|
||||
while (read_count > 0) {
|
||||
u32 to_read{std::min(count_max - target_read_offset, read_count)};
|
||||
u32 to_read{(std::min)(count_max - target_read_offset, read_count)};
|
||||
if (to_read > 0) {
|
||||
const auto read_addr = return_buffer + target_read_offset * sizeof(s32);
|
||||
memory.ReadBlockUnsafe(read_addr, &output[write_pos], to_read * sizeof(s32));
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace AudioCore::Renderer {
|
||||
void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input,
|
||||
std::array<s16, 3>& b_, std::array<s16, 2>& a_,
|
||||
VoiceState::BiquadFilterState& state, const u32 sample_count) {
|
||||
constexpr f64 min{std::numeric_limits<s32>::min()};
|
||||
constexpr f64 max{std::numeric_limits<s32>::max()};
|
||||
constexpr f64 min{(std::numeric_limits<s32>::min)()};
|
||||
constexpr f64 max{(std::numeric_limits<s32>::max)()};
|
||||
std::array<f64, 3> b{Common::FixedPoint<50, 14>::from_base(b_[0]).to_double(),
|
||||
Common::FixedPoint<50, 14>::from_base(b_[1]).to_double(),
|
||||
Common::FixedPoint<50, 14>::from_base(b_[2]).to_double()};
|
||||
@@ -61,8 +61,8 @@ void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input,
|
||||
static void ApplyBiquadFilterInt(std::span<s32> output, std::span<const s32> input,
|
||||
std::array<s16, 3>& b, std::array<s16, 2>& a,
|
||||
VoiceState::BiquadFilterState& state, const u32 sample_count) {
|
||||
constexpr s64 min{std::numeric_limits<s32>::min()};
|
||||
constexpr s64 max{std::numeric_limits<s32>::max()};
|
||||
constexpr s64 min{(std::numeric_limits<s32>::min)()};
|
||||
constexpr s64 max{(std::numeric_limits<s32>::max)()};
|
||||
|
||||
for (u32 i = 0; i < sample_count; i++) {
|
||||
const s64 in_sample{input[i]};
|
||||
|
||||
@@ -79,7 +79,7 @@ static u32 WriteAuxBufferDsp(Core::Memory::Memory& memory, const CpuAddr send_in
|
||||
u32 write_count{write_count_};
|
||||
u32 write_pos{0};
|
||||
while (write_count > 0) {
|
||||
u32 to_write{std::min(count_max - target_write_offset, write_count)};
|
||||
u32 to_write{(std::min)(count_max - target_write_offset, write_count)};
|
||||
|
||||
if (to_write > 0) {
|
||||
memory.WriteBlockUnsafe(send_buffer + target_write_offset * sizeof(s32),
|
||||
|
||||
@@ -76,9 +76,9 @@ static void UpdateI3dl2ReverbEffectParameter(const I3dl2ReverbInfo::ParameterVer
|
||||
|
||||
state.dry_gain = params.dry_gain;
|
||||
Common::FixedPoint<50, 14> early_gain{
|
||||
std::min(params.room_gain + params.reflection_gain, 5000.0f) / 2000.0f};
|
||||
(std::min)(params.room_gain + params.reflection_gain, 5000.0f) / 2000.0f};
|
||||
state.early_gain = pow_10(early_gain.to_float());
|
||||
Common::FixedPoint<50, 14> late_gain{std::min(params.room_gain + params.reverb_gain, 5000.0f) /
|
||||
Common::FixedPoint<50, 14> late_gain{(std::min)(params.room_gain + params.reverb_gain, 5000.0f) /
|
||||
2000.0f};
|
||||
state.late_gain = pow_10(late_gain.to_float());
|
||||
|
||||
@@ -94,7 +94,7 @@ static void UpdateI3dl2ReverbEffectParameter(const I3dl2ReverbInfo::ParameterVer
|
||||
const Common::FixedPoint<50, 14> c{
|
||||
std::sqrt(std::pow(b.to_float(), 2.0f) + (std::pow(a.to_float(), 2.0f) * -4.0f))};
|
||||
|
||||
state.lowpass_1 = std::min(((b - c) / (a * 2.0f)).to_float(), 0.99723f);
|
||||
state.lowpass_1 = (std::min)(((b - c) / (a * 2.0f)).to_float(), 0.99723f);
|
||||
state.lowpass_2 = 1.0f - state.lowpass_1;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ static void ApplyLightLimiterEffect(const LightLimiterInfo::ParameterVersion2& p
|
||||
std::span<std::span<const s32>> inputs,
|
||||
std::span<std::span<s32>> outputs, const u32 sample_count,
|
||||
LightLimiterInfo::StatisticsInternal* statistics) {
|
||||
constexpr s64 min{std::numeric_limits<s32>::min()};
|
||||
constexpr s64 max{std::numeric_limits<s32>::max()};
|
||||
constexpr s64 min{(std::numeric_limits<s32>::min)()};
|
||||
constexpr s64 max{(std::numeric_limits<s32>::max)()};
|
||||
|
||||
const auto recip_estimate = [](f64 a) -> f64 {
|
||||
s32 q, s;
|
||||
@@ -117,9 +117,9 @@ static void ApplyLightLimiterEffect(const LightLimiterInfo::ParameterVersion2& p
|
||||
|
||||
if (statistics) {
|
||||
statistics->channel_max_sample[channel] =
|
||||
std::max(statistics->channel_max_sample[channel], abs_sample.to_float());
|
||||
(std::max)(statistics->channel_max_sample[channel], abs_sample.to_float());
|
||||
statistics->channel_compression_gain_min[channel] =
|
||||
std::min(statistics->channel_compression_gain_min[channel],
|
||||
(std::min)(statistics->channel_compression_gain_min[channel],
|
||||
state.compression_gain[channel].to_float());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ static void UpdateReverbEffectParameter(const ReverbInfo::ParameterVersion2& par
|
||||
for (u32 i = 0; i < ReverbInfo::MaxDelayTaps; i++) {
|
||||
auto early_delay{
|
||||
((pre_delay_time + EarlyDelayTimes[params.early_mode][i]) * sample_rate).to_int()};
|
||||
early_delay = std::min(early_delay, state.pre_delay_line.sample_count_max);
|
||||
early_delay = (std::min)(early_delay, state.pre_delay_line.sample_count_max);
|
||||
state.early_delay_times[i] = early_delay + 1;
|
||||
state.early_gains[i] = Common::FixedPoint<50, 14>::from_base(params.early_gain) *
|
||||
EarlyDelayGains[params.early_mode][i];
|
||||
@@ -107,7 +107,7 @@ static void UpdateReverbEffectParameter(const ReverbInfo::ParameterVersion2& par
|
||||
|
||||
auto pre_time{
|
||||
((pre_delay_time + EarlyDelayTimes[params.early_mode][10]) * sample_rate).to_int()};
|
||||
state.pre_delay_time = std::min(pre_time, state.pre_delay_line.sample_count_max);
|
||||
state.pre_delay_time = (std::min)(pre_time, state.pre_delay_line.sample_count_max);
|
||||
|
||||
if (!unk_initialized) {
|
||||
unk_value = cos((1280.0f / sample_rate).to_float());
|
||||
@@ -117,13 +117,13 @@ static void UpdateReverbEffectParameter(const ReverbInfo::ParameterVersion2& par
|
||||
for (u32 i = 0; i < ReverbInfo::MaxDelayLines; i++) {
|
||||
const auto fdn_delay{(FdnDelayTimes[params.late_mode][i] * sample_rate).to_int()};
|
||||
state.fdn_delay_lines[i].sample_count =
|
||||
std::min(fdn_delay, state.fdn_delay_lines[i].sample_count_max);
|
||||
(std::min)(fdn_delay, state.fdn_delay_lines[i].sample_count_max);
|
||||
state.fdn_delay_lines[i].buffer_end =
|
||||
&state.fdn_delay_lines[i].buffer[state.fdn_delay_lines[i].sample_count - 1];
|
||||
|
||||
const auto decay_delay{(DecayDelayTimes[params.late_mode][i] * sample_rate).to_int()};
|
||||
state.decay_delay_lines[i].sample_count =
|
||||
std::min(decay_delay, state.decay_delay_lines[i].sample_count_max);
|
||||
(std::min)(decay_delay, state.decay_delay_lines[i].sample_count_max);
|
||||
state.decay_delay_lines[i].buffer_end =
|
||||
&state.decay_delay_lines[i].buffer[state.decay_delay_lines[i].sample_count - 1];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user