summaryrefslogtreecommitdiff
path: root/intermediate
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-26 22:06:57 +1100
committerquou <quou@disroot.org>2024-12-26 22:06:57 +1100
commit7fa078995b3ed62925788ce2460441bc3d373392 (patch)
tree3ea7cb6288319ed56b28b7443d628a4f40a4e5fd /intermediate
parentdac7103df9f748d3409ac87ac3d015e329f6c7f5 (diff)
constant buffers
Diffstat (limited to 'intermediate')
-rw-r--r--intermediate/triangle.glsl13
1 files changed, 12 insertions, 1 deletions
diff --git a/intermediate/triangle.glsl b/intermediate/triangle.glsl
index 8f3b586..1e883f5 100644
--- a/intermediate/triangle.glsl
+++ b/intermediate/triangle.glsl
@@ -33,6 +33,17 @@ name: colour_texture
stage: fragment
dimension: 2
+[struct]
+name: Config
+[variable]
+name: offset
+type: vec2
+
+[cbuffer]
+name: config_buffer
+type: Config
+stage: vertex
+
#endif
#ifdef VERTEX_SHADER
@@ -40,7 +51,7 @@ dimension: 2
void main() {
interpolator.colour = colour;
interpolator.uv = uv;
- gl_Position = vec4(position, 0.0, 1.0);
+ gl_Position = vec4(position + config_buffer.offset, 0.0, 1.0);
}
#endif