summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt
blob: 3c81d626ae6f4d085a2de7b06e2f1baede0b1b38 (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
#include <metal_stdlib>
using namespace metal;
struct xlatMtlShaderInput {
  half3 uv1;
  float3 uv2;
};
struct xlatMtlShaderOutput {
  half4 _fragColor [[color(0)]];
};
struct xlatMtlShaderUniform {
};
;
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
  ,   texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
{
  xlatMtlShaderOutput _mtl_o;
  half2 tmpvar_1;
  tmpvar_1 = dfdx(_mtl_i.uv1.xy);
  half2 tmpvar_2;
  tmpvar_2 = dfdy(_mtl_i.uv1.xy);
  float2 tmpvar_3;
  tmpvar_3 = dfdx(_mtl_i.uv2.xy);
  float2 tmpvar_4;
  tmpvar_4 = dfdy(_mtl_i.uv2.xy);
  _mtl_o._fragColor = ((tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv1.xy), gradient2d((float2)(tmpvar_1), (float2)(tmpvar_2))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(tmpvar_3), (float2)(tmpvar_4)))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(_mtl_i.uv1.xy), (float2)(_mtl_i.uv1.xy))));
  return _mtl_o;
}


// stats: 6 alu 3 tex 0 flow
// inputs: 2
//  #0: uv1 (medium float) 3x1 [-1]
//  #1: uv2 (high float) 3x1 [-1]
// textures: 1
//  #0: tex (low 2d) 0x0 [-1] loc 0