# Xbox changes to KytyPS5 KytyPS5 (upstream `KytyPS5/KytyPS5` at `7f145b0e2`) plus what it takes to run on the Xbox Series X: a UWP app with a D3D12 renderer. This branch (`xbox-on-upstream-2026-11-20-7f145b0e`) has one commit per topic, and each commit adds its row below, so the series can be read, tried and moved to a newer upstream one commit at a time. The "Checked" column says how a change was checked when it was made, before the work was regrouped into this series. ## Rules - One commit per topic: it says what it changes and adds its row here. - No local paths, game names or title ids. - Where in doubt, upstream is right. ## Changes | Change | What | Upstream files touched | Checked | | --- | --- | --- | --- | | UWP app: launcher | New folder `src/uwp`, its own CMake project: WinUI 2 launcher with a game library (game folders and `.zar` archives, also on the Xbox's USB drive through the `*FromApp` file calls), settings page, game menu, overlay, four Xbox controllers with the PS5 mapping (listed by model, with the Xbox's button symbols on a page of their own), a trophies page, `uwp.ps1` for building, packaging and the Device Portal | none | PC and Series X: works with the controller | | UWP app: the emulator inside the app | `KYTY_BUILD_UWP` compiles the emulator into the app: `*FromApp` file and memory functions (never read-write-execute; a look-up or read the Xbox's USB drive refuses for a moment is asked again), a backend seam with a placeholder D3D12 renderer, the Xbox controller as the guest's pad (View + right stick sets the pad's angle for its motion sensors, up to 180 degrees), guest audio through XAudio2, Roboto in the package for the games' text, `kyty://run` activation, the frame rate in the log | root and `3rdparty` `CMakeLists.txt`, `common/platform/sysWindows*`, `common/{archive,hostException}.cpp`, `kernel/memory*`, `libs/{audio,agc,controller}.*`, `libs/libFont.cpp`, `libs/libAmpr.cpp`, `common/emulatorConfig.*`, the command processor's and renderer's entry points | PC and Series X: games boot, with sound | | Lazy guest memory | Guest direct and flexible memory is reserved and each 64 KiB window committed on first touch, instead of one 13.8 GiB section the Series X cannot reserve (`src/xbox/lazyRegions.h`, `HandleCommitFault`, `EnsureGuestCommitted` before host calls). Always on in the UWP app, `KYTY_LAZY_MEMORY=1` on the desktop | `kernel/memory*`, `kernel/pthread.cpp`, `libs/{libKernel,network,agc}.cpp`, `loader/runtimeLinker.cpp`, `common/platform/sysWindowsVirtual.*`, `host_gpu/pageManager.*` | PC and Series X: games run with far less memory committed | | Renderer: shared logic | The guest shader translation and cache (`graphics/shader/programCache.*`) and the renderer logic that does not call Vulkan (caches, bindings, render targets, draw and dispatch preparation, pipeline state, tiling dispatches) are shared by both backends; the Vulkan calls move to Vulkan-only files next to them. Upstream's later edits of the moved code are carried over | most of `host_gpu/renderer/`, `shader/rectListShader.*`, root `CMakeLists.txt` | Desktop: built, not run | | D3D12 renderer | `host_gpu/d3d12/`: SPIR-V to DXIL through Mesa's `spirv_to_dxil`, pipelines, buffers in pooled heaps (D3D12 Memory Allocator), images, samplers, GPU tiling, draws, dispatches, presentation; upstream's user clip planes (in root constants), ordered-append dispatches (one group at a time, each with its group ID) and alpha-to-coverage, the Pro mode's linear PSSR (an image kernel) and HDR10 frames shown as SDR with upstream's curve. Not ported: upstream builds the stored pipelines at the start; the D3D12 cache keeps the translated shaders only (the Series X keeps no built pipelines, and building them ahead ran a game out of memory). Follows the Series X's limits (shader model 6.4, no barycentrics, mesh shaders or 16-bit ops; `xbox_gpu_limits` applies them on a PC); two-level BDA table (32 MB instead of 768 MB); R8 and R16 de-tiling without atomics | `common/emulatorConfig.*`, D3D12-only paths of the SPIR-V emitter, `renderer/cache/{bdaPageTable,bufferCache}.*`, `shader/programCache.*`, root `CMakeLists.txt`, `.gitmodules` | PC and Series X: 3D games draw correctly, videos play | | UWP app: running games | The controller keeps working in a game, and the game's rumble, adaptive triggers (on the Impulse Triggers) and haptic feedback (soft bumps on the small motor) come back to it; the overlay shows shaders, pipelines and the internal, scaled and display resolution; the pipeline cache is saved when a game ends (and can be kept across builds: a developer setting); 16:9 picture on a PC; guest code is executable before it runs; the app restarts itself when host memory sits in a range the game asks for; the guest's red zone is protected (`--redzone`) | `common/platform/sysWindowsVirtual.*`, `kernel/memory*`, `loader/runtimeLinker.cpp`, `libs/{audio,controller}.*`, `common/emulatorConfig.*`, `renderer/pipeline/pipelineCacheFile.*` | Series X: games that crashed at start now start; rumble, triggers and haptics work | | UWP app: the controller's headset | What a game plays on the DualSense's speaker plays on a headset on the Xbox controller, and the headset's microphone is the DualSense's (WASAPI capture; the `microphone` capability, Windows asks once). The headset: the controller's where Windows reports it, else the chat headset (the Xbox reports none for a controller), else just the chat microphone; a headset mark after the controller in the lists; the log lists the audio devices | `libs/audio.cpp` | Series X: the headset's speaker and microphone work in a game | | Speed: faults and samplers | Lazy memory answers page-watcher faults and host copies from per-window flags instead of `VirtualQuery` (a busy scene: 2 to 6-7 fps on the desktop, 1-2 to 4 in the app); D3D12 writes a set of samplers once per command list instead of per draw (a long list overflowed the 2048-sampler heap) | `kernel/memoryAddressSpace.inc` | PC and Series X: no more sampler errors in play | | D3D12: missing device features | Merged geometry (NGG) programs run as compute shaders where the device has no mesh shaders (`IR::MeshEmulation`; `mesh_compute` forces it); below shader model 6.6 shaders read guest memory through a table of 65,536 buffers instead of indexing the heap | the SPIR-V emitter and recompiler, `shader/{shader,programCache}.*`, `renderer/renderDraw.cpp`, `common/emulatorConfig.*` | PC: no change; Series X: the shaders that need them work | | Pager | Cold 64 KiB windows go to a temporary file while the guest is above its budget; a touch brings one back as a view of a section of its own, in one step. At the Series X's memory wall it evicts on a failed commit, follows the OS limit and caps the views. On by default where the app's limit is 8 GiB or less; `guest_ram_budget_mb` caps it or turns it off | `kernel/{memory*,fileSystem.cpp,pthread.cpp}`, `libs/{libKernel,libSaveData,network}.cpp`, `loader/runtimeLinker.cpp`, `common/emulatorConfig.*` | PC and Series X: games run for minutes without a crash; growing GPU memory still limits long sessions | | D3D12 debugging | The device-removed report says the DRED state; settings-file switches `xbox_limits_dxil_parts`, `dump_pipeline` (saves a pipeline's shaders) and `shader_override` (replaces a pipeline's DXIL with files) | `common/emulatorConfig.*` | PC and Series X: used to find a GPU hang | | Shader fixes for the Series X | Read first lane: native wave instruction when exec is true, and an empty ballot gives the lane its own value (helper lanes are not in the ballot at shader model 6.4: a pixel shader loop never ended); lane shuffles with per-lane lane numbers loop over the source lanes below 6.7; DXIL atomic calls are no longer `readnone`, so the driver keeps them | SPIR-V emitter (`spirvEmitter{Flow,Memory,Helpers,Program}.cpp`, `spirvEmitterInternal.h`), `HostShaderFeatures.h` | Series X: no more GPU hang | | Memory options | GPU memory savings (scratch buffer made when needed, small pool buffers committed, 16 MB allocator blocks); big block-compressed textures without their finest mip level (`texture_mip_skip`); videos decoded on several threads; a 'Memory and quality (for testing)' section on the settings page. The savings and the video threads are on in the UWP app; the desktop build keeps upstream's behaviour | `renderer/cache/{bufferCache,textureCache}.*`, `renderer/image/{imageInfo.h,imageView.cpp}`, `kernel/memory*`, `libs/avPlayer.cpp`, `common/emulatorConfig.*` | PC: much less GPU memory, the picture looked the same | | Debug tools | Game menu 'Save frame dump': the render targets of one frame as PNG files, a draw log of that frame (shaders, targets, textures, state, skipped draws, guest memory read by the command processor) and the images compute passes wrote; `frame_dump_snapshots` adds per-draw averages of large float targets; a GPU memory breakdown in the log; `auto_press_ms` for unattended runs; a crash report has the thread's last library calls, the game's last text (its own assert message) and the files it last looked for in vain, and the log the microphone ports, video players and decoders | `guest_gpu/graphicsRun.cpp`, `pm4Handlers.cpp`, `commandProcessor.h`, renderer caches, `renderDraw.cpp`, `renderCompute.cpp`, `common/emulatorConfig.*`, `libs/libs.h` (`PRINT_NAME`), `loader/runtimeLinker.cpp`, `libs/{guestPrintf,avPlayer,libVideoDec2,libAmpr,audio}.cpp`, `kernel/fileSystem.cpp` | PC and Series X: frame dumps and crash reports work | | Debug tools: no cost while off | The GPU memory breakdown, which walked every image and buffer under the texture cache's lock every 10 s, now has a switch on the settings page (Developer: 'GPU memory report in the log', `gpu_memory_log`, off by default); the command processor builds the text of its guest-read log lines only while a frame dump records | none | Built, not run | | GPU crash diagnostics behind a switch | DRED and the GPU trace (a marker before and after every draw and dispatch, which names the draw a hang or device removal happened in) cost time on every draw and were always on. They now need the settings page switch (Developer: 'GPU crash diagnostics', `gpu_crash_diagnostics`, off by default); `gpu_hang_exit_seconds` still turns the trace on. A hang report says when they were off | none | Built, not run | | D3D12: formats from the PS5's description | The renderer chooses a host format from the PS5's description; on D3D12 it is swapped for one with the same bits that can be rendered to (A2R10G10B10 to A2B10G10R10, B8G8R8A8 snorm/uint/sint to R8G8B8A8, B5G6R5 to R5G6B5, R4G4B4A4 to A4R4G4B4), and the channel order goes into the pixel shader's export and the texture view. A target the device cannot render to is reported once and its draw skipped, instead of stopping the emulator | `renderer/image/textureCommon.cpp` | PC and Series X: a game that stopped at boot now runs | | D3D12: fixes a second 3D game needed | Buffers that DXIL can only make UAVs (coherent reads, 8- and 16-bit element views) are UAVs in the shader, the root signature and the descriptors alike; a failed shader translation is reported every run and never cached (a cached failure had skipped draws silently); per-vertex pixel shader inputs are read with `AttributeAtVertex` (Mesa patch; the Series X has no barycentrics, see the known limits) | `shader/recompiler/ir/{ShaderIR.h,passes/ShaderInfoCollection.cpp}` | PC: looks as on the Vulkan renderer; Series X: runs | | D3D12: BC texture arrays on the Series X | The Series X's copies place the layers of BC texture arrays whose mip level is under 64 KB where its texture unit does not read them, so they read zeros or other levels (a 3D game's reflection probes: rough surfaces looked metallic and floors like mirrors). A check at device creation finds this; then BC 2D arrays live in CPU-visible memory and the CPU writes their levels (`WriteToSubresource`); each such upload waits for the GPU. The D3D12 self test (`d3d12_selftest`) maps which layers and levels read back wrong | `renderer/image/image.h` (D3D12 part) | PC: no change; Series X: shiny surfaces are matte again, as on the PC | | UWP app: local co-op | Up to four Xbox controllers play a game together: each is a player with a user of its own (the configured user, then users that sign in when their controller first connects and stay signed in) and a pad of its own (handles 1 to 4) with its own rumble, adaptive triggers and haptics. Built on upstream's local multiplayer: the Xbox's controllers are players of their own in its router, players 2 to 4 keep their saves apart and earn no trophies, as upstream has it | `libs/{controller.*,libUserService.cpp,audio.cpp}` | Four controllers in a game, each its own player | | UWP app: User Data Path | Saves, patches and trophies can live in a folder of the user's choice (a USB drive) instead of LocalState: `Config::user_data_folder` for the emulator, whose save, trophy and patch files go through `Common::File` (the file broker reaches the Xbox's USB drives); the settings page says whether the folder is writable and how to allow it. LocalState when the folder cannot be written | `common/{emulatorConfig.*,trophies.cpp,file.cpp}`, `libs/{libSaveData,libTrophy}.cpp`, `loader/gamePatch.cpp` | PC and Series X: saves and patches in the chosen folder work, also on a USB drive | | UWP app: remove compiled shaders | A button on the settings page (Developer) removes the games' compiled shaders (`LocalState\_PipelineCache`); each game compiles them afresh on its next start | none | Series X: works | | UWP app: RAM in parts in the overlay | Under RAM the overlay shows the game's memory in RAM, the part of it in the pager's swap file (with what is written to it and read back per second), the GPU's memory (part of RAM on the Xbox, on the graphics card on a PC) and the rest | `kernel/memory.{h,cpp}` | Series X: works | | Texture options for speed | The settings page's texture detail goes down to a sixteenth and counts textures as big from 256 px; uncompressed textures can shrink too (`texture_mip_skip_uncompressed`); texture sharpness adds up to four levels to the samplers' LOD bias (`texture_lod_bias`); anisotropic filtering can be turned off (`anisotropic_filtering`). As in the Jetsku-based build | `common/emulatorConfig.*`, `renderer/cache/textureCache.cpp` | Series X: works | | Memory lines that read well | Our memory lines in the log are short: the swap file and its traffic every 10 s (problems on a line of their own, only when there are some), the GPU's memory when it moved by 50 MB, the game's code and stacks when they changed; the detailed lines need the settings page's memory report. The overlay's log panel shows the game's running time before each line. Upstream's lines are as they were | `kernel/memory.cpp` | PC: works; the swap file's lines only on the Series X, not seen | | UWP app: the Xbox's look | Measured on the Series X's own screens: one bar of controller hints for every screen (the buttons' own symbols in the Xbox's colours on #050505, bottom right), one title size and the same margins. Settings as the Xbox's: categories on the left, the settings in columns of tiles (a choice shows its value and opens a list, a switch is a check box) and next to them the explanation of the one with the focus, in short paragraphs checked against the code; Game resolution became TV resolution, 1080p or 4K, all it changes. The controller page in the Xbox's cards of shortcuts. Texts say what holds on the device the app runs on. Smaller covers (88). The user data folder must be writable at a game's start | `uwp/src/xboxLook.*`, the pages, `uwp/src/emulatorHost.cpp` | Series X: matches the Xbox's own screens | | UWP app: what is going on, in the overlay | The overlay's sections: Frame (draws, draws skipped as not supported with the last reason, GPU time, per frame; GPU time from timestamps at the start and end of each command list), System (CPU, disk reads), RAM, Swap file (size, out, in; only where there is one), Shaders and Pipelines (each with the new ones of this run), Waiting (time per second spent compiling shaders and making pipelines, and waiting for the swap file). Rates and values per frame are over the last second | `graphics/host_gpu/{workCounters.h,d3d12/commandScheduler.*,d3d12/pipelineCache.*,d3d12/renderCommands.cpp}`, `graphics/shader/programCache.cpp`, `kernel/{fileSystem.*,memory.h}`, `libs/libAmpr.cpp` | Built, not run | | UWP app: built for the Series X's CPU | The UWP build and the libraries built with it target x86-64-v3 (AVX2, FMA, BMI: Zen 2 and PC CPUs since about 2013), tuned for Zen 2, with ThinLTO in release builds; Tracy's zones are left out (`KYTY_PROFILER`, on for desktop builds). The desktop build is unchanged | `CMakeLists.txt`, `3rdparty/CMakeLists.txt`, `common/profiler.*` | PC: the app starts; speed not measured | | Xbox builds on GitHub | A workflow, started by hand, builds the Xbox package on GitHub and publishes it as a release with the install steps. Packages are signed with a public test key for `CN=KytyPS5`, so every build installs over the previous one, and are versioned in UTC (1.1) | `.github/workflows/xbox.yml`, `src/uwp/uwp.ps1`, `src/uwp/KytyPS5-signing.pfx` | Series X: an update installs over an older build and keeps the app's data | | UWP app: the overlay's settings in the game menu | The game menu's Settings change the overlay during a game, with the settings page's tiles: what it shows (Off, the frame rate, Compact or Full), the log on screen (Off or 2 to 20 lines), the controllers on screen, its size. The settings page's Display has the same tiles, in two groups | `uwp/src/app.cpp`, `uwp/src/overlay.*`, `uwp/src/settingTiles.*`, `uwp/src/settingsPage.cpp`, `uwp/src/settings.*` | Series X: works | | UWP app: trophy notifications | A trophy a game unlocks shows as a system notification (the Xbox's popup and its list of notifications, Windows' notification on a PC): its name and "Trophy earned!". Selecting it opens the trophy (link `kyty://trophy?title=…&name=…`): its details over the game while one runs, else the trophies page at that game, reading only that game's trophy files. The D3D12 backend's stand-in for the desktop overlay's trophy popup hands the unlock to the app. No picture: the Series X refuses every picture in a notification (0x80004005, even the package's logo) | `graphics/host_gpu/d3d12/presentationStubs.*`, `uwp/src/trophyToast.*`, `uwp/src/app.cpp`, `uwp/src/trophiesPage.*` | Series X: notifications show; selecting one not tried | | UWP app: Skip intro logos and Refresh rate | Two of the desktop launcher's settings: Skip intro logos (games that ask the console skip their logo videos) and the refresh rate the console reports to games (30, 60 or 120 Hz; at 120 Hz games are told the console outputs 119.88 Hz). On the Xbox, more than 60 frames a second need V-Sync off: the Xbox reports vblanks at 60 Hz also with the TV at 120 Hz, and in Dev Mode shows the app at up to 60 pictures a second, as the setting's text says | `uwp/src/settings.*`, `uwp/src/settingsPage.cpp`, `uwp/src/emulatorHost.cpp` | Series X: games run up to 120 frames a second with V-Sync off, the TV gets 60 (DXGI frame statistics); Skip intro logos not tried | | UWP app: the game's start screen | While a game starts, the launch screen is its own start screen as the PS5 shows it (`sce_sys` pic1 with pic2's logo fading in, BC7 decoded with the vendored bcdec), or a card with its background and name when it has none. It closes when the game says it is ready (sceSystemServiceHideSplashScreen); a game that never says so is shown once it presents steadily | `graphics/host_gpu/d3d12/presentationStubs.*`, `3rdparty/bcdec` (new), `uwp/src/app.cpp`, `uwp/src/gameImages.*`, `uwp/uwp.cmake` | Series X: works | | UWP app: text input | When a game asks for text (its own text field, sceIme, or the keyboard dialog, sceImeDialog), a box over the game shows the game's text and the Xbox's on-screen keyboard opens; Done gives the text to the game, B cancels, and the game's input is paused meanwhile. Uses the emulator's keyboard state as the desktop's overlay does; games that read the controller themselves while typing are left alone | `uwp/src/keyboard.*` (new), `uwp/src/app.cpp` | Series X: works in a game's name entry | | ATRAC9: room after the input of split jobs | LibAtrac9 reads up to 3 bytes past its input. Split decode jobs copy the input into a buffer of exactly its size, and a UWP app's heap (the segment heap) can end it right before an unreadable page; the copy now has 16 bytes after the input | `libs/ajm.cpp` | Series X: the crash is gone | | UWP app: trophies in the game menu | Game menu › Trophies shows the running game's progress and trophies in the menu's side panel, read anew each time; A opens a trophy's details over the game. Settings › Developer › Reset all trophies removes the unlock files of all games after a confirmation. When the menu finds no trophies, the log says which step failed | `uwp/src/app.cpp`, `uwp/src/trophiesPage.*`, `uwp/src/settingsPage.cpp` | Series X: works; once showed no trophies until the next try | | UWP app: settings in clearer categories | Display, Overlay, Controller, System (user name, console language, Skip intro logos), Storage (game folders and the data folder), Memory and quality, Developer (Diagnostics and Testing). On the Xbox, texts no longer speak of a PC (F5, a developer script, the Copy command button) or of "the Xbox" | `uwp/src/settingsPage.cpp`, `uwp/src/launcher.cpp`, `uwp/src/app.cpp` | Series X: looked at by the user | | UWP app: the game's music in the library | A moment after a game's cover gets the focus, its `sce_sys/snd0.at9` plays in a loop, as on the PS4's home screen (ATRAC9 decoded with LibAtrac9, played through XAudio2, fading in and out). Settings › System › Home screen music turns it off, a switch as on the PS5. For a game without the file, the log names the sound files its `sce_sys` has | `uwp/src/titleMusic.*` (new), `uwp/src/launcher.cpp`, `uwp/src/settings.*`, `uwp/src/settingsPage.cpp` | Series X: works | | UWP app: the SRT walker's generated code | Upstream's SRT walker generates small x86 functions with xbyak, in heap memory that xbyak makes executable with VirtualProtect; on the Xbox such a page did not run, and a game crashed at the first call. In the UWP app the code takes whole pages from the emulator's memory functions, made executable once complete (VirtualProtectFromApp), as the game's own code; the desktop build keeps upstream's way | `graphics/shader/recompiler/ir/passes/SrtWalker.cpp` | Series X: the crash is gone | | D3D12: four cases that stopped the game | What upstream's Vulkan renderer does and the D3D12 renderer stopped on: the depth-to-color copy (the depth plane goes through a buffer, as D3D12 copies a depth plane only whole), a DMA copy within one buffer (through a second buffer), a command list that runs out of descriptors (a new list starts before a draw or dispatch whose tables might not fit; it holds 2048 samplers), and sample texel offsets the shader computes (Vulkan needs maintenance8 for them; here they move the coordinates by offset / the size of the level read, exact for that level) | `graphics/host_gpu/d3d12/renderCommands.cpp`, `graphics/host_gpu/d3d12/image.cpp`, `graphics/host_gpu/d3d12/buffer.cpp`, `graphics/host_gpu/d3d12/descriptorHeap.*`, `graphics/host_gpu/d3d12/renderExecutor.cpp`, `graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp`, `graphics/shader/recompiler/HostShaderFeatures.h` | Series X: not tried yet | | Modules start with a zero root frame | The init and fini functions of a game's modules (its C library first) run with rbp on a zero root frame, as the program's entry and its threads already do. A game whose heap tracer walks its frame pointers walked on into the emulator's own frames, read garbage there and crashed on the Xbox | `loader/runtimeLinker.cpp` | Series X: the game gets past its start (it stops later at another gap) | | D3D12: small gaps to upstream's renderer | Draws without attachments that ask for 2 samples rasterize with 4 (D3D12 offers 1, 4, 8 and 16 there); copies between images with different color transforms (the bgra16 swap, the 10-11-11 order) convert the bytes as upstream's copy does; where the device has no blend factor for the constant's alpha on color channels (the Xbox), the blend constant holds that alpha in all four channels for draws that need no constant color; an unmap waits for the GPU only when a cache holds the range, as upstream's renderer | `graphics/host_gpu/d3d12/{image,renderCommands,renderContext,commandScheduler,pipelineCache}.*`, `graphics/host_gpu/renderer/pipeline/pipelineState.cpp` | Series X: not tried yet | | D3D12: 64-bit image atomics under a lock | Shader model 6.4 has no 64-bit image atomics, which upstream's renderer uses where the GPU has them: the image is a two-dword image, and each atomic (swap, add, unsigned min and max, and, or, xor) takes a lock word of a 4 MB table, reads the texel, writes the result and releases the lock; lanes of one wave take turns. Exact, slower where many lanes hit one texel. Before, such a shader stopped the game | `graphics/shader/recompiler/backend/spirv/spirvEmitter{Image,Analysis,Module}.cpp`, `graphics/host_gpu/d3d12/{descriptorHeap,pipelineCache}.*`, `graphics/host_gpu/renderer/pipeline/descriptors.cpp` | Series X: builds; no game reached such a shader yet | | UWP app: upstream's other options | The settings page has the desktop launcher's remaining options that apply on the Xbox, with upstream's defaults: vibration intensity and DualSense speaker volume (Controller), trophy notifications and the network connection (System; the app may now use the local network), accurate texture synchronization, read back linear images and read back small tiled images (Textures), and the command-line flags PlayGo fallback, virtual VR headset, PS5 Pro mode and guest clock at PS5 speed (Testing) and Emulate PSN sign-in (System). Not ported: the lightbar color (Xbox controllers have none) and the key map (a mapping page is still to come) | `uwp/src/settings.*`, `uwp/src/settingsPage.cpp`, `uwp/src/emulatorHost.cpp`, `uwp/AppxManifest.xml.in` | Series X: not tried yet | | D3D12: views it has no descriptor for | Shaders read two kinds of views from a copy of their own, as D3D12 has no shader resource view for them: 2D and 2D array views of a 3D image's slices (upstream's 2D-array-compatible 3D images), and 2D and cube views that start at a later layer of an array. The copy is made again when the image changed since; where the CPU writes BC arrays (the Series X), the CPU copies them too. Before, the game stopped. Storage views that start at a later layer still stop it | `graphics/host_gpu/d3d12/{image.cpp,imageBacking.h}`, `graphics/host_gpu/renderer/image/image.h` (D3D12 part) | Series X: not tried yet | | D3D12: 96-bit textures | A 96-bit texture removes the Series X's device, so the renderer left them out and skipped the draws that use them. They are 128-bit textures now: uploads widen each texel and set the fourth channel to 1 (what the PS5 reads there), read-backs narrow it again (the row copy kernel) | `graphics/host_gpu/d3d12/{formats,image}.cpp`, `graphics/host_gpu/shaders/gpu_tiler_copy_rows.comp` (D3D12 only) | Series X: not tried yet | | D3D12: color reinterpreted as multisampled depth | Where a game uses a color image's memory as a multisampled depth image, upstream's renderer converts it with a draw of its own (each sample's depth is a channel of the color texel); the D3D12 renderer stopped the game there. It now makes the same draw with upstream's shaders | `graphics/host_gpu/d3d12/blitHelper.*` | Series X: not tried yet | | D3D12: clears of shared-exponent images | D3D12 can neither render to nor write E5B9G9R9 images, so clearing one stopped the game. The clear color is now packed into the format and copied in from a buffer filled with it | `graphics/host_gpu/d3d12/image.cpp` | Series X: not tried yet | | D3D12: vertex formats it has no input for | D3D12 cannot read scaled vertex data (8-, 16- and 10-bit integers the shader sees as floats) or 10:10:10:2 SNORM, so draws with them were skipped. They now come in as integers, and the vertex shader converts them as Vulkan does (`HostShaderFeatures::vertex_formats_as_integers`, D3D12 only) | `graphics/host_gpu/d3d12/{formats,pipelineCache}.cpp`, `graphics/shader/recompiler/HostShaderFeatures.h`, `graphics/shader/recompiler/backend/spirv/spirvEmitter{Module,Helpers}.cpp`, `spirvEmitterInternal.h` | Series X: not tried yet | | D3D12: textures read with texel positions | D3D12 samplers have no unnormalized coordinates, so such samples read the wrong spot. The shader now divides the positions by the size of the image's first level for samplers that ask for it (the sampler's FORCE_UNNORMALIZED is part of the shader's specialization; `HostShaderFeatures::unnormalized_samplers_in_shader`, D3D12 only) | `graphics/host_gpu/d3d12/{pipelineCache,samplerCache}.cpp`, `graphics/shader/recompiler/{HostShaderFeatures.h,ir/ShaderIR.h,ir/passes/ResourceMaterialization.*,backend/spirv/spirvEmitterImage.cpp}` | Series X: not tried yet | | D3D12: stencil values per face | D3D12 on the Xbox has one stencil reference and one pair of stencil masks for both faces, so draws whose faces differ in them used the front face's for both. Such triangle draws are now drawn once per face, each time with that face's values (a pipeline that culls the other face) | `graphics/host_gpu/d3d12/{pipelineCache.*,renderCommands.cpp}` | Series X: not tried yet | | D3D12: faster lane shuffles | The source-lane loops of the Series X shader fix now run only where needed and only as long as needed: reads of one lane for all lanes (read lane, read first lane, append) use the shuffle as it is; shuffles within quads (DPP quad_perm, DS_SWIZZLE's quad mode and in-quad masks) use quad operations in pixel and compute shaders; the other loops visit only the lanes the instruction can read and stop at the host's wave size; whether the source lane runs is a ballot bit instead of a second loop | SPIR-V emitter (`spirvEmitter{Flow,Memory,Helpers,Program,Module}.cpp`, `spirvEmitterInternal.h`), `HostShaderFeatures.h` | Series X: not tried yet | | D3D12: no empty command lists | The command processor often flushes twice in a row (an end-of-pipe event at the end of a guest submission, then the submission's end): a list with nothing in it now gets only its fence signal and stays open for the next commands, instead of being closed, submitted and reset. CommitBindings also reuses its sampler list instead of allocating one per draw | `graphics/host_gpu/d3d12/{commandScheduler.*,render.h,renderExecutor.cpp}` | Series X: not tried yet | | D3D12: views in other formats share the image's memory | D3D12 views must keep their resource's format family (the Xbox has no relaxed casting), so an image viewed in another family had a second resource, with the contents copied over whenever the other one wrote. On the Xbox (and a PC with Xbox limits) that resource is now placed on the image's own memory with the same description but for the format, where the texel size is the same and its flags are among the image's: nothing is copied, switching is an aliasing barrier, and the second resource takes no memory. D3D12 leaves those bytes undefined; the same description gives the same layout (as the earlier Vulkan-on-D3D12 experiment found on the Xbox) | `graphics/host_gpu/d3d12/{image.cpp,imageBacking.h}`, `common/emulatorConfig.*`, `uwp/src/emulatorHost.cpp` | Series X: not tried yet | | D3D12: 64-bit buffer and shared memory atomics under a lock | Shader model 6.4 has no 64-bit atomics on buffers or group shared memory either, so shaders with them failed. They now work as the 64-bit image atomics do: a lock word of the same table, both dwords read and written with 32-bit atomics, the lock released; lanes of one wave take turns. Exact, slower where many lanes hit one address; buffer locks go by the address within the buffer | SPIR-V emitter (`spirvEmitter{Memory,MemoryHelpers,Module}.cpp`), `HostShaderFeatures.h`, `graphics/host_gpu/d3d12/pipelineCache.cpp` | Series X: not tried yet | | D3D12: shadow samples with a bias or gradients | Below shader model 6.8 spirv_to_dxil drops the comparison of such samples and returns the depth itself, so shadows came out wrong. They now keep the comparison and lose the bias or gradients: pixel shaders sample at the level the hardware picks, other stages at level 0. Exact for shadow maps of one level | SPIR-V emitter (`spirvEmitterImage.cpp`), `HostShaderFeatures.h`, `graphics/host_gpu/d3d12/{dxilCompiler,pipelineCache}.*` | Series X: not tried yet | | D3D12: draws that sample what they render to | D3D12 has no feedback loops: a color target the same draw sampled was bound as a texture and a target at once, and a depth target it sampled was bound read-only, dropping the draw's depth and stencil writes. Now such a texture reads a copy of the view taken right before the draw (the image as it was; each pixel reads its own before writing it), and the target stays writable; read-only depth is kept for draws that write neither depth nor stencil. Copies are made only when the image changed since | `graphics/host_gpu/d3d12/{renderCommands,renderExecutor,image}.cpp`, `graphics/host_gpu/d3d12/{render,imageBacking}.h`, `graphics/host_gpu/renderer/image/image.h` | Series X: not tried yet | | D3D12: viewports with different Y directions | D3D12 viewports have positive heights, so the last vertex stage flips Y for a viewport that maps +Y down; spirv_to_dxil took the first viewport's flip for every viewport, so the others of such a draw were upside down. The flip masks now have one bit per viewport, and the spirv_to_dxil patch makes a shader that writes the viewport index take that viewport's bit | `graphics/host_gpu/d3d12/renderCommands.cpp`, `3rdparty/spirv_to_dxil/{spirv_to_dxil.patch,README.md}` | Series X: not tried yet | | UWP app: `.zar` games load faster | The archive was read through MSVC's file stream in pieces of 4095 bytes, with the C runtime's 4 KB buffer and without Windows' read-ahead: each 64 KB block of an archive was 16 reads of the drive, about half a millisecond each on the Xbox's USB drive. Its C stream now has a 64 KB buffer (a block is one read) and the file is cached as usual, so Windows reads ahead while the game reads in order | `common/platform/sysWindowsFileIO.cpp` (the UWP part) | Series X, unattended: the loading ends after 50 to 100 s instead of about 190 s | | D3D12: storage views at a later layer | A D3D12 storage view of a plain 1D or 2D image starts at the image's first layer, so a game that wrote a later layer of an array through such a view stopped there. Shaders now declare 1D and 2D storage images as arrays and write at layer 0 of the view, which is an array view starting at that layer (`HostShaderFeatures::storage_images_as_arrays`, set by D3D12 only; null storage views likewise) | SPIR-V emitter (`spirvEmitterAnalysis.cpp`, `spirvEmitterImage.cpp`, `spirvEmitterInternal.h`), `HostShaderFeatures.h` | Series X: a game that stopped at about 30 s gets to its character screen at 60 fps | | Windows: signals hand over from the APC | A signal to a thread in host code ran its handler on a new helper thread, created inside the APC that interrupted the thread. Creating a thread waits and allocates, and done in an APC that interrupted a Windows lock or wait it could take that wait's wake-up: the thread then slept for good, and a game whose garbage collector stops all threads by signals froze waiting for it. The APC now only puts the signal in a ring of slots and sets an event; a dispatcher thread starts the helper | `libs/libKernel.cpp` | Series X: a game that froze 2 to 4 minutes in kept running (seen by the user) | | D3D12: copies between compressed and uncompressed images | Vulkan copies between a block-compressed and an uncompressed format whose texel is as big as a block, one block to one texel (the copy's size in source texels); the D3D12 copy stopped the game. The copy goes through a buffer as for other format families, and the destination side counts in its own texels | `graphics/host_gpu/d3d12/image.cpp` | Series X: not tried yet | | UWP app: the guest's address ranges reserved first | The guest's address ranges were reserved when the emulator started; by then the app's own threads (started by the app and XAML) had put their stacks into the middle of the user range on the Xbox, splitting its 944 GB into 250 and 693 GB, and a game that reserves 768 GB at once stopped. The app now reserves the ranges first thing in `wWinMain`, before any of its threads exist, and the guest address space takes these reservations over | `kernel/{memory.cpp,memory.h,memoryAddressSpace.inc}`, `uwp/src/main.cpp` | Series X: not tried yet | | UWP app: a restart when host memory splits the user range | On the Xbox the main thread's stack and its neighbours (a few MB, placed at random in the first terabyte before the app runs) can sit inside the PS5's user range; a game that reserves 768 GB at once then fits in no part of it. Such a reservation now restarts the app with the same game (the restart for address collisions, up to 8 times), as another start places the stack elsewhere | `kernel/{memory.cpp,memoryAddressSpace.inc}` | Series X: a game restarted once, then its 768 GB reservation went through | | D3D12: upstream's performance counters | Where upstream counts in its Vulkan renderer only, the D3D12 renderer counts the same: the command lists handed to the queue, the waits for the GPU and their time, the pipeline states made and their time, the draws with their instances, the dispatches, swap chain resizes | `graphics/host_gpu/d3d12/{commandScheduler,masterSemaphore,pipelineCache,presenter,renderCommands,renderExecutor}.cpp` | Series X: the overlay's Detailed view shows them | | Threads named on Windows too | The game's threads get their names on Windows as on Linux and macOS (SetThreadDescription), and so do the emulator's main ones: GPU, Present, Main, Pager, Page faults; debuggers and the overlay's busiest threads show them | `common/threads.*`, `kernel/pthread.cpp`, `graphics/guest_gpu/graphicsRun.cpp`, `graphics/presentation/videoOut.cpp`, `loader/runtimeLinker.cpp`, `kernel/memoryAddressSpace.inc` | PC: desktop and UWP build | | UWP app: the overlay's Detailed view | A fifth overlay choice, Detailed: beside the box with the game, the frame rate and the graph, three panels grouped as the desktop's performance panel (upstream) groups them: Frames and CPU (1% low, worst frame, flips, late vblanks, the busiest threads, emulated instructions, missing HLE calls); GPU and GPU memory (draws, dispatches, submits, waits, faults, compile counts and times, transfers, evictions); guest memory, app memory, the swap file, files and audio. Bold headings, fixed widths, upstream's green, yellow and red. Off, Frame rate, Compact and Full stay as they were; their figures and Detailed's come from upstream's counters, which count while the overlay shows (our own compile timer and file read counter gave way to them) | `uwp/src/{overlay.cpp,window.cpp,emulatorHost.h,settings.h}`, `graphics/host_gpu/{workCounters.h,d3d12/pipelineCache.cpp}`, `graphics/shader/programCache.cpp`, `kernel/fileSystem.*`, `libs/libAmpr.cpp` | Series X: looked at by the user | | UWP app: cheats | The desktop launcher's Cheats dialog as a page in the look of the settings page: a game's options in the library have Cheats, with Local (the cheats saved for the game, a check box each and Turn all on and Turn all off, saved at once), Remote (the HEN Cheats Collection's files for the game, the installed version first; a file's panel shows its cheats and where Download saves it, all switched off) and Info (where the file is, from the data folder or the app's storage, and how to reach it from a PC); the header names the installed version, and the explanation sits under the categories, so entries have the page's width. The emulator applies them when the game starts, as before. Same checks as the desktop (title ID, version, executable, only what the emulator can apply) | none | Built, not run | | D3D12: upstream's float min/max on AMD GPUs | Upstream's renderer runs the guest's float min/max as the GPU's own instructions on AMD GPUs, which give the guest's NaN and signed-zero results, instead of a dozen instructions each. The D3D12 renderer does the same on AMD GPUs and on the Xbox, whose adapter reports Microsoft's vendor ID. As its shaders also pass through DXIL, a small compute program first runs upstream's edge cases on the device at the start, and the min/max stay emulated where a result differs. The log names the device's vendor and the outcome | `shader/recompiler/backend/spirv/SpirvEmitter.*` | Series X: the check passes; games run as before | | D3D12: the first active lane in 64-lane waves | The Series X runs programs of 32 lanes in waves of 64. Upstream's first active lane (V_READFIRSTLANE and waterfall loops) looked only at the first 32 lanes for such programs, so a loop whose active lanes were all past them read an inactive lane, never ended and hung the GPU. It now looks at all 64 where the host's waves are wider than 32, and wave reductions (min, max, or) reduce each half on its own | `shader/recompiler/HostShaderFeatures.h`, `shader/recompiler/backend/spirv/spirvEmitterProgram.cpp` | Series X: a level that hung the GPU within minutes runs | | D3D12: guest buffer reads without branches | Each read from a guest buffer was two nested branches (the lane's EXEC bit, then the bounds check), so the biggest shaders had thousands of blocks, which the Series X's driver compiled for up to 12 s each at every start. Where the shader fixes the buffer's slot, the read now runs for every lane and its value is selected afterwards: D3D12 buffer views read 0 past their end, and reads have no side effect. Buffers a lane chooses, guest addresses, LDS, scratch, writes and atomics keep their branches | `shader/recompiler/HostShaderFeatures.h`, `shader/recompiler/backend/spirv/spirvEmitterInternal.h`, `shader/recompiler/backend/spirv/spirvEmitterMemory.cpp` | Series X: a heavy game's pipelines compile in 39 s instead of 66 s at its start | | D3D12: S_MEMREALTIME without a shader clock | Upstream now reads the GPU's clock for S_MEMREALTIME and stops a shader that uses it where there is none. DXIL has no clock a shader can read, so on D3D12 it reads all ones, as before | `shader/recompiler/HostShaderFeatures.h`, `shader/recompiler/backend/spirv/spirvEmitterFlow.cpp`, `graphics/host_gpu/d3d12/pipelineCache.cpp` | Built, not run | | D3D12: upstream's occlusion queries | Upstream's --occlusion-queries: while a game's query is open, draws count their samples in a D3D12 query heap, and the game reads the counts. A switch under Testing, off as upstream; off, queries read as all visible | `graphics/host_gpu/d3d12/occlusionQueries.*`, `graphics/host_gpu/occlusionCounters.h`, `uwp/src/{settings.*,settingsPage.cpp,emulatorHost.cpp}` | Built, not run | | D3D12: upstream's color clears selected on the GPU | A compute check finds the slices of a render target's color metadata that are one fast clear, and D3D12 predication clears exactly those, so the CPU no longer waits to read the metadata back, where a check at the start finds that the device skips predicated clears. The overlay's Detailed view counts the readbacks and the checks | `graphics/host_gpu/d3d12/{tiler,image,computeKernels}.*`, `graphics/host_gpu/renderer/cache/textureCache.cpp`, `graphics/host_gpu/shaders/gpu_tiler_color_clear.comp`, `uwp/src/overlay.cpp` | Series X: fails the check (its driver makes predicated clears anyway), so the metadata is read back as before; a game's picture is right again | | D3D12: upstream's indirect draws from GPU-read records | ExecuteIndirect reads a game's indirect draw records on the GPU, so the CPU no longer reads records the GPU wrote. Where the shaders need each draw's first vertex and instance, a small kernel puts them before each record. Indirect mesh draws too, without a task shader: a kernel writes each record's draw parameters and groups for ExecuteIndirect (records whose packet patches a first instance stay on the CPU) | `graphics/host_gpu/d3d12/{renderCommands,renderExecutor}.cpp`, `graphics/host_gpu/shaders/gpu_tiler_draw_records.comp`, `graphics/host_gpu/renderer/renderDraw.cpp` | Built, not run | | UWP app: code that writes into its own page | The app never maps memory writable and executable at once, so code that keeps its variables next to it (a cheat's code cave, for example) could not finish its stores and the game stopped. The instruction emulator now makes such a store and the code continues | `common/platform/sysWindowsVirtual.*`, `common/hostException.cpp`, `loader/{x64InstructionEmulator,runtimeLinker}.cpp` | PC and Series X: a game with such a cheat runs past its start instead of stopping | | UWP app: stalls you can see in the overlay | The overlay keeps moving while the game waits: what it asks the emulator and the driver for is fetched on a thread of its own, so a call that waits (the driver's memory figures while it builds a pipeline) no longer stops the app's UI. After 250 ms without a frame the frame rate turns red and the frame time counts the stall; the graph shows the last 10 s scrolling with time, stalls as red blocks. While the emulator translates shaders or builds pipelines for half a second, a box of fixed width at the bottom right (part of the overlay) says which, for how long and how many so far; "Compile notice" in the overlay settings turns it off | `common/compileActivity.h`, `graphics/host_gpu/d3d12/pipelineCache.cpp`, `graphics/shader/programCache.cpp`, `uwp/src/{overlay.cpp,emulatorHost.*,settings.*}` | Series X: through a game's start the overlay keeps moving during stalls and pipeline builds, and the notice shows the builds | | UWP app: controller list with players, and DSU controllers (experiment) | Xbox controllers and the controllers of DSU servers (cemuhook's protocol, for example DualSenses that DSU Bridge serves from a PC) form one list. Each plays for a player, automatically or as chosen, also mid-game; several can share one, and every Xbox controller opens the game menu. With DSU Bridge's extension a DSU controller gets its player's feedback and audio. Off by default (Settings › Developer › Remote Controllers). Touchpad fingers no longer click | `libs/{audio.cpp,controller.*}`, `uwp/src/{dsu.*,input.*,padHost.*,controllerSettings.*,audio*.cpp}` | Series X with DSU Bridge: one DualSense as player 1 works well (user); several servers and players not tried yet | | UWP app: settings pages and game menu as on the Xbox | Settings › Controller opens its pages full screen, Overlay shows its tiles in two groups, and a text sits only next to tiles that need one. The game menu is a panel at the side over the dimmed game, with Controllers and Trophies in it | `uwp/src/{settingsPage.cpp,settingTiles.*,overlay.*,controlsPage.*,app.cpp,trophiesPage.*}` | Series X: the Controller pages, Overlay and the game menu seen (user) | | Pager: room for the emulator's own memory | At the app's memory limit the emulator's own allocations (D3D12 resources, the heap) failed and the app stopped. They now send some of the game's memory to the swap file and try again; a small heap reserve covers the bookkeeping this needs | `kernel/memory.{cpp,h}`, `kernel/memoryAddressSpace.inc` | Series X: under memory pressure, no more stops on D3D12 or heap failures | | D3D12: fixes a UE5 game needed | A compute shader that writes a BC texture's blocks through a 64- or 128-bit view (Vulkan's block-texel views) got a second resource of the texture's size in texels: 16 times the memory (930 MB for one texture) and copies with too-short rows, so the command list failed to close. The view now has one texel per block. Also: storage buffers with no memory get null views; half-to-integer conversions no longer need 16-bit ops (a rule in the Mesa patch) | none | Series X: the game that stopped at its start reaches its menus and play | | UWP app: PSN sign-in and error dialogs | A game that opens the system's sign-in or error dialog waits until it closes. The desktop draws them in its ImGui overlay, which the app does not have, so the game waited forever. The app now shows them over the game with the desktop's title, text and button; A (or B for the sign-in) closes them | none | Series X: a game's PSN sign-in at its start shown and closed, the game went on | | UWP app: thread priorities | The guest's high priorities mapped to the host's highest, above the emulator's own threads: worker threads that fill every CPU then starved whoever held a kernel lock, and unrelated calls froze for about 5 s until Windows rescued it. In the app all guest threads run at normal priority, and the GPU thread and the one that signals the guest's interrupts run above them. | `kernel/pthread.cpp`, `common/threads.*`, `graphics/guest_gpu/graphicsRun.cpp` | Series X: a heavy game's menu 1.3 to 17.2 fps, no freezes; a light game unchanged at 49 fps; a third game's title still 60 fps. | | Pager: at the limit of mappings | The console stops mapping at about 16,300 views of sections. Views now stay under it also while the guest swaps hard: cold views above the cap become private memory. A failed page-in evicts views first, as evicting private memory frees no mapping. Host copies into guest memory pin their windows until the copy is done: a window evicted on another thread's failed commit could leave under the copy. | `kernel/memoryAddressSpace.inc`, `xbox/lazyRegions.h` | Series X: peak views 16,500 with 8 failures down to 7,550 with none in one game's level; 0 failures at 12,484 views in a heavier game, whose "out of commit" stop is gone. The pinning is not proven in a level. | | UWP app: pipelines built ahead | The console's driver keeps no compiled pipelines across runs, so a game stalls on each one when it first needs it. Without a pipeline library the cache file now describes the pipelines, and two background workers build them, two pipelines at a time: from the library's "Play and build known pipelines" or the game menu's "Compile pipelines". Play alone builds none ahead. They wait while the game's room in RAM is under 512 MB. The overlay shows how many are ready. | none | Series X: compile stalls in a session about 95 s down to 5.3 s; a hub 46 s down to 4 s, settled at 50 s instead of 94 s. Built pipelines hold next to no memory. The game menu's entry and most games are not tried. A start's 74 known pipelines: 33.6 s one at a time, 19.8 s two at a time; no driver crash in four runs with two or four at once. | | Pager: compressed pool | Swapped windows can stay compressed (LZ4) in RAM in front of the swap file: a read cache, as every window still goes to the file, so a copy can go at any time. A window comes back in about 20 us instead of about 600 us, and a copy that fails its checksum falls back to the file. Off by default; the Memory group of the settings has its size, and the overlay shows it (Full and Detailed). | `kernel/memoryAddressSpace.inc`, `kernel/memory.h`, `common/emulatorConfig.*` | Series X, as tested in another build: a heavy game's menu 17.2 fps with 512 MB, 9.6 without (one run each); a lighter game's loading got worse with no gain in play, hence off by default. 0 bad copies. | | Overlay: numbers | All the overlay's digits are tabular, so values don't shift as they change, and its numbers use the region's thousands separator and decimal point. | none | Series X: seen in play. | | Hardware video decoding | The system video player's videos are decoded by the console's video decoder through D3D12 video on the renderer's own device (`libs/videoHardware.cpp`): the decoder on a thread of the app's own (on a game thread, an exception the driver raises and catches inside ends the app), its frames at the coded size (FFmpeg makes them at the display size, and the Xbox's decoder writes nothing into a smaller texture), each frame copied out of its GPU texture. FFmpeg comes from a fork of upstream's package, `Cosmo/ext-ffmpeg-core-xbox`, that adds the D3D12 hwaccels upstream's leaves out; videos the decoder can't take are decoded on the CPU. Settings page switch, on in the UWP app, off on the desktop. | `libs/avPlayer.cpp`, `common/emulatorConfig.*`, `CMakeLists.txt`, `.gitmodules` | Series X: 1080p H.264 videos decoded in hardware; a game's intro took about 150 MB less app memory than with a D3D11 device of its own. | | D3D12: faster pipeline compiles | The console's driver keeps no built pipelines and spends seconds on each large shader. The spirv_to_dxil patch moves code next to its uses before writing the DXIL (sink, move and global code motion; peephole select up to 64 instructions): shorter live ranges, which the driver compiles faster. Loads from scalar registers (SMEM), the same in every lane, read the guest buffer table directly instead of through a waterfall loop. | `3rdparty/spirv_to_dxil/{spirv_to_dxil.patch,README.md}`, SPIR-V emitter (`spirvEmitterMemory.cpp`, `spirvEmitterInternal.h`) | Series X: 5 heavy compute shaders 47 s down to 31 s in the driver (the same shaders in one session); in play no errors, same fps, pictures right. The SMEM part: about 13% less in one comparison that did not start from the same save. | | UWP app: storage readback and relaxed float switches | Upstream's two new options, off as upstream: Read back storage images (Textures) copies images that shaders write back to the game's memory when the game flushes the GPU cache for the CPU, and Relaxed shader float math (Testing) has shaders use the GPU's own float operations. D3D12's shader translation takes the float option too | `uwp/src/{settings.*,settingsPage.cpp,emulatorHost.cpp}`, `graphics/shader/programCache.*`, `graphics/host_gpu/d3d12/pipelineCache.cpp` | Series X: not tried yet | | UWP app: build known pipelines, then play | A third entry in the library's options: the game's code starts once the pipelines earlier runs described are built, four at a time (two while a game plays), with nothing else compiling and the game's memory not yet taken. The overlay's compile notice shows the builds. Play compiles on demand as before; Play and build known pipelines builds while the game runs | `uwp/src/{launcher,app}.cpp`, `common/pipelinePrewarm.h`, `emulator.cpp`, `graphics/host_gpu/d3d12/pipelineCache.*` | Series X: not tried yet | | Pager: what leaves | Under a tight budget the pager took memory the game uses: whatever nobody had touched for a second. Now the window untouched longest leaves first (after 8 s; above the budget whatever is cold goes at once, shielded windows last), windows that come straight back are shielded, windows of zeros are not written, windows the GPU caches watch for writes may leave, and windows in the swap file that the emulator keeps reading come back. The headroom below the app's limit is never handed to the game. The rules follow the swap of the Jadyx emulator. `guest_ram_pager_mode` 4 runs the rules of before | `kernel/memoryAddressSpace.inc`, `xbox/{lazyRegions,pagerRules,pagerStore}.h` | Series X, a heavy game from its start to its level map, nobody playing, 270 s (2 runs against 3 with the rules of before): 3,850-3,915 frames against 3,152-3,268, the game's threads waited 53-61 s against 84-91 s, 3.8 GB read back against 4.8-6.4 GB (measured while the headroom could still give way; not measured again since). Three lighter games run at 60 fps as before. Not tried in play | | D3D12: the texture collector frees after the read-back landed | Under pressure the collector reads a GPU-written image back to the game's memory and frees it. It freed the image at once, while the copy landed only when the GPU had completed the tick: over whatever the game had put into that memory meanwhile, as the freed image's pages were no longer watched. A console's budget puts the collector under pressure from 1.5 GB of GPU memory on. The D3D12 renderer now completes the tick and frees those images after their copies landed, as the buffer cache's collector does; the Vulkan renderer is as upstream's | `graphics/host_gpu/renderer/cache/textureCache.cpp` | Series X: five games run as before. The stop that led here (a racing game, a command buffer of zeros, "unknown op") still happened in one of three runs with the change: not its only cause, if one at all | | D3D12: 3D and cube textures read with texel positions | The shader's division of texel positions by the image's size (see above) was written for 1D and 2D images, and a shader that read a 3D image or a cube that way stopped the game. A 3D image divides all three coordinates; a cube is sampled along a direction, so nothing is scaled | `graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp` | Series X: a racing game went past the shader that stopped it; the picture was not looked at | | Host copies: no page left read-only | A copy into protected guest pages (a GPU image written back to the game's memory) opens them and hands the protections back afterwards. A page whose watcher went away meanwhile got its old read-only protection back, for nobody, and the next write to it faulted for ever: a game froze in its first seconds. Such a page now gets the protection the game asked for | `kernel/memory.cpp` | Series X, one game, short starts: 11 of 28 froze before, 30 of 30 ran with the fix. In one test build with the window widened: 3 of 6 froze the old way, 8 of 8 ran with the fix | | D3D12: geometry shaders as compute shaders on 64-lane waves | A game's geometry shader runs as a compute shader where the device has no mesh shaders (the Series X). spirv_to_dxil now compiles such programs without the code motion added for large shaders (sink, move and global code motion): with it, one game's sprites lost a corner on the Xbox. The workaround before (two lanes per thread) doubled the program, and another game's doubled program crashed the Xbox's driver compiler | `3rdparty/spirv_to_dxil`, `graphics/host_gpu/d3d12/{dxilCompiler,pipelineCache}.cpp`, `graphics/shader/{programCache.cpp,shader.*}`, `graphics/shader/recompiler/backend/spirv/spirvEmitter{Helpers,Mesh,Module}.cpp` | Series X: the sprites whole with every pipeline compiled anew; the other game past its driver crash | | Textures: lower detail and images the GPU writes | With texture detail below full, a texture's host image leaves out its finest levels. A game sampled a 1920x1080 image with six levels and then wrote it with the GPU; under memory pressure the written image was read back to the game's memory with copies of levels and sizes the shrunk image does not have, and the app stopped with "close command list failed". A shrunk image that is asked for as a render target or storage image is now replaced by one of full size, and a shrunk image is never read back | `graphics/host_gpu/renderer/cache/textureCache.cpp` | Series X, unattended, with the settings that stopped one game (after 139 s in one run of four, and twice in play): four runs of 240 s without the error, the game's menus opened by hand in one of them; the log shows the replacement. PC: the replacement shows there too | | D3D12: draw targets and mesh indices as upstream | Upstream keeps a draw's color and depth targets on the executor and has mesh shaders read a draw's indices by address; D3D12 now does the same and builds its pipeline keys from those targets. D3D12 shaders cannot read by address, so a mesh draw and its compute emulation get the index buffer's descriptor slot and byte offset instead and read through the guest buffer table. Saved pipelines of earlier builds are not used. | `d3d12/{renderCommands.cpp,pipelineCache.*}`, `graphics/shader/recompiler/{HostShaderFeatures.h,frontend/translate/Translate.cpp,backend/spirv/spirvEmitter{Memory,Module}.cpp}` | Console test pending | | Kernel: backed reads as upstream | Upstream's page table of section-backed memory: reads of backed guest memory go through it without a lock, and a fully backed range skips the walk through the virtual ranges. The virtual range table keeps its recursive lock (upstream guards it with one global lock). Lazy memory (the Xbox) has no backing table and keeps the pager's paths. | `kernel/{memory.cpp,memoryAddressSpace.inc}` | Console test pending | | UWP app: draws per GPU submission | Upstream's `--flush-draws` (7d4e0d9b) as a setting in Testing, 0 (off) as upstream: with a number, the recorded work is submitted to the GPU after that many draws. Applies when a game starts. | `uwp/src/{settings.*,settingsPage.cpp,emulatorHost.cpp}` | Console test pending | | D3D12: 64-bit buffer reads under the atomics' lock | A read of an aligned pair of dwords, which may be a 64-bit atomic's value, takes the lock the emulated 64-bit atomics take (the Xbox has no 64-bit atomics in shaders) and reads both dwords under it. It read them through the buffers' 64-bit view, which the emulation does not make, so one game's shader failed to translate ("storage buffer descriptor array was not emitted") | `graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp` | Series X: the game past that shader | | D3D12: one and two component scaled vertex formats | D3D12 has no scaled vertex formats: they come in as integers that the vertex shader converts. R8, R16 and R8G8 scaled were missing from that list, so draws that use them were skipped. | `graphics/host_gpu/d3d12/formats.cpp`, `graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp` | Console test pending | | UWP app: a game's details | Details in a game's options: its title ID, version, required system software, content ID, folder or archive, whether it supports PS5 Pro mode (the desktop launcher's bit) and every other field of its param.json, read before it starts. | `uwp/src/launcher.cpp` | Console test pending | | D3D12: upstream's batched BDA uploads | Upstream (bc934ef03) uploads the guest memory shaders read by address in one batch behind one barrier pair, and re-uploads CPU writes only to pages a shader has read (marked in its address table). D3D12 takes the batch; its table has two levels and no marks, so a CPU write re-uploads its pages as before. | `renderer/cache/bufferCache.cpp`, `d3d12/{buffer.*,renderContext.cpp}` | Console test pending | | Kernel: refused direct memory calls in the log | A direct memory allocation or mapping the kernel refuses writes one line to the log of every build: the call, which check refused it, the error and the arguments. A game that stops on such an error otherwise leaves only its own assert. | `kernel/memory.cpp` | Desktop build | | Lazy memory: protect allocation by allocation | A page watcher protects a run of neighbouring windows in one call. After heavy paging some of them are allocations of their own, the call failed and the page manager ended the app without a word in the log. The protect now goes allocation by allocation then, and the page manager's fatal message is in the log. | `common/platform/sysWindowsVirtual.cpp`, `host_gpu/pageManager.cpp` | Console and PC: runs past the point where it ended | | UWP app: the app's memory in the log | A line with the free memory and its parts (game in RAM, GPU, swap file) every 10 s, below 1 GB free every half second when it moves, and a line for each memory warning of the system, so that a log shows what filled the memory when a game ends at the app's limit. | none | Console test pending | | D3D12: FSR as the PSSR upscaler | Upstream's PSSR upscaler option (e35360fa4) on the Xbox: Linear (the default) or FSR. Upstream loads AMD's DLLs from a folder the user picks, which an app on the Xbox cannot; the UWP build compiles FSR 3.1.4 from the FidelityFX SDK v1.1.4 source (MIT, fetched with a pinned hash) into the app and ships AMD's license next to it. The upscaler uses the game's PSSR color, depth and motion, and falls back to linear PSSR without them. The overlay's Scaled row says FSR while it upscales. | `d3d12/{fidelityfx.*,renderPssr.cpp,renderContext.*}`, `uwp/fidelityfx.cmake` | Console test pending | | D3D12: FSR frame generation | AMD FSR 3.1 frame interpolation (the same MIT SDK source) makes a frame between two flips from the game's PSSR depth and motion and shows it in between, when the game flips at half the refresh rate on SDR. A switch under Testing, off by default; while it is on, the overlay's Generated row shows the made frames per second and the game's own. | `presentation/videoOut.cpp`, `presentation/presenter.h`, `d3d12/{fidelityfx.*,presenter.cpp}` | Series X: runs with the switch on; the Generated row shows why no frame is made yet (no game with PSSR ran at half the refresh rate) | | D3D12: FSR 1 upscaling | For every game: AMD FSR 1 (v1.0.2, MIT, `3rdparty/fidelityfx-fsr`) scales a picture smaller than the screen and sharpens it, instead of the plain scale. A choice under Testing (off, sharpness low/medium/high), off by default; HDR pictures keep the plain scale. The overlay's Display row says when it scales. | `d3d12/presenter.cpp`, `shaders/gpu_blit_fsr1_*.frag` | Series X: works | | UWP app: the screen picture at the TV's size | On an Xbox the app's window has 1920 × 1080 pixels whatever mode the TV is in, so a 4K picture reached the screen at 1080p and the console scaled it up again. The swap chain now gets the size of the TV's current mode (HdmiDisplayInformation, as RetroArch does on the Xbox), and its inverse transform keeps it in the panel. Elsewhere nothing changes. | `uwp/src/app.cpp` | Series X: a 4K game reaches the screen at 3840 × 2160 (overlay Display row, 4K screenshots) | | UWP app: Display settings in groups | Settings › Display has two columns: Your TV (the Xbox's TV mode, read only), What games see (PS5 resolution, PS5 refresh rate, PS5 Pro mode), Upscaling (Output resolution, PSSR upscaler, FSR 1) and Frame rate (V-Sync, FSR frame generation). PS5 Pro mode, PSSR upscaler, FSR 1 and FSR frame generation move there from Testing; Stretch to screen moves to Testing. Shorter texts in the Xbox Settings' style. Output resolution (Xbox only): Match TV, or 1080p, which keeps the window's pixels and lets the console scale them. | `uwp/src/settingsPage.cpp`, `uwp/src/settings.*`, `uwp/src/app.cpp` | Series X: looked at by the user | | UWP app: version and commit in the overlay | In Full and Detailed, the overlay's last line shows the app's version and the commit it was built from, in grey; -dirty marks a build from uncommitted changes. | `uwp/src/overlay.cpp` | Series X: looked at by the user | | Xbox builds: the FidelityFX SDK kept between runs | The workflow downloads AMD's FidelityFX SDK v1.1.4 archive (about 200 MB) once, checks it against the checksum that `src/uwp/fidelityfx.cmake` names, keeps only its `sdk` folder and license, and caches them for later runs; the build reads them through `KYTY_FSR_SDK_ROOT`. | `.github/workflows/xbox.yml` | Built, not run (the step's commands tried locally on the same archive) | | UWP app: graphics settings during a game | The game menu has a Graphics page next to Overlay (its panel on the right, the game in view): FSR 1, Output resolution, V-Sync, FSR frame generation (off, and on again only if it was on when the game started), draws per GPU submission and the texture settings. A change applies at once; texture sizes reach the textures loaded afterwards. The values the page changes are read atomically, and D3D12 samplers are kept per filtering setting. | `common/emulatorConfig.*`, `guest_gpu/graphicsRun.cpp`, `guest_gpu/command_processor/commandProcessor.h` | PC: the page by keyboard (FSR 1, V-Sync and Texture sharpness change at once and are saved); Series X: played with the page, Output resolution after the fix of its picture size | | D3D12: tessellation through compute passes | The Series X's tessellator emits no points, so a tessellated draw runs as a capture draw (the LS stores its outputs per vertex), the HS as a compute shader (a workgroup per patch), a port of the D3D11 reference tessellator (Mesa's copy, MIT) and the TES as the vertex stage of an indirect draw of its triangles (`IR::TessEmulation`). Settings > Testing > Tessellation is upstream's --tessellation, off by default; off, the draws are skipped and the overlay names them. | `graphics/host_gpu/renderer/renderDraw.cpp`, `graphics/shader/shader.*`, `graphics/shader/recompiler/backend/spirv/*` | Series X: played with the switch on, in a game that does not tessellate; a developer setting, to be tried more over time | | UWP app: game clock at the TV's rate | On the Xbox the games' vblank clock runs at the TV's own refresh (59.94 instead of 60, read from the HDMI mode at game start), so the emulator does not make one picture more than the TV shows about every 17 s. No setting; the PC keeps the whole number, as upstream | `presentation/videoOut.cpp`, `common/emulatorConfig.*`, `uwp/src/emulatorHost.cpp` | Series X, a game at 60 with V-Sync off (DXGI frame statistics, 60 s each): no picture skipped with the TV's rate, 2 skipped with the whole number | | UWP app: no V-Sync on the Xbox | The Xbox shows frames as soon as they're ready; the V-Sync tile is gone from Settings and the game menu's Graphics page there, and a saved V-Sync on is not used. With the games' clock at the TV's rate it made no difference. The PC keeps V-Sync | `uwp/src/{emulatorHost.cpp,settingsPage.cpp,gameGraphics.cpp}` | Series X, DXGI frame statistics, same input, clock at the TV's rate: V-Sync on and off alike, no picture skipped (a game at 60 for 90 s, a game at 19 fps for 160 s) | | D3D12: 32-lane programs in 64-lane waves | D3D12 on the Xbox runs every shader in 64-lane waves, so one holds two waves of a program written for 32 lanes. What such a program sees of other lanes now comes from its own half: lane numbers (V_MBCNT, DS_ADDTID), lane masks, the scalar branches' any and all, V_READFIRSTLANE and V_READLANE, DPP and shuffle lane checks, wave atomics' elected lane, swizzled buffers' lane index. Pixel programs take only lane numbers and lane masks from their half; their any/all and lane reads stay the whole wave's (per half, a glass came out opaque or the GPU hung) | `shader/recompiler/backend/spirv/spirvEmitter{Flow,Helpers,Memory}.cpp`, `spirvEmitterInternal.h` | Series X: a cloud layer drawn through emulated mesh programs, hard patches before, soft as on the PC; a refracting glass translucent as on the PC; another game at 60 fps for 2 min | | Save data: written again when the drive refuses | The Xbox's USB drives refuse a UWP app now and then for a moment; reads were already asked again, saves were not, so a refused save was lost and the game started over the next time. Writing a save file and making its folder are now tried again for up to 2 seconds, and the log says when that was needed or still failed | `libs/libSaveData.cpp` | Not tried on the console yet | | UWP app: right stick up tips the motion sensors back or forward | Settings › Controller › Motion sensors: with View held, pushing the right stick up tips the emulated DualSense back (its top toward you, as before) or forward. Back suits games that aim with the controller, forward games you steer by tipping it | `uwp/src/{input.*,settings.*,settingsPage.cpp,emulatorHost.cpp}` | Not tried on the console yet | | UWP app: game folders from Development Files | The Xbox's folder picker doesn't show `D:\DevelopmentFiles`; there, Settings › Storage › Add folder is a menu: File Explorer (the picker) or Development Files, a panel with its folders and their game counts. Choose folder (data folder) is a menu too: File Explorer, Development Files (when writable), Internal storage | `uwp/src/{folderPanel.*,settingsPage.cpp,gameLibrary.*}`, `uwp/README.md` | Series X: tried by the user (both menus, the panel, a game and a data folder in Development Files) | | UWP app: a folder for logs and dumps | Settings › Storage › Logs and dumps: on the Xbox internal storage or a folder in Development Files, where a PC can open them; on a PC any folder apps may write. The emulator's log and frame dumps follow from the next game, the app's log from the next start; a folder that can't be written leaves them in LocalState. `uwp.ps1 logs` and `run` read them there | `uwp/src/{settings.*,settingsPage.cpp,emulatorHost.*,log.*,fileAccess.*,folderPanel.*,overlay.cpp}`, `uwp/uwp.ps1`, `uwp/README.md` | Series X: tried by the user (both logs in a Development Files folder); PC: not tried | | UWP app: CPU panel in the overlay | Settings › Overlay › CPU on screen (off): a panel at the top right, Controllers to its left. The app's CPU share and the cores (Windows' list: a box per core, a bar per logical processor, the system's cores in grey) and up to 10 busiest threads. A processor's load comes from `QueryIdleProcessorCycleTime`, a desktop function the Xbox has; without it the boxes don't show. The Xbox reserves the app's cores about a second after it starts, so the panel reads that anew each second (the log says each change). Not with Detailed | `uwp/src/{processorLoad.*,overlay.cpp,settings.*}`, `uwp/README.md` | Series X: screenshots in a game (4 cores, the system's core grey), tried by the user; PC: not tried | | UWP app: swap file in the frame graph | Settings › Overlay › Swap file in the graph (shown while Full is chosen; off): a stripe at the bottom of Full's frame graph, on its time axis: white where data went to or came from the swap file (brighter with more), black where the game waited for it (as long as the wait, darker the larger its share) | `uwp/src/overlay.cpp`, `uwp/README.md` | Not tried on the console yet | | UWP app: Pipelines and Launch activity in a game's options | Title ID and Version side by side. Pipelines (Build when needed, Build known ones alongside, Build known ones first; one choice for every game, kept in the app's state) replaces the three play entries and applies to A on a cover too. Launch activity... lists the activities of a game whose param.json permits upstream's launchActivity intent (or says why there are none) and starts the game in the chosen one for that run (upstream's `--launch-activity`); `kyty://run` takes `&activity=`, and a restart for an address collision keeps it. | `emulator.cpp` (a comment) | Not tried yet | ## Known limits on the Series X - **Vertex values in pixel shaders**: the Series X has no barycentrics, so a pixel shader that reads the values of its triangle's three vertices (RDNA2 custom interpolation: P0, P10, P20) gets the interpolated value as P0 and zeros as P10 and P20 (`HostShaderFeatures.h`, `EmitInterpolationParameter`). Plain interpolation comes out right; surfaces whose shaders need the real vertex values show black speckles. Giving the interpolated value for all three, as older Kyty did, speckles too. On a PC the Mesa patch reads them with `AttributeAtVertex`; `xbox_gpu_limits` shows the Series X's result there. - **DLSS for PSSR**: upstream’s model and preset options apply to its NVIDIA Vulkan path. D3D12 defaults to linear PSSR and can use the FSR option for compatible temporal PSSR requests. - **Multisampled storage images**: a shader that writes a multisampled image stops the game; D3D12 below shader model 6.7 has no writable multisampled textures. ## Notes on running the CPU tests - The tests that start the guest memory (`virtual_memory_allocation`, `guest_red_zone_patcher`, the compute tests with a context) each reserve 13.8 GB of address space on the desktop. Run in parallel (`ctest -j 4`), several of them fail with "could not reserve 13824 MB" when the PC's commit limit is reached. This is not a bug in the code: run them one at a time (`ctest -j 1`, or `ctest --rerun-failed -j 1`) and they pass. The UWP app avoids this with lazy memory (`KYTY_LAZY_MEMORY=1` on the desktop). - `shader_recompiler_compute` and `pm4_context_state` fail in `Pm4NativeTargetGeometry` ("legacy register holes"); they failed the same way before these changes. ## Research guards the D3D12 renderer does not apply Guards G1 to G15 of the research are applied as `docs/d3d12-backend.md` lists, except these: - **G6** (loops with `break` need `[loop]`): there is no HLSL to annotate, because shaders go through Mesa's `spirv_to_dxil`. Not applied, not seen to fail in the test game. - **G3** (uint view of a BC texture) and **G7** (stencil plane copy to a buffer): not handled specially; not run on the console. - **G5** and **G13**: nothing in the shaders of the test game needed them, so they are neither applied nor tried. - **Tessellation**: runs as compute passes behind a Testing switch, off by default as upstream (see the change list); isoline patches are skipped, and the patches past a draw's buffers are dropped. Mesh programs run as compute shaders where the device has no mesh shaders (see the change list). - **Native ray tracing**: upstream's `--native-rt` (eb3e86d5a), which mirrors the games' BVHs into Vulkan acceleration structures, is not in the D3D12 renderer: UWP apps on the Xbox have no DirectX Raytracing. - **Shader model 6.6 heap indexing**: below 6.6 (the Series X has 6.4) shaders read guest memory by address through a table of buffers instead (see the change list).