summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
blob: 2d85a7fc8693313f3aec62c12f16c05f8ec4014b (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
#include <metal_stdlib>
using namespace metal;
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
struct xlatMtlShaderInput {
  float4 uvHi;
  half4 uvMed;
};
struct xlatMtlShaderOutput {
  half4 _fragColor [[color(0)]];
};
struct xlatMtlShaderUniform {
};
;
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
  ,   depth2d<float> shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half4 r_1;
  half4 tmpvar_2;
  tmpvar_2 = half4((shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi.xyz).xy, (float)(_mtl_i.uvHi.xyz).z) + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi).xy / (float)(_mtl_i.uvHi).w, (float)(_mtl_i.uvHi).z / (float)(_mtl_i.uvHi).w)));
  r_1.yzw = tmpvar_2.yzw;
  r_1.x = (tmpvar_2.x + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvMed.xyz).xy, (float)(_mtl_i.uvMed.xyz).z));
  _mtl_o._fragColor = r_1;
  return _mtl_o;
}


// stats: 2 alu 3 tex 0 flow
// inputs: 2
//  #0: uvHi (high float) 4x1 [-1]
//  #1: uvMed (medium float) 4x1 [-1]
// textures: 1
//  #0: shadowmap (low 2dshadow) 0x0 [-1] loc 0