renderer: clamp blur:passes 1-8

fixes some UB and dumb things

ref #11707
This commit is contained in:
Vaxry 2025-09-15 12:44:12 +01:00
parent 559024c331
commit 9e74d0aea7
No known key found for this signature in database
GPG key ID: 665806380871D640
2 changed files with 10 additions and 5 deletions

View file

@ -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) {