you dont own anything, driver does
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
adfe8064d2
commit
5b95c2ca45
4 changed files with 22 additions and 13 deletions
|
|
@ -749,7 +749,11 @@ elseif (WIN32)
|
||||||
endif()
|
endif()
|
||||||
elseif (PLATFORM_HAIKU)
|
elseif (PLATFORM_HAIKU)
|
||||||
# Haiku is so special :)
|
# Haiku is so special :)
|
||||||
set(PLATFORM_LIBRARIES bsd network)
|
# Some fucking genius decided to name an entire module "network" in 2019
|
||||||
|
# this caused great disaster amongst the Haiku community who had came first with
|
||||||
|
# their "libnetwork.so"; since CMake doesn't do magic, we have to use an ABSOLUTE PATH
|
||||||
|
# to the library itself, otherwise it will think we are linking to... our network thing
|
||||||
|
set(PLATFORM_LIBRARIES bsd /boot/system/lib/libnetwork.so)
|
||||||
elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
|
elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
|
||||||
set(PLATFORM_LIBRARIES rt)
|
set(PLATFORM_LIBRARIES rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ Eden will store configuration files in the following directories:
|
||||||
- **Windows**: `%AppData%\Roaming`.
|
- **Windows**: `%AppData%\Roaming`.
|
||||||
- **Android**: Data is stored internally.
|
- **Android**: Data is stored internally.
|
||||||
- **Linux, macOS, FreeBSD, Solaris, OpenBSD**: `$XDG_DATA_HOME`, `$XDG_CACHE_HOME`, `$XDG_CONFIG_HOME`.
|
- **Linux, macOS, FreeBSD, Solaris, OpenBSD**: `$XDG_DATA_HOME`, `$XDG_CACHE_HOME`, `$XDG_CONFIG_HOME`.
|
||||||
|
- **HaikuOS**: `/boot/home/config/settings/eden`
|
||||||
|
|
||||||
If a `user` directory is present in the current working directory, that will override all global configuration directories and the emulator will use that instead.
|
If a `user` directory is present in the current working directory, that will override all global configuration directories and the emulator will use that instead.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ private:
|
||||||
std::unordered_map<size_t, size_t> placeholder_host_pointers; ///< Placeholder backing offset
|
std::unordered_map<size_t, size_t> placeholder_host_pointers; ///< Placeholder backing offset
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__) // ^^^ Windows ^^^ vvv POSIX vvv
|
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__) || defined(__HAIKU__) // ^^^ Windows ^^^ vvv POSIX vvv
|
||||||
|
|
||||||
#ifdef ARCHITECTURE_arm64
|
#ifdef ARCHITECTURE_arm64
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,20 +50,24 @@ bool TestProgram(const GLchar* glsl) {
|
||||||
return link_status == GL_TRUE;
|
return link_status == GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string_view> GetExtensions() {
|
/// @brief Query OpenGL extensions
|
||||||
|
/// DO NOT use string_view, the driver can immediately free up the extension name and such
|
||||||
|
/// do NOT under ANY circumstances use string_view, make a copy, it's required
|
||||||
|
std::vector<std::string> GetExtensions() {
|
||||||
GLint num_extensions;
|
GLint num_extensions;
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
|
glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
|
||||||
std::vector<std::string_view> extensions;
|
std::vector<std::string> extensions;
|
||||||
extensions.reserve(num_extensions);
|
|
||||||
for (GLint index = 0; index < num_extensions; ++index) {
|
for (GLint index = 0; index < num_extensions; ++index) {
|
||||||
extensions.push_back(
|
auto const* p = reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, GLuint(index)));
|
||||||
reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, static_cast<GLuint>(index))));
|
if (p != nullptr) // Fuck you? - sincerely, buggy mesa drivers
|
||||||
|
extensions.push_back(std::string{p});
|
||||||
}
|
}
|
||||||
return extensions;
|
return extensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasExtension(std::span<const std::string_view> extensions, std::string_view extension) {
|
/// @brief Find extension in set of extensions (string)
|
||||||
return std::ranges::find(extensions, extension) != extensions.end();
|
bool HasExtension(std::span<const std::string> extensions, std::string_view extension) {
|
||||||
|
return std::ranges::find(extensions, std::string{extension}) != extensions.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u32, Shader::MaxStageTypes> BuildMaxUniformBuffers() noexcept {
|
std::array<u32, Shader::MaxStageTypes> BuildMaxUniformBuffers() noexcept {
|
||||||
|
|
@ -148,7 +152,7 @@ static bool HasSlowSoftwareAstc(std::string_view vendor_name, std::string_view r
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool IsDebugToolAttached(std::span<const std::string_view> extensions) {
|
[[nodiscard]] bool IsDebugToolAttached(std::span<const std::string> extensions) {
|
||||||
const bool nsight = std::getenv("NVTX_INJECTION64_PATH") || std::getenv("NSIGHT_LAUNCHED");
|
const bool nsight = std::getenv("NVTX_INJECTION64_PATH") || std::getenv("NSIGHT_LAUNCHED");
|
||||||
return nsight || HasExtension(extensions, "GL_EXT_debug_tool") ||
|
return nsight || HasExtension(extensions, "GL_EXT_debug_tool") ||
|
||||||
Settings::values.renderer_debug.GetValue();
|
Settings::values.renderer_debug.GetValue();
|
||||||
|
|
@ -161,9 +165,9 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) {
|
||||||
throw std::runtime_error{"Insufficient version"};
|
throw std::runtime_error{"Insufficient version"};
|
||||||
}
|
}
|
||||||
vendor_name = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
vendor_name = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
||||||
const std::string_view version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
const std::string version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||||
const std::string_view renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
const std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||||
const std::vector extensions = GetExtensions();
|
const std::vector<std::string> extensions = GetExtensions();
|
||||||
|
|
||||||
const bool is_nvidia = vendor_name == "NVIDIA Corporation";
|
const bool is_nvidia = vendor_name == "NVIDIA Corporation";
|
||||||
const bool is_amd = vendor_name == "ATI Technologies Inc.";
|
const bool is_amd = vendor_name == "ATI Technologies Inc.";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue