summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt
blob: d2b158086659e6eae2aebc15bafb521ff7d68d9f (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
#include <metal_stdlib>
using namespace metal;
struct xlatMtlShaderInput {
  float4 _glesVertex [[attribute(0)]];
};
struct xlatMtlShaderOutput {
  float4 gl_Position [[position]];
  float3 xlv_TEXCOORD2;
};
struct xlatMtlShaderUniform {
  float3 _WorldSpaceCameraPos;
  float4x4 glstate_matrix_mvp;
  float4x4 _World2Object;
  float3 _TerrainTreeLightDirections[4];
};
vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  float3 viewDir_1;
  float3 tmpvar_2;
  float4 tmpvar_3;
  tmpvar_3.w = 1.0;
  tmpvar_3.xyz = _mtl_u._WorldSpaceCameraPos;
  viewDir_1 = normalize(((_mtl_u._World2Object * tmpvar_3).xyz - _mtl_i._glesVertex.xyz));
  half tmpvar_4;
  float tmpvar_5;
  tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0);
  tmpvar_4 = half(tmpvar_5);
  float3 tmpvar_6;
  tmpvar_6.yz = tmpvar_2.yz;
  tmpvar_6.x = float((tmpvar_4 * (half)2.0));
  half tmpvar_7;
  float tmpvar_8;
  tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0);
  tmpvar_7 = half(tmpvar_8);
  float3 tmpvar_9;
  tmpvar_9.xz = tmpvar_6.xz;
  tmpvar_9.y = float((tmpvar_7 * (half)2.0));
  half tmpvar_10;
  float tmpvar_11;
  tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0);
  tmpvar_10 = half(tmpvar_11);
  float3 tmpvar_12;
  tmpvar_12.xy = tmpvar_9.xy;
  tmpvar_12.z = float((tmpvar_10 * (half)2.0));
  tmpvar_2 = tmpvar_12;
  _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
  _mtl_o.xlv_TEXCOORD2 = tmpvar_12;
  return _mtl_o;
}


// stats: 17 alu 0 tex 0 flow
// inputs: 1
//  #0: _glesVertex (high float) 4x1 [-1] loc 0
// uniforms: 4 (total size: 208)
//  #0: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 0
//  #1: glstate_matrix_mvp (high float) 4x4 [-1] loc 16
//  #2: _World2Object (high float) 4x4 [-1] loc 80
//  #3: _TerrainTreeLightDirections (high float) 3x1 [4] loc 144