diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-09-15 12:44:12 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-09-15 12:44:12 +0100 |
| commit | 9e74d0aea7614eaf238ef07261129026572337e7 (patch) | |
| tree | 0c5ac74d008632009db6fe40af3c655170d2d64c /src/render/pass/Pass.cpp | |
| parent | 559024c3314e4b1180b10b80fce4e9f20bad14c8 (diff) | |
renderer: clamp blur:passes 1-8
fixes some UB and dumb things
ref #11707
Diffstat (limited to 'src/render/pass/Pass.cpp')
| -rw-r--r-- | src/render/pass/Pass.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/render/pass/Pass.cpp b/src/render/pass/Pass.cpp index f7ee6a71..3e14d787 100644 --- a/src/render/pass/Pass.cpp +++ b/src/render/pass/Pass.cpp @@ -294,7 +294,10 @@ float CRenderPass::oneBlurRadius() { // TODO: is this exact range correct? static auto PBLURSIZE = CConfigValue<Hyprlang::INT>("decoration:blur:size"); static auto PBLURPASSES = CConfigValue<Hyprlang::INT>("decoration:blur:passes"); - return *PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, sc<int64_t>(1), sc<int64_t>(40)) * pow(2, *PBLURPASSES); // is this 2^pass? I don't know but it works... I think. + + const auto BLUR_PASSES = std::clamp(*PBLURPASSES, sc<int64_t>(1), sc<int64_t>(8)); + + return std::clamp(*PBLURSIZE, sc<int64_t>(1), sc<int64_t>(40)) * pow(2, BLUR_PASSES); // is this 2^pass? I don't know but it works... I think. } void CRenderPass::removeAllOfType(const std::string& type) { |
