[compat] fix solaris Qt build

This commit is contained in:
lizzie 2025-08-03 18:13:01 +01:00 committed by crueter
parent ae89b5e1b9
commit 6e661266f2
Signed by untrusted user: crueter
GPG key ID: 425ACD2D4830EBC6
9 changed files with 55 additions and 30 deletions

View file

@ -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)

View file

@ -104,6 +104,7 @@ Then type `target remote localhost:1234` and type `c` (for continue) - and then
- `br <expr>`: Set breakpoint at `<expr>`.
- `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).

13
docs/build/Solaris.md vendored
View file

@ -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`).

View file

@ -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

View file

@ -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<WebService::RoomJson>(Settings::values.web_api_url.GetValue(),
Settings::values.eden_username.GetValue(),
Settings::values.eden_token.GetValue());
//#else
// backend = std::make_unique<AnnounceMultiplayerRoom::NullBackend>();
//#endif
#else
backend = std::make_unique<AnnounceMultiplayerRoom::NullBackend>();
#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<WebService::RoomJson>(Settings::values.web_api_url.GetValue(),
Settings::values.eden_username.GetValue(),
Settings::values.eden_token.GetValue());
//#endif
#else
backend = std::make_unique<AnnounceMultiplayerRoom::NullBackend>();
#endif
}
} // namespace Core

View file

@ -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<const std::string_view> extensions, std::string_view
}
std::array<u32, Shader::MaxStageTypes> BuildMaxUniformBuffers() noexcept {
std::array<u32, Shader::MaxStageTypes> max;
std::array<u32, Shader::MaxStageTypes> max{};
std::ranges::transform(LIMIT_UBOS, max.begin(), &GetInteger<u32>);
return max;
}

View file

@ -60,6 +60,7 @@ size_t StagingBuffers::RequestBuffer(size_t requested_size) {
storage_flags | GL_MAP_PERSISTENT_BIT);
alloc.map = static_cast<u8*>(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;

View file

@ -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)

View file

@ -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);