diff options
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/flatcolor.vert')
-rw-r--r-- | src/quick/scenegraph/shaders_ng/flatcolor.vert | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/quick/scenegraph/shaders_ng/flatcolor.vert b/src/quick/scenegraph/shaders_ng/flatcolor.vert index b5dfd32197..eec2a2d6ed 100644 --- a/src/quick/scenegraph/shaders_ng/flatcolor.vert +++ b/src/quick/scenegraph/shaders_ng/flatcolor.vert @@ -3,13 +3,19 @@ layout(location = 0) in vec4 vertexCoord; layout(std140, binding = 0) uniform buf { +#if QSHADER_VIEW_COUNT >= 2 + mat4 matrix[QSHADER_VIEW_COUNT]; +#else mat4 matrix; +#endif vec4 color; -} ubuf; - -out gl_PerVertex { vec4 gl_Position; }; +}; void main() { - gl_Position = ubuf.matrix * vertexCoord; +#if QSHADER_VIEW_COUNT >= 2 + gl_Position = matrix[gl_ViewIndex] * vertexCoord; +#else + gl_Position = matrix * vertexCoord; +#endif } |