mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
+11
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user