aboutsummaryrefslogtreecommitdiffstats
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/header_330.glsl2
-rw-r--r--shaders/rect.vert7
2 files changed, 7 insertions, 2 deletions
diff --git a/shaders/header_330.glsl b/shaders/header_330.glsl
index 5ae7f43..1bcdf05 100644
--- a/shaders/header_330.glsl
+++ b/shaders/header_330.glsl
@@ -1 +1,3 @@
#version 330 core
+
+#define UBO(qualifiers) layout(std140)
diff --git a/shaders/rect.vert b/shaders/rect.vert
index 337f105..ef8c8cc 100644
--- a/shaders/rect.vert
+++ b/shaders/rect.vert
@@ -1,7 +1,10 @@
/* The vertex shader is trivial, but forwards scaled UV coordinates (in pixels)
to the fragment shader for drawing the border. */
-uniform mat4 u_projection;
+UBO(binding = 0) uniform UniformBufferObject
+{
+ mat4 projection;
+} ubo;
layout(location = 0) in vec2 v_position;
layout(location = 1) in vec2 v_origin;
@@ -22,7 +25,7 @@ main()
v_origin[0], v_origin[1], 0.0, 1.0);
// clang-format on
- mat4 MVP = u_projection * m;
+ mat4 MVP = ubo.projection * m;
f_uv = v_position * v_size;
f_size = v_size;