mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
gpu: limit atlas textures to 8k x 8k
Fixes gio#131 Fixes gio#133 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+10
-2
@@ -409,8 +409,16 @@ func newRenderer(ctx backend.Device) *renderer {
|
|||||||
blitter: newBlitter(ctx),
|
blitter: newBlitter(ctx),
|
||||||
pather: newPather(ctx),
|
pather: newPather(ctx),
|
||||||
}
|
}
|
||||||
r.packer.maxDim = ctx.Caps().MaxTextureSize
|
|
||||||
r.intersections.maxDim = r.packer.maxDim
|
maxDim := ctx.Caps().MaxTextureSize
|
||||||
|
// Large atlas textures cause artifacts due to precision loss in
|
||||||
|
// shaders.
|
||||||
|
if cap := 8192; maxDim > cap {
|
||||||
|
maxDim = cap
|
||||||
|
}
|
||||||
|
|
||||||
|
r.packer.maxDim = maxDim
|
||||||
|
r.intersections.maxDim = maxDim
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user