chore: format llm c files
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 22s
JS/TS / lint (pull_request) Successful in 16s
Python / static (pull_request) Failing after 37s
C++ / clang-tidy (pull_request) Failing after 1m19s
Rust / fmt (pull_request) Successful in 1m24s
Rust / clippy (pull_request) Successful in 1m59s
Rust / build (pull_request) Successful in 2m12s
Python / verify (pull_request) Successful in 2m48s

This commit is contained in:
2026-08-31 19:05:22 +02:00
parent 52feb6006a
commit c5a089adaf
+12 -20
View File
@@ -37,12 +37,10 @@ static std::filesystem::path g_runtimeDir{"/tmp"};
static std::filesystem::path g_cacheBase{"/tmp/.cache"}; static std::filesystem::path g_cacheBase{"/tmp/.cache"};
static void initEnvPaths() { static void initEnvPaths() {
if (const char* env = getenv("XDG_RUNTIME_DIR")) if (const char* env = getenv("XDG_RUNTIME_DIR")) g_runtimeDir = env;
g_runtimeDir = env;
if (const char* env = getenv("XDG_CACHE_HOME")) { if (const char* env = getenv("XDG_CACHE_HOME")) {
if (*env) if (*env) g_cacheBase = env;
g_cacheBase = env;
} else if (const char* home = getenv("HOME")) { } else if (const char* home = getenv("HOME")) {
g_cacheBase = std::filesystem::path(home) / ".cache"; g_cacheBase = std::filesystem::path(home) / ".cache";
} }
@@ -50,8 +48,7 @@ static void initEnvPaths() {
static std::ofstream& debugLog() { static std::ofstream& debugLog() {
static std::ofstream log( static std::ofstream log(
g_runtimeDir / "zshell-nightlight-debug.log", g_runtimeDir / "zshell-nightlight-debug.log", std::ios::app);
std::ios::app);
return log; return log;
} }
@@ -173,15 +170,14 @@ static bool hkSaveBufferForMirror(CHyprOpenGLImpl* thisptr, const CBox& box) {
static void installShader() { static void installShader() {
auto* gl = g_pHyprOpenGL.get(); auto* gl = g_pHyprOpenGL.get();
if (!gl) if (!gl) return;
return;
ensureShaderFile(shaderPath(), defaultShaderSource()); ensureShaderFile(shaderPath(), defaultShaderSource());
gl->applyScreenShader(shaderPath().string()); gl->applyScreenShader(shaderPath().string());
auto* shader = gl->m_finalScreenShader.get(); auto* shader = gl->m_finalScreenShader.get();
if (shader && shader->program() >= 1 && if (shader && shader->program() >= 1 &&
shader->getUniformLocation(SHADER_TINT) != -1) { shader->getUniformLocation(SHADER_TINT) != -1) {
g_uniformMode = true; g_uniformMode = true;
} else { } else {
g_uniformMode = false; g_uniformMode = false;
@@ -196,8 +192,7 @@ static void installShader() {
static void setUniformGain(const std::array<float, 3>& gain) { static void setUniformGain(const std::array<float, 3>& gain) {
auto* gl = g_pHyprOpenGL.get(); auto* gl = g_pHyprOpenGL.get();
auto* shader = gl ? gl->m_finalScreenShader.get() : nullptr; auto* shader = gl ? gl->m_finalScreenShader.get() : nullptr;
if (!gl || !shader) if (!gl || !shader) return;
return;
gl->useShader(gl->m_finalScreenShader); gl->useShader(gl->m_finalScreenShader);
shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]); shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]);
@@ -214,8 +209,7 @@ static void hkBegin(
if (fb) { if (fb) {
auto* renderer = g_pHyprRenderer.get(); auto* renderer = g_pHyprRenderer.get();
if (renderer) if (renderer) renderer->m_renderData.blockScreenShader = true;
renderer->m_renderData.blockScreenShader = true;
} }
if (!g_active) return; if (!g_active) return;
@@ -223,17 +217,15 @@ static void hkBegin(
auto* gl = g_pHyprOpenGL.get(); auto* gl = g_pHyprOpenGL.get();
if (!gl) return; if (!gl) return;
if (gl->m_finalScreenShader.get() && if (gl->m_finalScreenShader.get() && gl->m_finalScreenShader->program() < 1)
gl->m_finalScreenShader->program() < 1)
installShader(); installShader();
if (!gl->m_finalScreenShader.get() || if (!gl->m_finalScreenShader.get() ||
gl->m_finalScreenShader->program() < 1) gl->m_finalScreenShader->program() < 1)
return; return;
if (g_transition.active) { if (g_transition.active) {
auto* monPtr = mon.get(); auto* monPtr = mon.get();
if (!monPtr) if (!monPtr) return;
return;
const float elapsed = const float elapsed =
std::chrono::duration<float>( std::chrono::duration<float>(
std::chrono::steady_clock::now() - g_transition.start) std::chrono::steady_clock::now() - g_transition.start)
@@ -255,9 +247,9 @@ static void hkBegin(
ensureShaderFile( ensureShaderFile(
bakedShaderPath(g_currentGain), bakedShaderPath(g_currentGain),
bakedShaderSource(g_currentGain)); bakedShaderSource(g_currentGain));
gl->applyScreenShader(bakedShaderPath(g_currentGain).string()); gl->applyScreenShader(bakedShaderPath(g_currentGain).string());
}
} }
}
if (t >= 1.f) { if (t >= 1.f) {
g_transition.active = false; g_transition.active = false;