gpu,gpu/gl: implement shader uniform buffers

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>
This commit is contained in:
Elias Naur
2020-02-19 21:06:30 +01:00
parent ef3e94e7a7
commit 646a767665
12 changed files with 504 additions and 252 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ layout(location = 1) in vec2 uv;
layout(binding = 0) uniform Block {
vec2 scale;
vec2 offset;
} uvparams;
};
layout(location = 0) out vec2 vUV;
@@ -18,5 +18,5 @@ void main() {
vec2 p = pos;
p.y = -p.y;
gl_Position = vec4(p, 0, 1);
vUV = uv*uvparams.scale + uvparams.offset;
vUV = uv*scale + offset;
}