summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.invariant-float-math.vert
blob: caa8639a895deed4a84653dc1e16ca71afba978c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#version 450

layout(set = 0, binding = 0) uniform Matrices
{
	mat4   vpMatrix;
	mat4   wMatrix;
	mat4x3 wMatrix4x3;
	mat3x4 wMatrix3x4;
};

layout(location = 0) in vec3 InPos;
layout(location = 1) in vec3 InNormal;

layout(location = 0) out vec3 OutNormal;
layout(location = 1) out vec4 OutWorldPos[4];

void main()
{
	gl_Position = vpMatrix * wMatrix * vec4(InPos, 1);
	OutWorldPos[0] = wMatrix * vec4(InPos, 1);
	OutWorldPos[1] = vec4(InPos, 1) * wMatrix;
	OutWorldPos[2] = wMatrix3x4 * InPos;
	OutWorldPos[3] = InPos * wMatrix4x3;
	OutNormal = (wMatrix * vec4(InNormal, 0)).xyz;
}