shader: fix the Linux and macOS build #285
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!285
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/285/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@StefanosCosta on GitHub · 2026-08-18 10:04 UTC · original
StefanosCosta:main→main· +3 −2 · 2 files · 3 commits · merged 2026-08-18 12:41 UTCSummary
Fixes the Linux and macOS build, which has been broken since 2026-08-15. Two independent
compile errors landed with the shader recompiler work — one is a literal-suffix overload
ambiguity that only exists on LP64, the other is a
throwunder-fno-exceptions. Bothcompile cleanly on Windows, so CI has been green there throughout while Linux and macOS
failed on every run.
Windows behaviour is unchanged: one change is a spelling of an integer literal that already
resolved to the same constructor under LLP64, the other sits in a
constevalbranch thatemits no code on any platform.
What's included
Shader recompiler
Translate.cpp: spell the whole-quad mask asIR::Value(uint64_t {0x1111111111111111})instead of a
0x...ullliteral.IR::Valuehasexplicitconstructors forboolthroughuint64_t; on LP64uint64_tisunsigned long, so anunsigned long longliteralmatches none exactly and all five are equal-rank conversions —
error: ambiguous conversion for functional-style cast from 'unsigned long long' to 'IR::Value'. The next line alreadyused the correct form. Windows is LLP64, where
uint64_tisunsigned long long, so itresolved as an exact match and never failed.
OpcodeTable.h: replace thethrowinconsteval MakeOpcodeTablewith a call to adeclared-but-never-defined
[[noreturn]] void InvalidOpcodeTable().-fno-exceptions(
src/utils.cmake:120, every clang build) makes clang rejectthrowwhen the expression isformed, not when constant evaluation reaches it, so the branch being unreachable did not
help. A non-
constexprcall is equally illegal in a constant expression but only whenactually evaluated, so a malformed table still fails the build — now naming the offending
table — while a valid one compiles.
static_assertcannot express this check: the conditionreads a function parameter, which is not a constant expression inside the body.
Platform impact
Translate.cppliteral already bound toValue(uint64_t)under LLP64, so the emitted code is identical.
InvalidOpcodeTableis never odr-used —nmshows no reference to it in any decode object or in the linkedkyty_emulator—because an immediate function emits no runtime code. No build flags are touched; Windows
takes the MSVC branch of
utils.cmakeand never had-fno-exceptionsin the first place.as x86_64, which is LP64, so the
Translate.cppambiguity applies identically and is fixed.Whether Xcode's clang also rejected the
throwis unconfirmed; that change is harmlesseither way.
Testing
Linux, clang 18.1.3 (matching the
ubuntu-24.04CI image), Ninja, Release:launcher,page_manager_tests,memory_tracker_tests,audio_out2_port_tests,ime_dialog_tests,virtual_memory_allocation_tests— 1015/1015, zero errors.ctest -R '^(audio_out2_port|ime_dialog|page_manager|memory_tracker|virtual_memory_allocation)$'— 5/5 passed.
returns, then restored.
CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF; the local toolchain has nollvm-ar,so the LTO link path CI uses is not covered by the above.
@Nmzik on GitHub · 2026-08-18 12:41 UTC · original
@StefanosCosta Thanks