mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
Makes the dual source implementation in wgpu WebGPU spec compliant. Furthermore, makes the dual source blending extension available when targeting WebGPU.
21 lines
498 B
Plaintext
21 lines
498 B
Plaintext
// language: metal1.2
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using metal::uint;
|
|
|
|
struct FragmentOutput {
|
|
metal::float4 output0_;
|
|
metal::float4 output1_;
|
|
};
|
|
|
|
struct main_Output {
|
|
metal::float4 output0_ [[color(0) index(0)]];
|
|
metal::float4 output1_ [[color(0) index(1)]];
|
|
};
|
|
fragment main_Output main_(
|
|
) {
|
|
const auto _tmp = FragmentOutput {metal::float4(0.4, 0.3, 0.2, 0.1), metal::float4(0.9, 0.8, 0.7, 0.6)};
|
|
return main_Output { _tmp.output0_, _tmp.output1_ };
|
|
}
|