mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-31 05:27:08 -06:00
Effects: padded buffers stay within a pixel budget (#2261)
Effects that grow their buffer (CC Radial Fast Blur, CC Lens, Magnify, the distorts and blurs) could pad a 20 x 20 layer by 4096 px a side, a ~8200 x 8200 f32 buffer plus its clone. Buf::pad (CPU and GPU) now cuts the pad so the grown buffer stays within 16 Mpx or four times its own area, whichever is larger: small layers are bounded at 256 MiB, big layers still grow as before in practice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f868cc68f3
commit
fb2fb169dc
@@ -46,6 +46,7 @@ impl GBuf {
|
||||
|
||||
/// Buf::pad: grow by `pad` transparent pixels on every side.
|
||||
pub fn pad(&mut self, e: &mut Enc, pad: u32) -> Option<()> {
|
||||
let pad = effectcraft_effects::pad_within_budget(self.img.width, self.img.height, pad);
|
||||
if pad == 0 {
|
||||
return Some(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user