gpu: [compute] restore relative transformation correctly on state load

Fixes gio#277

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-09-24 15:55:52 +02:00
parent 3434bf8af1
commit 41f3a7e74e
+11 -3
View File
@@ -1818,11 +1818,19 @@ func (c *collector) collect(root *op.Ops, viewport image.Point, texOps *[]textur
case opconst.TypeLoad:
id, mask := ops.DecodeLoad(encOp.Data)
s := c.states[id]
if mask&opconst.TransformState != 0 {
state.t = s.t
}
if mask&^opconst.TransformState != 0 {
state = s
} else if mask&opconst.TransformState != 0 {
state.t = s.t
state.relTrans = s.t
if cl := state.clip; cl != nil {
var relTrans f32.Affine2D
for cl != nil {
relTrans = cl.relTrans.Mul(relTrans)
cl = cl.parent
}
state.relTrans = relTrans.Invert().Mul(state.relTrans)
}
}
}
}