21 lines
		
	
	
		
			552 B
		
	
	
	
		
			Metal
		
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			552 B
		
	
	
	
		
			Metal
		
	
	
	
| #include <metal_stdlib>
 | |
| #include <simd/simd.h>
 | |
| using namespace metal;
 | |
| struct Inputs {
 | |
| };
 | |
| struct Outputs {
 | |
|     half4 sk_FragColor [[color(0)]];
 | |
| };
 | |
| 
 | |
| half4 half4_from_half2x2(half2x2 x) {
 | |
|     return half4(x[0].xy, x[1].xy);
 | |
| }
 | |
| fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
 | |
|     Outputs _out;
 | |
|     (void)_out;
 | |
|     half2x2 x = half2x2(half2(0.0h, 1.0h), half2(2.0h, 3.0h));
 | |
|     float2 y = float2(half4_from_half2x2(x).xy);
 | |
|     _out.sk_FragColor = half4(y.xyxy);
 | |
|     return _out;
 | |
| }
 |