mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-05 15:47:12 +02: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:
parent
428f136a75
commit
9d2681ecc9
276 changed files with 973 additions and 1010 deletions
|
|
@ -39,7 +39,7 @@ void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::strin
|
|||
// which may be overwritten by the result of the addition
|
||||
if (IR::Inst * overflow{inst.GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp)}) {
|
||||
// https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c
|
||||
constexpr u32 s32_max{static_cast<u32>(std::numeric_limits<s32>::max())};
|
||||
constexpr u32 s32_max{static_cast<u32>((std::numeric_limits<s32>::max)())};
|
||||
const auto sub_a{fmt::format("{}u-{}", s32_max, a)};
|
||||
const auto positive_result{fmt::format("int({})>int({})", b, sub_a)};
|
||||
const auto negative_result{fmt::format("int({})<int({})", b, sub_a)};
|
||||
|
|
|
|||
|
|
@ -314,9 +314,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
|
|||
break;
|
||||
case Stage::Compute:
|
||||
stage_name = "cs";
|
||||
const u32 local_x{std::max(program.workgroup_size[0], 1u)};
|
||||
const u32 local_y{std::max(program.workgroup_size[1], 1u)};
|
||||
const u32 local_z{std::max(program.workgroup_size[2], 1u)};
|
||||
const u32 local_x{(std::max)(program.workgroup_size[0], 1u)};
|
||||
const u32 local_y{(std::max)(program.workgroup_size[1], 1u)};
|
||||
const u32 local_z{(std::max)(program.workgroup_size[2], 1u)};
|
||||
header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;",
|
||||
local_x, local_y, local_z);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ Id VarAlloc::Alloc(GlslVarType type) {
|
|||
if (use_tracker.var_use[var]) {
|
||||
continue;
|
||||
}
|
||||
use_tracker.num_used = std::max(use_tracker.num_used, var + 1);
|
||||
use_tracker.num_used = (std::max)(use_tracker.num_used, var + 1);
|
||||
use_tracker.var_use[var] = true;
|
||||
Id ret{};
|
||||
ret.is_valid.Assign(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue