diff options
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/shadereffect.vert')
-rw-r--r-- | src/quick/scenegraph/shaders_ng/shadereffect.vert | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/quick/scenegraph/shaders_ng/shadereffect.vert b/src/quick/scenegraph/shaders_ng/shadereffect.vert index ae65059f19..e030b5ee71 100644 --- a/src/quick/scenegraph/shaders_ng/shadereffect.vert +++ b/src/quick/scenegraph/shaders_ng/shadereffect.vert @@ -6,14 +6,20 @@ layout(location = 1) in vec2 qt_MultiTexCoord0; layout(location = 0) out vec2 qt_TexCoord0; layout(std140, binding = 0) uniform qt_buf { +#if QSHADER_VIEW_COUNT >= 2 + mat4 qt_Matrix[QSHADER_VIEW_COUNT]; +#else mat4 qt_Matrix; +#endif float qt_Opacity; } qt_ubuf; // must use a name that does not clash with custom code when no uniform blocks -out gl_PerVertex { vec4 gl_Position; }; - void main() { qt_TexCoord0 = qt_MultiTexCoord0; +#if QSHADER_VIEW_COUNT >= 2 + gl_Position = qt_ubuf.qt_Matrix[gl_ViewIndex] * qt_Vertex; +#else gl_Position = qt_ubuf.qt_Matrix * qt_Vertex; +#endif } |