mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
1062d4e79d
Safari's WebGL1 implementation (rightly) complains that first-class array types are not supported as function result types. Define and use a struct type instead. While we're here, use const variables instead of functions. Signed-off-by: Elias Naur <mail@eliasnaur.com>
29 lines
646 B
GLSL
29 lines
646 B
GLSL
#version 310 es
|
|
|
|
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
precision highp float;
|
|
|
|
#include <common.inc>
|
|
|
|
layout(binding = 0) uniform Block {
|
|
vec4 transform;
|
|
vec4 uvCoverTransform;
|
|
vec4 uvTransform;
|
|
float z;
|
|
};
|
|
|
|
layout(location = 0) in vec2 pos;
|
|
|
|
layout(location = 0) out vec2 vCoverUV;
|
|
|
|
layout(location = 1) in vec2 uv;
|
|
layout(location = 1) out vec2 vUV;
|
|
|
|
void main() {
|
|
gl_Position = toClipSpace(vec4(pos*transform.xy + transform.zw, z, 1));
|
|
vUV = uv*uvTransform.xy + uvTransform.zw;
|
|
vec3 uv3 = transform3x2(fboTextureTransform, vec3(uv, 1.0));
|
|
vCoverUV = (uv3*vec3(uvCoverTransform.xy, 1.0)+vec3(uvCoverTransform.zw, 0.0)).xy;
|
|
}
|