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:
Elias Naur
2020-07-16 14:52:51 +02:00
parent f958f9512e
commit 47efa26cfc
+10 -2
View File
@@ -409,8 +409,16 @@ func newRenderer(ctx backend.Device) *renderer {
blitter: newBlitter(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
}