diff --git a/CMakeLists.txt b/CMakeLists.txt index a364821734..c488f4d777 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ project(yuzu) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + # Terrific Solaris pkg shenanigans + list(APPEND CMAKE_PREFIX_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/lib/qt/6.6/lib/amd64/cmake") +endif() set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm) diff --git a/docs/Development.md b/docs/Development.md index 3e1ff62ae6..26a10fd062 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -104,6 +104,7 @@ Then type `target remote localhost:1234` and type `c` (for continue) - and then - `br `: Set breakpoint at ``. - `delete`: Deletes all breakpoints. - `catch throw`: Breakpoint at throw. Can also use `br __cxa_throw` +- `br _mesa_error`: Break on mesa errors (set environment variable `MESA_DEBUG=1` beforehand), see [MESA_DEBUG](https://mesa-docs.readthedocs.io/en/latest/debugging.html). Expressions can be `variable_names` or `1234` (numbers) or `*var` (dereference of a pointer) or `*(1 + var)` (computed expression). diff --git a/docs/build/Solaris.md b/docs/build/Solaris.md index c7daa2279b..be681d5308 100644 --- a/docs/build/Solaris.md +++ b/docs/build/Solaris.md @@ -87,6 +87,19 @@ export PATH="$PATH:$PWD" - **Build**: `cmake --build build`. - **Installing**: `sudo cmake --install build`. +### Running + +Default Mesa is a bit outdated, the following environment variables should be set for a smoother experience: +```sh +export MESA_GL_VERSION_OVERRIDE=4.6 +export MESA_GLSL_VERSION_OVERRIDE=460 +export MESA_EXTENSION_MAX_YEAR=2025 +export MESA_DEBUG=1 +export MESA_VK_VERSION_OVERRIDE=1.3 +# Only if nvidia/intel drm drivers cause crashes, will severely hinder performance +export LIBGL_ALWAYS_SOFTWARE=1 +``` + ### Notes - Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`). diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 9e34cd3ac6..949cd188f3 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -442,16 +442,15 @@ static int shm_open_anon(int flags, mode_t mode) { for (char *fill = start; fill < limit; r /= 8) *fill++ = '0' + (r % 8); int fd = shm_open(name, flags, mode); - if (fd != -1) - return ([](const char *name, int fd) { - if (shm_unlink(name) == -1) { - int tmp = errno; - close(fd); - errno = tmp; - return -1; - } - return fd; - })(name, fd); + if (fd != -1) { + if (shm_unlink(name) == -1) { + int tmp = errno; + close(fd); + errno = tmp; + return -1; + } + return fd; + } if (errno != EEXIST) break; } @@ -464,15 +463,13 @@ static int shm_open_anon(int flags, mode_t mode) { int fd; if ((fd = shm_mkstemp(name)) == -1) return -1; - return ([](const char *name, int fd) { - if (shm_unlink(name) == -1) { - int tmp = errno; - close(fd); - errno = tmp; - return -1; - } - return fd; - })(name, fd); + if (shm_unlink(name) == -1) { + int tmp = errno; + close(fd); + errno = tmp; + return -1; + } + return fd; } #endif diff --git a/src/network/announce_multiplayer_session.cpp b/src/network/announce_multiplayer_session.cpp index 8836524c73..d2a47de73d 100644 --- a/src/network/announce_multiplayer_session.cpp +++ b/src/network/announce_multiplayer_session.cpp @@ -13,9 +13,9 @@ #include "common/settings.h" #include "network/network.h" -//#ifdef ENABLE_WEB_SERVICE +#ifdef ENABLE_WEB_SERVICE #include "web_service/announce_room_json.h" -//#endif +#endif namespace Core { @@ -23,13 +23,13 @@ namespace Core { static constexpr std::chrono::seconds announce_time_interval(15); AnnounceMultiplayerSession::AnnounceMultiplayerSession() { -//#ifdef ENABLE_WEB_SERVICE +#ifdef ENABLE_WEB_SERVICE backend = std::make_unique(Settings::values.web_api_url.GetValue(), Settings::values.eden_username.GetValue(), Settings::values.eden_token.GetValue()); -//#else -// backend = std::make_unique(); -//#endif +#else + backend = std::make_unique(); +#endif } WebService::WebResult AnnounceMultiplayerSession::Register() { @@ -155,12 +155,13 @@ bool AnnounceMultiplayerSession::IsRunning() const { void AnnounceMultiplayerSession::UpdateCredentials() { ASSERT_MSG(!IsRunning(), "Credentials can only be updated when session is not running"); - -//#ifdef ENABLE_WEB_SERVICE +#ifdef ENABLE_WEB_SERVICE backend = std::make_unique(Settings::values.web_api_url.GetValue(), Settings::values.eden_username.GetValue(), Settings::values.eden_token.GetValue()); -//#endif +#else + backend = std::make_unique(); +#endif } } // namespace Core diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 9be1b08055..3d6b27ae0a 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -24,6 +24,8 @@ using namespace Common::Literals; namespace OpenGL { namespace { + +// TODO: Needs to explicitly enable ARB_TESSELLATION_SHADER for GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS constexpr std::array LIMIT_UBOS = { GL_MAX_VERTEX_UNIFORM_BLOCKS, GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, GL_MAX_GEOMETRY_UNIFORM_BLOCKS, @@ -62,7 +64,7 @@ bool HasExtension(std::span extensions, std::string_view } std::array BuildMaxUniformBuffers() noexcept { - std::array max; + std::array max{}; std::ranges::transform(LIMIT_UBOS, max.begin(), &GetInteger); return max; } diff --git a/src/video_core/renderer_opengl/gl_staging_buffer_pool.cpp b/src/video_core/renderer_opengl/gl_staging_buffer_pool.cpp index bdd8e47f61..5767d6b7de 100644 --- a/src/video_core/renderer_opengl/gl_staging_buffer_pool.cpp +++ b/src/video_core/renderer_opengl/gl_staging_buffer_pool.cpp @@ -60,6 +60,7 @@ size_t StagingBuffers::RequestBuffer(size_t requested_size) { storage_flags | GL_MAP_PERSISTENT_BIT); alloc.map = static_cast(glMapNamedBufferRange(alloc.buffer.handle, 0, next_pow2_size, map_flags | GL_MAP_PERSISTENT_BIT)); + DEBUG_ASSERT(alloc.map != nullptr); alloc.size = next_pow2_size; allocs.emplace_back(std::move(alloc)); return allocs.size() - 1; diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 2902b695ad..71164b58f3 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -492,6 +492,11 @@ if (YUZU_ROOM) target_link_libraries(yuzu PRIVATE yuzu-room) endif() +# Explicit linking required +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + target_link_libraries(yuzu PRIVATE X11) +endif() + # Extra deps add_subdirectory(externals) target_link_libraries(yuzu PRIVATE QuaZip::QuaZip) diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index b3d9d8006b..5c7eb59d7c 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp @@ -2429,7 +2429,7 @@ void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, co 1.0 - std::sqrt((offset.x() * offset.x()) + (offset.y() * offset.y())) * 0.1f); const float rotation = - ((offset.x() == 0) ? atan(1) * 2 : atan(offset.y() / offset.x())) * (180 / (atan(1) * 4)); + ((offset.x() == 0.f) ? std::atan(1.f) * 2.f : std::atan(offset.y() / offset.x())) * (180.f / (std::atan(1.f) * 4.f)); p.save(); p.translate(offset_center);