39 lines
586 B
Plaintext
39 lines
586 B
Plaintext
|
|
#[set(everything)]
|
|
const constants: {
|
|
WVP: float4x4;
|
|
};
|
|
|
|
#[set(everything)]
|
|
const sampler_linear: sampler;
|
|
|
|
#[set(everything)]
|
|
const my_texture: tex2d;
|
|
|
|
struct vert_in {
|
|
pos: float4;
|
|
tex: float2;
|
|
}
|
|
|
|
struct vert_out {
|
|
pos: float4;
|
|
tex: float2;
|
|
}
|
|
|
|
fun mesh_vert(input: vert_in): vert_out {
|
|
var output: vert_out;
|
|
output.tex = input.tex;
|
|
output.pos = constants.WVP * float4(input.pos.xyz, 1.0);
|
|
return output;
|
|
}
|
|
|
|
fun mesh_frag(input: vert_out): float4 {
|
|
return sample(my_texture, sampler_linear, input.tex);
|
|
}
|
|
|
|
#[pipe]
|
|
struct pipe {
|
|
vertex = mesh_vert;
|
|
fragment = mesh_frag;
|
|
}
|