mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
gpu: pack 2D transforms in vec4 values
Instead of separate 2d scale and transform, pack them into a single 4d value. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
precision highp float;
|
||||
|
||||
layout(binding = 0) uniform Block {
|
||||
vec2 scale;
|
||||
vec2 offset;
|
||||
vec4 transform;
|
||||
vec2 pathOffset;
|
||||
};
|
||||
|
||||
@@ -46,8 +45,7 @@ void main() {
|
||||
vFrom = from-pos;
|
||||
vCtrl = ctrl-pos;
|
||||
vTo = to-pos;
|
||||
pos *= scale;
|
||||
pos += offset;
|
||||
pos = pos*transform.xy + transform.zw;
|
||||
gl_Position = vec4(pos, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user