Skip to content

Bring up Is This Seat Taken? on Apple Silicon and native Metal - #1

Open
LuizDusky wants to merge 4 commits into
TxCsOffc:mainfrom
LuizDusky:draft/arm64-unity-metal-bringup
Open

LuizDusky wants to merge 4 commits into
TxCsOffc:mainfrom
LuizDusky:draft/arm64-unity-metal-bringup

Conversation

@LuizDusky

@LuizDusky LuizDusky commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Adapt the ARM64 bridge to a pinned public FEXCore port and document the dependency patch and build commands.
  • Fix startup issues involving JIT writes, guest pthread scheduling, Unity callbacks, and signal delivery.
  • Lower supported embedded vertex attribute loads in the direct Metal shader path.
  • Key native Metal vertex pulling on the active stride and whether the shader indexes vertices or instances. The game uses both 76-byte and 108-byte vertex records with the same shader. Reusing the 76-byte specialization for a 108-byte draw corrupted UI geometry and rendered text incorrectly.

Validation

  • Built the ARM64 emulator and ran Is This Seat Taken? (PPSA37001) on a Mac mini M4 with 16 GiB and macOS 27.2.1. Metal frame captures verified the title menu, the Barcelona map, and the first level through its Perfect 6/6 results screen. Text was readable and the reported rectangle and results-screen corruption did not recur.
  • The focused cache-key regression passed. The full shader_cfg suite hit the same SPIR-V repeated-export failure before and after the change.

Audio quality and other titles still need validation. See the ARM64 bring-up notes for the build commands and limitations.

Prepared with AI assistance.

@LuizDusky
LuizDusky marked this pull request as ready for review November 23, 2026 23:26

@TxCsOffc TxCsOffc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed bring-up work and the shader/runtime fixes here!

There are several very valuable changes in this PR:

  • Fixing KernelSchedParam to match the 4-byte guest sched_param layout (src/kernel/pthread.h / pthread.cpp)
  • Wrapping scriptingGetMem and AddLibkernelUnityFunc with Loader::GuestCpu::GetHostFunctionStub (src/libs/libKernel.cpp)
  • Cooperative cross-thread signal queueing (PthreadQueuePendingSignal / PthreadWakeForSignal) and pthread_jit_write_protect_np(1) before HandleCallback
  • Embedded vertex attribute lowering in MslEmitter.cpp + metalRenderer.mm and keying BuildStageStaticKey on stride and index source (vid/iid) with unit coverage in tests/shaderCfgTests.cpp

However, I cannot merge this PR as-is because building kyty_emulator against KyTx's configured dbc-hbin/FEX-darwin fails to compile in src/loader/guest_cpu/fex_guest_cpu.cpp (commit 859671c7 unconditionally targets alamshafil/fexcore-darwin APIs):

src/loader/guest_cpu/fex_guest_cpu.cpp:236:4: error: no member named 'DCacheLineSize' in 'FEXCore::HostFeatures'
src/loader/guest_cpu/fex_guest_cpu.cpp:237:4: error: no member named 'ICacheLineSize' in 'FEXCore::HostFeatures'
src/loader/guest_cpu/fex_guest_cpu.cpp:352:44: error: too many arguments to function call, expected at most single argument 'NewThreadState', have 3 arguments
src/loader/guest_cpu/fex_guest_cpu.cpp:609:76: error: no type named 'SyscallArguments' in namespace 'FEXCore::HLE'
src/loader/guest_cpu/fex_guest_cpu.cpp:607:25: error: use of undeclared identifier 'OSABI'
src/loader/guest_cpu/fex_guest_cpu.cpp:607:47: error: no member named 'SyscallOSABI' in namespace 'FEXCore::HLE'
src/loader/guest_cpu/fex_guest_cpu.cpp:711:19: error: allocating an object of abstract class type 'KytySyscallHandler'
src/loader/guest_cpu/fex_guest_cpu.cpp:899:30: error: no type named 'ScopedJITWriteProtect' in namespace 'FEXCore::Allocator'

Requested changes

  1. Either preserve compatibility with dbc-hbin/FEX-darwin in fex_guest_cpu.cpp (for example via compile-time detection / a CMake option so both FEX ports build cleanly), or split the alamshafil/fexcore-darwin migration (fex_guest_cpu.cpp + docs/bringup/) into its own dedicated PR.
  2. That way, the pthread/libKernel fixes and the native Metal embedded vertex-pulling & cache-key fixes can be verified and merged cleanly right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants