debug: move to hyprutils' logger (#12673)
This commit is contained in:
parent
f88deb928a
commit
6175ecd4c4
147 changed files with 1696 additions and 1709 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "../managers/eventLoop/EventLoopManager.hpp"
|
||||
#include "../managers/CursorManager.hpp"
|
||||
#include "../helpers/fs/FsUtils.hpp"
|
||||
#include "../helpers/env/Env.hpp"
|
||||
#include "../helpers/MainLoopExecutor.hpp"
|
||||
#include "../i18n/Engine.hpp"
|
||||
#include "debug/HyprNotificationOverlay.hpp"
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
#include "AsyncResourceGatherer.hpp"
|
||||
#include <ranges>
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <xf86drm.h>
|
||||
#include <fcntl.h>
|
||||
|
|
@ -57,19 +59,19 @@ const std::vector<const char*> ASSET_PATHS = {
|
|||
static inline void loadGLProc(void* pProc, const char* name) {
|
||||
void* proc = rc<void*>(eglGetProcAddress(name));
|
||||
if (proc == nullptr) {
|
||||
Debug::log(CRIT, "[Tracy GPU Profiling] eglGetProcAddress({}) failed", name);
|
||||
Log::logger->log(Log::CRIT, "[Tracy GPU Profiling] eglGetProcAddress({}) failed", name);
|
||||
abort();
|
||||
}
|
||||
*sc<void**>(pProc) = proc;
|
||||
}
|
||||
|
||||
static enum eLogLevel eglLogToLevel(EGLint type) {
|
||||
static enum Hyprutils::CLI::eLogLevel eglLogToLevel(EGLint type) {
|
||||
switch (type) {
|
||||
case EGL_DEBUG_MSG_CRITICAL_KHR: return CRIT;
|
||||
case EGL_DEBUG_MSG_ERROR_KHR: return ERR;
|
||||
case EGL_DEBUG_MSG_WARN_KHR: return WARN;
|
||||
case EGL_DEBUG_MSG_INFO_KHR: return LOG;
|
||||
default: return LOG;
|
||||
case EGL_DEBUG_MSG_CRITICAL_KHR: return Log::CRIT;
|
||||
case EGL_DEBUG_MSG_ERROR_KHR: return Log::ERR;
|
||||
case EGL_DEBUG_MSG_WARN_KHR: return Log::WARN;
|
||||
case EGL_DEBUG_MSG_INFO_KHR: return Log::DEBUG;
|
||||
default: return Log::DEBUG;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +98,7 @@ static const char* eglErrorToString(EGLint error) {
|
|||
}
|
||||
|
||||
static void eglLog(EGLenum error, const char* command, EGLint type, EGLLabelKHR thread, EGLLabelKHR obj, const char* msg) {
|
||||
Debug::log(eglLogToLevel(type), "[EGL] Command {} errored out with {} (0x{}): {}", command, eglErrorToString(error), error, msg);
|
||||
Log::logger->log(eglLogToLevel(type), "[EGL] Command {} errored out with {} (0x{}): {}", command, eglErrorToString(error), error, msg);
|
||||
}
|
||||
|
||||
static int openRenderNode(int drmFd) {
|
||||
|
|
@ -106,14 +108,14 @@ static int openRenderNode(int drmFd) {
|
|||
// primary node
|
||||
renderName = drmGetPrimaryDeviceNameFromFd(drmFd);
|
||||
if (!renderName) {
|
||||
Debug::log(ERR, "drmGetPrimaryDeviceNameFromFd failed");
|
||||
Log::logger->log(Log::ERR, "drmGetPrimaryDeviceNameFromFd failed");
|
||||
return -1;
|
||||
}
|
||||
Debug::log(LOG, "DRM dev {} has no render node, falling back to primary", renderName);
|
||||
Log::logger->log(Log::DEBUG, "DRM dev {} has no render node, falling back to primary", renderName);
|
||||
|
||||
drmVersion* render_version = drmGetVersion(drmFd);
|
||||
if (render_version && render_version->name) {
|
||||
Debug::log(LOG, "DRM dev versionName", render_version->name);
|
||||
Log::logger->log(Log::DEBUG, "DRM dev versionName", render_version->name);
|
||||
if (strcmp(render_version->name, "evdi") == 0) {
|
||||
free(renderName); // NOLINT(cppcoreguidelines-no-malloc)
|
||||
renderName = strdup("/dev/dri/card0");
|
||||
|
|
@ -122,11 +124,11 @@ static int openRenderNode(int drmFd) {
|
|||
}
|
||||
}
|
||||
|
||||
Debug::log(LOG, "openRenderNode got drm device {}", renderName);
|
||||
Log::logger->log(Log::DEBUG, "openRenderNode got drm device {}", renderName);
|
||||
|
||||
int renderFD = open(renderName, O_RDWR | O_CLOEXEC);
|
||||
if (renderFD < 0)
|
||||
Debug::log(ERR, "openRenderNode failed to open drm device {}", renderName);
|
||||
Log::logger->log(Log::ERR, "openRenderNode failed to open drm device {}", renderName);
|
||||
|
||||
free(renderName); // NOLINT(cppcoreguidelines-no-malloc)
|
||||
return renderFD;
|
||||
|
|
@ -159,13 +161,13 @@ void CHyprOpenGLImpl::initEGL(bool gbm) {
|
|||
m_exts.EXT_image_dma_buf_import_modifiers = EGLEXTENSIONS.contains("EXT_image_dma_buf_import_modifiers");
|
||||
|
||||
if (m_exts.IMG_context_priority) {
|
||||
Debug::log(LOG, "EGL: IMG_context_priority supported, requesting high");
|
||||
Log::logger->log(Log::DEBUG, "EGL: IMG_context_priority supported, requesting high");
|
||||
attrs.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG);
|
||||
attrs.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG);
|
||||
}
|
||||
|
||||
if (m_exts.EXT_create_context_robustness) {
|
||||
Debug::log(LOG, "EGL: EXT_create_context_robustness supported, requesting lose on reset");
|
||||
Log::logger->log(Log::DEBUG, "EGL: EXT_create_context_robustness supported, requesting lose on reset");
|
||||
attrs.push_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT);
|
||||
attrs.push_back(EGL_LOSE_CONTEXT_ON_RESET_EXT);
|
||||
}
|
||||
|
|
@ -180,7 +182,7 @@ void CHyprOpenGLImpl::initEGL(bool gbm) {
|
|||
|
||||
m_eglContext = eglCreateContext(m_eglDisplay, EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT, attrs.data());
|
||||
if (m_eglContext == EGL_NO_CONTEXT) {
|
||||
Debug::log(WARN, "EGL: Failed to create a context with GLES3.2, retrying 3.0");
|
||||
Log::logger->log(Log::WARN, "EGL: Failed to create a context with GLES3.2, retrying 3.0");
|
||||
|
||||
attrs = attrsNoVer;
|
||||
attrs.push_back(EGL_CONTEXT_MAJOR_VERSION);
|
||||
|
|
@ -200,9 +202,9 @@ void CHyprOpenGLImpl::initEGL(bool gbm) {
|
|||
EGLint priority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
|
||||
eglQueryContext(m_eglDisplay, m_eglContext, EGL_CONTEXT_PRIORITY_LEVEL_IMG, &priority);
|
||||
if (priority != EGL_CONTEXT_PRIORITY_HIGH_IMG)
|
||||
Debug::log(ERR, "EGL: Failed to obtain a high priority context");
|
||||
Log::logger->log(Log::ERR, "EGL: Failed to obtain a high priority context");
|
||||
else
|
||||
Debug::log(LOG, "EGL: Got a high priority context");
|
||||
Log::logger->log(Log::DEBUG, "EGL: Got a high priority context");
|
||||
}
|
||||
|
||||
eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, m_eglContext);
|
||||
|
|
@ -222,12 +224,12 @@ static bool drmDeviceHasName(const drmDevice* device, const std::string& name) {
|
|||
EGLDeviceEXT CHyprOpenGLImpl::eglDeviceFromDRMFD(int drmFD) {
|
||||
EGLint nDevices = 0;
|
||||
if (!m_proc.eglQueryDevicesEXT(0, nullptr, &nDevices)) {
|
||||
Debug::log(ERR, "eglDeviceFromDRMFD: eglQueryDevicesEXT failed");
|
||||
Log::logger->log(Log::ERR, "eglDeviceFromDRMFD: eglQueryDevicesEXT failed");
|
||||
return EGL_NO_DEVICE_EXT;
|
||||
}
|
||||
|
||||
if (nDevices <= 0) {
|
||||
Debug::log(ERR, "eglDeviceFromDRMFD: no devices");
|
||||
Log::logger->log(Log::ERR, "eglDeviceFromDRMFD: no devices");
|
||||
return EGL_NO_DEVICE_EXT;
|
||||
}
|
||||
|
||||
|
|
@ -235,13 +237,13 @@ EGLDeviceEXT CHyprOpenGLImpl::eglDeviceFromDRMFD(int drmFD) {
|
|||
devices.resize(nDevices);
|
||||
|
||||
if (!m_proc.eglQueryDevicesEXT(nDevices, devices.data(), &nDevices)) {
|
||||
Debug::log(ERR, "eglDeviceFromDRMFD: eglQueryDevicesEXT failed (2)");
|
||||
Log::logger->log(Log::ERR, "eglDeviceFromDRMFD: eglQueryDevicesEXT failed (2)");
|
||||
return EGL_NO_DEVICE_EXT;
|
||||
}
|
||||
|
||||
drmDevice* drmDev = nullptr;
|
||||
if (int ret = drmGetDevice(drmFD, &drmDev); ret < 0) {
|
||||
Debug::log(ERR, "eglDeviceFromDRMFD: drmGetDevice failed");
|
||||
Log::logger->log(Log::ERR, "eglDeviceFromDRMFD: drmGetDevice failed");
|
||||
return EGL_NO_DEVICE_EXT;
|
||||
}
|
||||
|
||||
|
|
@ -251,21 +253,21 @@ EGLDeviceEXT CHyprOpenGLImpl::eglDeviceFromDRMFD(int drmFD) {
|
|||
continue;
|
||||
|
||||
if (drmDeviceHasName(drmDev, devName)) {
|
||||
Debug::log(LOG, "eglDeviceFromDRMFD: Using device {}", devName);
|
||||
Log::logger->log(Log::DEBUG, "eglDeviceFromDRMFD: Using device {}", devName);
|
||||
drmFreeDevice(&drmDev);
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
drmFreeDevice(&drmDev);
|
||||
Debug::log(LOG, "eglDeviceFromDRMFD: No drm devices found");
|
||||
Log::logger->log(Log::DEBUG, "eglDeviceFromDRMFD: No drm devices found");
|
||||
return EGL_NO_DEVICE_EXT;
|
||||
}
|
||||
|
||||
CHyprOpenGLImpl::CHyprOpenGLImpl() : m_drmFD(g_pCompositor->m_drmRenderNode.fd >= 0 ? g_pCompositor->m_drmRenderNode.fd : g_pCompositor->m_drm.fd) {
|
||||
const std::string EGLEXTENSIONS = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||
|
||||
Debug::log(LOG, "Supported EGL global extensions: ({}) {}", std::ranges::count(EGLEXTENSIONS, ' '), EGLEXTENSIONS);
|
||||
Log::logger->log(Log::DEBUG, "Supported EGL global extensions: ({}) {}", std::ranges::count(EGLEXTENSIONS, ' '), EGLEXTENSIONS);
|
||||
|
||||
m_exts.KHR_display_reference = EGLEXTENSIONS.contains("KHR_display_reference");
|
||||
|
||||
|
|
@ -315,7 +317,7 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() : m_drmFD(g_pCompositor->m_drmRenderNode.fd >
|
|||
}
|
||||
|
||||
if (!success) {
|
||||
Debug::log(WARN, "EGL: EXT_platform_device or EGL_EXT_device_query not supported, using gbm");
|
||||
Log::logger->log(Log::WARN, "EGL: EXT_platform_device or EGL_EXT_device_query not supported, using gbm");
|
||||
if (EGLEXTENSIONS.contains("KHR_platform_gbm")) {
|
||||
success = true;
|
||||
m_gbmFD = CFileDescriptor{openRenderNode(m_drmFD)};
|
||||
|
|
@ -337,33 +339,33 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() : m_drmFD(g_pCompositor->m_drmRenderNode.fd >
|
|||
|
||||
m_extensions = EXTENSIONS;
|
||||
|
||||
Debug::log(LOG, "Creating the Hypr OpenGL Renderer!");
|
||||
Debug::log(LOG, "Using: {}", rc<const char*>(glGetString(GL_VERSION)));
|
||||
Debug::log(LOG, "Vendor: {}", rc<const char*>(glGetString(GL_VENDOR)));
|
||||
Debug::log(LOG, "Renderer: {}", rc<const char*>(glGetString(GL_RENDERER)));
|
||||
Debug::log(LOG, "Supported extensions: ({}) {}", std::ranges::count(m_extensions, ' '), m_extensions);
|
||||
Log::logger->log(Log::DEBUG, "Creating the Hypr OpenGL Renderer!");
|
||||
Log::logger->log(Log::DEBUG, "Using: {}", rc<const char*>(glGetString(GL_VERSION)));
|
||||
Log::logger->log(Log::DEBUG, "Vendor: {}", rc<const char*>(glGetString(GL_VENDOR)));
|
||||
Log::logger->log(Log::DEBUG, "Renderer: {}", rc<const char*>(glGetString(GL_RENDERER)));
|
||||
Log::logger->log(Log::DEBUG, "Supported extensions: ({}) {}", std::ranges::count(m_extensions, ' '), m_extensions);
|
||||
|
||||
m_exts.EXT_read_format_bgra = m_extensions.contains("GL_EXT_read_format_bgra");
|
||||
|
||||
RASSERT(m_extensions.contains("GL_EXT_texture_format_BGRA8888"), "GL_EXT_texture_format_BGRA8888 support by the GPU driver is required");
|
||||
|
||||
if (!m_exts.EXT_read_format_bgra)
|
||||
Debug::log(WARN, "Your GPU does not support GL_EXT_read_format_bgra, this may cause issues with texture importing");
|
||||
Log::logger->log(Log::WARN, "Your GPU does not support GL_EXT_read_format_bgra, this may cause issues with texture importing");
|
||||
if (!m_exts.EXT_image_dma_buf_import || !m_exts.EXT_image_dma_buf_import_modifiers)
|
||||
Debug::log(WARN, "Your GPU does not support DMABUFs, this will possibly cause issues and will take a hit on the performance.");
|
||||
Log::logger->log(Log::WARN, "Your GPU does not support DMABUFs, this will possibly cause issues and will take a hit on the performance.");
|
||||
|
||||
const std::string EGLEXTENSIONS_DISPLAY = eglQueryString(m_eglDisplay, EGL_EXTENSIONS);
|
||||
|
||||
Debug::log(LOG, "Supported EGL display extensions: ({}) {}", std::ranges::count(EGLEXTENSIONS_DISPLAY, ' '), EGLEXTENSIONS_DISPLAY);
|
||||
Log::logger->log(Log::DEBUG, "Supported EGL display extensions: ({}) {}", std::ranges::count(EGLEXTENSIONS_DISPLAY, ' '), EGLEXTENSIONS_DISPLAY);
|
||||
|
||||
#if defined(__linux__)
|
||||
m_exts.EGL_ANDROID_native_fence_sync_ext = EGLEXTENSIONS_DISPLAY.contains("EGL_ANDROID_native_fence_sync");
|
||||
|
||||
if (!m_exts.EGL_ANDROID_native_fence_sync_ext)
|
||||
Debug::log(WARN, "Your GPU does not support explicit sync via the EGL_ANDROID_native_fence_sync extension.");
|
||||
Log::logger->log(Log::WARN, "Your GPU does not support explicit sync via the EGL_ANDROID_native_fence_sync extension.");
|
||||
#else
|
||||
m_exts.EGL_ANDROID_native_fence_sync_ext = false;
|
||||
Debug::log(WARN, "Forcefully disabling explicit sync: BSD is missing support for proper timeline export");
|
||||
Log::logger->log(Log::WARN, "Forcefully disabling explicit sync: BSD is missing support for proper timeline export");
|
||||
#endif
|
||||
|
||||
#ifdef USE_TRACY_GPU
|
||||
|
|
@ -454,7 +456,7 @@ std::optional<std::vector<uint64_t>> CHyprOpenGLImpl::getModsForFormat(EGLint fo
|
|||
|
||||
EGLint len = 0;
|
||||
if (!m_proc.eglQueryDmaBufModifiersEXT(m_eglDisplay, format, 0, nullptr, nullptr, &len)) {
|
||||
Debug::log(ERR, "EGL: Failed to query mods");
|
||||
Log::logger->log(Log::ERR, "EGL: Failed to query mods");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
|
@ -492,12 +494,12 @@ std::optional<std::vector<uint64_t>> CHyprOpenGLImpl::getModsForFormat(EGLint fo
|
|||
}
|
||||
|
||||
void CHyprOpenGLImpl::initDRMFormats() {
|
||||
const auto DISABLE_MODS = envEnabled("HYPRLAND_EGL_NO_MODIFIERS");
|
||||
const auto DISABLE_MODS = Env::envEnabled("HYPRLAND_EGL_NO_MODIFIERS");
|
||||
if (DISABLE_MODS)
|
||||
Debug::log(WARN, "HYPRLAND_EGL_NO_MODIFIERS set, disabling modifiers");
|
||||
Log::logger->log(Log::WARN, "HYPRLAND_EGL_NO_MODIFIERS set, disabling modifiers");
|
||||
|
||||
if (!m_exts.EXT_image_dma_buf_import) {
|
||||
Debug::log(ERR, "EGL: No dmabuf import, DMABufs will not work.");
|
||||
Log::logger->log(Log::ERR, "EGL: No dmabuf import, DMABufs will not work.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -506,7 +508,7 @@ void CHyprOpenGLImpl::initDRMFormats() {
|
|||
if (!m_exts.EXT_image_dma_buf_import_modifiers || !m_proc.eglQueryDmaBufFormatsEXT) {
|
||||
formats.push_back(DRM_FORMAT_ARGB8888);
|
||||
formats.push_back(DRM_FORMAT_XRGB8888);
|
||||
Debug::log(WARN, "EGL: No mod support");
|
||||
Log::logger->log(Log::WARN, "EGL: No mod support");
|
||||
} else {
|
||||
EGLint len = 0;
|
||||
m_proc.eglQueryDmaBufFormatsEXT(m_eglDisplay, 0, nullptr, &len);
|
||||
|
|
@ -515,11 +517,11 @@ void CHyprOpenGLImpl::initDRMFormats() {
|
|||
}
|
||||
|
||||
if (formats.empty()) {
|
||||
Debug::log(ERR, "EGL: Failed to get formats, DMABufs will not work.");
|
||||
Log::logger->log(Log::ERR, "EGL: Failed to get formats, DMABufs will not work.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug::log(LOG, "Supported DMA-BUF formats:");
|
||||
Log::logger->log(Log::DEBUG, "Supported DMA-BUF formats:");
|
||||
|
||||
std::vector<SDRMFormat> dmaFormats;
|
||||
// reserve number of elements to avoid reallocations
|
||||
|
|
@ -551,7 +553,7 @@ void CHyprOpenGLImpl::initDRMFormats() {
|
|||
modifierData.reserve(mods.size());
|
||||
|
||||
auto fmtName = drmGetFormatName(fmt);
|
||||
Debug::log(LOG, "EGL: GPU Supports Format {} (0x{:x})", fmtName ? fmtName : "?unknown?", fmt);
|
||||
Log::logger->log(Log::DEBUG, "EGL: GPU Supports Format {} (0x{:x})", fmtName ? fmtName : "?unknown?", fmt);
|
||||
for (auto const& mod : mods) {
|
||||
auto modName = drmGetFormatModifierName(mod);
|
||||
modifierData.emplace_back(std::make_pair<>(mod, modName ? modName : "?unknown?"));
|
||||
|
|
@ -569,16 +571,16 @@ void CHyprOpenGLImpl::initDRMFormats() {
|
|||
});
|
||||
|
||||
for (auto const& [m, name] : modifierData) {
|
||||
Debug::log(LOG, "EGL: | with modifier {} (0x{:x})", name, m);
|
||||
Log::logger->log(Log::DEBUG, "EGL: | with modifier {} (0x{:x})", name, m);
|
||||
mods.emplace_back(m);
|
||||
}
|
||||
}
|
||||
|
||||
Debug::log(LOG, "EGL: {} formats found in total. Some modifiers may be omitted as they are external-only.", dmaFormats.size());
|
||||
Log::logger->log(Log::DEBUG, "EGL: {} formats found in total. Some modifiers may be omitted as they are external-only.", dmaFormats.size());
|
||||
|
||||
if (dmaFormats.empty())
|
||||
Debug::log(WARN,
|
||||
"EGL: WARNING: No dmabuf formats were found, dmabuf will be disabled. This will degrade performance, but is most likely a driver issue or a very old GPU.");
|
||||
Log::logger->log(
|
||||
Log::WARN, "EGL: WARNING: No dmabuf formats were found, dmabuf will be disabled. This will degrade performance, but is most likely a driver issue or a very old GPU.");
|
||||
|
||||
m_drmFormats = dmaFormats;
|
||||
}
|
||||
|
|
@ -630,7 +632,7 @@ EGLImageKHR CHyprOpenGLImpl::createEGLImage(const Aquamarine::SDMABUFAttrs& attr
|
|||
|
||||
EGLImageKHR image = m_proc.eglCreateImageKHR(m_eglDisplay, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs.data());
|
||||
if (image == EGL_NO_IMAGE_KHR) {
|
||||
Debug::log(ERR, "EGL: EGLCreateImageKHR failed: {}", eglGetError());
|
||||
Log::logger->log(Log::ERR, "EGL: EGLCreateImageKHR failed: {}", eglGetError());
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
|
|
@ -653,7 +655,7 @@ void CHyprOpenGLImpl::logShaderError(const GLuint& shader, bool program, bool si
|
|||
|
||||
const auto FULLERROR = (program ? "Screen shader parser: Error linking program:" : "Screen shader parser: Error compiling shader: ") + errorStr;
|
||||
|
||||
Debug::log(ERR, "Failed to link shader: {}", FULLERROR);
|
||||
Log::logger->log(Log::ERR, "Failed to link shader: {}", FULLERROR);
|
||||
|
||||
if (!silent)
|
||||
g_pConfigManager->addParseError(FULLERROR);
|
||||
|
|
@ -1020,9 +1022,10 @@ bool CHyprOpenGLImpl::initShaders() {
|
|||
shaders->m_shCM.uniformLocations[SHADER_USE_ALPHA_MATTE] = glGetUniformLocation(prog, "useAlphaMatte");
|
||||
shaders->m_shCM.createVao();
|
||||
} else
|
||||
Debug::log(ERR,
|
||||
"WARNING: CM Shader failed compiling, color management will not work. It's likely because your GPU is an old piece of garbage, don't file bug reports "
|
||||
"about this!");
|
||||
Log::logger->log(
|
||||
Log::ERR,
|
||||
"WARNING: CM Shader failed compiling, color management will not work. It's likely because your GPU is an old piece of garbage, don't file bug reports "
|
||||
"about this!");
|
||||
}
|
||||
|
||||
const auto FRAGSHADOW = processShader("shadow.frag", includes);
|
||||
|
|
@ -1238,14 +1241,14 @@ bool CHyprOpenGLImpl::initShaders() {
|
|||
if (!m_shadersInitialized)
|
||||
throw e;
|
||||
|
||||
Debug::log(ERR, "Shaders update failed: {}", e.what());
|
||||
Log::logger->log(Log::ERR, "Shaders update failed: {}", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
m_shaders = shaders;
|
||||
m_shadersInitialized = true;
|
||||
|
||||
Debug::log(LOG, "Shaders initialized successfully.");
|
||||
Log::logger->log(Log::DEBUG, "Shaders initialized successfully.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1967,7 +1970,7 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, const CBox& box, CFra
|
|||
// Dual (or more) kawase blur
|
||||
CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* originalDamage) {
|
||||
if (!m_renderData.currentFB->getTexture()) {
|
||||
Debug::log(ERR, "BUG THIS: null fb texture while attempting to blur main fb?! (introspection off?!)");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: null fb texture while attempting to blur main fb?! (introspection off?!)");
|
||||
return &m_renderData.pCurrentMonData->mirrorFB; // return something to sample from at least
|
||||
}
|
||||
|
||||
|
|
@ -2809,12 +2812,12 @@ std::string CHyprOpenGLImpl::resolveAssetPath(const std::string& filename) {
|
|||
fullPath = p;
|
||||
break;
|
||||
} else
|
||||
Debug::log(LOG, "resolveAssetPath: looking at {} unsuccessful: ec {}", filename, ec.message());
|
||||
Log::logger->log(Log::DEBUG, "resolveAssetPath: looking at {} unsuccessful: ec {}", filename, ec.message());
|
||||
}
|
||||
|
||||
if (fullPath.empty()) {
|
||||
m_failedAssetsNo++;
|
||||
Debug::log(ERR, "resolveAssetPath: looking for {} failed (no provider found)", filename);
|
||||
Log::logger->log(Log::ERR, "resolveAssetPath: looking for {} failed (no provider found)", filename);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
@ -2832,7 +2835,7 @@ SP<CTexture> CHyprOpenGLImpl::loadAsset(const std::string& filename) {
|
|||
|
||||
if (!CAIROSURFACE) {
|
||||
m_failedAssetsNo++;
|
||||
Debug::log(ERR, "loadAsset: failed to load {} (corrupt / inaccessible / not png)", fullPath);
|
||||
Log::logger->log(Log::ERR, "loadAsset: failed to load {} (corrupt / inaccessible / not png)", fullPath);
|
||||
return m_missingAssetTexture;
|
||||
}
|
||||
|
||||
|
|
@ -3084,7 +3087,7 @@ void CHyprOpenGLImpl::requestBackgroundResource() {
|
|||
void CHyprOpenGLImpl::createBGTextureForMonitor(PHLMONITOR pMonitor) {
|
||||
RASSERT(m_renderData.pMonitor, "Tried to createBGTex without begin()!");
|
||||
|
||||
Debug::log(LOG, "Creating a texture for BGTex");
|
||||
Log::logger->log(Log::DEBUG, "Creating a texture for BGTex");
|
||||
|
||||
static auto PRENDERTEX = CConfigValue<Hyprlang::INT>("misc:disable_hyprland_logo");
|
||||
static auto PNOSPLASH = CConfigValue<Hyprlang::INT>("misc:disable_splash_rendering");
|
||||
|
|
@ -3180,7 +3183,7 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(PHLMONITOR pMonitor) {
|
|||
if (m_renderData.currentFB)
|
||||
m_renderData.currentFB->bind();
|
||||
|
||||
Debug::log(LOG, "Background created for monitor {}", pMonitor->m_name);
|
||||
Log::logger->log(Log::DEBUG, "Background created for monitor {}", pMonitor->m_name);
|
||||
|
||||
// clear the resource after we're done using it
|
||||
g_pEventLoopManager->doLater([this] { m_backgroundResource.reset(); });
|
||||
|
|
@ -3237,7 +3240,7 @@ void CHyprOpenGLImpl::destroyMonitorResources(PHLMONITORREF pMonitor) {
|
|||
}
|
||||
|
||||
if (pMonitor)
|
||||
Debug::log(LOG, "Monitor {} -> destroyed all render data", pMonitor->m_name);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {} -> destroyed all render data", pMonitor->m_name);
|
||||
}
|
||||
|
||||
void CHyprOpenGLImpl::saveMatrix() {
|
||||
|
|
@ -3373,7 +3376,7 @@ void SRenderModifData::applyToBox(CBox& box) {
|
|||
box.y = OLDPOS.y * COS + OLDPOS.x * SIN;
|
||||
}
|
||||
}
|
||||
} catch (std::bad_any_cast& e) { Debug::log(ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::applyToBox!"); }
|
||||
} catch (std::bad_any_cast& e) { Log::logger->log(Log::ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::applyToBox!"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3390,7 +3393,7 @@ void SRenderModifData::applyToRegion(CRegion& rg) {
|
|||
case RMOD_TYPE_ROTATE: /* TODO */
|
||||
case RMOD_TYPE_ROTATECENTER: break;
|
||||
}
|
||||
} catch (std::bad_any_cast& e) { Debug::log(ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::applyToRegion!"); }
|
||||
} catch (std::bad_any_cast& e) { Log::logger->log(Log::ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::applyToRegion!"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3408,7 +3411,7 @@ float SRenderModifData::combinedScale() {
|
|||
case RMOD_TYPE_ROTATE:
|
||||
case RMOD_TYPE_ROTATECENTER: break;
|
||||
}
|
||||
} catch (std::bad_any_cast& e) { Debug::log(ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::combinedScale!"); }
|
||||
} catch (std::bad_any_cast& e) { Log::logger->log(Log::ERR, "BUG THIS OR PLUGIN ERROR: caught a bad_any_cast in SRenderModifData::combinedScale!"); }
|
||||
}
|
||||
return scale;
|
||||
}
|
||||
|
|
@ -3419,7 +3422,7 @@ UP<CEGLSync> CEGLSync::create() {
|
|||
EGLSyncKHR sync = g_pHyprOpenGL->m_proc.eglCreateSyncKHR(g_pHyprOpenGL->m_eglDisplay, EGL_SYNC_NATIVE_FENCE_ANDROID, nullptr);
|
||||
|
||||
if (sync == EGL_NO_SYNC_KHR) {
|
||||
Debug::log(ERR, "eglCreateSyncKHR failed");
|
||||
Log::logger->log(Log::ERR, "eglCreateSyncKHR failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -3428,7 +3431,7 @@ UP<CEGLSync> CEGLSync::create() {
|
|||
|
||||
int fd = g_pHyprOpenGL->m_proc.eglDupNativeFenceFDANDROID(g_pHyprOpenGL->m_eglDisplay, sync);
|
||||
if (fd == EGL_NO_NATIVE_FENCE_FD_ANDROID) {
|
||||
Debug::log(ERR, "eglDupNativeFenceFDANDROID failed");
|
||||
Log::logger->log(Log::ERR, "eglDupNativeFenceFDANDROID failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -3445,7 +3448,7 @@ CEGLSync::~CEGLSync() {
|
|||
return;
|
||||
|
||||
if (g_pHyprOpenGL && g_pHyprOpenGL->m_proc.eglDestroySyncKHR(g_pHyprOpenGL->m_eglDisplay, m_sync) != EGL_TRUE)
|
||||
Debug::log(ERR, "eglDestroySyncKHR failed");
|
||||
Log::logger->log(Log::ERR, "eglDestroySyncKHR failed");
|
||||
}
|
||||
|
||||
CFileDescriptor& CEGLSync::fd() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue