mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
gpu/internal/shaders: generate shader variants
We're about to add Direct3D support, where shaders are written in HLSL. Rather than write shaders twice (or more), convert them to a GLSL variant understood by the glslcc cross-compiler and generate the OpenGL ES 2.0 and HLSL variants. The HLSL is used by a future change. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#version 310 es
|
||||
|
||||
// SPDX-License-Identifier: Unlicense OR MIT
|
||||
|
||||
precision highp float;
|
||||
|
||||
layout(location = 0) in vec2 pos;
|
||||
layout(location = 1) in vec2 uv;
|
||||
|
||||
layout(binding = 0) uniform Block {
|
||||
vec2 scale;
|
||||
vec2 offset;
|
||||
} uvparams;
|
||||
|
||||
layout(location = 0) out vec2 vUV;
|
||||
|
||||
void main() {
|
||||
vec2 p = pos;
|
||||
p.y = -p.y;
|
||||
gl_Position = vec4(p, 0, 1);
|
||||
vUV = uv*uvparams.scale + uvparams.offset;
|
||||
}
|
||||
Reference in New Issue
Block a user