qt5base-lts/tests/manual/rhi/instancing/inst.vert
Laszlo Agocs 63790184c7 rhi: Fix up vertex inputs with matrices
In order to prevent too much voodoo in backends like D3D11, the input
layout is expected to specify the slice index for vecX that are part of
an unrolled matrix.

Also deoptimize the instancing manual test to exercise a matrix too
instead of just vectors.

Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-14 22:35:19 +02:00

22 lines
438 B
GLSL

#version 440
layout(location = 0) in vec4 position;
// Instanced attributes to variate the transform and color of the cube
layout(location = 1) in mat4 instMat;
layout(location = 5) in vec3 instColor;
layout(location = 0) out vec3 vColor;
out gl_PerVertex { vec4 gl_Position; };
layout(std140, binding = 0) uniform buf {
mat4 mvp;
} ubuf;
void main()
{
vColor = instColor;
gl_Position = ubuf.mvp * instMat * position;
}