summaryrefslogtreecommitdiffstats
path: root/src/multimedia/shaders/rectsampler.vert
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2022-03-31 12:28:23 +0200
committerLars Knoll <lars.knoll@qt.io>2022-04-07 10:38:17 +0200
commitf94b272fe9d11836390cc44bdbfb9b7ac83893e1 (patch)
tree264de57d2d5d255390c5fa4041fc01aeddbc295a /src/multimedia/shaders/rectsampler.vert
parent8d8c33205a5d921f900144bc19840f4f652762a7 (diff)
Shader refactoring: Share the uniform buffer across shaders
Get rid of some code duplication and share the uniform buffer that we use across our shaders, so that we will only need to modify it in one place in the future. Change-Id: I649ce30b2b982dbb0e81f3c8793b33ad7f0429bb Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Diffstat (limited to 'src/multimedia/shaders/rectsampler.vert')
-rw-r--r--src/multimedia/shaders/rectsampler.vert10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/multimedia/shaders/rectsampler.vert b/src/multimedia/shaders/rectsampler.vert
index 44e09fc70..e693370dc 100644
--- a/src/multimedia/shaders/rectsampler.vert
+++ b/src/multimedia/shaders/rectsampler.vert
@@ -1,17 +1,13 @@
#version 440
+#extension GL_GOOGLE_include_directive : enable
+
+#include "uniformbuffer.glsl"
layout(location = 0) in vec4 vertexPosition;
layout(location = 1) in vec2 vertexTexCoord;
layout(location = 0) out vec2 texCoord;
-layout(std140, binding = 0) uniform buf {
- mat4 matrix;
- mat4 colorMatrix;
- float opacity;
- float width;
-} ubuf;
-
out gl_PerVertex { vec4 gl_Position; };
void main() {