mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-23 23:34:29 +00:00
30 lines
851 B
Plaintext
30 lines
851 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
struct PushConstants {
|
|
metal::uint index;
|
|
};
|
|
|
|
struct main1Input {
|
|
metal::float2 tex_coord [[user(loc0), center_perspective]];
|
|
};
|
|
struct main1Output {
|
|
metal::float4 member [[color(1)]];
|
|
};
|
|
fragment main1Output main1(
|
|
main1Input varyings [[stage_in]]
|
|
, metal::texture2d<float, metal::access::sample> texture0_ [[user(fake0)]]
|
|
, metal::texture2d<float, metal::access::sample> texture1_ [[user(fake0)]]
|
|
, metal::sampler sampler [[user(fake0)]]
|
|
, constant PushConstants& pc [[user(fake0)]]
|
|
) {
|
|
const auto tex_coord = varyings.tex_coord;
|
|
if (pc.index == 0u) {
|
|
metal::float4 _e9 = texture0_.sample(sampler, tex_coord);
|
|
return main1Output { _e9 };
|
|
} else {
|
|
metal::float4 _e10 = texture1_.sample(sampler, tex_coord);
|
|
return main1Output { _e10 };
|
|
}
|
|
}
|