rhi: multiview manual test: exercise passing through gl_ViewIndex

Change-Id: Iee9a29250061ca57ea30e3e545d1a6de952c1852
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2024-04-16 10:24:05 +02:00
parent d914c58c7e
commit e55f6f0e01
6 changed files with 4 additions and 1 deletions

View File

@ -1,10 +1,11 @@
#version 440
layout(location = 0) in vec3 v_color;
layout(location = 1) in flat uint v_viewIndex;
layout(location = 0) out vec4 fragColor;
void main()
{
fragColor = vec4(v_color, 1.0);
fragColor = vec4(v_color + v_viewIndex * 0.5, 1.0);
}

View File

@ -6,6 +6,7 @@ layout(location = 1) in vec3 color;
layout(location = 2) in vec3 translation;
layout(location = 0) out vec3 v_color;
layout(location = 1) out flat uint v_viewIndex;
layout(std140, binding = 0) uniform buf
{
@ -16,4 +17,5 @@ void main()
{
v_color = color;
gl_Position = mvp[gl_ViewIndex] * (pos + vec4(translation, 0.0));
v_viewIndex = gl_ViewIndex;
}