aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMako <137927095+Takoroka@users.noreply.github.com>2026-11-01 10:18:27 -0500
committerGitHub <noreply@github.com>2026-11-01 10:18:27 -0500
commit89dd760cc44aec0a9401809f3837917645d8af25 (patch)
tree41d6ea03c7be56feb0b2573ab199a43c7c9ab5e0 /src
parentadae7635708e155d967e84d7ad84bf63c5203409 (diff)
parent76adfd3e9508bf685b0dc5354d6821148139cef1 (diff)
Merge pull request #143 from Sssnowyyy/macos
macOS (Apple Silicon) build fixes and release builds
Diffstat (limited to 'src')
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp4
-rw-r--r--src/video_core/texture_cache/texture_cache.h4
-rw-r--r--src/yuzu/Info.plist2
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3.cpp14
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl3.h6
-rw-r--r--src/yuzu_cmd/yuzu.cpp3
7 files changed, 31 insertions, 4 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index d3e7b03cd2..76c5019788 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -152,7 +152,7 @@ add_library(
set_source_files_properties(zbic_compression.cpp PROPERTIES
INCLUDE_DIRECTORIES "${ZBIC_INCLUDE_DIR}"
- COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:Clang,GNU>:-Wno-unused-function;-Wno-missing-declarations;-Wno-shadow>;$<$<CXX_COMPILER_ID:MSVC>:/wd4505;/wd5245>")
+ COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-unused-function;-Wno-missing-declarations;-Wno-shadow>;$<$<CXX_COMPILER_ID:MSVC>:/wd4505;/wd5245>")
if(WIN32)
target_sources(common PRIVATE windows/timer_resolution.cpp
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 2c64f3375b..05511c10e1 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -256,6 +256,10 @@ Shader::RuntimeInfo MakeRuntimeInfo(std::span<const Shader::IR::Program> program
if (device.IsMoltenVK()) {
for (size_t i = 0; i < 8; ++i) {
const auto format = static_cast<Tegra::RenderTargetFormat>(key.state.color_formats[i]);
+ if (format == Tegra::RenderTargetFormat::NONE) {
+ info.color_output_types[i] = Shader::AttributeType::Float;
+ continue;
+ }
const auto pixel_format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(format);
if (VideoCore::Surface::IsPixelFormatInteger(pixel_format)) {
if (VideoCore::Surface::IsPixelFormatSignedInteger(pixel_format)) {
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index c8aaf8dff5..3b783fc6c6 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -3063,6 +3063,10 @@ template <class P>
void TextureCache<P>::CopyImage(ImageId dst_id, ImageId src_id, std::vector<ImageCopy> copies) {
Image& dst = slot_images[dst_id];
Image& src = slot_images[src_id];
+ if (True(dst.flags & ImageFlagBits::UnwrittenSparse) ||
+ True(src.flags & ImageFlagBits::UnwrittenSparse)) {
+ return;
+ }
if (dst.info.astc_opaque != src.info.astc_opaque) {
// BC1 and BC3 blocks differ in size, so the host can't copy between them; both hold the
// same guest data, which is uploaded from guest memory instead.
diff --git a/src/yuzu/Info.plist b/src/yuzu/Info.plist
index cf6f597e99..9b6d49b87a 100644
--- a/src/yuzu/Info.plist
+++ b/src/yuzu/Info.plist
@@ -13,7 +13,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl3.cpp
index ecb8171ac7..93bbbfb8fc 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3.cpp
@@ -38,8 +38,10 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co
titlebar_timer = SDL_AddTimer(2000, [](void *userdata, SDL_TimerID, Uint32) -> Uint32 {
auto* this_ = (EmuWindow_SDL3*)userdata;
auto const results = this_->system.GetAndResetPerfStats();
- auto const title = fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, results.average_game_fps, results.emulation_speed * 100.0f);
- SDL_SetWindowTitle(this_->render_window, title.c_str());
+ auto* const title = new std::string(fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, results.average_game_fps, results.emulation_speed * 100.0f));
+ // Timers run on their own thread and AppKit throws when a title is set off the main
+ // thread: ApplyPendingTitle sets it from the main loop.
+ delete this_->pending_title.exchange(title);
return 2000;
}, this);
mouse_timer = SDL_AddTimer(100, [](void *userdata, SDL_TimerID, Uint32) -> Uint32 {
@@ -55,6 +57,7 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co
EmuWindow_SDL3::~EmuWindow_SDL3() {
SDL_RemoveTimer(titlebar_timer);
SDL_RemoveTimer(mouse_timer);
+ delete pending_title.exchange(nullptr);
system.HIDCore().UnloadInputDevices();
input_subsystem->Shutdown();
SDL_Quit();
@@ -154,6 +157,13 @@ bool EmuWindow_SDL3::IsOpen() const {
return is_open;
}
+void EmuWindow_SDL3::ApplyPendingTitle() {
+ if (std::string* const title = pending_title.exchange(nullptr)) {
+ SDL_SetWindowTitle(render_window, title->c_str());
+ delete title;
+ }
+}
+
bool EmuWindow_SDL3::IsShown() const {
return is_shown;
}
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl3.h b/src/yuzu_cmd/emu_window/emu_window_sdl3.h
index 0dc2a4983a..a76a2bfd85 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl3.h
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl3.h
@@ -6,7 +6,9 @@
#pragma once
+#include <atomic>
#include <cstdlib>
+#include <string>
#include <tuple>
#include <utility>
@@ -41,6 +43,9 @@ public:
/// Whether the window is still open, and a close request hasn't yet been sent
bool IsOpen() const;
+ /// Sets the title the titlebar timer prepared; call from the main thread.
+ void ApplyPendingTitle();
+
/// Returns if window is shown (not minimized)
bool IsShown() const override;
@@ -92,6 +97,7 @@ protected:
/// Periodic changer of titlebar (independent of event loop)
SDL_TimerID titlebar_timer;
+ std::atomic<std::string*> pending_title{};
// Mouse resetter once it
SDL_TimerID mouse_timer;
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 22abe6a759..4d71a29993 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -481,6 +481,9 @@ static void RunKeyScript(InputCommon::InputSubsystem& input_subsystem) {
extern "C" SDL_AppResult SDL_AppIterate(void *appstate) {
SdlState *state = (SdlState *)appstate;
RunKeyScript(state->input_subsystem);
+ if (state->emu_window) {
+ state->emu_window->ApplyPendingTitle();
+ }
return state->emu_window && state->emu_window->IsOpen() ? SDL_APP_CONTINUE : SDL_APP_SUCCESS;
}
extern "C" SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {