mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 08:44:08 +00:00
28 lines
655 B
Plaintext
28 lines
655 B
Plaintext
// language: metal1.2
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using metal::uint;
|
|
|
|
struct FragmentOutput {
|
|
metal::float4 color;
|
|
metal::float4 mask;
|
|
};
|
|
|
|
struct main_Input {
|
|
};
|
|
struct main_Output {
|
|
metal::float4 color [[color(0)]];
|
|
metal::float4 mask [[color(0) index(1)]];
|
|
};
|
|
fragment main_Output main_(
|
|
metal::float4 position [[position]]
|
|
) {
|
|
metal::float4 color = metal::float4(0.4, 0.3, 0.2, 0.1);
|
|
metal::float4 mask = metal::float4(0.9, 0.8, 0.7, 0.6);
|
|
metal::float4 _e13 = color;
|
|
metal::float4 _e14 = mask;
|
|
const auto _tmp = FragmentOutput {_e13, _e14};
|
|
return main_Output { _tmp.color, _tmp.mask };
|
|
}
|