2024-05-22 16:09:36 +08:00
|
|
|
#include <pango/pangocairo.h>
|
2022-05-28 17:32:19 +02:00
|
|
|
#include "HyprDebugOverlay.hpp"
|
2024-05-22 16:09:36 +08:00
|
|
|
#include "config/ConfigValue.hpp"
|
2022-05-28 17:32:19 +02:00
|
|
|
#include "../Compositor.hpp"
|
2024-12-26 00:16:42 +01:00
|
|
|
#include "../render/pass/TexPassElement.hpp"
|
|
|
|
|
#include "../render/Renderer.hpp"
|
2025-01-17 15:21:35 +00:00
|
|
|
#include "../managers/AnimationManager.hpp"
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
CHyprDebugOverlay::CHyprDebugOverlay() {
|
2025-04-21 20:42:02 +02:00
|
|
|
m_texture = makeShared<CTexture>();
|
2024-06-08 10:07:59 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprMonitorDebugOverlay::renderData(PHLMONITOR pMonitor, float durationUs) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastRenderTimes.emplace_back(durationUs / 1000.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-30 23:45:20 +02:00
|
|
|
if (m_lastRenderTimes.size() > (long unsigned int)pMonitor->m_refreshRate)
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastRenderTimes.pop_front();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
if (!m_monitor)
|
|
|
|
|
m_monitor = pMonitor;
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprMonitorDebugOverlay::renderDataNoOverlay(PHLMONITOR pMonitor, float durationUs) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastRenderTimesNoOverlay.emplace_back(durationUs / 1000.f);
|
2022-05-28 17:40:57 +02:00
|
|
|
|
2025-04-30 23:45:20 +02:00
|
|
|
if (m_lastRenderTimesNoOverlay.size() > (long unsigned int)pMonitor->m_refreshRate)
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastRenderTimesNoOverlay.pop_front();
|
2022-05-28 17:40:57 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
if (!m_monitor)
|
|
|
|
|
m_monitor = pMonitor;
|
2022-05-28 17:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprMonitorDebugOverlay::frameData(PHLMONITOR pMonitor) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastFrametimes.emplace_back(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - m_lastFrame).count() / 1000.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-30 23:45:20 +02:00
|
|
|
if (m_lastFrametimes.size() > (long unsigned int)pMonitor->m_refreshRate)
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastFrametimes.pop_front();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastFrame = std::chrono::high_resolution_clock::now();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
if (!m_monitor)
|
|
|
|
|
m_monitor = pMonitor;
|
2023-03-03 12:15:59 +00:00
|
|
|
|
|
|
|
|
// anim data too
|
2025-05-05 23:44:49 +02:00
|
|
|
const auto PMONITORFORTICKS = g_pHyprRenderer->m_mostHzMonitor ? g_pHyprRenderer->m_mostHzMonitor.lock() : g_pCompositor->m_lastMonitor.lock();
|
2025-07-12 18:19:59 +02:00
|
|
|
if (PMONITORFORTICKS == pMonitor) {
|
2025-04-30 23:45:20 +02:00
|
|
|
if (m_lastAnimationTicks.size() > (long unsigned int)PMONITORFORTICKS->m_refreshRate)
|
2025-04-21 20:42:02 +02:00
|
|
|
m_lastAnimationTicks.pop_front();
|
2023-03-03 12:15:59 +00:00
|
|
|
|
2025-05-02 17:07:20 +02:00
|
|
|
m_lastAnimationTicks.push_back(g_pAnimationManager->m_lastTickTimeMs);
|
2023-03-03 12:15:59 +00:00
|
|
|
}
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CHyprMonitorDebugOverlay::draw(int offset) {
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
if (!m_monitor)
|
2022-05-28 17:32:19 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
// get avg fps
|
|
|
|
|
float avgFrametime = 0;
|
2023-03-03 12:15:59 +00:00
|
|
|
float maxFrametime = 0;
|
|
|
|
|
float minFrametime = 9999;
|
2025-04-21 20:42:02 +02:00
|
|
|
for (auto const& ft : m_lastFrametimes) {
|
2023-03-03 12:15:59 +00:00
|
|
|
if (ft > maxFrametime)
|
|
|
|
|
maxFrametime = ft;
|
|
|
|
|
if (ft < minFrametime)
|
|
|
|
|
minFrametime = ft;
|
2022-05-28 17:32:19 +02:00
|
|
|
avgFrametime += ft;
|
|
|
|
|
}
|
2023-03-03 12:15:59 +00:00
|
|
|
float varFrametime = maxFrametime - minFrametime;
|
2025-05-31 23:49:50 +05:00
|
|
|
avgFrametime /= m_lastFrametimes.empty() ? 1 : m_lastFrametimes.size();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
|
|
|
|
float avgRenderTime = 0;
|
2023-03-03 12:15:59 +00:00
|
|
|
float maxRenderTime = 0;
|
|
|
|
|
float minRenderTime = 9999;
|
2025-04-21 20:42:02 +02:00
|
|
|
for (auto const& rt : m_lastRenderTimes) {
|
2023-03-03 12:15:59 +00:00
|
|
|
if (rt > maxRenderTime)
|
|
|
|
|
maxRenderTime = rt;
|
|
|
|
|
if (rt < minRenderTime)
|
|
|
|
|
minRenderTime = rt;
|
2022-05-28 17:32:19 +02:00
|
|
|
avgRenderTime += rt;
|
|
|
|
|
}
|
2023-03-03 12:15:59 +00:00
|
|
|
float varRenderTime = maxRenderTime - minRenderTime;
|
2025-05-31 23:49:50 +05:00
|
|
|
avgRenderTime /= m_lastRenderTimes.empty() ? 1 : m_lastRenderTimes.size();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2022-05-28 17:40:57 +02:00
|
|
|
float avgRenderTimeNoOverlay = 0;
|
2023-03-03 12:15:59 +00:00
|
|
|
float maxRenderTimeNoOverlay = 0;
|
|
|
|
|
float minRenderTimeNoOverlay = 9999;
|
2025-04-21 20:42:02 +02:00
|
|
|
for (auto const& rt : m_lastRenderTimesNoOverlay) {
|
2023-03-03 12:15:59 +00:00
|
|
|
if (rt > maxRenderTimeNoOverlay)
|
|
|
|
|
maxRenderTimeNoOverlay = rt;
|
|
|
|
|
if (rt < minRenderTimeNoOverlay)
|
|
|
|
|
minRenderTimeNoOverlay = rt;
|
2022-05-28 17:40:57 +02:00
|
|
|
avgRenderTimeNoOverlay += rt;
|
|
|
|
|
}
|
2023-03-03 12:15:59 +00:00
|
|
|
float varRenderTimeNoOverlay = maxRenderTimeNoOverlay - minRenderTimeNoOverlay;
|
2025-05-31 23:49:50 +05:00
|
|
|
avgRenderTimeNoOverlay /= m_lastRenderTimes.empty() ? 1 : m_lastRenderTimes.size();
|
2022-05-28 17:40:57 +02:00
|
|
|
|
2023-03-03 12:15:59 +00:00
|
|
|
float avgAnimMgrTick = 0;
|
|
|
|
|
float maxAnimMgrTick = 0;
|
|
|
|
|
float minAnimMgrTick = 9999;
|
2025-04-21 20:42:02 +02:00
|
|
|
for (auto const& at : m_lastAnimationTicks) {
|
2023-03-03 12:15:59 +00:00
|
|
|
if (at > maxAnimMgrTick)
|
|
|
|
|
maxAnimMgrTick = at;
|
|
|
|
|
if (at < minAnimMgrTick)
|
|
|
|
|
minAnimMgrTick = at;
|
|
|
|
|
avgAnimMgrTick += at;
|
|
|
|
|
}
|
|
|
|
|
float varAnimMgrTick = maxAnimMgrTick - minAnimMgrTick;
|
2025-05-31 23:49:50 +05:00
|
|
|
avgAnimMgrTick /= m_lastAnimationTicks.empty() ? 1 : m_lastAnimationTicks.size();
|
2023-03-03 12:15:59 +00:00
|
|
|
|
2024-05-22 16:09:36 +08:00
|
|
|
const float FPS = 1.f / (avgFrametime / 1000.f); // frametimes are in ms
|
2025-04-21 20:42:02 +02:00
|
|
|
const float idealFPS = m_lastFrametimes.size();
|
2024-05-22 16:09:36 +08:00
|
|
|
|
|
|
|
|
static auto fontFamily = CConfigValue<std::string>("misc:font_family");
|
2025-04-21 20:42:02 +02:00
|
|
|
PangoLayout* layoutText = pango_cairo_create_layout(g_pDebugOverlay->m_cairo);
|
2024-05-22 16:09:36 +08:00
|
|
|
PangoFontDescription* pangoFD = pango_font_description_new();
|
|
|
|
|
|
|
|
|
|
pango_font_description_set_family(pangoFD, (*fontFamily).c_str());
|
|
|
|
|
pango_font_description_set_style(pangoFD, PANGO_STYLE_NORMAL);
|
|
|
|
|
pango_font_description_set_weight(pangoFD, PANGO_WEIGHT_NORMAL);
|
|
|
|
|
|
|
|
|
|
float maxTextW = 0;
|
|
|
|
|
int fontSize = 0;
|
2025-04-21 20:42:02 +02:00
|
|
|
auto cr = g_pDebugOverlay->m_cairo;
|
2024-05-22 16:09:36 +08:00
|
|
|
|
|
|
|
|
auto showText = [cr, layoutText, pangoFD, &maxTextW, &fontSize](const char* text, int size) {
|
|
|
|
|
if (fontSize != size) {
|
|
|
|
|
pango_font_description_set_absolute_size(pangoFD, size * PANGO_SCALE);
|
|
|
|
|
pango_layout_set_font_description(layoutText, pangoFD);
|
|
|
|
|
fontSize = size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pango_layout_set_text(layoutText, text, -1);
|
|
|
|
|
pango_cairo_show_layout(cr, layoutText);
|
|
|
|
|
|
|
|
|
|
int textW = 0, textH = 0;
|
|
|
|
|
pango_layout_get_size(layoutText, &textW, &textH);
|
|
|
|
|
textW /= PANGO_SCALE;
|
|
|
|
|
textH /= PANGO_SCALE;
|
|
|
|
|
if (textW > maxTextW)
|
|
|
|
|
maxTextW = textW;
|
|
|
|
|
|
|
|
|
|
// move to next line
|
|
|
|
|
cairo_rel_move_to(cr, 0, fontSize + 1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const int MARGIN_TOP = 8;
|
|
|
|
|
const int MARGIN_LEFT = 4;
|
|
|
|
|
cairo_move_to(cr, MARGIN_LEFT, MARGIN_TOP + offset);
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 1.f, 1.f, 1.f, 1.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2024-05-22 16:09:36 +08:00
|
|
|
std::string text;
|
2025-04-30 23:45:20 +02:00
|
|
|
showText(m_monitor->m_name.c_str(), 10);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
|
|
|
|
if (FPS > idealFPS * 0.95f)
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 0.2f, 1.f, 0.2f, 1.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
else if (FPS > idealFPS * 0.8f)
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 1.f, 1.f, 0.2f, 1.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
else
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 1.f, 0.2f, 0.2f, 1.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2023-09-20 07:26:20 +00:00
|
|
|
text = std::format("{} FPS", (int)FPS);
|
2024-05-22 16:09:36 +08:00
|
|
|
showText(text.c_str(), 16);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_set_source_rgba(g_pDebugOverlay->m_cairo, 1.f, 1.f, 1.f, 1.f);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2023-09-20 07:26:20 +00:00
|
|
|
text = std::format("Avg Frametime: {:.2f}ms (var {:.2f}ms)", avgFrametime, varFrametime);
|
2024-05-22 16:09:36 +08:00
|
|
|
showText(text.c_str(), 10);
|
2023-03-03 12:15:59 +00:00
|
|
|
|
2023-09-20 07:26:20 +00:00
|
|
|
text = std::format("Avg Rendertime: {:.2f}ms (var {:.2f}ms)", avgRenderTime, varRenderTime);
|
2024-05-22 16:09:36 +08:00
|
|
|
showText(text.c_str(), 10);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2023-09-20 07:26:20 +00:00
|
|
|
text = std::format("Avg Rendertime (No Overlay): {:.2f}ms (var {:.2f}ms)", avgRenderTimeNoOverlay, varRenderTimeNoOverlay);
|
2024-05-22 16:09:36 +08:00
|
|
|
showText(text.c_str(), 10);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2023-09-20 07:26:20 +00:00
|
|
|
text = std::format("Avg Anim Tick: {:.2f}ms (var {:.2f}ms) ({:.2f} TPS)", avgAnimMgrTick, varAnimMgrTick, 1.0 / (avgAnimMgrTick / 1000.0));
|
2024-05-22 16:09:36 +08:00
|
|
|
showText(text.c_str(), 10);
|
|
|
|
|
|
|
|
|
|
pango_font_description_free(pangoFD);
|
|
|
|
|
g_object_unref(layoutText);
|
2022-05-28 17:40:57 +02:00
|
|
|
|
2024-05-22 16:09:36 +08:00
|
|
|
double posX = 0, posY = 0;
|
|
|
|
|
cairo_get_current_point(cr, &posX, &posY);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
g_pHyprRenderer->damageBox(m_lastDrawnBox);
|
2025-04-30 23:45:20 +02:00
|
|
|
m_lastDrawnBox = {(int)g_pCompositor->m_monitors.front()->m_position.x + MARGIN_LEFT - 1, (int)g_pCompositor->m_monitors.front()->m_position.y + offset + MARGIN_TOP - 1,
|
2025-04-21 20:42:02 +02:00
|
|
|
(int)maxTextW + 2, posY - offset - MARGIN_TOP + 2};
|
|
|
|
|
g_pHyprRenderer->damageBox(m_lastDrawnBox);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2024-05-22 16:09:36 +08:00
|
|
|
return posY - offset;
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprDebugOverlay::renderData(PHLMONITOR pMonitor, float durationUs) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_monitorOverlays[pMonitor].renderData(pMonitor, durationUs);
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprDebugOverlay::renderDataNoOverlay(PHLMONITOR pMonitor, float durationUs) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_monitorOverlays[pMonitor].renderDataNoOverlay(pMonitor, durationUs);
|
2022-05-28 17:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-19 23:03:29 +01:00
|
|
|
void CHyprDebugOverlay::frameData(PHLMONITOR pMonitor) {
|
2024-12-16 15:58:19 +00:00
|
|
|
static auto PDEBUGOVERLAY = CConfigValue<Hyprlang::INT>("debug:overlay");
|
|
|
|
|
|
|
|
|
|
if (!*PDEBUGOVERLAY)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
m_monitorOverlays[pMonitor].frameData(pMonitor);
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CHyprDebugOverlay::draw() {
|
|
|
|
|
|
2025-04-22 15:23:29 +02:00
|
|
|
const auto PMONITOR = g_pCompositor->m_monitors.front();
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
if (!m_cairoSurface || !m_cairo) {
|
2025-04-30 23:45:20 +02:00
|
|
|
m_cairoSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y);
|
2025-04-21 20:42:02 +02:00
|
|
|
m_cairo = cairo_create(m_cairoSurface);
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clear the pixmap
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_save(m_cairo);
|
|
|
|
|
cairo_set_operator(m_cairo, CAIRO_OPERATOR_CLEAR);
|
|
|
|
|
cairo_paint(m_cairo);
|
|
|
|
|
cairo_restore(m_cairo);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
|
|
|
|
// draw the things
|
|
|
|
|
int offsetY = 0;
|
2025-04-22 15:23:29 +02:00
|
|
|
for (auto const& m : g_pCompositor->m_monitors) {
|
2025-04-21 20:42:02 +02:00
|
|
|
offsetY += m_monitorOverlays[m].draw(offsetY);
|
2022-05-28 17:32:19 +02:00
|
|
|
offsetY += 5; // for padding between mons
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 20:42:02 +02:00
|
|
|
cairo_surface_flush(m_cairoSurface);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
|
|
|
|
// copy the data to an OpenGL texture we have
|
2025-04-21 20:42:02 +02:00
|
|
|
const auto DATA = cairo_image_surface_get_data(m_cairoSurface);
|
|
|
|
|
m_texture->allocate();
|
renderer: reduce a lot of glcalls and cache various states (#10757)
* opengl: cache viewport state
according to nvidia docs calling glViewPort unnecessarily on the same
already set viewport is wasteful and can cause state changes when not
needed. cache it in a struct and only call it when the viewport is
actually changing.
* opengl: cache glenable/gldisable state
avoid making multiple glenable/gldisable calls on already set caps, can
cause state changes and incur driver overhead.
* opengl: cache glscissor box
only call glscissor if the box actually has changed, try to avoid state
changes.
* opengl: cache gluniform calls
cache the gluniform calls, the uniform values are cached in driver per
program only the drawcalls setting the uniform yet again with the same
value on same location is causing more overhead then caching it ourself
and just no oping on it if no changes.
* shader: rewrite handling of uniforms and state
this is way faster as we don't need to mess with maps (hashing, etc) and instead can just use an array
* opengl: stuff and 300 shaders
* opengl: typo
* opengl: get the uniform locations properly
now that the legacy shaders are gone get the uniformlocations for
SKIP_CM etc, so they can be properly set and used depending on if
cm_enabled is set to false or true, before it was falling back to a
legacy shader that didnt even have those uniforms.
* opengl: check epsilon on float and remove extra glcall
seems an extra unset glcall was added, remove it. and check the float
epsilon on the glfloat.
* opengl: remove instanced shader draw
remove the instanced boolean from the vertex shader, might be neglible
differences, needs more benchmark/work to see if its even worth it.
* texture: cache texture paramaters
parameters where occasionally set twice or more on same texture, short
version wrap it and cache it. and move gpu churn to cpu churn.
add a bind/unbind to texture aswell.
* texture: use fast std::array caching
cache the texparameter values in fast array lookups
and incase we dont want it cached, apply it anyways.
* shader: fix typo and hdr typo
actually use Matrix4x2fv in the 4x2fv cache function, and send the
proper float array for hdr.
* texture: make caching not linear lookup
make caching of texture params not linear.
* minor style changes
* opengl: revert drawarrays
revert the mostly code style reduce loc change of drawarrays, and focus
on the caching. its a if else case going wrong here breaking
blur/contrast amongst others drawing.
---------
Co-authored-by: Vaxry <vaxry@vaxry.net>
2025-06-25 12:42:32 +02:00
|
|
|
m_texture->bind();
|
|
|
|
|
m_texture->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
|
|
|
m_texture->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
|
|
|
m_texture->setTexParameter(GL_TEXTURE_SWIZZLE_R, GL_BLUE);
|
|
|
|
|
m_texture->setTexParameter(GL_TEXTURE_SWIZZLE_B, GL_RED);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2025-04-30 23:45:20 +02:00
|
|
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, DATA);
|
2022-05-28 17:32:19 +02:00
|
|
|
|
2024-12-26 00:16:42 +01:00
|
|
|
CTexPassElement::SRenderData data;
|
2025-04-21 20:42:02 +02:00
|
|
|
data.tex = m_texture;
|
2025-04-30 23:45:20 +02:00
|
|
|
data.box = {0, 0, PMONITOR->m_pixelSize.x, PMONITOR->m_pixelSize.y};
|
2025-07-10 10:44:59 +02:00
|
|
|
g_pHyprRenderer->m_renderPass.add(makeUnique<CTexPassElement>(std::move(data)));
|
2022-05-28 17:32:19 +02:00
|
|
|
}
|