summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt
blob: 78a49f1cabff9e3badf31c831eb5e509947642fe (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <metal_stdlib>
#pragma clang diagnostic ignored "-Wparentheses-equality"
using namespace metal;
struct xlatMtlShaderInput {
  float4 attrVertex [[attribute(0)]];
  half3 attrNormal [[attribute(1)]];
  half4 attrTangent [[attribute(2)]];
};
struct xlatMtlShaderOutput {
  float4 gl_Position [[position]];
  half3 varWorldN;
  half3 varLightDir;
  half3 varViewDir;
};
struct xlatMtlShaderUniform {
  float4x4 glstate_matrix_mvp;
  float4x4 _Object2World;
  float4x4 _World2Object;
  float3 _WorldSpaceCameraPos;
  half4 _WorldSpaceLightPos0;
  float4 unity_Scale;
};
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half3 lightDir_1;
  float3 worldN_2;
  half3 tmpvar_3;
  half3 tmpvar_4;
  half3 tmpvar_5;
  float3x3 tmpvar_6;
  tmpvar_6[0] = _mtl_u._Object2World[0].xyz;
  tmpvar_6[1] = _mtl_u._Object2World[1].xyz;
  tmpvar_6[2] = _mtl_u._Object2World[2].xyz;
  half3 tmpvar_7;
  tmpvar_7 = ((half3)(tmpvar_6 * (float3)_mtl_i.attrNormal));
  worldN_2 = float3(tmpvar_7);
  tmpvar_5 = half3(worldN_2);
  half3 tmpvar_8;
  half3 tmpvar_9;
  tmpvar_8 = _mtl_i.attrTangent.xyz;
  tmpvar_9 = (((_mtl_i.attrNormal.yzx * _mtl_i.attrTangent.zxy) - (_mtl_i.attrNormal.zxy * _mtl_i.attrTangent.yzx)) * _mtl_i.attrTangent.w);
  half3x3 tmpvar_10;
  tmpvar_10[0].x = tmpvar_8.x;
  tmpvar_10[0].y = tmpvar_9.x;
  tmpvar_10[0].z = _mtl_i.attrNormal.x;
  tmpvar_10[1].x = tmpvar_8.y;
  tmpvar_10[1].y = tmpvar_9.y;
  tmpvar_10[1].z = _mtl_i.attrNormal.y;
  tmpvar_10[2].x = tmpvar_8.z;
  tmpvar_10[2].y = tmpvar_9.z;
  tmpvar_10[2].z = _mtl_i.attrNormal.z;
  float3 tmpvar_11;
  tmpvar_11 = ((float3)(tmpvar_10 * (half3)(_mtl_u._World2Object * (float4)_mtl_u._WorldSpaceLightPos0).xyz));
  lightDir_1 = half3(tmpvar_11);
  tmpvar_3 = lightDir_1;
  float4 tmpvar_12;
  tmpvar_12.w = 1.0;
  tmpvar_12.xyz = _mtl_u._WorldSpaceCameraPos;
  float3 tmpvar_13;
  tmpvar_13 = normalize(((float3)lightDir_1 + normalize(
    ((float3)(tmpvar_10 * (half3)(((_mtl_u._World2Object * tmpvar_12).xyz * _mtl_u.unity_Scale.w) - _mtl_i.attrVertex.xyz)))
  )));
  tmpvar_4 = half3(tmpvar_13);
  _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i.attrVertex);
  _mtl_o.varWorldN = tmpvar_5;
  _mtl_o.varLightDir = tmpvar_3;
  _mtl_o.varViewDir = tmpvar_4;
  return _mtl_o;
}


// stats: 16 alu 0 tex 0 flow
// inputs: 3
//  #0: attrVertex (high float) 4x1 [-1] loc 0
//  #1: attrNormal (medium float) 3x1 [-1] loc 1
//  #2: attrTangent (medium float) 4x1 [-1] loc 2
// uniforms: 6 (total size: 240)
//  #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
//  #1: _Object2World (high float) 4x4 [-1] loc 64
//  #2: _World2Object (high float) 4x4 [-1] loc 128
//  #3: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 192
//  #4: _WorldSpaceLightPos0 (low float) 4x1 [-1] loc 208
//  #5: unity_Scale (high float) 4x1 [-1] loc 224