* macos: fix Vulkan/Metal renderer on macOS 26+ and bump MoltenVK
Four related changes that together let the Vulkan backend boot a game
on Apple Silicon Macs running macOS 26.x. Each is needed independently;
the combination was tested on a Mac16,6 (M4 Max) / macOS 26.4.1.
CMakeModules/DownloadExternals.cmake:
Bump bundled MoltenVK from v1.2.9 to v1.4.1. v1.2.9 does not
recognize macOS 26 surface objects and traps with an Objective-C
"unrecognized selector" inside vkGetPhysicalDeviceSurfaceCapabilitiesKHR.
src/video_core/renderer_vulkan/vk_instance.cpp:
Disable VK_EXT_tooling_info on MoltenVK. MoltenVK advertises the
extension but does not expose vkGetPhysicalDeviceToolPropertiesEXT
through its dispatcher, so the call inside CollectToolingInfo()
trips a vulkan-hpp assertion in Debug and dereferences NULL in
Release.
src/citra_qt/bootmanager.cpp:
Force-install a fresh CAMetalLayer on the NSView before handing it
to createMetalSurfaceEXT. Qt 6.11's QWindow::MetalSurface does not
always back the view with a CAMetalLayer on macOS 26, and MoltenVK
1.3+ aborts in MVKSurface::getNaturalExtent() if the layer is not
the right class. Implemented via objc_msgSend so no .mm conversion
is needed.
src/citra_meta/CMakeLists.txt:
Gate LaunchScreen.storyboard behind 'if (IOS)'. The storyboard is
iOS-only and previously broke the Xcode generator on macOS with
"iOS storyboards do not support target device type 'mac'."
* Move Metal layer creation logic into MetalUtil::CreateMetalLayer ObjC++ function
This change makes the code much more readable, as the logic is now in its native language
---------
Co-authored-by: SergeyMild <>
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
* renderer_gl: Add `DebugScopes` to rasterizer and texture-runtime
Some debug scopes I added while working on https://github.com/azahar-emu/azahar/pull/2053 to help better attribute OpenGL API calls to the particular C++ callstack that called it. Helps greatly for diagnosing rendering issues.
* renderer_gl: Fix DebugScope unconditional incrementing of `global_scope_depth`
`global_scope_depth` was being incremented unconditionally in the ctor, but the
dtor was decrementing it conditionally based on
`Settings::values.renderer_debug`, allowing an imbalanced scope-depth hazard in
the case that `Settings::values.renderer_debug` is operated at runtime during a
debug-scope.
* Add a new Secondary Display Layout option on android that makes the secondary display honor swap button
* add quick menu option for secondary layout
* fix icon
* added other secondary layouts
* Add a new Secondary Display Layout option on android that makes the secondary display honor swap button
# Conflicts:
# src/core/frontend/framebuffer_layout.cpp
* add quick menu option for secondary layout
* fix icon
* added other secondary layouts
* updated secondary menu with functionality to switch external displays
Conflicts:
src/android/app/src/main/java/org/citra/citra_emu/display/SecondaryDisplay.kt
* safety checks for crash prevention
* make secondary menu only appear if a secondary display is available
* update default displayid behavior to exclude "Built"
* update odin 2 bugfix to handle other languages
* Apply clang-format
* Rename "Opposite of Primary Display" option for brevity
* Rename menu_secondary_layout_reverse_primary for consistency
* Rename SecondaryDisplayLayout::ReversePrimary for consistency
* first round of code fixes based on review
* Added android-side enable_secondary_display boolean setting, replacing secondary_display_layout = none on the android side. Exposed it in Layout settings, and secondary display layout is now only selectable if it is enabled. Support for the old option is still in the code, but should no longer be selectable.
Also renamed opposite to reverse_primary in a few other places.
* Update framebuffer layout and renderers to correctly render hybrid mode on both primary and secondary displays
* Apply clang format
* Re-apply terminology changes which were undone by a recent commit
* Removed unused string emulation_secondary_display_default
---------
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
Disabled texture units on OpenGL always use a null 2D texture, but there are
cases where the null texture should be a null cubemap rather than a 2D
texture to match the active texture binding state.
Fixes some errors that occur in `OpenGLState::Apply()` found
in Brain Age: Concentration Training.
Rather than emitting these subroutine functions for _every_ shader, only emit
the subroutines when the `LG2` and `EX2` instructions are actually used.
This saves a good chunk of memory across all shaders.
Inspired by Tanuki3DS.
Ensure the scheduler worker thread has finished processing all dispatched command chunks before the rasterizer cache's garbage collector destroys sentenced surfaces.
The `SETEMIT`/`SETE` instruction only actually encodes 4 bits of possible state,
but this is currently expanded into three separate bytes of
data(four with padding) and requires three separate byte-writes for the x64 and
a64 JITs to write into. These 4 bits from the instruction can instead be
compacted into a singular 1-byte write from the JIT by encoding these 4 bits of
state into a singular byte at JIT-time, and unpacking this data is instead done
by `GeometryEmitter::Emit`. This also allows the serializer to use a singular
byte for all 3 fields now as well.
* libretro core
* Bringing citra libretro implementation over
* libretro: hook up vulkan renderer
* libretro: github actions
* libretro: gyro
* libretro: core options v2
* libretro: on ios turn off shader jit if unavailable
* moltenvk 1.3.0 introduces 8-bit indexes but allocates 16-bit for metal; this ends up allocating stream buffer * 2 = 132MiB. Instead, just use 16-bit indexes. (This will be necessary for standalone when bumping moltenvk version.)
* libretro core: address review feedback
* libretro: microphone support
* cmake: Add ENABLE_ROOM_STANDALONE to list of incompatible libretro flags
* libretro: proper initial geometry
* libretro: fix software renderer
* libretro: address review feedback
* .github/libretro.yml: Pin macOS runners at macOS 26
* ci: Remove explicit selection of Xcode 16.0
* .github/libretro.yml: remove unnecessary windows builder apt commands
* .github/libretro.yml: bump min macos version to 11.0
* ci: Re-enable CI jobs for all libretro cores
This is under the condition that we don't introduce build cache for these builds
---------
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>