From 7fa078995b3ed62925788ce2460441bc3d373392 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 26 Dec 2024 22:06:57 +1100 Subject: constant buffers --- intermediate/triangle.glsl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'intermediate/triangle.glsl') 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 -- cgit v1.2.3-54-g00ecf