forked from joejulian/gio
646a767665
Emulate them for the OpenGL ES backend because 2.0 doesn't support uniform buffers. The future d3d backend only supports uniform (constant) buffers. Signed-off-by: Elias Naur <mail@eliasnaur.com>
28 lines
418 B
GLSL
28 lines
418 B
GLSL
#version 310 es
|
|
|
|
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
precision highp float;
|
|
|
|
layout(binding = 0) uniform Block {
|
|
float z;
|
|
vec2 scale;
|
|
vec2 offset;
|
|
vec2 uvScale;
|
|
vec2 uvOffset;
|
|
};
|
|
|
|
layout(location = 0) in vec2 pos;
|
|
|
|
layout(location = 1) in vec2 uv;
|
|
|
|
layout(location = 0) out vec2 vUV;
|
|
|
|
void main() {
|
|
vec2 p = pos;
|
|
p *= scale;
|
|
p += offset;
|
|
gl_Position = vec4(p, z, 1);
|
|
vUV = uv*uvScale + uvOffset;
|
|
}
|