mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +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:
@@ -8,8 +8,7 @@ layout(location = 0) in vec2 pos;
|
||||
layout(location = 1) in vec2 uv;
|
||||
|
||||
layout(binding = 0) uniform Block {
|
||||
vec2 scale;
|
||||
vec2 offset;
|
||||
vec4 uvTransform;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec2 vUV;
|
||||
@@ -18,5 +17,5 @@ void main() {
|
||||
vec2 p = pos;
|
||||
p.y = -p.y;
|
||||
gl_Position = vec4(p, 0, 1);
|
||||
vUV = uv*scale + offset;
|
||||
vUV = uv*uvTransform.xy + uvTransform.zw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user