aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders_ng/styledtext.vert
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/styledtext.vert')
-rw-r--r--src/quick/scenegraph/shaders_ng/styledtext.vert22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/quick/scenegraph/shaders_ng/styledtext.vert b/src/quick/scenegraph/shaders_ng/styledtext.vert
index 271dae8d8a..5e0a8fa5c9 100644
--- a/src/quick/scenegraph/shaders_ng/styledtext.vert
+++ b/src/quick/scenegraph/shaders_ng/styledtext.vert
@@ -8,21 +8,27 @@ layout(location = 1) out vec2 shiftedSampleCoord;
layout(std140, binding = 0) uniform buf {
mat4 modelViewMatrix;
+#if QSHADER_VIEW_COUNT >= 2
+ mat4 projectionMatrix[QSHADER_VIEW_COUNT];
+#else
mat4 projectionMatrix;
- vec4 color;
+#endif
vec2 textureScale;
float dpr;
+ vec4 color;
// the above must stay compatible with textmask/8bittextmask
vec4 styleColor;
vec2 shift;
-} ubuf;
-
-out gl_PerVertex { vec4 gl_Position; };
+};
void main()
{
- sampleCoord = tCoord * ubuf.textureScale;
- shiftedSampleCoord = (tCoord - ubuf.shift) * ubuf.textureScale;
- vec4 xformed = ubuf.modelViewMatrix * vCoord;
- gl_Position = ubuf.projectionMatrix * vec4(floor(xformed.xyz * ubuf.dpr + 0.5) / ubuf.dpr, xformed.w);
+ sampleCoord = tCoord * textureScale;
+ shiftedSampleCoord = (tCoord - shift) * textureScale;
+ vec4 xformed = modelViewMatrix * vCoord;
+#if QSHADER_VIEW_COUNT >= 2
+ gl_Position = projectionMatrix[gl_ViewIndex] * vec4(floor(xformed.xyz * dpr + 0.5) / dpr, xformed.w);
+#else
+ gl_Position = projectionMatrix * vec4(floor(xformed.xyz * dpr + 0.5) / dpr, xformed.w);
+#endif
}